player battle controller is done

This commit is contained in:
DizzyEggg 2017-10-22 18:43:15 +02:00
parent 813b1bfd4a
commit df4e32a307
32 changed files with 1298 additions and 2553 deletions

View File

@ -67,8 +67,8 @@ _0805D192:
.pool
thumb_func_end FreeBattleSpritesData
thumb_func_start sub_805D19C
sub_805D19C: @ 805D19C
thumb_func_start ChooseMoveAndTargetInBattlePalace
ChooseMoveAndTargetInBattlePalace: @ 805D19C
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -448,7 +448,7 @@ _0805D496:
pop {r1}
bx r1
.pool
thumb_func_end sub_805D19C
thumb_func_end ChooseMoveAndTargetInBattlePalace
thumb_func_start sub_805D4A8
sub_805D4A8: @ 805D4A8
@ -834,8 +834,8 @@ _0805D800:
.pool
thumb_func_end sub_805D7EC
thumb_func_start move_anim_start_t2_for_situation
move_anim_start_t2_for_situation: @ 805D808
thumb_func_start DoStatusAnimation
DoStatusAnimation: @ 805D808
push {r4-r6,lr}
adds r4, r1, 0
lsls r0, 24
@ -962,10 +962,10 @@ _0805D902:
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end move_anim_start_t2_for_situation
thumb_func_end DoStatusAnimation
thumb_func_start move_anim_start_t3
move_anim_start_t3: @ 805D908
thumb_func_start DoBattleAnimationFromTable
DoBattleAnimationFromTable: @ 805D908
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -1070,7 +1070,7 @@ _0805D9CC:
ldr r0, =gUnknown_082C9320
adds r1, r5, 0
movs r2, 0
bl DoBattleAnim
bl LaunchBattleAnimation
ldr r0, =task0A_0803415C
movs r1, 0xA
bl CreateTask
@ -1105,7 +1105,7 @@ _0805DA1E:
pop {r1}
bx r1
.pool
thumb_func_end move_anim_start_t3
thumb_func_end DoBattleAnimationFromTable
thumb_func_start task0A_0803415C
task0A_0803415C: @ 805DA48
@ -1172,8 +1172,8 @@ _0805DABE:
bx r1
thumb_func_end sub_805DAA0
thumb_func_start move_anim_start_t4
move_anim_start_t4: @ 805DAC4
thumb_func_start DoSpecialBattleAnimation
DoSpecialBattleAnimation: @ 805DAC4
push {r4,lr}
adds r4, r0, 0
lsls r4, 24
@ -1187,7 +1187,7 @@ move_anim_start_t4: @ 805DAC4
ldr r0, =gUnknown_082C937C
adds r1, r3, 0
movs r2, 0
bl DoBattleAnim
bl LaunchBattleAnimation
ldr r0, =task0A_08034248
movs r1, 0xA
bl CreateTask
@ -1216,7 +1216,7 @@ move_anim_start_t4: @ 805DAC4
pop {r0}
bx r0
.pool
thumb_func_end move_anim_start_t4
thumb_func_end DoSpecialBattleAnimation
thumb_func_start task0A_08034248
task0A_08034248: @ 805DB34
@ -2229,8 +2229,8 @@ _0805E3EA:
.pool
thumb_func_end sub_805E394
thumb_func_start sub_805E408
sub_805E408: @ 805E408
thumb_func_start SetBattleSpriteInvisibilityBitToSpriteInvisibility
SetBattleSpriteInvisibilityBitToSpriteInvisibility: @ 805E408
lsls r0, 24
lsrs r0, 24
ldr r1, =gBattleSpritesDataPtr
@ -2258,7 +2258,7 @@ sub_805E408: @ 805E408
strb r0, [r3]
bx lr
.pool
thumb_func_end sub_805E408
thumb_func_end SetBattleSpriteInvisibilityBitToSpriteInvisibility
thumb_func_start sub_805E448
sub_805E448: @ 805E448

View File

@ -869,7 +869,7 @@ move_anim_start_t2: @ 80AA364
strb r4, [r0]
ldr r0, =gUnknown_082C92FC
movs r2, 0
bl DoBattleAnim
bl LaunchBattleAnimation
ldr r0, =task0A_80788BC
movs r1, 0xA
bl CreateTask

View File

@ -50443,8 +50443,8 @@ _081181CA:
bx r1
thumb_func_end sub_8118140
thumb_func_start battle_intro_launch
battle_intro_launch: @ 81181D4
thumb_func_start HandleIntroSlide
HandleIntroSlide: @ 81181D4
push {r4,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -50521,7 +50521,7 @@ _08118258:
pop {r0}
bx r0
.pool
thumb_func_end battle_intro_launch
thumb_func_end HandleIntroSlide
thumb_func_start sub_811828C
sub_811828C: @ 811828C

View File

@ -1163,7 +1163,7 @@ sub_8064D60: @ 8064D60
adds r1, r3, 0
adds r2, r3, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08064DA0:
ldr r0, =gBattleBankFunc
ldrb r1, [r4]
@ -1312,7 +1312,7 @@ sub_8064E50: @ 8064E50
ldrb r0, [r0]
bl SetHealthboxSpriteVisible
ldrb r0, [r5]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3970,7 +3970,7 @@ _080666E4:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_080666FE:
ldr r0, [r6]
ldrb r1, [r5]
@ -3995,7 +3995,7 @@ _08066712:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x2
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -4595,7 +4595,7 @@ LinkOpponentHandleFaintAnimation: @ 8066C40
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08066C74:
ldr r0, [r6]
ldrb r1, [r5]
@ -4890,7 +4890,7 @@ _08066ED2:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08066EF4:
ldr r0, [r7]
ldrb r1, [r6]
@ -4948,7 +4948,7 @@ _08066F32:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r0, [r7]
ldrb r1, [r6]
ldr r0, [r0]
@ -5285,7 +5285,7 @@ LinkOpponentHandleStatusAnimation: @ 8067214
ldrb r2, [r3]
lsls r2, 24
orrs r1, r2
bl move_anim_start_t2_for_situation
bl DoStatusAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -5481,7 +5481,7 @@ _080673B0:
movs r1, 0
strh r1, [r0, 0x30]
ldrb r0, [r4]
bl sub_80769F4
bl DoHitAnimHealthboxEffect
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
@ -5615,7 +5615,7 @@ LinkOpponentHandleIntroSlide: @ 80674D4
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl battle_intro_launch
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
@ -6092,7 +6092,7 @@ LinkOpponentHandleSpriteInvisibility: @ 80678D0
orrs r0, r1
strb r0, [r2]
ldrb r0, [r4]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
_08067916:
bl LinkOpponentBufferExecCompleted
pop {r4}
@ -6129,7 +6129,7 @@ LinkOpponentHandleBattleAnimation: @ 8067930
adds r0, r2, 0
adds r1, r2, 0
adds r3, r6, 0
bl move_anim_start_t3
bl DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _08067980

View File

@ -736,7 +736,7 @@ sub_814B4E0: @ 814B4E0
cmp r1, r0
bne _0814B532
adds r0, r3, 0
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldrb r2, [r4]
@ -751,7 +751,7 @@ sub_814B4E0: @ 814B4E0
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0814B526:
ldr r0, =gBattleBankFunc
ldrb r1, [r4]
@ -3554,7 +3554,7 @@ _0814CECC:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0814CEE6:
ldr r0, [r6]
ldrb r1, [r5]
@ -3579,7 +3579,7 @@ _0814CEFA:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x1
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3893,7 +3893,7 @@ sub_814D19C: @ 814D19C
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0814D1D0:
ldr r0, [r6]
ldrb r1, [r5]
@ -4216,7 +4216,7 @@ _0814D46E:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0814D490:
ldr r0, [r7]
ldrb r1, [r6]
@ -4274,7 +4274,7 @@ _0814D4CE:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r0, [r7]
ldrb r1, [r6]
ldr r0, [r0]
@ -4611,7 +4611,7 @@ sub_814D7B0: @ 814D7B0
ldrb r2, [r3]
lsls r2, 24
orrs r1, r2
bl move_anim_start_t2_for_situation
bl DoStatusAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -4807,7 +4807,7 @@ _0814D94C:
movs r1, 0
strh r1, [r0, 0x30]
ldrb r0, [r4]
bl sub_80769F4
bl DoHitAnimHealthboxEffect
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
@ -4942,7 +4942,7 @@ dp01t_2E_4_battle_intro: @ 814DA74
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl battle_intro_launch
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
@ -5503,7 +5503,7 @@ sub_814DF40: @ 814DF40
orrs r0, r1
strb r0, [r2]
ldrb r0, [r4]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
_0814DF86:
bl LinkPartnerBufferExecCompleted
pop {r4}
@ -5540,7 +5540,7 @@ sub_814DFA0: @ 814DFA0
adds r0, r2, 0
adds r1, r2, 0
adds r3, r6, 0
bl move_anim_start_t3
bl DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _0814DFF0

View File

@ -1256,7 +1256,7 @@ sub_805FC10: @ 805FC10
adds r1, r3, 0
adds r2, r3, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0805FC50:
ldr r0, =gBattleBankFunc
ldrb r1, [r4]
@ -1405,7 +1405,7 @@ sub_805FD00: @ 805FD00
ldrb r0, [r0]
bl SetHealthboxSpriteVisible
ldrb r0, [r5]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -4131,7 +4131,7 @@ _0806162C:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08061646:
ldr r0, [r6]
ldrb r1, [r5]
@ -4156,7 +4156,7 @@ _0806165A:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x2
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -4746,7 +4746,7 @@ OpponentHandleFaintAnimation: @ 8061B9C
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08061BD0:
ldr r0, [r6]
ldrb r1, [r5]
@ -5029,7 +5029,7 @@ _08061E12:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08061E34:
ldr r0, [r7]
ldrb r1, [r6]
@ -5087,7 +5087,7 @@ _08061E72:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r0, [r7]
ldrb r1, [r6]
ldr r0, [r0]
@ -5218,14 +5218,14 @@ OpponentHandleChooseMove: @ 8061FB8
ands r0, r2
cmp r0, 0
beq _08061FE4
bl sub_805D19C
bl ChooseMoveAndTargetInBattlePalace
adds r2, r0, 0
lsls r2, 16
lsrs r2, 16
movs r0, 0x1
movs r1, 0xA
_08061FD6:
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
_08061FDA:
bl OpponentBufferExecCompleted
b _08062156
@ -5329,7 +5329,7 @@ _0806209C:
movs r0, 0x1
movs r1, 0xA
adds r2, r4, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
b _08061FDA
.pool
_080620C4:
@ -5360,7 +5360,7 @@ _080620C6:
movs r0, 0x1
movs r1, 0xA
adds r2, r4, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
b _08062152
.pool
_08062108:
@ -5383,7 +5383,7 @@ _08062108:
orrs r2, r4
movs r0, 0x1
movs r1, 0xA
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
b _08062152
.pool
_0806213C:
@ -5395,7 +5395,7 @@ _0806213C:
orrs r2, r4
movs r0, 0x1
movs r1, 0xA
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
_08062152:
bl OpponentBufferExecCompleted
_08062156:
@ -5417,7 +5417,7 @@ OpponentHandleOpenBag: @ 806215C
adds r0, 0xC0
ldrb r1, [r0]
movs r0, 0x1
bl EmitCmd35
bl EmitOneReturnValue
bl OpponentBufferExecCompleted
pop {r0}
bx r0
@ -5532,7 +5532,7 @@ _0806225A:
lsrs r1, 24
movs r0, 0x1
movs r2, 0
bl EmitCmd34
bl EmitChosenMonReturnValue
bl OpponentBufferExecCompleted
pop {r4-r7}
pop {r0}
@ -5734,7 +5734,7 @@ OpponentHandleStatusAnimation: @ 8062408
ldrb r2, [r3]
lsls r2, 24
orrs r1, r2
bl move_anim_start_t2_for_situation
bl DoStatusAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -5930,7 +5930,7 @@ _080625A4:
movs r1, 0
strh r1, [r0, 0x30]
ldrb r0, [r4]
bl sub_80769F4
bl DoHitAnimHealthboxEffect
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
@ -6064,7 +6064,7 @@ OpponentHandleIntroSlide: @ 80626C8
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl battle_intro_launch
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
@ -6546,7 +6546,7 @@ OpponentHandleSpriteInvisibility: @ 8062AD0
orrs r0, r1
strb r0, [r2]
ldrb r0, [r4]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
_08062B16:
bl OpponentBufferExecCompleted
pop {r4}
@ -6582,7 +6582,7 @@ OpponentHandleBattleAnimation: @ 8062B30
str r4, [sp]
adds r0, r2, 0
adds r1, r2, 0
bl move_anim_start_t3
bl DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _08062B7C

File diff suppressed because it is too large Load Diff

View File

@ -645,7 +645,7 @@ _081BB2E2:
lsrs r2, 16
movs r0, 0x1
movs r1, 0xB
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
strb r5, [r4]
bl IsDoubleBattle
lsls r0, 24
@ -918,7 +918,7 @@ _081BB514:
lsrs r2, 16
movs r0, 0x1
movs r1, 0xB
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
strb r5, [r4]
ldr r0, =sub_81BB628
str r0, [r6]
@ -981,7 +981,7 @@ _081BB65C:
adds r1, r4, 0
adds r2, r4, 0
movs r3, 0
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r0, =gTasks
lsls r1, r5, 2
adds r1, r5
@ -1311,7 +1311,7 @@ sub_81BB92C: @ 81BB92C
cmp r1, r0
bne _081BB97E
adds r0, r3, 0
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldrb r2, [r4]
@ -1326,7 +1326,7 @@ sub_81BB92C: @ 81BB92C
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_081BB972:
ldr r0, =gBattleBankFunc
ldrb r1, [r4]
@ -4129,7 +4129,7 @@ _081BD318:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_081BD332:
ldr r0, [r6]
ldrb r1, [r5]
@ -4154,7 +4154,7 @@ _081BD346:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x1
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -4517,7 +4517,7 @@ sub_81BD674: @ 81BD674
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_081BD6A8:
ldr r0, [r6]
ldrb r1, [r5]
@ -4828,7 +4828,7 @@ _081BD92A:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_081BD94C:
ldr r0, [r7]
ldrb r1, [r6]
@ -4886,7 +4886,7 @@ _081BD98A:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r0, [r7]
ldrb r1, [r6]
ldr r0, [r0]
@ -5068,7 +5068,7 @@ _081BDB3C:
orrs r2, r5
movs r0, 0x1
movs r1, 0xA
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
bl PlayerPartnerBufferExecCompleted
pop {r4-r6}
pop {r0}
@ -5138,7 +5138,7 @@ _081BDBD0:
lsrs r1, 24
movs r0, 0x1
movs r2, 0
bl EmitCmd34
bl EmitChosenMonReturnValue
bl PlayerPartnerBufferExecCompleted
pop {r4-r6}
pop {r0}
@ -5398,7 +5398,7 @@ sub_81BDE14: @ 81BDE14
ldrb r2, [r3]
lsls r2, 24
orrs r1, r2
bl move_anim_start_t2_for_situation
bl DoStatusAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -5594,7 +5594,7 @@ _081BDFB0:
movs r1, 0
strh r1, [r0, 0x30]
ldrb r0, [r4]
bl sub_80769F4
bl DoHitAnimHealthboxEffect
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
@ -5729,7 +5729,7 @@ dp01t_2E_3_battle_intro: @ 81BE0D8
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl battle_intro_launch
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
@ -6236,7 +6236,7 @@ sub_81BE53C: @ 81BE53C
orrs r0, r1
strb r0, [r2]
ldrb r0, [r4]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
_081BE582:
bl PlayerPartnerBufferExecCompleted
pop {r4}
@ -6272,7 +6272,7 @@ sub_81BE59C: @ 81BE59C
str r4, [sp]
adds r0, r2, 0
adds r1, r2, 0
bl move_anim_start_t3
bl DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _081BE5E8

View File

@ -1161,7 +1161,7 @@ sub_8186EA4: @ 8186EA4
adds r1, r3, 0
adds r2, r3, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08186EE4:
ldr r0, =gBattleBankFunc
ldrb r1, [r4]
@ -1310,7 +1310,7 @@ sub_8186F94: @ 8186F94
ldrb r0, [r0]
bl SetHealthboxSpriteVisible
ldrb r0, [r5]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3968,7 +3968,7 @@ _08188828:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08188842:
ldr r0, [r6]
ldrb r1, [r5]
@ -3993,7 +3993,7 @@ _08188856:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x2
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -4301,7 +4301,7 @@ sub_8188AF8: @ 8188AF8
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08188B2C:
ldr r0, [r6]
ldrb r1, [r5]
@ -4584,7 +4584,7 @@ _08188D6E:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_08188D90:
ldr r0, [r7]
ldrb r1, [r6]
@ -4642,7 +4642,7 @@ _08188DCE:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r0, [r7]
ldrb r1, [r6]
ldr r0, [r0]
@ -4754,7 +4754,7 @@ sub_8188EF0: @ 8188EF0
lsrs r1, 24
movs r0, 0x1
movs r2, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
bl RecordedOpponentBufferExecCompleted
pop {r0}
bx r0
@ -4779,13 +4779,13 @@ sub_8188F20: @ 8188F20
ands r0, r1
cmp r0, 0
beq _08188F48
bl sub_805D19C
bl ChooseMoveAndTargetInBattlePalace
adds r2, r0, 0
lsls r2, 16
lsrs r2, 16
movs r0, 0x1
movs r1, 0xA
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
b _08188F6C
.pool
_08188F48:
@ -4803,7 +4803,7 @@ _08188F48:
orrs r2, r4
movs r0, 0x1
movs r1, 0xA
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
_08188F6C:
bl RecordedOpponentBufferExecCompleted
pop {r4,r5}
@ -4839,7 +4839,7 @@ sub_8188F88: @ 8188F88
ldrb r1, [r0]
movs r0, 0x1
movs r2, 0
bl EmitCmd34
bl EmitChosenMonReturnValue
bl RecordedOpponentBufferExecCompleted
pop {r4}
pop {r0}
@ -5041,7 +5041,7 @@ sub_8189144: @ 8189144
ldrb r2, [r3]
lsls r2, 24
orrs r1, r2
bl move_anim_start_t2_for_situation
bl DoStatusAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -5237,7 +5237,7 @@ _081892E0:
movs r1, 0
strh r1, [r0, 0x30]
ldrb r0, [r4]
bl sub_80769F4
bl DoHitAnimHealthboxEffect
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
@ -5371,7 +5371,7 @@ sub_8189404: @ 8189404
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl battle_intro_launch
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
@ -5848,7 +5848,7 @@ sub_8189800: @ 8189800
orrs r0, r1
strb r0, [r2]
ldrb r0, [r4]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
_08189846:
bl RecordedOpponentBufferExecCompleted
pop {r4}
@ -5884,7 +5884,7 @@ sub_8189860: @ 8189860
str r4, [sp]
adds r0, r2, 0
adds r1, r2, 0
bl move_anim_start_t3
bl DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _081898AC

View File

@ -1112,7 +1112,7 @@ sub_818A2B4: @ 818A2B4
cmp r1, r0
bne _0818A306
adds r0, r3, 0
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldrb r2, [r4]
@ -1127,7 +1127,7 @@ sub_818A2B4: @ 818A2B4
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0818A2FA:
ldr r0, =gBattleBankFunc
ldrb r1, [r4]
@ -3930,7 +3930,7 @@ _0818BCA0:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0818BCBA:
ldr r0, [r6]
ldrb r1, [r5]
@ -3955,7 +3955,7 @@ _0818BCCE:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x1
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -4373,7 +4373,7 @@ sub_818C064: @ 818C064
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0818C098:
ldr r0, [r6]
ldrb r1, [r5]
@ -4684,7 +4684,7 @@ _0818C31A:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0818C33C:
ldr r0, [r7]
ldrb r1, [r6]
@ -4742,7 +4742,7 @@ _0818C37A:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r0, [r7]
ldrb r1, [r6]
ldr r0, [r0]
@ -4861,7 +4861,7 @@ sub_818C49C: @ 818C49C
lsrs r1, 24
movs r0, 0x1
movs r2, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
bl RecordedPlayerBufferExecCompleted
_0818C4C6:
pop {r0}
@ -4897,7 +4897,7 @@ _0818C508:
lsrs r1, 24
movs r0, 0x1
movs r2, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
bl RecordedPlayerBufferExecCompleted
_0818C522:
pop {r0}
@ -4923,13 +4923,13 @@ sub_818C538: @ 818C538
ands r0, r1
cmp r0, 0
beq _0818C560
bl sub_805D19C
bl ChooseMoveAndTargetInBattlePalace
adds r2, r0, 0
lsls r2, 16
lsrs r2, 16
movs r0, 0x1
movs r1, 0xA
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
b _0818C584
.pool
_0818C560:
@ -4947,7 +4947,7 @@ _0818C560:
orrs r2, r4
movs r0, 0x1
movs r1, 0xA
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
_0818C584:
bl RecordedPlayerBufferExecCompleted
pop {r4,r5}
@ -4983,7 +4983,7 @@ sub_818C5A0: @ 818C5A0
ldrb r1, [r0]
movs r0, 0x1
movs r2, 0
bl EmitCmd34
bl EmitChosenMonReturnValue
bl RecordedPlayerBufferExecCompleted
pop {r4}
pop {r0}
@ -5192,7 +5192,7 @@ sub_818C76C: @ 818C76C
ldrb r2, [r3]
lsls r2, 24
orrs r1, r2
bl move_anim_start_t2_for_situation
bl DoStatusAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -5388,7 +5388,7 @@ _0818C908:
movs r1, 0
strh r1, [r0, 0x30]
ldrb r0, [r4]
bl sub_80769F4
bl DoHitAnimHealthboxEffect
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
@ -5523,7 +5523,7 @@ dp01t_2E_2_battle_intro: @ 818CA30
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl battle_intro_launch
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
@ -6032,7 +6032,7 @@ sub_818CE98: @ 818CE98
orrs r0, r1
strb r0, [r2]
ldrb r0, [r4]
bl sub_805E408
bl SetBattleSpriteInvisibilityBitToSpriteInvisibility
_0818CEDE:
bl RecordedPlayerBufferExecCompleted
pop {r4}
@ -6068,7 +6068,7 @@ sub_818CEF8: @ 818CEF8
str r4, [sp]
adds r0, r2, 0
adds r1, r2, 0
bl move_anim_start_t3
bl DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _0818CF44

View File

@ -103,13 +103,13 @@ _0815942A:
movs r1, 0x7
_0815942E:
movs r2, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
b _08159440
_08159436:
movs r0, 0x1
movs r1, 0x8
movs r2, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
_08159440:
bl SafariBufferExecCompleted
b _0815954E
@ -399,7 +399,7 @@ sub_8159698: @ 8159698
ldr r0, =gScriptItemId
ldrh r1, [r0]
movs r0, 0x1
bl EmitCmd35
bl EmitOneReturnValue
bl SafariBufferExecCompleted
_081596BE:
pop {r0}
@ -707,7 +707,7 @@ sub_8159910: @ 8159910
adds r0, r4, 0
adds r1, r4, 0
movs r3, 0x4
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -746,7 +746,7 @@ sub_8159964: @ 8159964
adds r0, r4, 0
adds r1, r4, 0
movs r3, 0x4
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -1227,7 +1227,7 @@ dp01t_2E_6_battle_intro: @ 8159D5C
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl battle_intro_launch
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
@ -1329,7 +1329,7 @@ sub_8159E1C: @ 8159E1C
str r4, [sp]
adds r0, r2, 0
adds r1, r2, 0
bl move_anim_start_t3
bl DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _08159E5C

View File

@ -121,7 +121,7 @@ _081684CE:
movs r1, 0x9
_081684E4:
movs r2, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
bl WallyBufferExecCompleted
ldr r1, [r4]
adds r1, 0x94
@ -176,7 +176,7 @@ _08168540:
movs r0, 0x1
movs r1, 0x1
movs r2, 0
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
bl WallyBufferExecCompleted
_08168564:
pop {r4,r5}
@ -279,7 +279,7 @@ sub_8168610: @ 8168610
ldr r0, =gScriptItemId
ldrh r1, [r0]
movs r0, 0x1
bl EmitCmd35
bl EmitOneReturnValue
bl WallyBufferExecCompleted
_08168636:
pop {r0}
@ -2952,7 +2952,7 @@ WallyHandleReturnMonToBall: @ 8169E44
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x1
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r0, =gBattleBankFunc
ldrb r1, [r6]
lsls r1, 2
@ -3207,7 +3207,7 @@ WallyHandleCmd12: @ 816A084
adds r0, r4, 0
adds r1, r4, 0
movs r3, 0x4
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3246,7 +3246,7 @@ WallyHandleBallThrow: @ 816A0D8
adds r0, r4, 0
adds r1, r4, 0
movs r3, 0x4
bl move_anim_start_t4
bl DoSpecialBattleAnimation
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3452,7 +3452,7 @@ _0816A2C6:
adds r1, r3, 0
adds r2, r3, 0
movs r3, 0x5
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0816A2E2:
ldr r0, [r7]
ldrb r1, [r6]
@ -3507,7 +3507,7 @@ _0816A320:
adds r0, r2, 0
adds r1, r2, 0
movs r3, 0x6
bl move_anim_start_t4
bl DoSpecialBattleAnimation
_0816A354:
ldr r0, [r7]
ldrb r1, [r6]
@ -3700,7 +3700,7 @@ _0816A504:
beq _0816A550
b _0816A574
_0816A50A:
bl sub_805C210
bl InitMoveSelectionsVarsAndStrings
ldr r1, [r4]
adds r1, 0x95
ldrb r0, [r1]
@ -3745,7 +3745,7 @@ _0816A550:
lsls r2, 1
movs r0, 0x1
movs r1, 0xA
bl EmitChoiceReturnValue
bl EmitTwoReturnValues
bl WallyBufferExecCompleted
_0816A574:
pop {r4}
@ -4062,7 +4062,7 @@ _0816A7C8:
movs r1, 0
strh r1, [r0, 0x30]
ldrb r0, [r4]
bl sub_80769F4
bl DoHitAnimHealthboxEffect
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2
@ -4184,7 +4184,7 @@ WallyHandleIntroSlide: @ 816A8D8
adds r1, 0x1
adds r0, r1
ldrb r0, [r0]
bl battle_intro_launch
bl HandleIntroSlide
ldr r2, =gUnknown_020243FC
ldrh r0, [r2]
movs r1, 0x1
@ -4672,7 +4672,7 @@ WallyHandleBattleAnimation: @ 816AD20
str r4, [sp]
adds r0, r2, 0
adds r1, r2, 0
bl move_anim_start_t3
bl DoBattleAnimationFromTable
lsls r0, 24
cmp r0, 0
beq _0816AD60

View File

@ -110,7 +110,7 @@ _0817CA4C:
ldr r1, =gStringInfo
ldr r1, [r1]
ldrh r1, [r1]
bl sub_817F33C
bl GetBankMoveSlotId
lsls r0, 24
lsrs r0, 24
mov r10, r0
@ -2572,7 +2572,7 @@ _0817E122:
mov r1, r10
ldrb r0, [r1]
adds r1, r7, 0
bl sub_817F33C
bl GetBankMoveSlotId
lsls r0, 24
lsrs r6, r0, 24
cmp r6, 0x3
@ -4793,8 +4793,8 @@ _0817F324:
.pool
thumb_func_end sub_817F2A8
thumb_func_start sub_817F33C
sub_817F33C: @ 817F33C
thumb_func_start GetBankMoveSlotId
GetBankMoveSlotId: @ 817F33C
push {r4-r7,lr}
lsls r0, 24
lsrs r5, r0, 24
@ -4835,7 +4835,7 @@ _0817F388:
pop {r4-r7}
pop {r1}
bx r1
thumb_func_end sub_817F33C
thumb_func_end GetBankMoveSlotId
thumb_func_start sub_817F394
sub_817F394: @ 817F394
@ -4888,97 +4888,4 @@ _0817F3E6:
bx r0
thumb_func_end sub_817F394
thumb_func_start nullsub_69
nullsub_69: @ 817F3EC
bx lr
thumb_func_end nullsub_69
thumb_func_start sub_817F3F0
sub_817F3F0: @ 817F3F0
push {r4-r6,lr}
mov r6, r9
mov r5, r8
push {r5,r6}
sub sp, 0x4
mov r9, r0
mov r8, r1
adds r5, r2, 0
adds r4, r3, 0
lsls r5, 16
negs r5, r5
lsls r4, 16
negs r4, r4
lsrs r4, 16
mov r0, r8
lsls r0, 16
asrs r0, 16
mov r8, r0
asrs r5, 16
adds r1, r5, 0
bl Cos
adds r6, r0, 0
lsls r4, 16
asrs r4, 16
mov r0, r8
adds r1, r4, 0
bl Sin
subs r6, r0
lsls r6, 16
lsrs r6, 16
mov r0, r8
adds r1, r4, 0
bl Cos
adds r2, r0, 0
mov r0, r8
adds r1, r5, 0
str r2, [sp]
bl Sin
ldr r2, [sp]
adds r2, r0
negs r5, r5
negs r4, r4
lsls r6, 16
asrs r6, 16
lsls r5, 16
asrs r5, 16
adds r6, r5
mov r0, r9
strh r6, [r0, 0x24]
lsls r2, 16
asrs r2, 16
lsls r4, 16
asrs r4, 16
adds r2, r4
strh r2, [r0, 0x26]
add sp, 0x4
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_817F3F0
thumb_func_start GetSpeciesBackAnimId
GetSpeciesBackAnimId: @ 817F474
push {lr}
lsls r0, 16
lsrs r0, 16
ldr r1, =gUnknown_0860A8C8
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _0817F48C
movs r0, 0
b _0817F492
.pool
_0817F48C:
subs r0, 0x1
lsls r0, 24
lsrs r0, 24
_0817F492:
pop {r1}
bx r1
thumb_func_end GetSpeciesBackAnimId
.align 2, 0 @ Don't pad with nop.

View File

@ -2685,8 +2685,8 @@ _080769EA:
.pool
thumb_func_end sub_80769CC
thumb_func_start sub_80769F4
sub_80769F4: @ 80769F4
thumb_func_start DoHitAnimHealthboxEffect
DoHitAnimHealthboxEffect: @ 80769F4
push {r4,r5,lr}
adds r4, r0, 0
lsls r4, 24
@ -2714,7 +2714,7 @@ sub_80769F4: @ 80769F4
pop {r0}
bx r0
.pool
thumb_func_end sub_80769F4
thumb_func_end DoHitAnimHealthboxEffect
thumb_func_start oamc_804BEB4
oamc_804BEB4: @ 8076A38

View File

@ -4,6 +4,100 @@
.syntax unified
.text
thumb_func_start nullsub_69
nullsub_69: @ 817F3EC
bx lr
thumb_func_end nullsub_69
thumb_func_start sub_817F3F0
sub_817F3F0: @ 817F3F0
push {r4-r6,lr}
mov r6, r9
mov r5, r8
push {r5,r6}
sub sp, 0x4
mov r9, r0
mov r8, r1
adds r5, r2, 0
adds r4, r3, 0
lsls r5, 16
negs r5, r5
lsls r4, 16
negs r4, r4
lsrs r4, 16
mov r0, r8
lsls r0, 16
asrs r0, 16
mov r8, r0
asrs r5, 16
adds r1, r5, 0
bl Cos
adds r6, r0, 0
lsls r4, 16
asrs r4, 16
mov r0, r8
adds r1, r4, 0
bl Sin
subs r6, r0
lsls r6, 16
lsrs r6, 16
mov r0, r8
adds r1, r4, 0
bl Cos
adds r2, r0, 0
mov r0, r8
adds r1, r5, 0
str r2, [sp]
bl Sin
ldr r2, [sp]
adds r2, r0
negs r5, r5
negs r4, r4
lsls r6, 16
asrs r6, 16
lsls r5, 16
asrs r5, 16
adds r6, r5
mov r0, r9
strh r6, [r0, 0x24]
lsls r2, 16
asrs r2, 16
lsls r4, 16
asrs r4, 16
adds r2, r4
strh r2, [r0, 0x26]
add sp, 0x4
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r6}
pop {r0}
bx r0
thumb_func_end sub_817F3F0
thumb_func_start GetSpeciesBackAnimId
GetSpeciesBackAnimId: @ 817F474
push {lr}
lsls r0, 16
lsrs r0, 16
ldr r1, =gUnknown_0860A8C8
adds r0, r1
ldrb r0, [r0]
cmp r0, 0
bne _0817F48C
movs r0, 0
b _0817F492
.pool
_0817F48C:
subs r0, 0x1
lsls r0, 24
lsrs r0, 24
_0817F492:
pop {r1}
bx r1
thumb_func_end GetSpeciesBackAnimId
thumb_func_start sub_817F498
sub_817F498: @ 817F498

View File

@ -750,38 +750,39 @@ extern struct BattleStruct* gBattleStruct;
#define MOVE_EFFECT_AFFECTS_USER 0x40
#define MOVE_EFFECT_CERTAIN 0x80
// battle animations ids
// table ids for general animations
#define B_ANIM_CASTFORM_CHANGE 0x0
#define B_ANIM_STATS_CHANGE 0x1
#define B_ANIM_SUBSTITUTE_FADE 0x2
#define B_ANIM_SUBSTITUTE_APPEAR 0x3
#define B_ANIM_x4 0x4
#define B_ANIM_ITEM_KNOCKOFF 0x5
#define B_ANIM_TURN_TRAP 0x6
#define B_ANIM_ITEM_EFFECT 0x7
#define B_ANIM_SMOKEBALL_ESCAPE 0x8
#define B_ANIM_HANGED_ON 0x9
#define B_ANIM_RAIN_CONTINUES 0xA
#define B_ANIM_SUN_CONTINUES 0xB
#define B_ANIM_SANDSTORM_CONTINUES 0xC
#define B_ANIM_HAIL_CONTINUES 0xD
#define B_ANIM_LEECH_SEED_DRAIN 0xE
#define B_ANIM_MON_HIT 0xF
#define B_ANIM_ITEM_STEAL 0x10
#define B_ANIM_SNATCH_MOVE 0x11
#define B_ANIM_FUTURE_SIGHT_HIT 0x12
#define B_ANIM_x13 0x13
#define B_ANIM_x14 0x14
#define B_ANIM_INGRAIN_HEAL 0x15
#define B_ANIM_WISH_HEAL 0x16
#define B_ANIM_CASTFORM_CHANGE 0x0
#define B_ANIM_STATS_CHANGE 0x1
#define B_ANIM_SUBSTITUTE_FADE 0x2
#define B_ANIM_SUBSTITUTE_APPEAR 0x3
#define B_ANIM_x4 0x4
#define B_ANIM_ITEM_KNOCKOFF 0x5
#define B_ANIM_TURN_TRAP 0x6
#define B_ANIM_ITEM_EFFECT 0x7
#define B_ANIM_SMOKEBALL_ESCAPE 0x8
#define B_ANIM_HANGED_ON 0x9
#define B_ANIM_RAIN_CONTINUES 0xA
#define B_ANIM_SUN_CONTINUES 0xB
#define B_ANIM_SANDSTORM_CONTINUES 0xC
#define B_ANIM_HAIL_CONTINUES 0xD
#define B_ANIM_LEECH_SEED_DRAIN 0xE
#define B_ANIM_MON_HIT 0xF
#define B_ANIM_ITEM_STEAL 0x10
#define B_ANIM_SNATCH_MOVE 0x11
#define B_ANIM_FUTURE_SIGHT_HIT 0x12
#define B_ANIM_x13 0x13
#define B_ANIM_x14 0x14
#define B_ANIM_INGRAIN_HEAL 0x15
#define B_ANIM_WISH_HEAL 0x16
#define B_ANIM_x17 0x17
#define B_ANIM_x18 0x18
#define B_ANIM_x19 0x19
#define B_ANIM_x1A 0x1A
#define B_ANIM_x1B 0x1B
#define B_ANIM_x1C 0x1C
#define B_ANIM_x1D 0x1D
// special animations table
#define B_ANIM_LVL_UP 0x0
#define B_ANIM_SWITCH_OUT_MON 0x1
#define B_ANIM_SPECIAL_2 0x2
#define B_ANIM_BALL_THROW 0x3
#define B_ANIM_SPECIAL_4 0x4
#define B_ANIM_SUBSTITUTE_TO_MON 0x5
#define B_ANIM_MON_TO_SUBSTITUTE 0x6
#define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8
#define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40
@ -868,6 +869,13 @@ bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn);
void sub_805EB9C(u8 arg0);
void sub_805E394(void);
void TrySetBehindSubstituteSpriteBit(u8 bank, u16 move);
void DoStatusAnimation(bool8 isStatus2, u32 status);
void DoSpecialBattleAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId);
bool8 DoBattleAnimationFromTable(u8 active, u8 atkBank, u8 defBank, u8 tableId, u16 argument);
void SetBattleSpriteInvisibilityBitToSpriteInvisibility(u8 bank);
u16 ChooseMoveAndTargetInBattlePalace(void);
void LoadBattleBarGfx(u8 arg0);
bool8 mplay_80342A4(u8 bank);
enum
{
@ -905,7 +913,7 @@ struct BattleAnimationInfo
u8 field_5;
u8 field_6;
u8 field_7;
u8 field_8;
u8 ballThrowCaseId;
u8 field_9_x1 : 1;
u8 field_9_x2 : 1;
u8 field_9_x1C : 3;
@ -920,9 +928,9 @@ struct BattleHealthboxInfo
u8 flag_x2 : 1;
u8 flag_x4 : 1;
u8 flag_x8 : 1;
u8 flag_x10 : 1;
u8 flag_x20 : 1;
u8 flag_x40 : 1;
u8 statusAnimActive : 1; // x10
u8 animFromTableActive : 1; // x20
u8 specialAnimActive : 1; //x40
u8 flag_x80 : 1;
u8 field_1_x1 : 1;
u8 field_1_x2 : 1;
@ -934,7 +942,7 @@ struct BattleHealthboxInfo
u8 field_1_x80 : 1;
u8 field_2;
u8 field_3;
u8 field_4;
u8 animationState;
u8 field_5;
u8 field_6;
u8 field_7;
@ -949,7 +957,7 @@ struct BattleBarInfo
u8 healthboxSpriteId;
s32 maxValue;
s32 currentValue;
s32 field_C;
s32 receivedValue;
s32 field_10;
};

View File

@ -2,26 +2,45 @@
#define GUARD_BATTLE_2_H
void CB2_InitBattle(void);
void CB2_QuitRecordedBattle(void);
void FaintClearSetData(void);
void SwitchInClearSetData(void);
void sub_803BDA0(u8 bank);
void BattleMainCB2(void);
void CB2_QuitRecordedBattle(void);
void sub_8038528(struct Sprite* sprite);
void sub_8038A04(void); // unused
void VBlankCB_Battle(void);
bool8 TryRunFromBattle(u8 bank);
u8 IsRunningFromBattleImpossible(void);
u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves);
void SwapTurnOrder(u8 id1, u8 id2);
void BattleTurnPassed(void);
void nullsub_17(void);
void sub_8038B74(struct Sprite *sprite);
void sub_8038D64(void);
void RunBattleScriptCommands_PopCallbacksStack(void);
void RunBattleScriptCommands(void);
u32 sub_80391E0(u8 arrayId, u8 caseId);
u32 sub_80397C4(u32 setId, u32 tableId);
void sub_8039E9C(struct Sprite *sprite);
void sub_8039B2C(struct Sprite *sprite);
void oac_poke_opponent(struct Sprite *sprite);
void SpriteCallbackDummy_2(struct Sprite *sprite);
void sub_8039934(struct Sprite *sprite);
void sub_8039AD8(struct Sprite *sprite);
void sub_8039B2C(struct Sprite *sprite);
void sub_8039B58(struct Sprite *sprite);
void sub_8039BB4(struct Sprite *sprite);
void sub_80105DC(struct Sprite *sprite);
void sub_8039C00(struct Sprite *sprite);
void dp11b_obj_instanciate(u8 bank, u8 b, s8 c, s8 d);
void dp11b_obj_free(u8 bank, bool8 b);
void sub_8039E44(struct Sprite *sprite);
void sub_8039E60(struct Sprite *sprite);
void sub_8039E84(struct Sprite *sprite);
void sub_8039E9C(struct Sprite *sprite);
void nullsub_20(void);
void BeginBattleIntro(void);
void SwitchInClearSetData(void);
void FaintClearSetData(void);
void sub_803B3AC(void); // unused
void sub_803B598(void); // unused
void BattleTurnPassed(void);
u8 IsRunningFromBattleImpossible(void);
void sub_803BDA0(u8 bank);
void SwapTurnOrder(u8 id1, u8 id2);
u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves);
void RunBattleScriptCommands_PopCallbacksStack(void);
void RunBattleScriptCommands(void);
bool8 TryRunFromBattle(u8 bank);
extern const u8 gStatusConditionString_PoisonJpn[8];
extern const u8 gStatusConditionString_SleepJpn[8];

View File

@ -60,7 +60,7 @@ extern u8 gUnknown_02038440;
void ClearBattleAnimationVars(void);
void DoMoveAnim(u16 move);
void DoBattleAnim(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim);
void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim);
void DestroyAnimSprite(struct Sprite *sprite);
void DestroyAnimVisualTask(u8 taskId);
void DestroyAnimSoundTask(u8 taskId);
@ -75,5 +75,24 @@ s16 CalculatePanIncrement(s16 sourcePan, s16 targetPan, s16 incrementPan);
// battle_anim_80FE840.s
void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value);
void sub_8118FBC(u8 arg0, u8 arg1, u8 arg2, u8 bankIdentity, u8 arg4, void *arg5, u16 *arg6, u16 arg7);
void HandleIntroSlide(u8 terrainId);
// battle_anim_80A5C6C.s
void sub_80A6EEC(struct Sprite *sprite);
void sub_80A8278(void);
void sub_80A6B30(struct UnknownAnimStruct2*);
void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1);
u8 sub_80A82E4(u8 bank);
u8 sub_80A5C6C(u8 bank, u8 attributeId);
bool8 AnimBankSpriteExists(u8 bank);
void sub_80A6C68(u8 arg0);
u8 GetAnimBankSpriteId(u8 wantedBank);
bool8 IsDoubleBattle(void);
u8 sub_80A6D94(void);
u8 sub_80A8364(u8);
void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*));
void oamt_add_pos2_onto_pos1(struct Sprite *sprite);
u8 sub_80A6138(u8 bank);
u8 sub_80A82E4(u8 bank);
#endif // GUARD_BATTLE_ANIM_H

View File

@ -76,6 +76,16 @@ enum
#define BALL_3_SHAKES_SUCCESS 4
#define BALL_TRAINER_BLOCK 5
#define RET_VALUE_LEVELLED_UP 11
#define INSTANT_HP_BAR_DROP 32767
struct UnusedControllerStruct
{
u8 field_0 : 7;
u8 flag_x80 : 1;
};
struct HpAndStatus
{
u16 hp;
@ -113,14 +123,14 @@ enum
CONTROLLER_TRAINERSLIDEBACK,
CONTROLLER_FAINTANIMATION,
CONTROLLER_PALETTEFADE,
CONTROLLER_12,
CONTROLLER_BALLTHROW,
CONTROLLER_SUCCESSBALLTHROWANIM,
CONTROLLER_BALLTHROWANIM,
CONTROLLER_PAUSE,
CONTROLLER_MOVEANIMATION,
CONTROLLER_PRINTSTRING,
CONTROLLER_PRINTSTRINGPLAYERONLY,
CONTROLLER_CHOOSEACTION,
CONTROLLER_YESNOBOX,
CONTROLLER_UNKNOWNYESNOBOX,
CONTROLLER_CHOOSEMOVE,
CONTROLLER_OPENBAG,
CONTROLLER_CHOOSEPOKEMON,
@ -134,10 +144,10 @@ enum
CONTROLLER_DMA3TRANSFER,
CONTROLLER_31,
CONTROLLER_32,
CONTROLLER_CHOICERETURNVALUE,
CONTROLLER_34,
CONTROLLER_35,
CONTROLLER_36,
CONTROLLER_TWORETURNVALUES,
CONTROLLER_CHOSENMONRETURNVALUE,
CONTROLLER_ONERETURNVALUE,
CONTROLLER_ONERETURNVALUE_DUPLICATE,
CONTROLLER_37,
CONTROLLER_38,
CONTROLLER_39,
@ -182,16 +192,16 @@ void EmitTrainerSlide(u8 bufferId);
void EmitTrainerSlideBack(u8 bufferId);
void EmitFaintAnimation(u8 bufferId);
void EmitPaletteFade(u8 bufferId); // unused
void EmitCmd12(u8 bufferId); // unused
void EmitBallThrow(u8 bufferId, u8 caseId);
void EmitSuccessBallThrowAnim(u8 bufferId); // unused
void EmitBallThrowAnim(u8 bufferId, u8 caseId);
void EmitPause(u8 bufferId, u8 toWait, void *data); // unused
void EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 movePower, s32 dmg, u8 friendship, struct DisableStruct *disableStructPtr, u8 multihit);
void EmitPrintString(u8 bufferId, u16 stringId);
void EmitPrintStringPlayerOnly(u8 bufferId, u16 stringId);
void EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2);
void EmitYesNoBox(u8 bufferId);
void EmitUnknownYesNoBox(u8 bufferId);
void EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData);
void EmitOpenBag(u8 bufferId, u8* arg1);
void EmitChooseItem(u8 bufferId, u8* arg1);
void EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4);
void EmitCmd23(u8 bufferId); // unused
void EmitHealthBarUpdate(u8 bufferId, u16 hpValue);
@ -203,14 +213,14 @@ void EmitDataTransfer(u8 bufferId, u16 size, void *data);
void EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data); // unused
void EmitPlayBGM(u8 bufferId, u16 songId, void *unusedDumbDataParameter); // unused
void EmitCmd32(u8 bufferId, u16 size, void *c); // unused
void EmitChoiceReturnValue(u8 bufferId, u8 arg1, u16 arg2);
void EmitCmd34(u8 bufferId, u8 b, u8 *c);
void EmitCmd35(u8 bufferId, u16 b);
void EmitCmd36(u8 bufferId, u16 b);
void EmitCmd37(u8 bufferId);
void EmitCmd38(u8 bufferId, u8 b);
void EmitCmd39(u8 bufferId);
void EmitCmd40(u8 bufferId);
void EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2);
void EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c);
void EmitOneReturnValue(u8 bufferId, u16 arg1);
void EmitOneReturnValue_Duplicate(u8 bufferId, u16 b);
void EmitCmd37(u8 bufferId); // unused
void EmitCmd38(u8 bufferId, u8 b); // unused
void EmitCmd39(u8 bufferId); // unused
void EmitCmd40(u8 bufferId); // unused
void EmitHitAnimation(u8 bufferId);
void EmitCmd42(u8 bufferId);
void EmitEffectivenessSound(u8 bufferId, u16 songId);
@ -230,8 +240,15 @@ void EmitCmd55(u8 bufferId, u8 arg1);
// player controller
void SetBankFuncToPlayerBufferRunCommand(void);
void nullsub_21(void);
void PlayerHandleGetRawMonData(void);
void sub_80587B0(void);
void sub_805CC00(struct Sprite *sprite);
void SetCB2ToReshowScreenAfterMenu(void);
void SetCB2ToReshowScreenAfterMenu2(void);
void c3_0802FDF4(u8 taskId);
void ActionSelectionCreateCursorAt(u8 cursorPos, u8 unused);
void ActionSelectionDestroyCursorAt(u8 cursorPos);
void InitMoveSelectionsVarsAndStrings(void);
// recorded player controller
void SetBankFuncToRecordedPlayerBufferRunCommand(void);

View File

@ -9,6 +9,12 @@ enum
HP_MAX
};
enum
{
HEALTH_BAR,
EXP_BAR
};
#define TAG_HEALTHBOX_PLAYER1_TILE 0xD6FF
#define TAG_HEALTHBOX_PLAYER2_TILE 0xD700
#define TAG_HEALTHBOX_OPPONENT1_TILE 0xD701
@ -41,7 +47,7 @@ enum
u8 CreateBankHealthboxSprites(u8 bank);
u8 CreateSafariPlayerHealthboxSprites(void);
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 field_C);
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue);
void SetHealthboxSpriteInvisible(u8 healthboxSpriteId);
void SetHealthboxSpriteVisible(u8 healthboxSpriteId);
void DestoryHealthboxSprite(u8 healthboxSpriteId);

View File

@ -0,0 +1,11 @@
#ifndef GUARD_BATTLE_LINK_817C95C_H
#define GUARD_BATTLE_LINK_817C95C_H
void sub_817C95C(u16 stringId);
void sub_817E0FC(u16 move, u16 weatherFlags, struct DisableStruct *disableStructPtr);
void sub_817E32C(u8 animationId);
void sub_817E3F4(void);
void sub_817F2A8(void);
u8 GetBankMoveSlotId(u8 bank, u16 move);
#endif // GUARD_BATTLE_LINK_817C95C_H

View File

@ -191,5 +191,6 @@ void sub_800A620(void);
void sub_8011BD0(void);
u8 sub_800ABAC(void);
u8 sub_800ABBC(void);
void sub_800AC34(void);
#endif // GUARD_LINK_H

8
include/pokeball.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GUARD_POKEBALL_H
#define GUARD_POKEBALL_H
u8 sub_80753E8(u16, u8);
void sub_8076918(u8 bank);
void DoHitAnimHealthboxEffect(u8 bank);
#endif // GUARD_POKEBALL_H

View File

@ -62,7 +62,6 @@ SECTIONS {
src/battle_script_commands.o(.text);
asm/battle_5.o(.text);
src/battle_controller_player.o(.text);
asm/battle_controller_player.o(.text);
asm/battle_7.o(.text);
src/battle_controller_opponent.o(.text);
asm/battle_controller_opponent.o(.text);
@ -117,7 +116,7 @@ SECTIONS {
src/palette.o(.text);
src/sound.o(.text);
src/battle_anim.o(.text);
asm/rom_80A5C6C.o(.text);
asm/battle_anim_80A5C6C.o(.text);
src/task.o(.text);
src/reshow_battle_screen.o(.text);
asm/battle_anim_80A9C70.o(.text);

View File

@ -238,7 +238,6 @@ static void sub_8038F34(void);
static void sub_80392A8(void);
static void sub_803937C(void);
static void sub_803939C(void);
void oac_poke_opponent(struct Sprite *sprite);
static void sub_803980C(struct Sprite *sprite);
static void sub_8039838(struct Sprite *sprite);
static void sub_8039894(struct Sprite *sprite);
@ -4025,7 +4024,7 @@ static void HandleTurnActionSelectionState(void)
}
else
{
EmitOpenBag(0, gBattleStruct->field_60[gActiveBank]);
EmitChooseItem(0, gBattleStruct->field_60[gActiveBank]);
MarkBufferBankForExecution(gActiveBank);
}
break;
@ -4070,7 +4069,7 @@ static void HandleTurnActionSelectionState(void)
}
break;
case ACTION_POKEBLOCK_CASE:
EmitOpenBag(0, gBattleStruct->field_60[gActiveBank]);
EmitChooseItem(0, gBattleStruct->field_60[gActiveBank]);
MarkBufferBankForExecution(gActiveBank);
break;
case ACTION_CANCEL_PARTNER:

View File

@ -39,7 +39,7 @@ static bool8 ShouldSwitchIfPerishSong(void)
&& gDisableStructs[gActiveBank].perishSong1 == 0)
{
*(gBattleStruct->field_294 + gActiveBank) = 6;
EmitChoiceReturnValue(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
@ -121,7 +121,7 @@ static bool8 ShouldSwitchIfWonderGuard(void)
{
// we found a mon
*(gBattleStruct->field_294 + gActiveBank) = i;
EmitChoiceReturnValue(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
}
@ -221,7 +221,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
{
// we found a mon
*(gBattleStruct->field_294 + gActiveBank) = i;
EmitChoiceReturnValue(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
}
@ -241,13 +241,13 @@ static bool8 ShouldSwitchIfNaturalCure(void)
if ((gUnknown_02024250[gActiveBank] == 0 || gUnknown_02024250[gActiveBank] == 0xFFFF) && Random() & 1)
{
*(gBattleStruct->field_294 + gActiveBank) = 6;
EmitChoiceReturnValue(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
else if (gBattleMoves[gUnknown_02024250[gActiveBank]].power == 0 && Random() & 1)
{
*(gBattleStruct->field_294 + gActiveBank) = 6;
EmitChoiceReturnValue(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
@ -258,7 +258,7 @@ static bool8 ShouldSwitchIfNaturalCure(void)
if (Random() & 1)
{
*(gBattleStruct->field_294 + gActiveBank) = 6;
EmitChoiceReturnValue(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
@ -426,7 +426,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
if (moveFlags & MOVESTATUS_SUPEREFFECTIVE && Random() % moduloPercent == 0)
{
*(gBattleStruct->field_294 + gActiveBank) = i;
EmitChoiceReturnValue(1, 2, 0);
EmitTwoReturnValues(1, ACTION_SWITCH, 0);
return TRUE;
}
}
@ -611,7 +611,7 @@ void AI_TrySwitchOrUseItem(void)
}
}
EmitChoiceReturnValue(1, 0, (gActiveBank ^ BIT_SIDE) << 8);
EmitTwoReturnValues(1, ACTION_USE_MOVE, (gActiveBank ^ BIT_SIDE) << 8);
}
#define TYPE_FORESIGHT 0xFE
@ -940,7 +940,7 @@ static bool8 ShouldUseItem(void)
if (shouldUse)
{
EmitChoiceReturnValue(1, 1, 0);
EmitTwoReturnValues(1, ACTION_USE_ITEM, 0);
*(gBattleStruct->field_C0 + (gActiveBank / 2) * 2) = item;
gBattleResources->battleHistory->trainerItems[i] = 0;
return shouldUse;

View File

@ -47,18 +47,6 @@ extern const struct CompressedSpriteSheet gBattleAnimPicTable[];
extern const struct CompressedSpritePalette gBattleAnimPaletteTable[];
extern const struct BattleAnimBackground gBattleAnimBackgroundTable[];
extern void sub_80A8278(void); // rom_80A5C6C.s
extern void sub_80A6B30(struct UnknownAnimStruct2*); // rom_80A5C6C.s
extern void sub_80A6B90(struct UnknownAnimStruct2*, u32 arg1); // rom_80A5C6C.s
extern u8 sub_80A82E4(u8 bank); // rom_80A5C6C.s
extern u8 sub_80A5C6C(u8 bank, u8 attributeId); // rom_80A5C6C.s
extern bool8 AnimBankSpriteExists(u8 bank); // rom_80A5C6C.s
extern void sub_80A6C68(u8 arg0); // rom_80A5C6C.s
extern u8 GetAnimBankSpriteId(u8 wantedBank); // rom_80A5C6C.s
extern u8 sub_80A6D94(void);
extern u8 sub_80A8364(u8);
extern bool8 IsDoubleBattle(void);
// this file's functions
static void ScriptCmd_loadspritegfx(void);
static void ScriptCmd_unloadspritegfx(void);
@ -234,10 +222,10 @@ void DoMoveAnim(u16 move)
{
gAnimBankAttacker = gBankAttacker;
gAnimBankTarget = gBankTarget;
DoBattleAnim(gBattleAnims_Moves, move, TRUE);
LaunchBattleAnimation(gBattleAnims_Moves, move, TRUE);
}
void DoBattleAnim(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim)
void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim)
{
s32 i;
@ -1281,7 +1269,7 @@ static void ScriptCmd_changebg(void)
s8 BattleAnimAdjustPanning(s8 pan)
{
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].flag_x10)
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].statusAnimActive)
{
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
pan = PAN_SIDE_OPPONENT;
@ -1323,7 +1311,7 @@ s8 BattleAnimAdjustPanning(s8 pan)
s8 BattleAnimAdjustPanning2(s8 pan)
{
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].flag_x10)
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].statusAnimActive)
{
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
pan = PAN_SIDE_OPPONENT;

File diff suppressed because it is too large Load Diff

View File

@ -984,9 +984,9 @@ void EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
void EmitLoadMonSprite(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_LOADMONSPRITE;
gBattleBuffersTransferData[1] = 4;
gBattleBuffersTransferData[2] = 4;
gBattleBuffersTransferData[3] = 4;
gBattleBuffersTransferData[1] = CONTROLLER_LOADMONSPRITE;
gBattleBuffersTransferData[2] = CONTROLLER_LOADMONSPRITE;
gBattleBuffersTransferData[3] = CONTROLLER_LOADMONSPRITE;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1009,27 +1009,27 @@ void EmitReturnMonToBall(u8 bufferId, u8 arg1)
void EmitDrawTrainerPic(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_DRAWTRAINERPIC;
gBattleBuffersTransferData[1] = 7;
gBattleBuffersTransferData[2] = 7;
gBattleBuffersTransferData[3] = 7;
gBattleBuffersTransferData[1] = CONTROLLER_DRAWTRAINERPIC;
gBattleBuffersTransferData[2] = CONTROLLER_DRAWTRAINERPIC;
gBattleBuffersTransferData[3] = CONTROLLER_DRAWTRAINERPIC;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitTrainerSlide(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_TRAINERSLIDE;
gBattleBuffersTransferData[1] = 8;
gBattleBuffersTransferData[2] = 8;
gBattleBuffersTransferData[3] = 8;
gBattleBuffersTransferData[1] = CONTROLLER_TRAINERSLIDE;
gBattleBuffersTransferData[2] = CONTROLLER_TRAINERSLIDE;
gBattleBuffersTransferData[3] = CONTROLLER_TRAINERSLIDE;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitTrainerSlideBack(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_TRAINERSLIDEBACK;
gBattleBuffersTransferData[1] = 9;
gBattleBuffersTransferData[2] = 9;
gBattleBuffersTransferData[3] = 9;
gBattleBuffersTransferData[1] = CONTROLLER_TRAINERSLIDEBACK;
gBattleBuffersTransferData[2] = CONTROLLER_TRAINERSLIDEBACK;
gBattleBuffersTransferData[3] = CONTROLLER_TRAINERSLIDEBACK;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1051,18 +1051,18 @@ void EmitPaletteFade(u8 bufferId)
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd12(u8 bufferId)
void EmitSuccessBallThrowAnim(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_12;
gBattleBuffersTransferData[1] = 12;
gBattleBuffersTransferData[2] = 12;
gBattleBuffersTransferData[3] = 12;
gBattleBuffersTransferData[0] = CONTROLLER_SUCCESSBALLTHROWANIM;
gBattleBuffersTransferData[1] = CONTROLLER_SUCCESSBALLTHROWANIM;
gBattleBuffersTransferData[2] = CONTROLLER_SUCCESSBALLTHROWANIM;
gBattleBuffersTransferData[3] = CONTROLLER_SUCCESSBALLTHROWANIM;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitBallThrow(u8 bufferId, u8 caseId)
void EmitBallThrowAnim(u8 bufferId, u8 caseId)
{
gBattleBuffersTransferData[0] = CONTROLLER_BALLTHROW;
gBattleBuffersTransferData[0] = CONTROLLER_BALLTHROWANIM;
gBattleBuffersTransferData[1] = caseId;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 2);
}
@ -1178,12 +1178,12 @@ void EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2)
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitYesNoBox(u8 bufferId)
void EmitUnknownYesNoBox(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_YESNOBOX;
gBattleBuffersTransferData[1] = CONTROLLER_YESNOBOX;
gBattleBuffersTransferData[2] = CONTROLLER_YESNOBOX;
gBattleBuffersTransferData[3] = CONTROLLER_YESNOBOX;
gBattleBuffersTransferData[0] = CONTROLLER_UNKNOWNYESNOBOX;
gBattleBuffersTransferData[1] = CONTROLLER_UNKNOWNYESNOBOX;
gBattleBuffersTransferData[2] = CONTROLLER_UNKNOWNYESNOBOX;
gBattleBuffersTransferData[3] = CONTROLLER_UNKNOWNYESNOBOX;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1200,7 +1200,7 @@ void EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, sizeof(*movePpData) + 4);
}
void EmitOpenBag(u8 bufferId, u8 *arg1)
void EmitChooseItem(u8 bufferId, u8 *arg1)
{
s32 i;
@ -1337,38 +1337,38 @@ void EmitCmd32(u8 bufferId, u16 size, void *data)
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, size + 3);
}
void EmitChoiceReturnValue(u8 bufferId, u8 arg1, u16 arg2)
void EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2)
{
gBattleBuffersTransferData[0] = CONTROLLER_CHOICERETURNVALUE;
gBattleBuffersTransferData[0] = CONTROLLER_TWORETURNVALUES;
gBattleBuffersTransferData[1] = arg1;
gBattleBuffersTransferData[2] = arg2;
gBattleBuffersTransferData[3] = (arg2 & 0xFF00) >> 8;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd34(u8 bufferId, u8 b, u8 *c)
void EmitChosenMonReturnValue(u8 bufferId, u8 b, u8 *c)
{
s32 i;
gBattleBuffersTransferData[0] = CONTROLLER_34;
gBattleBuffersTransferData[0] = CONTROLLER_CHOSENMONRETURNVALUE;
gBattleBuffersTransferData[1] = b;
for (i = 0; i < 3; i++)
gBattleBuffersTransferData[2 + i] = c[i];
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 5);
}
void EmitCmd35(u8 bufferId, u16 b)
void EmitOneReturnValue(u8 bufferId, u16 arg1)
{
gBattleBuffersTransferData[0] = CONTROLLER_35;
gBattleBuffersTransferData[1] = b;
gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8;
gBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE;
gBattleBuffersTransferData[1] = arg1;
gBattleBuffersTransferData[2] = (arg1 & 0xFF00) >> 8;
gBattleBuffersTransferData[3] = 0;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd36(u8 bufferId, u16 b)
void EmitOneReturnValue_Duplicate(u8 bufferId, u16 b)
{
gBattleBuffersTransferData[0] = CONTROLLER_36;
gBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE_DUPLICATE;
gBattleBuffersTransferData[1] = b;
gBattleBuffersTransferData[2] = (b & 0xFF00) >> 8;
gBattleBuffersTransferData[3] = 0;
@ -1378,9 +1378,9 @@ void EmitCmd36(u8 bufferId, u16 b)
void EmitCmd37(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_37;
gBattleBuffersTransferData[1] = 37;
gBattleBuffersTransferData[2] = 37;
gBattleBuffersTransferData[3] = 37;
gBattleBuffersTransferData[1] = CONTROLLER_37;
gBattleBuffersTransferData[2] = CONTROLLER_37;
gBattleBuffersTransferData[3] = CONTROLLER_37;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
@ -1394,27 +1394,27 @@ void EmitCmd38(u8 bufferId, u8 b)
void EmitCmd39(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_39;
gBattleBuffersTransferData[1] = 39;
gBattleBuffersTransferData[2] = 39;
gBattleBuffersTransferData[3] = 39;
gBattleBuffersTransferData[1] = CONTROLLER_39;
gBattleBuffersTransferData[2] = CONTROLLER_39;
gBattleBuffersTransferData[3] = CONTROLLER_39;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitCmd40(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_40;
gBattleBuffersTransferData[1] = 40;
gBattleBuffersTransferData[2] = 40;
gBattleBuffersTransferData[3] = 40;
gBattleBuffersTransferData[1] = CONTROLLER_40;
gBattleBuffersTransferData[2] = CONTROLLER_40;
gBattleBuffersTransferData[3] = CONTROLLER_40;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}
void EmitHitAnimation(u8 bufferId)
{
gBattleBuffersTransferData[0] = CONTROLLER_HITANIMATION;
gBattleBuffersTransferData[1] = 41;
gBattleBuffersTransferData[2] = 41;
gBattleBuffersTransferData[3] = 41;
gBattleBuffersTransferData[1] = CONTROLLER_HITANIMATION;
gBattleBuffersTransferData[2] = CONTROLLER_HITANIMATION;
gBattleBuffersTransferData[3] = CONTROLLER_HITANIMATION;
PrepareBufferDataTransfer(bufferId, gBattleBuffersTransferData, 4);
}

View File

@ -21,17 +21,11 @@
#include "safari_zone.h"
#include "battle_anim.h"
enum
{
HEALTH_BAR,
EXP_BAR
};
struct TestingBar
{
s32 maxValue;
s32 currValue;
s32 field_8;
s32 receivedValue;
u32 unkC_0:5;
u32 unk10;
};
@ -183,7 +177,6 @@ extern const u16 gBattleInterface_BallDisplayPal[];
extern const u8 gHealthboxElementsGfxTable[][32];
// functions
extern bool8 IsDoubleBattle(void);
extern void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor *color, s8 speed, const u8 *str); // menu.h
extern void LoadBattleBarGfx(u8 arg0);
@ -214,10 +207,10 @@ static void SpriteCB_StatusSummaryBallsOnBattleStart(struct Sprite *sprite);
static void SpriteCB_StatusSummaryBallsOnSwitchout(struct Sprite *sprite);
static u8 GetStatusIconForBankId(u8 statusElementId, u8 bank);
static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4, u16 arg5);
static u8 GetScaledExpFraction(s32 currValue, s32 arg1, s32 maxValue, u8 scale);
static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 arg4, u16 arg5);
static u8 GetScaledExpFraction(s32 currValue, s32 receivedValue, s32 maxValue, u8 scale);
static void sub_8074B9C(u8 bank, u8 whichBar);
static u8 sub_8074E8C(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 *arg4, u8 arg5);
static u8 sub_8074E8C(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 *arg4, u8 arg5);
static void sub_8074F88(struct TestingBar *barInfo, s32 *arg1, u16 *arg2);
// const rom data
@ -1049,12 +1042,12 @@ static void sub_8072924(struct Sprite *sprite)
sprite->pos2.y = gSprites[otherSpriteId].pos2.y;
}
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 field_C)
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue)
{
gBattleSpritesDataPtr->battleBars[bank].healthboxSpriteId = healthboxSpriteId;
gBattleSpritesDataPtr->battleBars[bank].maxValue = maxVal;
gBattleSpritesDataPtr->battleBars[bank].currentValue = currVal;
gBattleSpritesDataPtr->battleBars[bank].field_C = field_C;
gBattleSpritesDataPtr->battleBars[bank].receivedValue = receivedValue;
gBattleSpritesDataPtr->battleBars[bank].field_10 = -32768;
}
@ -2262,22 +2255,22 @@ s32 sub_8074AA0(u8 bank, u8 healthboxSpriteId, u8 whichBar, u8 arg3)
{
var = sub_8074DB8(gBattleSpritesDataPtr->battleBars[bank].maxValue,
gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
&gBattleSpritesDataPtr->battleBars[bank].field_10,
6, 1);
}
else // exp bar
{
u16 expFraction = GetScaledExpFraction(gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
gBattleSpritesDataPtr->battleBars[bank].maxValue, 8);
if (expFraction == 0)
expFraction = 1;
expFraction = abs(gBattleSpritesDataPtr->battleBars[bank].field_C / expFraction);
expFraction = abs(gBattleSpritesDataPtr->battleBars[bank].receivedValue / expFraction);
var = sub_8074DB8(gBattleSpritesDataPtr->battleBars[bank].maxValue,
gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
&gBattleSpritesDataPtr->battleBars[bank].field_10,
8, expFraction);
}
@ -2293,7 +2286,7 @@ s32 sub_8074AA0(u8 bank, u8 healthboxSpriteId, u8 whichBar, u8 arg3)
static void sub_8074B9C(u8 bank, u8 whichBar)
{
u8 array[7];
u8 array[8];
u8 subRet, level;
u8 barElementId;
u8 i;
@ -2303,7 +2296,7 @@ static void sub_8074B9C(u8 bank, u8 whichBar)
case HEALTH_BAR:
subRet = sub_8074E8C(gBattleSpritesDataPtr->battleBars[bank].maxValue,
gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
&gBattleSpritesDataPtr->battleBars[bank].field_10,
array, 6);
barElementId = 3;
@ -2327,7 +2320,7 @@ static void sub_8074B9C(u8 bank, u8 whichBar)
case EXP_BAR:
sub_8074E8C(gBattleSpritesDataPtr->battleBars[bank].maxValue,
gBattleSpritesDataPtr->battleBars[bank].currentValue,
gBattleSpritesDataPtr->battleBars[bank].field_C,
gBattleSpritesDataPtr->battleBars[bank].receivedValue,
&gBattleSpritesDataPtr->battleBars[bank].field_10,
array, 8);
level = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_LEVEL);
@ -2349,7 +2342,7 @@ static void sub_8074B9C(u8 bank, u8 whichBar)
}
}
static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4, u16 arg5)
static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 arg4, u16 arg5)
{
s32 r6;
s32 ret;
@ -2363,7 +2356,7 @@ static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4
*arg3 = currValue;
}
currValue -= arg2;
currValue -= receivedValue;
if (currValue < 0)
currValue = 0;
else if (currValue > maxValue)
@ -2388,7 +2381,7 @@ static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4
{
s32 var = (maxValue << 8) / arg4;
if (arg2 < 0)
if (receivedValue < 0)
{
*arg3 = r6 + var;
ret = *arg3 >> 8;
@ -2413,7 +2406,7 @@ static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4
}
else
{
if (arg2 < 0)
if (receivedValue < 0)
{
*arg3 += arg5;
if (*arg3 > currValue)
@ -2432,9 +2425,9 @@ static s32 sub_8074DB8(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 arg4
return ret;
}
static u8 sub_8074E8C(s32 maxValue, s32 currValue, s32 arg2, s32 *arg3, u8 *arg4, u8 arg5)
static u8 sub_8074E8C(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 *arg4, u8 arg5)
{
s32 r5 = currValue - arg2;
s32 r5 = currValue - receivedValue;
u8 ret;
u8 i;
u8 r2;
@ -2487,7 +2480,7 @@ static s16 sub_8074F28(struct TestingBar *barInfo, s32 *arg1, u16 *arg2, s32 arg
ret = sub_8074DB8(barInfo->maxValue,
barInfo->currValue,
barInfo->field_8,
barInfo->receivedValue,
arg1, 6, 1);
sub_8074F88(barInfo, arg1, arg2);
@ -2508,7 +2501,7 @@ static void sub_8074F88(struct TestingBar *barInfo, s32 *arg1, u16 *arg2)
u8 i;
sub_8074E8C(barInfo->maxValue, barInfo->currValue,
barInfo->field_8, arg1, sp8, 6);
barInfo->receivedValue, arg1, sp8, 6);
for (i = 0; i < 6; i++)
sp10[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + sp8[i]);
@ -2516,13 +2509,13 @@ static void sub_8074F88(struct TestingBar *barInfo, s32 *arg1, u16 *arg2)
CpuCopy16(sp10, arg2, sizeof(sp10));
}
static u8 GetScaledExpFraction(s32 currValue, s32 arg1, s32 maxValue, u8 scale)
static u8 GetScaledExpFraction(s32 currValue, s32 receivedValue, s32 maxValue, u8 scale)
{
s32 r5, result;
s8 r4, r0;
scale *= 8;
r5 = currValue - arg1;
r5 = currValue - receivedValue;
if (r5 < 0)
r5 = 0;

View File

@ -3625,7 +3625,7 @@ static void atk23_getexp(void)
if (gBattleExecBuffer == 0)
{
gActiveBank = gBattleStruct->expGetterBank;
if (gBattleBufferB[gActiveBank][0] == 0x21 && gBattleBufferB[gActiveBank][1] == 0xB)
if (gBattleBufferB[gActiveBank][0] == CONTROLLER_TWORETURNVALUES && gBattleBufferB[gActiveBank][1] == RET_VALUE_LEVELLED_UP)
{
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gBattlePartyID[gActiveBank] == gBattleStruct->expGetterId)
sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank);
@ -7137,7 +7137,7 @@ static void atk76_various(void)
gDisableStructs[1].truantUnknownBit = 1;
break;
case VARIOUS_EMIT_YESNOBOX:
EmitYesNoBox(0);
EmitUnknownYesNoBox(0);
MarkBufferBankForExecution(gActiveBank);
break;
case 14:
@ -7255,7 +7255,7 @@ static void atk78_faintifabilitynotdamp(void)
{
gActiveBank = gBankAttacker;
gBattleMoveDamage = gBattleMons[gActiveBank].hp;
EmitHealthBarUpdate(0, 0x7FFF);
EmitHealthBarUpdate(0, INSTANT_HP_BAR_DROP);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr++;
@ -10184,7 +10184,7 @@ static void atkC9_jumpifattackandspecialattackcannotfall(void) // memento
{
gActiveBank = gBankAttacker;
gBattleMoveDamage = gBattleMons[gActiveBank].hp;
EmitHealthBarUpdate(0, 0x7FFF);
EmitHealthBarUpdate(0, INSTANT_HP_BAR_DROP);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr += 5;
}
@ -11003,13 +11003,13 @@ static void atkEF_pokeball_catch_calculation(void)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
{
EmitBallThrow(0, BALL_TRAINER_BLOCK);
EmitBallThrowAnim(0, BALL_TRAINER_BLOCK);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr = BattleScript_TrainerBallBlock;
}
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL)
{
EmitBallThrow(0, BALL_3_SHAKES_SUCCESS);
EmitBallThrowAnim(0, BALL_3_SHAKES_SUCCESS);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr = BattleScript_WallyBallThrow;
}
@ -11098,7 +11098,7 @@ static void atkEF_pokeball_catch_calculation(void)
if (odds > 254) // mon caught
{
EmitBallThrow(0, BALL_3_SHAKES_SUCCESS);
EmitBallThrowAnim(0, BALL_3_SHAKES_SUCCESS);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr = BattleScript_SuccessBallThrow;
SetMonData(&gEnemyParty[gBattlePartyID[gBankTarget]], MON_DATA_POKEBALL, &gLastUsedItem);
@ -11120,7 +11120,7 @@ static void atkEF_pokeball_catch_calculation(void)
if (gLastUsedItem == ITEM_MASTER_BALL)
shakes = BALL_3_SHAKES_SUCCESS; // why calculate the shakes before that check?
EmitBallThrow(0, shakes);
EmitBallThrowAnim(0, shakes);
MarkBufferBankForExecution(gActiveBank);
if (shakes == BALL_3_SHAKES_SUCCESS) // mon caught, copy of the code above