pokeemerald/asm/battle_controller_wally.s
2017-10-22 18:43:15 +02:00

4756 lines
74 KiB
ArmAsm

.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start WallyBufferRunCommand
WallyBufferRunCommand: @ 81683F4
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 _08168440
ldr r0, =gBattleBufferA
lsls r1, r3, 9
adds r1, r0
ldrb r0, [r1]
cmp r0, 0x38
bhi _0816843C
ldr r0, =gWallyBufferCommands
ldrb r1, [r1]
lsls r1, 2
adds r1, r0
ldr r0, [r1]
bl _call_via_r0
b _08168440
.pool
_0816843C:
bl WallyBufferExecCompleted
_08168440:
pop {r0}
bx r0
thumb_func_end WallyBufferRunCommand
thumb_func_start sub_8168444
sub_8168444: @ 8168444
push {r4,r5,lr}
ldr r1, =gBattleStruct
ldr r0, [r1]
adds r0, 0x94
ldrb r0, [r0]
adds r4, r1, 0
cmp r0, 0x5
bls _08168456
b _08168564
_08168456:
lsls r0, 2
ldr r1, =_08168468
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_08168468:
.4byte _08168480
.4byte _08168492
.4byte _081684B0
.4byte _081684CE
.4byte _08168508
.4byte _08168540
_08168480:
ldr r0, [r4]
adds r0, 0x96
movs r1, 0x40
strb r1, [r0]
ldr r1, [r4]
adds r1, 0x94
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
_08168492:
ldr r1, [r4]
adds r1, 0x96
ldrb r0, [r1]
subs r0, 0x1
strb r0, [r1]
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0
bne _08168564
movs r0, 0x5
bl PlaySE
movs r0, 0x1
movs r1, 0
b _081684E4
_081684B0:
ldr r1, [r4]
adds r1, 0x96
ldrb r0, [r1]
subs r0, 0x1
strb r0, [r1]
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0
bne _08168564
movs r0, 0x5
bl PlaySE
movs r0, 0x1
movs r1, 0
b _081684E4
_081684CE:
ldr r1, [r4]
adds r1, 0x96
ldrb r0, [r1]
subs r0, 0x1
strb r0, [r1]
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0
bne _08168564
movs r0, 0x1
movs r1, 0x9
_081684E4:
movs r2, 0
bl EmitTwoReturnValues
bl WallyBufferExecCompleted
ldr r1, [r4]
adds r1, 0x94
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
ldr r0, [r4]
adds r0, 0x95
strb r5, [r0]
ldr r0, [r4]
adds r0, 0x96
movs r1, 0x40
strb r1, [r0]
b _08168564
_08168508:
ldr r1, [r4]
adds r1, 0x96
ldrb r0, [r1]
subs r0, 0x1
strb r0, [r1]
lsls r0, 24
cmp r0, 0
bne _08168564
movs r0, 0x5
bl PlaySE
movs r0, 0
bl ActionSelectionDestroyCursorAt
movs r0, 0x1
movs r1, 0
bl ActionSelectionCreateCursorAt
ldr r0, [r4]
adds r0, 0x96
movs r1, 0x40
strb r1, [r0]
ldr r1, [r4]
adds r1, 0x94
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
b _08168564
_08168540:
ldr r1, [r4]
adds r1, 0x96
ldrb r0, [r1]
subs r0, 0x1
strb r0, [r1]
lsls r0, 24
cmp r0, 0
bne _08168564
movs r0, 0x5
bl PlaySE
movs r0, 0x1
movs r1, 0x1
movs r2, 0
bl EmitTwoReturnValues
bl WallyBufferExecCompleted
_08168564:
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end sub_8168444
thumb_func_start sub_816856C
sub_816856C: @ 816856C
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 _08168590
bl WallyBufferExecCompleted
_08168590:
pop {r0}
bx r0
.pool
thumb_func_end sub_816856C
thumb_func_start sub_81685A4
sub_81685A4: @ 81685A4
push {lr}
movs r0, 0
bl IsTextPrinterActive
lsls r0, 16
cmp r0, 0
bne _081685B6
bl WallyBufferExecCompleted
_081685B6:
pop {r0}
bx r0
thumb_func_end sub_81685A4
thumb_func_start bx_wait_t5
bx_wait_t5: @ 81685BC
push {lr}
ldr r0, =gDoingBattleAnim
ldrb r0, [r0]
cmp r0, 0
bne _081685CA
bl WallyBufferExecCompleted
_081685CA:
pop {r0}
bx r0
.pool
thumb_func_end bx_wait_t5
thumb_func_start sub_81685D4
sub_81685D4: @ 81685D4
push {lr}
ldr r0, =gPaletteFade
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _081685FC
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
ldrb r0, [r0]
lsls r0, 2
adds r0, r1
ldr r1, =sub_8168610
str r1, [r0]
bl nullsub_35
bl FreeAllWindowBuffers
bl DoWallyTutorialBagMenu
_081685FC:
pop {r0}
bx r0
.pool
thumb_func_end sub_81685D4
thumb_func_start sub_8168610
sub_8168610: @ 8168610
push {lr}
ldr r0, =gMain
ldr r1, [r0, 0x4]
ldr r0, =BattleMainCB2
cmp r1, r0
bne _08168636
ldr r0, =gPaletteFade
ldrb r1, [r0, 0x7]
movs r0, 0x80
ands r0, r1
cmp r0, 0
bne _08168636
ldr r0, =gScriptItemId
ldrh r1, [r0]
movs r0, 0x1
bl EmitOneReturnValue
bl WallyBufferExecCompleted
_08168636:
pop {r0}
bx r0
.pool
thumb_func_end sub_8168610
thumb_func_start sub_816864C
sub_816864C: @ 816864C
push {r4-r7,lr}
mov r7, r8
push {r7}
ldr r4, =gBattleSpritesDataPtr
ldr r0, [r4]
ldr r5, =gActiveBank
ldrb r2, [r5]
ldr r1, [r0, 0x4]
lsls r3, r2, 1
adds r0, r3, r2
lsls r0, 2
adds r0, r1
ldrb r1, [r0]
movs r7, 0x88
adds r0, r7, 0
ands r0, r1
cmp r0, 0
bne _08168684
ldr r0, =gBattlePartyID
adds r0, r3, r0
ldrh r1, [r0]
movs r0, 0x64
muls r1, r0
ldr r0, =gPlayerParty
adds r1, r0
adds r0, r2, 0
bl sub_8172EF0
_08168684:
ldr r1, [r4]
ldrb r0, [r5]
movs r6, 0x2
adds r2, r6, 0
eors r2, r0
ldr r1, [r1, 0x4]
lsls r3, r2, 1
adds r0, r3, r2
lsls r0, 2
adds r0, r1
ldrb r1, [r0]
adds r0, r7, 0
ands r0, r1
cmp r0, 0
bne _081686B6
ldr r0, =gBattlePartyID
adds r0, r3, r0
ldrh r1, [r0]
movs r0, 0x64
muls r1, r0
ldr r0, =gPlayerParty
adds r1, r0
adds r0, r2, 0
bl sub_8172EF0
_081686B6:
ldr r0, [r4]
ldrb r2, [r5]
ldr r3, [r0, 0x4]
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r0, r3
ldrb r1, [r0]
movs r4, 0x8
adds r0, r4, 0
ands r0, r1
cmp r0, 0
beq _081686D2
b _081687DC
_081686D2:
adds r1, r2, 0
eors r1, r6
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r3
ldrb r1, [r0]
adds r0, r4, 0
ands r0, r1
cmp r0, 0
bne _081687DC
ldr r0, =gSprites
mov r8, r0
ldr r7, =gUnknown_03005D7C
adds r0, r2, r7
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
mov r4, r8
adds r4, 0x1C
adds r0, r4
ldr r3, [r0]
ldr r0, =SpriteCallbackDummy
cmp r3, r0
bne _081687DC
ldr r0, =gBankSpriteIds
adds r0, r2, r0
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r4
ldr r0, [r0]
cmp r0, r3
bne _081687DC
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0816877A
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x40
ands r0, r1
cmp r0, 0
bne _0816877A
ldrb r0, [r5]
eors r0, r6
adds r0, r7
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
add r0, r8
bl DestroySprite
ldr r4, =gHealthBoxesIds
ldrb r0, [r5]
adds r1, r6, 0
eors r1, r0
adds r0, r1, r4
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, 0
bl UpdateHealthboxAttribute
ldrb r0, [r5]
eors r0, r6
bl sub_8076918
ldrb r0, [r5]
eors r0, r6
adds r0, r4
ldrb r0, [r0]
bl SetHealthboxSpriteVisible
_0816877A:
ldr r1, =gUnknown_03005D7C
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r1
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
ldr r1, =gSprites
adds r0, r1
bl DestroySprite
ldr r5, =gHealthBoxesIds
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, 0
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl SetHealthboxSpriteVisible
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldr r2, [r0, 0x8]
ldrb r1, [r2, 0x9]
movs r0, 0x2
negs r0, r0
ands r0, r1
strb r0, [r2, 0x9]
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
adds r0, r1
ldr r1, =sub_8168818
str r1, [r0]
_081687DC:
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_816864C
thumb_func_start sub_8168818
sub_8168818: @ 8168818
push {r4-r7,lr}
mov r7, r8
push {r7}
movs r4, 0
ldr r2, =gSprites
ldr r0, =gHealthBoxesIds
ldr r1, =gActiveBank
mov r8, r1
ldrb r3, [r1]
adds r0, r3, r0
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 _08168842
movs r4, 0x1
_08168842:
cmp r4, 0
beq _08168904
ldr r7, =gBattleSpritesDataPtr
ldr r0, [r7]
ldr r4, [r0, 0x4]
lsls r0, r3, 1
adds r0, r3
lsls r0, 2
adds r2, r0, r4
ldrb r1, [r2, 0x1]
movs r5, 0x1
adds r0, r5, 0
ands r0, r1
cmp r0, 0
beq _08168904
movs r6, 0x2
adds r1, r6, 0
eors r1, r3
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r4
ldrb r1, [r0, 0x1]
adds r0, r5, 0
ands r0, r1
cmp r0, 0
beq _08168904
ldrb r1, [r2]
movs r3, 0x7F
adds r0, r3, 0
ands r0, r1
strb r0, [r2]
ldr r0, [r7]
mov r1, r8
ldrb r2, [r1]
ldr r0, [r0, 0x4]
lsls r1, r2, 1
adds r1, r2
lsls r1, 2
adds r1, r0
ldrb r2, [r1, 0x1]
movs r4, 0x2
negs r4, r4
adds r0, r4, 0
ands r0, r2
strb r0, [r1, 0x1]
ldr r2, [r7]
mov r1, r8
ldrb r0, [r1]
adds r1, r6, 0
eors r1, r0
ldr r2, [r2, 0x4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
ldrb r1, [r0]
ands r3, r1
strb r3, [r0]
ldr r2, [r7]
mov r1, r8
ldrb r0, [r1]
adds r1, r6, 0
eors r1, r0
ldr r2, [r2, 0x4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
ldrb r1, [r0, 0x1]
ands r4, r1
strb r4, [r0, 0x1]
ldr r4, =0x000027f9
adds r0, r4, 0
bl FreeSpriteTilesByTag
adds r0, r4, 0
bl FreeSpritePaletteByTag
ldr r0, =c3_0802FDF4
movs r1, 0xA
bl CreateTask
ldr r2, =gBattlePartyID
mov r0, r8
ldrb r1, [r0]
lsls r0, r1, 1
adds r0, r2
ldrh r2, [r0]
movs r0, 0x64
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805E990
bl WallyBufferExecCompleted
_08168904:
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_8168818
thumb_func_start sub_8168934
sub_8168934: @ 8168934
push {r4-r6,lr}
ldr r5, =gActiveBank
ldrb r0, [r5]
ldr r6, =gHealthBoxesIds
adds r1, r0, r6
ldrb r1, [r1]
movs r2, 0
movs r3, 0
bl sub_8074AA0
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
ldrb r0, [r5]
adds r0, r6
ldrb r0, [r0]
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
negs r0, r0
cmp r1, r0
beq _0816897C
ldrb r0, [r5]
adds r0, r6
ldrb r0, [r0]
movs r2, 0
bl UpdateHpTextInHealthbox
b _08168996
.pool
_0816897C:
ldr r2, =gBattlePartyID
ldrb r1, [r5]
lsls r0, r1, 1
adds r0, r2
ldrh r2, [r0]
movs r0, 0x64
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805E990
bl WallyBufferExecCompleted
_08168996:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_8168934
thumb_func_start bx_blink_t5
bx_blink_t5: @ 81689A4
push {r4,lr}
ldr r1, =gBankSpriteIds
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
ldrb r1, [r0]
ldr r2, =gSprites
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r4, r0, r2
movs r1, 0x30
ldrsh r0, [r4, r1]
cmp r0, 0x20
bne _081689F0
movs r3, 0
movs r0, 0
strh r0, [r4, 0x30]
adds r2, r4, 0
adds r2, 0x3E
ldrb r1, [r2]
subs r0, 0x5
ands r0, r1
strb r0, [r2]
ldr r0, =gDoingBattleAnim
strb r3, [r0]
bl WallyBufferExecCompleted
b _08168A1A
.pool
_081689F0:
ldrh r0, [r4, 0x30]
movs r1, 0x3
ands r0, r1
cmp r0, 0
bne _08168A14
adds r3, r4, 0
adds r3, 0x3E
ldrb r2, [r3]
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
strb r0, [r3]
_08168A14:
ldrh r0, [r4, 0x30]
adds r0, 0x1
strh r0, [r4, 0x30]
_08168A1A:
pop {r4}
pop {r0}
bx r0
thumb_func_end bx_blink_t5
thumb_func_start sub_8168A20
sub_8168A20: @ 8168A20
push {r4-r6,lr}
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldr r6, =gActiveBank
ldrb r2, [r6]
ldr r1, [r0, 0x4]
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r0, r1
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
bne _08168A74
ldr r5, =gBankSpriteIds
adds r0, r2, r5
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
ldr r4, =gSprites
adds r0, r4
bl FreeSpriteOamMatrix
ldrb r0, [r6]
adds r0, r5
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r4
bl DestroySprite
ldr r1, =gHealthBoxesIds
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl SetHealthboxSpriteInvisible
bl WallyBufferExecCompleted
_08168A74:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_8168A20
thumb_func_start sub_8168A90
sub_8168A90: @ 8168A90
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 _08168AB4
bl WallyBufferExecCompleted
_08168AB4:
pop {r0}
bx r0
.pool
thumb_func_end sub_8168A90
thumb_func_start sub_8168AC8
sub_8168AC8: @ 8168AC8
push {lr}
ldr r0, =gBattleSpritesDataPtr
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 _08168AEA
bl WallyBufferExecCompleted
_08168AEA:
pop {r0}
bx r0
.pool
thumb_func_end sub_8168AC8
thumb_func_start WallyBufferExecCompleted
WallyBufferExecCompleted: @ 8168AF8
push {r4,lr}
sub sp, 0x4
ldr r1, =gBattleBankFunc
ldr r4, =gActiveBank
ldrb r0, [r4]
lsls r0, 2
adds r0, r1
ldr r1, =WallyBufferRunCommand
str r1, [r0]
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x2
ands r0, r1
cmp r0, 0
beq _08168B4C
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 _08168B5E
.pool
_08168B4C:
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]
_08168B5E:
add sp, 0x4
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end WallyBufferExecCompleted
thumb_func_start sub_8168B70
sub_8168B70: @ 8168B70
push {lr}
ldr r0, =gBattleSpritesDataPtr
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 _08168B92
bl WallyBufferExecCompleted
_08168B92:
pop {r0}
bx r0
.pool
thumb_func_end sub_8168B70
thumb_func_start WallyHandleGetMonData
WallyHandleGetMonData: @ 8168BA0
push {r4-r6,lr}
sub sp, 0x100
movs r6, 0
ldr r1, =gBattleBufferA
ldr r0, =gActiveBank
ldrb r2, [r0]
lsls r0, r2, 9
adds r1, 0x2
adds r1, r0, r1
ldrb r0, [r1]
cmp r0, 0
bne _08168BD8
ldr r0, =gBattlePartyID
lsls r1, r2, 1
adds r1, r0
ldrb r0, [r1]
mov r1, sp
bl sub_8168C14
adds r6, r0, 0
b _08168BFA
.pool
_08168BD8:
ldrb r4, [r1]
movs r5, 0
_08168BDC:
movs r0, 0x1
ands r0, r4
cmp r0, 0
beq _08168BF2
lsls r0, r5, 24
lsrs r0, 24
mov r2, sp
adds r1, r2, r6
bl sub_8168C14
adds r6, r0
_08168BF2:
lsrs r4, 1
adds r5, 0x1
cmp r5, 0x5
ble _08168BDC
_08168BFA:
lsls r1, r6, 16
lsrs r1, 16
movs r0, 0x1
mov r2, sp
bl EmitDataTransfer
bl WallyBufferExecCompleted
add sp, 0x100
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end WallyHandleGetMonData
thumb_func_start sub_8168C14
sub_8168C14: @ 8168C14
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x90
adds r7, r1, 0
lsls r0, 24
lsrs r5, r0, 24
movs r6, 0
ldr r2, =gBattleBufferA
ldr r3, =gActiveBank
ldrb r0, [r3]
lsls r0, 9
adds r1, r2, 0x1
adds r0, r1
ldrb r0, [r0]
cmp r0, 0x3B
bls _08168C3E
bl _081693AA
_08168C3E:
lsls r0, 2
ldr r1, =_08168C54
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_08168C54:
.4byte _08168D44
.4byte _08168F68
.4byte _08168F78
.4byte _08168F88
.4byte _08168FF0
.4byte _08168FF0
.4byte _08168FF0
.4byte _08168FF0
.4byte _0816900C
.4byte _08169048
.4byte _08169048
.4byte _08169048
.4byte _08169048
.4byte _081693AA
.4byte _081693AA
.4byte _081693AA
.4byte _081693AA
.4byte _08169064
.4byte _08169074
.4byte _081690A4
.4byte _081690B4
.4byte _081690C4
.4byte _081690D4
.4byte _081690E4
.4byte _081690F4
.4byte _08169104
.4byte _08169114
.4byte _08169124
.4byte _08169134
.4byte _08169144
.4byte _08169154
.4byte _08169164
.4byte _081691B4
.4byte _081691C4
.4byte _081691D4
.4byte _081691E4
.4byte _081691F4
.4byte _08169204
.4byte _08169214
.4byte _08169224
.4byte _08169234
.4byte _08169268
.4byte _08169278
.4byte _08169288
.4byte _08169298
.4byte _081692A8
.4byte _081692B8
.4byte _081692C8
.4byte _081692D8
.4byte _081692F8
.4byte _08169308
.4byte _08169318
.4byte _08169328
.4byte _08169338
.4byte _08169348
.4byte _08169358
.4byte _08169368
.4byte _08169378
.4byte _08169388
.4byte _08169398
_08168D44:
movs r0, 0x64
adds r4, r5, 0
muls r4, r0
ldr r0, =gPlayerParty
adds r4, r0
adds r0, r4, 0
movs r1, 0xB
bl GetMonData
mov r1, sp
strh r0, [r1]
adds r0, r4, 0
movs r1, 0xC
bl GetMonData
mov r1, sp
strh r0, [r1, 0x2E]
movs r6, 0
add r0, sp, 0x24
mov r9, r0
movs r1, 0x3B
add r1, sp
mov r10, r1
mov r2, sp
adds r2, 0x2B
str r2, [sp, 0x80]
mov r0, sp
adds r0, 0x2A
str r0, [sp, 0x7C]
mov r1, sp
adds r1, 0x68
str r1, [sp, 0x8C]
adds r2, 0x5
str r2, [sp, 0x84]
adds r0, 0x12
str r0, [sp, 0x88]
mov r8, r4
add r4, sp, 0xC
_08168D90:
adds r1, r6, 0
adds r1, 0xD
mov r0, r8
bl GetMonData
strh r0, [r4]
adds r1, r6, 0
adds r1, 0x11
mov r0, r8
bl GetMonData
mov r2, r9
adds r1, r2, r6
strb r0, [r1]
adds r4, 0x2
adds r6, 0x1
cmp r6, 0x3
ble _08168D90
movs r0, 0x64
adds r4, r5, 0
muls r4, r0
ldr r0, =gPlayerParty
adds r4, r0
adds r0, r4, 0
movs r1, 0x15
bl GetMonData
mov r1, r10
strb r0, [r1]
adds r0, r4, 0
movs r1, 0x20
bl GetMonData
ldr r2, [sp, 0x80]
strb r0, [r2]
adds r0, r4, 0
movs r1, 0x19
bl GetMonData
str r0, [sp, 0x44]
adds r0, r4, 0
movs r1, 0x27
bl GetMonData
mov r3, sp
movs r5, 0x1F
ands r0, r5
ldrb r2, [r3, 0x14]
movs r1, 0x20
negs r1, r1
ands r1, r2
orrs r1, r0
strb r1, [r3, 0x14]
adds r0, r4, 0
movs r1, 0x28
bl GetMonData
mov r3, sp
movs r6, 0x1F
ands r0, r6
lsls r0, 5
ldrh r2, [r3, 0x14]
ldr r1, =0xfffffc1f
ands r1, r2
orrs r1, r0
strh r1, [r3, 0x14]
adds r0, r4, 0
movs r1, 0x29
bl GetMonData
mov r3, sp
ands r0, r5
lsls r0, 2
ldrb r2, [r3, 0x15]
movs r1, 0x7D
negs r1, r1
ands r1, r2
orrs r1, r0
strb r1, [r3, 0x15]
adds r0, r4, 0
movs r1, 0x2A
bl GetMonData
movs r1, 0x1F
ands r1, r0
lsls r1, 15
ldr r0, [sp, 0x14]
ldr r2, =0xfff07fff
ands r0, r2
orrs r0, r1
str r0, [sp, 0x14]
adds r0, r4, 0
movs r1, 0x2B
bl GetMonData
mov r3, sp
ands r0, r6
lsls r0, 4
ldrh r2, [r3, 0x16]
ldr r1, =0xfffffe0f
ands r1, r2
orrs r1, r0
strh r1, [r3, 0x16]
adds r0, r4, 0
movs r1, 0x2C
bl GetMonData
mov r3, sp
ands r0, r5
lsls r0, 1
ldrb r2, [r3, 0x17]
movs r1, 0x3F
negs r1, r1
ands r1, r2
orrs r1, r0
strb r1, [r3, 0x17]
adds r0, r4, 0
movs r1, 0
bl GetMonData
str r0, [sp, 0x48]
adds r0, r4, 0
movs r1, 0x37
bl GetMonData
str r0, [sp, 0x4C]
adds r0, r4, 0
movs r1, 0x38
bl GetMonData
ldr r1, [sp, 0x7C]
strb r0, [r1]
adds r0, r4, 0
movs r1, 0x39
bl GetMonData
mov r1, sp
strh r0, [r1, 0x28]
adds r0, r4, 0
movs r1, 0x3A
bl GetMonData
mov r1, sp
strh r0, [r1, 0x2C]
adds r0, r4, 0
movs r1, 0x3B
bl GetMonData
mov r1, sp
strh r0, [r1, 0x2]
adds r0, r4, 0
movs r1, 0x3C
bl GetMonData
mov r1, sp
strh r0, [r1, 0x4]
adds r0, r4, 0
movs r1, 0x3D
bl GetMonData
mov r1, sp
strh r0, [r1, 0x6]
adds r0, r4, 0
movs r1, 0x3E
bl GetMonData
mov r1, sp
strh r0, [r1, 0x8]
adds r0, r4, 0
movs r1, 0x3F
bl GetMonData
mov r1, sp
strh r0, [r1, 0xA]
adds r0, r4, 0
movs r1, 0x2D
bl GetMonData
mov r3, sp
movs r1, 0x1
ands r0, r1
lsls r0, 6
ldrb r2, [r3, 0x17]
movs r1, 0x41
negs r1, r1
ands r1, r2
orrs r1, r0
strb r1, [r3, 0x17]
adds r0, r4, 0
movs r1, 0x2E
bl GetMonData
mov r3, sp
lsls r0, 7
ldrb r2, [r3, 0x17]
movs r1, 0x7F
ands r1, r2
orrs r1, r0
strb r1, [r3, 0x17]
adds r0, r4, 0
movs r1, 0x1
bl GetMonData
str r0, [sp, 0x54]
adds r0, r4, 0
movs r1, 0x2
ldr r2, [sp, 0x8C]
bl GetMonData
ldr r0, [sp, 0x84]
ldr r1, [sp, 0x8C]
bl StringCopy10
adds r0, r4, 0
movs r1, 0x7
ldr r2, [sp, 0x88]
bl GetMonData
mov r2, sp
movs r6, 0
_08168F48:
adds r0, r7, r6
adds r1, r2, r6
ldrb r1, [r1]
strb r1, [r0]
adds r6, 0x1
cmp r6, 0x57
bls _08168F48
b _081693AA
.pool
_08168F68:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0xB
b _081692E2
.pool
_08168F78:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0xC
b _081692E2
.pool
_08168F88:
movs r6, 0
add r2, sp, 0x58
mov r9, r2
add r0, sp, 0x60
mov r10, r0
movs r0, 0x64
adds r1, r5, 0
muls r1, r0
ldr r0, =gPlayerParty
adds r4, r1, r0
mov r8, r9
_08168F9E:
adds r1, r6, 0
adds r1, 0xD
adds r0, r4, 0
bl GetMonData
mov r1, r8
strh r0, [r1]
adds r1, r6, 0
adds r1, 0x11
adds r0, r4, 0
bl GetMonData
mov r2, r10
adds r1, r2, r6
strb r0, [r1]
movs r0, 0x2
add r8, r0
adds r6, 0x1
cmp r6, 0x3
ble _08168F9E
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x15
bl GetMonData
mov r1, r9
strb r0, [r1, 0xC]
mov r2, r9
movs r6, 0
_08168FDC:
adds r0, r7, r6
adds r1, r2, r6
ldrb r1, [r1]
strb r1, [r0]
adds r6, 0x1
cmp r6, 0xF
bls _08168FDC
b _081693AA
.pool
_08168FF0:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldrb r1, [r3]
lsls r1, 9
adds r2, 0x1
adds r1, r2
ldrb r1, [r1]
adds r1, 0x9
b _081692E2
.pool
_0816900C:
movs r6, 0
movs r0, 0x64
adds r4, r5, 0
muls r4, r0
ldr r2, =gPlayerParty
mov r8, r2
_08169018:
adds r1, r6, 0
adds r1, 0x11
mov r2, r8
adds r0, r4, r2
bl GetMonData
adds r1, r7, r6
strb r0, [r1]
adds r6, 0x1
cmp r6, 0x3
ble _08169018
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x15
bl GetMonData
adds r1, r7, r6
strb r0, [r1]
adds r6, 0x1
b _081693AA
.pool
_08169048:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldrb r1, [r3]
lsls r1, 9
adds r2, 0x1
adds r1, r2
ldrb r1, [r1]
adds r1, 0x8
b _081693A2
.pool
_08169064:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x1
b _0816907E
.pool
_08169074:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x19
_0816907E:
bl GetMonData
adds r1, r0, 0
strb r1, [r7]
movs r0, 0xFF
lsls r0, 8
ands r0, r1
lsrs r0, 8
strb r0, [r7, 0x1]
movs r0, 0xFF
lsls r0, 16
ands r0, r1
lsrs r0, 16
strb r0, [r7, 0x2]
movs r6, 0x3
b _081693AA
.pool
_081690A4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x1A
b _081693A2
.pool
_081690B4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x1B
b _081693A2
.pool
_081690C4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x1C
b _081693A2
.pool
_081690D4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x1D
b _081693A2
.pool
_081690E4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x1E
b _081693A2
.pool
_081690F4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x1F
b _081693A2
.pool
_08169104:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x20
b _081693A2
.pool
_08169114:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x22
b _081693A2
.pool
_08169124:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x23
b _081693A2
.pool
_08169134:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x24
b _081693A2
.pool
_08169144:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x25
b _081693A2
.pool
_08169154:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x26
b _081693A2
.pool
_08169164:
movs r0, 0x64
adds r4, r5, 0
muls r4, r0
ldr r0, =gPlayerParty
adds r4, r0
adds r0, r4, 0
movs r1, 0x27
bl GetMonData
strb r0, [r7]
adds r0, r4, 0
movs r1, 0x28
bl GetMonData
strb r0, [r7, 0x1]
adds r0, r4, 0
movs r1, 0x29
bl GetMonData
strb r0, [r7, 0x2]
adds r0, r4, 0
movs r1, 0x2A
bl GetMonData
strb r0, [r7, 0x3]
adds r0, r4, 0
movs r1, 0x2B
bl GetMonData
strb r0, [r7, 0x4]
adds r0, r4, 0
movs r1, 0x2C
bl GetMonData
strb r0, [r7, 0x5]
movs r6, 0x6
b _081693AA
.pool
_081691B4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x27
b _081693A2
.pool
_081691C4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x28
b _081693A2
.pool
_081691D4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x29
b _081693A2
.pool
_081691E4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x2A
b _081693A2
.pool
_081691F4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x2B
b _081693A2
.pool
_08169204:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x2C
b _081693A2
.pool
_08169214:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0
b _0816923E
.pool
_08169224:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x9
b _081692E2
.pool
_08169234:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x37
_0816923E:
bl GetMonData
adds r1, r0, 0
strb r1, [r7]
movs r0, 0xFF
lsls r0, 8
ands r0, r1
lsrs r0, 8
strb r0, [r7, 0x1]
movs r0, 0xFF
lsls r0, 16
ands r0, r1
lsrs r0, 16
strb r0, [r7, 0x2]
lsrs r0, r1, 24
strb r0, [r7, 0x3]
movs r6, 0x4
b _081693AA
.pool
_08169268:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x38
b _081693A2
.pool
_08169278:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x39
b _081692E2
.pool
_08169288:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x3A
b _081692E2
.pool
_08169298:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x3B
b _081692E2
.pool
_081692A8:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x3C
b _081692E2
.pool
_081692B8:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x3D
b _081692E2
.pool
_081692C8:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x3E
b _081692E2
.pool
_081692D8:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x3F
_081692E2:
bl GetMonData
lsls r0, 16
lsrs r0, 16
strb r0, [r7]
lsrs r0, 8
strb r0, [r7, 0x1]
movs r6, 0x2
b _081693AA
.pool
_081692F8:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x16
b _081693A2
.pool
_08169308:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x17
b _081693A2
.pool
_08169318:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x18
b _081693A2
.pool
_08169328:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x21
b _081693A2
.pool
_08169338:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x2F
b _081693A2
.pool
_08169348:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x30
b _081693A2
.pool
_08169358:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x32
b _081693A2
.pool
_08169368:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x33
b _081693A2
.pool
_08169378:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x34
b _081693A2
.pool
_08169388:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x35
b _081693A2
.pool
_08169398:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x36
_081693A2:
bl GetMonData
strb r0, [r7]
movs r6, 0x1
_081693AA:
adds r0, r6, 0
add sp, 0x90
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r1}
bx r1
.pool
thumb_func_end sub_8168C14
thumb_func_start WallyHandleGetRawMonData
WallyHandleGetRawMonData: @ 81693C0
push {lr}
bl PlayerHandleGetRawMonData
pop {r0}
bx r0
thumb_func_end WallyHandleGetRawMonData
thumb_func_start WallyHandleSetMonData
WallyHandleSetMonData: @ 81693CC
push {r4,r5,lr}
ldr r1, =gBattleBufferA
ldr r0, =gActiveBank
ldrb r2, [r0]
lsls r0, r2, 9
adds r1, 0x2
adds r1, r0, r1
ldrb r0, [r1]
cmp r0, 0
bne _081693FC
ldr r0, =gBattlePartyID
lsls r1, r2, 1
adds r1, r0
ldrb r0, [r1]
bl sub_8169424
b _0816941A
.pool
_081693FC:
ldrb r4, [r1]
movs r5, 0
_08169400:
movs r0, 0x1
ands r0, r4
cmp r0, 0
beq _0816940E
adds r0, r5, 0
bl sub_8169424
_0816940E:
lsrs r4, 1
adds r0, r5, 0x1
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0x5
bls _08169400
_0816941A:
bl WallyBufferExecCompleted
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end WallyHandleSetMonData
thumb_func_start sub_8169424
sub_8169424: @ 8169424
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x34
lsls r0, 24
lsrs r5, r0, 24
ldr r0, =gActiveBank
ldrb r0, [r0]
lsls r0, 9
ldr r2, =gBattleBufferA + 3
adds r3, r0, r2
adds r6, r3, 0
subs r1, r2, 0x2
adds r0, r1
ldrb r0, [r0]
adds r7, r2, 0
cmp r0, 0x3B
bls _08169450
bl _08169DEA
_08169450:
lsls r0, 2
ldr r1, =_08169468
adds r0, r1
ldr r0, [r0]
mov pc, r0
.pool
.align 2, 0
_08169468:
.4byte _08169558
.4byte _081696F0
.4byte _08169710
.4byte _08169730
.4byte _08169788
.4byte _08169788
.4byte _08169788
.4byte _08169788
.4byte _081697B0
.4byte _08169814
.4byte _08169814
.4byte _08169814
.4byte _08169814
.4byte _08169DEA
.4byte _08169DEA
.4byte _08169DEA
.4byte _08169DEA
.4byte _08169844
.4byte _08169864
.4byte _08169884
.4byte _081698A4
.4byte _081698C4
.4byte _081698E4
.4byte _08169904
.4byte _08169924
.4byte _08169944
.4byte _08169964
.4byte _08169984
.4byte _081699A4
.4byte _081699C4
.4byte _081699E4
.4byte _08169A04
.4byte _08169A74
.4byte _08169A94
.4byte _08169AB4
.4byte _08169AD4
.4byte _08169AF4
.4byte _08169B14
.4byte _08169B34
.4byte _08169B54
.4byte _08169B74
.4byte _08169B94
.4byte _08169BB4
.4byte _08169BD4
.4byte _08169BF4
.4byte _08169C14
.4byte _08169C34
.4byte _08169C54
.4byte _08169C74
.4byte _08169C94
.4byte _08169CB4
.4byte _08169CD4
.4byte _08169CF4
.4byte _08169D14
.4byte _08169D34
.4byte _08169D54
.4byte _08169D74
.4byte _08169D94
.4byte _08169DB4
.4byte _08169DD4
_08169558:
movs r0, 0x64
adds r4, r5, 0
muls r4, r0
ldr r0, =gPlayerParty
adds r4, r0
adds r0, r4, 0
movs r1, 0xB
adds r2, r6, 0
bl SetMonData
adds r2, r6, 0
adds r2, 0x2E
adds r0, r4, 0
movs r1, 0xC
bl SetMonData
movs r0, 0
mov r8, r0
movs r0, 0x3B
adds r0, r6
mov r10, r0
adds r0, r6, 0
adds r0, 0x2B
str r0, [sp, 0x20]
adds r0, 0x19
str r0, [sp, 0x28]
adds r0, 0x4
str r0, [sp, 0x2C]
adds r0, 0x4
str r0, [sp, 0x30]
subs r0, 0x22
str r0, [sp, 0x1C]
subs r0, 0x2
str r0, [sp, 0x18]
adds r0, 0x4
str r0, [sp, 0x24]
adds r0, r6, 0x2
str r0, [sp, 0x4]
adds r0, r6, 0x4
str r0, [sp, 0x8]
adds r0, r6, 0x6
str r0, [sp, 0xC]
adds r0, 0x2
str r0, [sp, 0x10]
adds r0, 0x2
str r0, [sp, 0x14]
mov r9, r4
adds r7, r6, 0
adds r7, 0x24
adds r4, r6, 0
adds r4, 0xC
_081695BE:
mov r1, r8
adds r1, 0xD
mov r0, r9
adds r2, r4, 0
bl SetMonData
mov r1, r8
adds r1, 0x11
mov r0, r9
adds r2, r7, 0
bl SetMonData
adds r7, 0x1
adds r4, 0x2
movs r0, 0x1
add r8, r0
mov r0, r8
cmp r0, 0x3
ble _081695BE
movs r0, 0x64
adds r4, r5, 0
muls r4, r0
ldr r0, =gPlayerParty
adds r4, r0
adds r0, r4, 0
movs r1, 0x15
mov r2, r10
bl SetMonData
adds r0, r4, 0
movs r1, 0x20
ldr r2, [sp, 0x20]
bl SetMonData
adds r0, r4, 0
movs r1, 0x19
ldr r2, [sp, 0x28]
bl SetMonData
ldrb r0, [r6, 0x14]
lsls r0, 27
lsrs r0, 27
mov r1, sp
strb r0, [r1]
adds r0, r4, 0
movs r1, 0x27
mov r2, sp
bl SetMonData
mov r1, sp
ldrh r0, [r6, 0x14]
lsls r0, 22
lsrs r0, 27
strb r0, [r1]
adds r0, r4, 0
movs r1, 0x28
mov r2, sp
bl SetMonData
mov r1, sp
ldrb r0, [r6, 0x15]
lsls r0, 25
lsrs r0, 27
strb r0, [r1]
adds r0, r4, 0
movs r1, 0x29
mov r2, sp
bl SetMonData
mov r1, sp
ldr r0, [r6, 0x14]
lsls r0, 12
lsrs r0, 27
strb r0, [r1]
adds r0, r4, 0
movs r1, 0x2A
mov r2, sp
bl SetMonData
mov r1, sp
ldrh r0, [r6, 0x16]
lsls r0, 23
lsrs r0, 27
strb r0, [r1]
adds r0, r4, 0
movs r1, 0x2B
mov r2, sp
bl SetMonData
mov r1, sp
ldrb r0, [r6, 0x17]
lsls r0, 26
lsrs r0, 27
strb r0, [r1]
adds r0, r4, 0
movs r1, 0x2C
mov r2, sp
bl SetMonData
adds r0, r4, 0
movs r1, 0
ldr r2, [sp, 0x2C]
bl SetMonData
adds r0, r4, 0
movs r1, 0x37
ldr r2, [sp, 0x30]
bl SetMonData
adds r0, r4, 0
movs r1, 0x38
ldr r2, [sp, 0x1C]
bl SetMonData
adds r0, r4, 0
movs r1, 0x39
ldr r2, [sp, 0x18]
bl SetMonData
adds r0, r4, 0
movs r1, 0x3A
ldr r2, [sp, 0x24]
bl SetMonData
adds r0, r4, 0
movs r1, 0x3B
ldr r2, [sp, 0x4]
bl SetMonData
adds r0, r4, 0
movs r1, 0x3C
ldr r2, [sp, 0x8]
bl SetMonData
adds r0, r4, 0
movs r1, 0x3D
ldr r2, [sp, 0xC]
bl SetMonData
adds r0, r4, 0
movs r1, 0x3E
ldr r2, [sp, 0x10]
bl SetMonData
adds r0, r4, 0
movs r1, 0x3F
ldr r2, [sp, 0x14]
bl SetMonData
b _08169DEA
.pool
_081696F0:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0xB
bl SetMonData
b _08169DEA
.pool
_08169710:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0xC
bl SetMonData
b _08169DEA
.pool
_08169730:
movs r0, 0
mov r8, r0
movs r0, 0xC
adds r0, r3
mov r9, r0
movs r0, 0x64
adds r1, r5, 0
muls r1, r0
ldr r0, =gPlayerParty
adds r7, r1, r0
adds r6, r3, 0
adds r6, 0x8
adds r4, r3, 0
_0816974A:
mov r1, r8
adds r1, 0xD
adds r0, r7, 0
adds r2, r4, 0
bl SetMonData
mov r1, r8
adds r1, 0x11
adds r0, r7, 0
adds r2, r6, 0
bl SetMonData
adds r6, 0x1
adds r4, 0x2
movs r0, 0x1
add r8, r0
mov r0, r8
cmp r0, 0x3
ble _0816974A
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x15
mov r2, r9
bl SetMonData
b _08169DEA
.pool
_08169788:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r3, =gBattleBufferA
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r1, r3, 0x1
adds r1, r2, r1
ldrb r1, [r1]
adds r1, 0x9
b _0816982C
.pool
_081697B0:
movs r0, 0x64
adds r4, r5, 0
muls r4, r0
ldr r0, =gPlayerParty
adds r4, r0
ldr r5, =gActiveBank
ldrb r2, [r5]
lsls r2, 9
adds r2, r7
adds r0, r4, 0
movs r1, 0x11
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x1
adds r2, r0
adds r0, r4, 0
movs r1, 0x12
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x2
adds r2, r0
adds r0, r4, 0
movs r1, 0x13
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x3
adds r2, r0
adds r0, r4, 0
movs r1, 0x14
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x4
adds r2, r0
adds r0, r4, 0
movs r1, 0x15
bl SetMonData
b _08169DEA
.pool
_08169814:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r3, =gBattleBufferA
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r1, r3, 0x1
adds r1, r2, r1
ldrb r1, [r1]
adds r1, 0x8
_0816982C:
adds r3, 0x3
adds r2, r3
bl SetMonData
b _08169DEA
.pool
_08169844:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x1
bl SetMonData
b _08169DEA
.pool
_08169864:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x19
bl SetMonData
b _08169DEA
.pool
_08169884:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x1A
bl SetMonData
b _08169DEA
.pool
_081698A4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x1B
bl SetMonData
b _08169DEA
.pool
_081698C4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x1C
bl SetMonData
b _08169DEA
.pool
_081698E4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x1D
bl SetMonData
b _08169DEA
.pool
_08169904:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x1E
bl SetMonData
b _08169DEA
.pool
_08169924:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x1F
bl SetMonData
b _08169DEA
.pool
_08169944:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x20
bl SetMonData
b _08169DEA
.pool
_08169964:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x22
bl SetMonData
b _08169DEA
.pool
_08169984:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x23
bl SetMonData
b _08169DEA
.pool
_081699A4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x24
bl SetMonData
b _08169DEA
.pool
_081699C4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x25
bl SetMonData
b _08169DEA
.pool
_081699E4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x26
bl SetMonData
b _08169DEA
.pool
_08169A04:
movs r0, 0x64
adds r4, r5, 0
muls r4, r0
ldr r0, =gPlayerParty
adds r4, r0
ldr r5, =gActiveBank
ldrb r2, [r5]
lsls r2, 9
adds r2, r7
adds r0, r4, 0
movs r1, 0x27
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x1
adds r2, r0
adds r0, r4, 0
movs r1, 0x28
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x2
adds r2, r0
adds r0, r4, 0
movs r1, 0x29
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x3
adds r2, r0
adds r0, r4, 0
movs r1, 0x2A
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x4
adds r2, r0
adds r0, r4, 0
movs r1, 0x2B
bl SetMonData
ldrb r2, [r5]
lsls r2, 9
adds r0, r7, 0x5
adds r2, r0
adds r0, r4, 0
b _08169B24
.pool
_08169A74:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x27
bl SetMonData
b _08169DEA
.pool
_08169A94:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x28
bl SetMonData
b _08169DEA
.pool
_08169AB4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x29
bl SetMonData
b _08169DEA
.pool
_08169AD4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x2A
bl SetMonData
b _08169DEA
.pool
_08169AF4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x2B
bl SetMonData
b _08169DEA
.pool
_08169B14:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
_08169B24:
movs r1, 0x2C
bl SetMonData
b _08169DEA
.pool
_08169B34:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0
bl SetMonData
b _08169DEA
.pool
_08169B54:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x9
bl SetMonData
b _08169DEA
.pool
_08169B74:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x37
bl SetMonData
b _08169DEA
.pool
_08169B94:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x38
bl SetMonData
b _08169DEA
.pool
_08169BB4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x39
bl SetMonData
b _08169DEA
.pool
_08169BD4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x3A
bl SetMonData
b _08169DEA
.pool
_08169BF4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x3B
bl SetMonData
b _08169DEA
.pool
_08169C14:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x3C
bl SetMonData
b _08169DEA
.pool
_08169C34:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x3D
bl SetMonData
b _08169DEA
.pool
_08169C54:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x3E
bl SetMonData
b _08169DEA
.pool
_08169C74:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x3F
bl SetMonData
b _08169DEA
.pool
_08169C94:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x16
bl SetMonData
b _08169DEA
.pool
_08169CB4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x17
bl SetMonData
b _08169DEA
.pool
_08169CD4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x18
bl SetMonData
b _08169DEA
.pool
_08169CF4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x21
bl SetMonData
b _08169DEA
.pool
_08169D14:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x2F
bl SetMonData
b _08169DEA
.pool
_08169D34:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x30
bl SetMonData
b _08169DEA
.pool
_08169D54:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x32
bl SetMonData
b _08169DEA
.pool
_08169D74:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x33
bl SetMonData
b _08169DEA
.pool
_08169D94:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x34
bl SetMonData
b _08169DEA
.pool
_08169DB4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x35
bl SetMonData
b _08169DEA
.pool
_08169DD4:
movs r0, 0x64
muls r0, r5
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gActiveBank
ldrb r2, [r1]
lsls r2, 9
adds r2, r7
movs r1, 0x36
bl SetMonData
_08169DEA:
ldr r2, =gBattlePartyID
ldr r0, =gActiveBank
ldrb r1, [r0]
lsls r0, r1, 1
adds r0, r2
ldrh r2, [r0]
movs r0, 0x64
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805E990
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_8169424
thumb_func_start WallyHandleSetRawMonData
WallyHandleSetRawMonData: @ 8169E20
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleSetRawMonData
thumb_func_start WallyHandleLoadMonSprite
WallyHandleLoadMonSprite: @ 8169E2C
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleLoadMonSprite
thumb_func_start WallyHandleSwitchInAnim
WallyHandleSwitchInAnim: @ 8169E38
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleSwitchInAnim
thumb_func_start WallyHandleReturnMonToBall
WallyHandleReturnMonToBall: @ 8169E44
push {r4-r6,lr}
ldr r0, =gBattleBufferA
ldr r6, =gActiveBank
ldrb r2, [r6]
lsls r1, r2, 9
adds r0, 0x1
adds r1, r0
ldrb r0, [r1]
cmp r0, 0
bne _08169E80
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x1
bl DoSpecialBattleAnimation
ldr r0, =gBattleBankFunc
ldrb r1, [r6]
lsls r1, 2
adds r1, r0
ldr r0, =sub_8168A20
str r0, [r1]
b _08169EB6
.pool
_08169E80:
ldr r5, =gBankSpriteIds
adds r0, r2, r5
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
ldr r4, =gSprites
adds r0, r4
bl FreeSpriteOamMatrix
ldrb r0, [r6]
adds r0, r5
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r4
bl DestroySprite
ldr r1, =gHealthBoxesIds
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl SetHealthboxSpriteInvisible
bl WallyBufferExecCompleted
_08169EB6:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleReturnMonToBall
thumb_func_start WallyHandleDrawTrainerPic
WallyHandleDrawTrainerPic: @ 8169EC8
push {r4-r6,lr}
ldr r4, =gActiveBank
ldrb r1, [r4]
movs r0, 0x6
bl DecompressTrainerBackPic
ldrb r0, [r4]
bl GetBankIdentity
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
movs r0, 0x6
bl sub_806A12C
ldr r0, =gUnknown_0202499C
ldr r1, =gTrainerBackPicCoords
ldrb r1, [r1, 0x18]
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, [r4]
adds r1, r6
strb r0, [r1]
ldr r5, =gSprites
ldrb r3, [r4]
adds r0, r3, r6
ldrb r0, [r0]
lsls r1, r0, 4
adds r1, r0
lsls r1, 2
adds r1, r5
lsls r3, 4
ldrb r2, [r1, 0x5]
movs r0, 0xF
ands r0, r2
orrs r0, r3
strb r0, [r1, 0x5]
ldrb r0, [r4]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
movs r1, 0xF0
strh r1, [r0, 0x24]
ldrb r0, [r4]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =0x0000fffe
strh r1, [r0, 0x2E]
ldrb r0, [r4]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r5, 0x1C
adds r0, r5
ldr r1, =sub_805D7AC
str r1, [r0]
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
adds r0, r1
ldr r1, =sub_816856C
str r1, [r0]
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleDrawTrainerPic
thumb_func_start WallyHandleTrainerSlide
WallyHandleTrainerSlide: @ 8169F94
push {r4-r6,lr}
ldr r4, =gActiveBank
ldrb r1, [r4]
movs r0, 0x6
bl DecompressTrainerBackPic
ldrb r0, [r4]
bl GetBankIdentity
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
movs r0, 0x6
bl sub_806A12C
ldr r0, =gUnknown_0202499C
ldr r1, =gTrainerBackPicCoords
ldrb r1, [r1, 0x18]
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, [r4]
adds r1, r6
strb r0, [r1]
ldr r5, =gSprites
ldrb r3, [r4]
adds r0, r3, r6
ldrb r0, [r0]
lsls r1, r0, 4
adds r1, r0
lsls r1, 2
adds r1, r5
lsls r3, 4
ldrb r2, [r1, 0x5]
movs r0, 0xF
ands r0, r2
orrs r0, r3
strb r0, [r1, 0x5]
ldrb r0, [r4]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =0x0000ffa0
strh r1, [r0, 0x24]
ldrb r0, [r4]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
movs r1, 0x2
strh r1, [r0, 0x2E]
ldrb r0, [r4]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r5, 0x1C
adds r0, r5
ldr r1, =sub_805D7AC
str r1, [r0]
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
adds r0, r1
ldr r1, =sub_8168A90
str r1, [r0]
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleTrainerSlide
thumb_func_start WallyHandleTrainerSlideBack
WallyHandleTrainerSlideBack: @ 816A060
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleTrainerSlideBack
thumb_func_start WallyHandleFaintAnimation
WallyHandleFaintAnimation: @ 816A06C
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleFaintAnimation
thumb_func_start WallyHandleCmd11
WallyHandleCmd11: @ 816A078
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd11
thumb_func_start WallyHandleCmd12
WallyHandleCmd12: @ 816A084
push {r4,r5,lr}
ldr r0, =gBattleSpritesDataPtr
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 GetBankByIdentity
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
adds r0, r4, 0
adds r1, r4, 0
movs r3, 0x4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
adds r0, r1
ldr r1, =bx_wait_t5
str r1, [r0]
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleCmd12
thumb_func_start WallyHandleBallThrow
WallyHandleBallThrow: @ 816A0D8
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, =gBattleSpritesDataPtr
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 GetBankByIdentity
adds r2, r0, 0
lsls r2, 24
lsrs r2, 24
adds r0, r4, 0
adds r1, r4, 0
movs r3, 0x4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
adds r0, r1
ldr r1, =bx_wait_t5
str r1, [r0]
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleBallThrow
thumb_func_start WallyHandlePause
WallyHandlePause: @ 816A138
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandlePause
thumb_func_start WallyHandleMoveAnimation
WallyHandleMoveAnimation: @ 816A144
push {r4-r6,lr}
ldr r0, =gBattleBufferA
mov r12, r0
ldr r6, =gActiveBank
ldrb r2, [r6]
lsls r2, 9
adds r0, 0x1
adds r0, r2, r0
ldrb r0, [r0]
mov r1, r12
adds r1, 0x2
adds r1, r2, r1
ldrb r1, [r1]
lsls r1, 8
orrs r0, r1
ldr r5, =gAnimMoveTurn
mov r1, r12
adds r1, 0x3
adds r2, r1
ldrb r1, [r2]
strb r1, [r5]
ldr r4, =gAnimMovePower
ldrb r2, [r6]
lsls r2, 9
mov r1, r12
adds r1, 0x4
adds r1, r2, r1
ldrb r3, [r1]
mov r1, r12
adds r1, 0x5
adds r2, r1
ldrb r1, [r2]
lsls r1, 8
orrs r3, r1
strh r3, [r4]
ldr r4, =gAnimMoveDmg
ldrb r2, [r6]
lsls r2, 9
mov r1, r12
adds r1, 0x6
adds r1, r2, r1
ldrb r3, [r1]
mov r1, r12
adds r1, 0x7
adds r1, r2, r1
ldrb r1, [r1]
lsls r1, 8
orrs r3, r1
mov r1, r12
adds r1, 0x8
adds r1, r2, r1
ldrb r1, [r1]
lsls r1, 16
orrs r3, r1
mov r1, r12
adds r1, 0x9
adds r2, r1
ldrb r1, [r2]
lsls r1, 24
orrs r3, r1
str r3, [r4]
ldr r3, =gAnimFriendship
ldrb r1, [r6]
lsls r1, 9
mov r2, r12
adds r2, 0xA
adds r1, r2
ldrb r1, [r1]
strb r1, [r3]
ldr r4, =gWeatherMoveAnim
ldrb r2, [r6]
lsls r2, 9
mov r1, r12
adds r1, 0xC
adds r1, r2, r1
ldrb r3, [r1]
mov r1, r12
adds r1, 0xD
adds r2, r1
ldrb r1, [r2]
lsls r1, 8
orrs r3, r1
strh r3, [r4]
ldr r3, =gAnimDisableStructPtr
ldrb r2, [r6]
lsls r2, 9
mov r1, r12
adds r1, 0x10
adds r2, r1
str r2, [r3]
ldr r3, =gTransformedPersonalities
ldrb r1, [r6]
lsls r1, 2
adds r1, r3
ldr r2, [r2]
str r2, [r1]
ldrb r1, [r5]
bl IsMoveWithoutAnimation
lsls r0, 24
lsrs r3, r0, 24
cmp r3, 0
beq _0816A23C
bl WallyBufferExecCompleted
b _0816A25A
.pool
_0816A23C:
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldrb r1, [r6]
ldr r2, [r0, 0x4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
strb r3, [r0, 0x4]
ldr r1, =gBattleBankFunc
ldrb r0, [r6]
lsls r0, 2
adds r0, r1
ldr r1, =bx_move_anim_5
str r1, [r0]
_0816A25A:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleMoveAnimation
thumb_func_start bx_move_anim_5
bx_move_anim_5: @ 816A26C
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
ldr r2, =gBattleBufferA
ldr r6, =gActiveBank
ldrb r3, [r6]
lsls r1, r3, 9
adds r0, r2, 0x1
mov r9, r0
adds r0, r1, r0
ldrb r4, [r0]
adds r2, 0x2
mov r8, r2
add r1, r8
ldrb r0, [r1]
lsls r0, 8
orrs r4, r0
ldr r7, =gBattleSpritesDataPtr
ldr r5, [r7]
ldr r1, [r5, 0x4]
lsls r0, r3, 1
adds r0, r3
lsls r0, 2
adds r0, r1
ldrb r2, [r0, 0x4]
cmp r2, 0x1
beq _0816A2F6
cmp r2, 0x1
bgt _0816A2BC
cmp r2, 0
beq _0816A2C6
b _0816A3AC
.pool
_0816A2BC:
cmp r2, 0x2
beq _0816A320
cmp r2, 0x3
beq _0816A370
b _0816A3AC
_0816A2C6:
ldr r1, [r5]
lsls r0, r3, 2
adds r0, r1
ldrb r1, [r0]
movs r0, 0x4
ands r0, r1
cmp r0, 0
beq _0816A2E2
adds r0, r3, 0
adds r1, r3, 0
adds r2, r3, 0
movs r3, 0x5
bl DoSpecialBattleAnimation
_0816A2E2:
ldr r0, [r7]
ldrb r1, [r6]
ldr r2, [r0, 0x4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
movs r1, 0x1
strb r1, [r0, 0x4]
b _0816A3AC
_0816A2F6:
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
cmp r0, 0
bne _0816A3AC
movs r0, 0
bl sub_805EB9C
adds r0, r4, 0
bl DoMoveAnim
ldr r0, [r7]
ldrb r1, [r6]
ldr r2, [r0, 0x4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
movs r1, 0x2
strb r1, [r0, 0x4]
b _0816A3AC
_0816A320:
ldr r0, =gAnimScriptCallback
ldr r0, [r0]
bl _call_via_r0
ldr r0, =gAnimScriptActive
ldrb r0, [r0]
cmp r0, 0
bne _0816A3AC
movs r0, 0x1
bl sub_805EB9C
ldr r0, [r7]
ldrb r2, [r6]
ldr r1, [r0]
lsls r0, r2, 2
adds r0, r1
ldrb r1, [r0]
movs r0, 0x4
ands r0, r1
cmp r0, 0
beq _0816A354
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl DoSpecialBattleAnimation
_0816A354:
ldr r0, [r7]
ldrb r1, [r6]
ldr r2, [r0, 0x4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
movs r1, 0x3
strb r1, [r0, 0x4]
b _0816A3AC
.pool
_0816A370:
ldrb r1, [r0]
movs r0, 0x40
ands r0, r1
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
bne _0816A3AC
bl sub_805E394
ldrb r0, [r6]
lsls r2, r0, 9
mov r3, r9
adds r1, r2, r3
ldrb r1, [r1]
add r2, r8
ldrb r2, [r2]
lsls r2, 8
orrs r1, r2
bl TrySetBehindSubstituteSpriteBit
ldr r0, [r7]
ldrb r1, [r6]
ldr r2, [r0, 0x4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
strb r4, [r0, 0x4]
bl WallyBufferExecCompleted
_0816A3AC:
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end bx_move_anim_5
thumb_func_start WallyHandlePrintString
WallyHandlePrintString: @ 816A3B8
push {r4,lr}
ldr r0, =gBattle_BG0_X
movs r1, 0
strh r1, [r0]
ldr r0, =gBattle_BG0_Y
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 BattleHandleAddTextPrinter
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
adds r0, r1
ldr r1, =sub_81685A4
str r1, [r0]
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandlePrintString
thumb_func_start WallyHandlePrintStringPlayerOnly
WallyHandlePrintStringPlayerOnly: @ 816A40C
push {lr}
ldr r0, =gActiveBank
ldrb r0, [r0]
bl GetBankSide
lsls r0, 24
cmp r0, 0
bne _0816A428
bl WallyHandlePrintString
b _0816A42C
.pool
_0816A428:
bl WallyBufferExecCompleted
_0816A42C:
pop {r0}
bx r0
thumb_func_end WallyHandlePrintStringPlayerOnly
thumb_func_start sub_816A430
sub_816A430: @ 816A430
push {lr}
bl IsDma3ManagerBusyWithBgCopy
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0
bne _0816A456
ldr r0, =gBattle_BG0_X
strh r1, [r0]
ldr r1, =gBattle_BG0_Y
movs r0, 0xA0
strh r0, [r1]
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
ldrb r0, [r0]
lsls r0, 2
adds r0, r1
ldr r1, =sub_8168444
str r1, [r0]
_0816A456:
pop {r0}
bx r0
.pool
thumb_func_end sub_816A430
thumb_func_start WallyHandleChooseAction
WallyHandleChooseAction: @ 816A470
push {r4,lr}
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
ldrb r0, [r0]
lsls r0, 2
adds r0, r1
ldr r1, =sub_816A430
str r1, [r0]
ldr r0, =gText_BattleMenu
movs r1, 0x2
bl BattleHandleAddTextPrinter
movs r4, 0
_0816A48A:
lsls r0, r4, 24
lsrs r0, 24
bl ActionSelectionDestroyCursorAt
adds r4, 0x1
cmp r4, 0x3
ble _0816A48A
ldr r1, =gActionSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
ldrb r0, [r0]
movs r1, 0
bl ActionSelectionCreateCursorAt
ldr r0, =gText_WhatWillWallyDo
bl BattleStringExpandPlaceholdersToDisplayedString
ldr r0, =gDisplayedStringBattle
movs r1, 0x1
bl BattleHandleAddTextPrinter
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleChooseAction
thumb_func_start WallyHandleCmd19
WallyHandleCmd19: @ 816A4D8
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd19
thumb_func_start WallyHandleChooseMove
WallyHandleChooseMove: @ 816A4E4
push {r4,lr}
ldr r4, =gBattleStruct
ldr r1, [r4]
adds r0, r1, 0
adds r0, 0x95
ldrb r0, [r0]
cmp r0, 0x1
beq _0816A522
cmp r0, 0x1
bgt _0816A504
cmp r0, 0
beq _0816A50A
b _0816A574
.pool
_0816A504:
cmp r0, 0x2
beq _0816A550
b _0816A574
_0816A50A:
bl InitMoveSelectionsVarsAndStrings
ldr r1, [r4]
adds r1, 0x95
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
ldr r0, [r4]
adds r0, 0x97
movs r1, 0x50
strb r1, [r0]
b _0816A574
_0816A522:
bl IsDma3ManagerBusyWithBgCopy
lsls r0, 24
lsrs r1, r0, 24
cmp r1, 0
bne _0816A574
ldr r0, =gBattle_BG0_X
strh r1, [r0]
ldr r1, =gBattle_BG0_Y
movs r2, 0xA0
lsls r2, 1
adds r0, r2, 0
strh r0, [r1]
ldr r1, [r4]
adds r1, 0x95
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
b _0816A574
.pool
_0816A550:
adds r1, 0x97
ldrb r0, [r1]
subs r0, 0x1
strb r0, [r1]
lsls r0, 24
cmp r0, 0
bne _0816A574
movs r0, 0x5
bl PlaySE
movs r2, 0x80
lsls r2, 1
movs r0, 0x1
movs r1, 0xA
bl EmitTwoReturnValues
bl WallyBufferExecCompleted
_0816A574:
pop {r4}
pop {r0}
bx r0
thumb_func_end WallyHandleChooseMove
thumb_func_start WallyHandleOpenBag
WallyHandleOpenBag: @ 816A57C
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_81685D4
str r1, [r0]
ldr r1, =gBankInMenu
ldrb r0, [r2]
strb r0, [r1]
add sp, 0x4
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleOpenBag
thumb_func_start WallyHandleChoosePokemon
WallyHandleChoosePokemon: @ 816A5BC
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleChoosePokemon
thumb_func_start WallyHandleCmd23
WallyHandleCmd23: @ 816A5C8
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd23
thumb_func_start WallyHandleHealthBarUpdate
WallyHandleHealthBarUpdate: @ 816A5D4
push {r4-r7,lr}
mov r7, r9
mov r6, r8
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
ldrb r4, [r0]
lsls r2, r4, 9
adds r0, r3, 0x2
adds r0, r2, r0
ldrb r1, [r0]
adds r3, 0x3
adds r2, r3
ldrb r0, [r2]
lsls r0, 8
orrs r1, r0
lsls r1, 16
asrs r7, r1, 16
ldr r0, =0x00007fff
cmp r7, r0
beq _0816A664
ldr r6, =gBattlePartyID
lsls r0, r4, 1
adds r0, r6
ldrh r0, [r0]
movs r5, 0x64
muls r0, r5
ldr r4, =gPlayerParty
adds r0, r4
movs r1, 0x3A
bl GetMonData
mov r8, r0
mov r1, r9
ldrb r0, [r1]
lsls r0, 1
adds r0, r6
ldrh r0, [r0]
muls r0, r5
adds r0, r4
movs r1, 0x39
bl GetMonData
adds r3, r0, 0
mov r1, r9
ldrb r0, [r1]
ldr r1, =gHealthBoxesIds
adds r1, r0, r1
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl SetBattleBarStruct
b _0816A69E
.pool
_0816A664:
ldr r1, =gBattlePartyID
lsls r0, r4, 1
adds r0, r1
ldrh r1, [r0]
movs r0, 0x64
muls r0, r1
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0x3A
bl GetMonData
adds r2, r0, 0
mov r1, r9
ldrb r0, [r1]
ldr r4, =gHealthBoxesIds
adds r1, r0, r4
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl SetBattleBarStruct
mov r1, r9
ldrb r0, [r1]
adds r0, r4
ldrb r0, [r0]
movs r1, 0
movs r2, 0
bl UpdateHpTextInHealthbox
_0816A69E:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
ldrb r0, [r0]
lsls r0, 2
adds r0, r1
ldr r1, =sub_8168934
str r1, [r0]
add sp, 0x4
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleHealthBarUpdate
thumb_func_start WallyHandleExpUpdate
WallyHandleExpUpdate: @ 816A6D4
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleExpUpdate
thumb_func_start WallyHandleStatusIconUpdate
WallyHandleStatusIconUpdate: @ 816A6E0
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleStatusIconUpdate
thumb_func_start WallyHandleStatusAnimation
WallyHandleStatusAnimation: @ 816A6EC
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleStatusAnimation
thumb_func_start WallyHandleStatusXor
WallyHandleStatusXor: @ 816A6F8
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleStatusXor
thumb_func_start WallyHandleDataTransfer
WallyHandleDataTransfer: @ 816A704
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleDataTransfer
thumb_func_start WallyHandleDMA3Transfer
WallyHandleDMA3Transfer: @ 816A710
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleDMA3Transfer
thumb_func_start WallyHandlePlayBGM
WallyHandlePlayBGM: @ 816A71C
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandlePlayBGM
thumb_func_start WallyHandleCmd32
WallyHandleCmd32: @ 816A728
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd32
thumb_func_start WallyHandleCmd33
WallyHandleCmd33: @ 816A734
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd33
thumb_func_start WallyHandleCmd34
WallyHandleCmd34: @ 816A740
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd34
thumb_func_start WallyHandleCmd35
WallyHandleCmd35: @ 816A74C
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd35
thumb_func_start WallyHandleCmd36
WallyHandleCmd36: @ 816A758
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd36
thumb_func_start WallyHandleCmd37
WallyHandleCmd37: @ 816A764
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd37
thumb_func_start WallyHandleCmd38
WallyHandleCmd38: @ 816A770
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd38
thumb_func_start WallyHandleCmd39
WallyHandleCmd39: @ 816A77C
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd39
thumb_func_start WallyHandleCmd40
WallyHandleCmd40: @ 816A788
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd40
thumb_func_start WallyHandleHitAnimation
WallyHandleHitAnimation: @ 816A794
push {r4,lr}
ldr r3, =gSprites
ldr r2, =gBankSpriteIds
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r2
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r3
adds r0, 0x3E
ldrb r0, [r0]
lsls r0, 29
cmp r0, 0
bge _0816A7C8
bl WallyBufferExecCompleted
b _0816A7F2
.pool
_0816A7C8:
ldr r1, =gDoingBattleAnim
movs r0, 0x1
strb r0, [r1]
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
strh r1, [r0, 0x30]
ldrb r0, [r4]
bl DoHitAnimHealthboxEffect
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
adds r0, r1
ldr r1, =bx_blink_t5
str r1, [r0]
_0816A7F2:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleHitAnimation
thumb_func_start WallyHandleCmd42
WallyHandleCmd42: @ 816A804
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd42
thumb_func_start WallyHandleEffectivenessSound
WallyHandleEffectivenessSound: @ 816A810
push {lr}
ldr r2, =gBattleBufferA
ldr r0, =gActiveBank
ldrb r1, [r0]
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
bl PlaySE
bl WallyBufferExecCompleted
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleEffectivenessSound
thumb_func_start WallyHandlePlayFanfareOrBGM
WallyHandlePlayFanfareOrBGM: @ 816A840
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 _0816A87C
bl BattleMusicStop
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 _0816A890
.pool
_0816A87C:
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
_0816A890:
bl WallyBufferExecCompleted
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end WallyHandlePlayFanfareOrBGM
thumb_func_start WallyHandleFaintingCry
WallyHandleFaintingCry: @ 816A89C
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 WallyBufferExecCompleted
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleFaintingCry
thumb_func_start WallyHandleIntroSlide
WallyHandleIntroSlide: @ 816A8D8
push {lr}
ldr r1, =gBattleBufferA
ldr r0, =gActiveBank
ldrb r0, [r0]
lsls r0, 9
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
orrs r0, r1
strh r0, [r2]
bl WallyBufferExecCompleted
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleIntroSlide
thumb_func_start WallyHandleIntroTrainerBallThrow
WallyHandleIntroTrainerBallThrow: @ 816A90C
push {r4-r7,lr}
ldr r6, =gBankSpriteIds
ldr r7, =gActiveBank
ldrb r0, [r7]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
ldr r5, =gSprites
adds r0, r5
bl oamt_add_pos2_onto_pos1
ldrb r0, [r7]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
movs r1, 0x32
strh r1, [r0, 0x2E]
ldrb r0, [r7]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =0x0000ffd8
strh r1, [r0, 0x32]
ldrb r0, [r7]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
ldrh r1, [r0, 0x22]
strh r1, [r0, 0x36]
ldrb r0, [r7]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r1, r5, 0
adds r1, 0x1C
adds r0, r1
ldr r1, =sub_80A6EEC
str r1, [r0]
ldrb r2, [r7]
adds r0, r2, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
strh r2, [r0, 0x38]
ldrb r0, [r7]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =sub_805CC00
bl StoreSpriteCallbackInData6
ldrb r0, [r7]
adds r0, r6
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
movs r1, 0x1
bl StartSpriteAnim
ldr r0, =0x0000d6f8
bl AllocSpritePalette
adds r4, r0, 0
lsls r4, 24
ldr r0, =gTrainerBackPicPaletteTable
ldr r0, [r0, 0x30]
lsrs r4, 20
movs r2, 0x80
lsls r2, 1
adds r1, r4, r2
movs r2, 0x20
bl LoadCompressedPalette
ldrb r0, [r7]
adds r0, r6
ldrb r0, [r0]
lsls r1, r0, 4
adds r1, r0
lsls r1, 2
adds r1, r5
ldrb r2, [r1, 0x5]
movs r0, 0xF
ands r0, r2
orrs r0, r4
strb r0, [r1, 0x5]
ldr r0, =sub_816AC04
movs r1, 0x5
bl CreateTask
lsls r0, 24
lsrs r0, 24
ldr r4, =gTasks
lsls r1, r0, 2
adds r1, r0
lsls r1, 3
adds r1, r4
ldrb r0, [r7]
strh r0, [r1, 0x8]
ldr r3, =gBattleSpritesDataPtr
ldr r0, [r3]
ldrb r2, [r7]
ldr r1, [r0, 0x4]
lsls r0, r2, 1
adds r0, r2
lsls r0, 2
adds r0, r1
ldrb r1, [r0]
movs r0, 0x1
ands r0, r1
cmp r0, 0
beq _0816AA24
ldr r0, =gUnknown_020244B4
adds r0, r2, r0
ldrb r1, [r0]
lsls r0, r1, 2
adds r0, r1
lsls r0, 3
adds r0, r4
ldr r1, =sub_8073C30
str r1, [r0]
_0816AA24:
ldr r0, [r3]
ldr r2, [r0, 0x8]
ldrb r0, [r2, 0x9]
movs r1, 0x1
orrs r0, r1
strb r0, [r2, 0x9]
ldr r1, =gBattleBankFunc
ldrb r0, [r7]
lsls r0, 2
adds r0, r1
ldr r1, =nullsub_21
str r1, [r0]
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleIntroTrainerBallThrow
thumb_func_start sub_816AA80
sub_816AA80: @ 816AA80
push {r4-r6,lr}
mov r6, r10
mov r5, r9
mov r4, r8
push {r4-r6}
adds r6, r0, 0
lsls r6, 24
lsrs r6, 24
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldr r1, [r0]
lsls r0, r6, 2
adds r0, r1
movs r1, 0
strh r1, [r0, 0x2]
ldr r0, =gBattlePartyID
lsls r2, r6, 1
adds r2, r0
ldr r0, =gBattleBufferA
lsls r1, r6, 9
adds r0, 0x1
adds r1, r0
ldrb r0, [r1]
strh r0, [r2]
ldrh r1, [r2]
movs r0, 0x64
muls r0, r1
ldr r1, =gPlayerParty
adds r0, r1
movs r1, 0xB
bl GetMonData
mov r8, r0
lsls r0, 16
lsrs r0, 16
mov r8, r0
ldr r0, =sub_805D714
bl CreateInvisibleSpriteWithCallback
ldr r1, =gUnknown_03005D7C
mov r9, r1
add r9, r6
mov r1, r9
strb r0, [r1]
adds r0, r6, 0
bl GetBankIdentity
adds r1, r0, 0
lsls r1, 24
lsrs r1, 24
mov r0, r8
bl sub_806A068
ldr r0, =gUnknown_0202499C
mov r10, r0
adds r0, r6, 0
movs r1, 0x2
bl sub_80A5C6C
adds r5, r0, 0
lsls r5, 24
lsrs r5, 24
adds r0, r6, 0
bl sub_80A6138
adds r4, r0, 0
lsls r4, 24
lsrs r4, 24
adds r0, r6, 0
bl sub_80A82E4
adds r3, r0, 0
lsls r3, 24
lsrs r3, 24
mov r0, r10
adds r1, r5, 0
adds r2, r4, 0
bl CreateSprite
ldr r4, =gBankSpriteIds
adds r4, r6, r4
strb r0, [r4]
ldr r5, =gSprites
mov r0, r9
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
ldrb r1, [r4]
strh r1, [r0, 0x30]
mov r0, r9
ldrb r1, [r0]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
strh r6, [r0, 0x32]
ldrb r1, [r4]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
strh r6, [r0, 0x2E]
ldrb r1, [r4]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
mov r1, r8
strh r1, [r0, 0x32]
ldrb r0, [r4]
lsls r1, r0, 4
adds r1, r0
lsls r1, 2
adds r1, r5
lsls r3, r6, 4
ldrb r2, [r1, 0x5]
movs r0, 0xF
ands r0, r2
orrs r0, r3
strb r0, [r1, 0x5]
ldrb r1, [r4]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r0, r5
ldr r1, =gBattleMonForms
adds r6, r1
ldrb r1, [r6]
bl StartSpriteAnim
ldrb r1, [r4]
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]
ldrb r1, [r4]
lsls r0, r1, 4
adds r0, r1
lsls r0, 2
adds r1, r5, 0
adds r1, 0x1C
adds r0, r1
ldr r1, =SpriteCallbackDummy
str r1, [r0]
movs r0, 0
movs r1, 0xFF
bl sub_80753E8
mov r1, r9
ldrb r2, [r1]
lsls r1, r2, 4
adds r1, r2
lsls r1, 2
adds r1, r5
lsls r0, 24
lsrs r0, 24
strh r0, [r1, 0x2E]
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_816AA80
thumb_func_start sub_816AC04
sub_816AC04: @ 816AC04
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 r1, r0, r1
ldrh r2, [r1, 0xA]
movs r3, 0xA
ldrsh r0, [r1, r3]
cmp r0, 0x1E
bgt _0816AC28
adds r0, r2, 0x1
strh r0, [r1, 0xA]
b _0816AC5E
.pool
_0816AC28:
ldr r4, =gActiveBank
ldrb r5, [r4]
ldrh r0, [r1, 0x8]
strb r0, [r4]
ldr r0, =gBattleBufferA
ldrb r1, [r4]
lsls r2, r1, 9
adds r0, 0x1
adds r2, r0
ldr r0, =gBattlePartyID
lsls r1, 1
adds r1, r0
ldrh r0, [r1]
strb r0, [r2]
ldrb r0, [r4]
bl sub_816AA80
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
adds r0, r1
ldr r1, =sub_816864C
str r1, [r0]
strb r5, [r4]
adds r0, r6, 0
bl DestroyTask
_0816AC5E:
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end sub_816AC04
thumb_func_start WallyHandleDrawPartyStatusSummary
WallyHandleDrawPartyStatusSummary: @ 816AC78
push {r4,r5,lr}
ldr r1, =gBattleBufferA
ldr r0, =gActiveBank
ldrb r2, [r0]
lsls r0, r2, 9
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
beq _0816ACA8
adds r0, r2, 0
bl GetBankSide
lsls r0, 24
cmp r0, 0
bne _0816ACA8
bl WallyBufferExecCompleted
b _0816ACE6
.pool
_0816ACA8:
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldr r5, =gActiveBank
ldrb r1, [r5]
ldr r2, [r0, 0x4]
lsls r0, r1, 1
adds r0, r1
lsls r0, 2
adds r0, r2
ldrb r1, [r0]
movs r2, 0x1
orrs r1, r2
strb r1, [r0]
ldrb r0, [r5]
lsls r4, r0, 9
ldr r3, =gBattleBufferA + 4
adds r1, r4, r3
subs r2, r3, 0x3
adds r2, r4, r2
ldrb r2, [r2]
subs r3, 0x2
adds r4, r3
ldrb r3, [r4]
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2
strb r0, [r1]
bl WallyBufferExecCompleted
_0816ACE6:
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleDrawPartyStatusSummary
thumb_func_start WallyHandleCmd49
WallyHandleCmd49: @ 816ACFC
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd49
thumb_func_start WallyHandleCmd50
WallyHandleCmd50: @ 816AD08
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleCmd50
thumb_func_start WallyHandleSpriteInvisibility
WallyHandleSpriteInvisibility: @ 816AD14
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleSpriteInvisibility
thumb_func_start WallyHandleBattleAnimation
WallyHandleBattleAnimation: @ 816AD20
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 DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _0816AD60
bl WallyBufferExecCompleted
b _0816AD6C
.pool
_0816AD60:
ldr r0, =gBattleBankFunc
ldrb r1, [r6]
lsls r1, 2
adds r1, r0
ldr r0, =sub_8168AC8
str r0, [r1]
_0816AD6C:
add sp, 0x4
pop {r4-r6}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleBattleAnimation
thumb_func_start WallyHandleLinkStandbyMsg
WallyHandleLinkStandbyMsg: @ 816AD7C
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleLinkStandbyMsg
thumb_func_start WallyHandleResetActionMoveSelection
WallyHandleResetActionMoveSelection: @ 816AD88
push {lr}
bl WallyBufferExecCompleted
pop {r0}
bx r0
thumb_func_end WallyHandleResetActionMoveSelection
thumb_func_start WallyHandleCmd55
WallyHandleCmd55: @ 816AD94
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 WallyBufferExecCompleted
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x6
ands r0, r1
cmp r0, 0x2
bne _0816ADD0
ldr r0, =gBattleBankFunc
ldrb r1, [r4]
lsls r1, 2
adds r1, r0
ldr r0, =sub_80587B0
str r0, [r1]
_0816ADD0:
pop {r4}
pop {r0}
bx r0
.pool
thumb_func_end WallyHandleCmd55
thumb_func_start nullsub_118
nullsub_118: @ 816ADF0
bx lr
thumb_func_end nullsub_118
.align 2, 0 @ Don't pad with nop.