decompile reshow battle screen

This commit is contained in:
DizzyEggg 2017-10-09 18:18:40 +02:00
parent 96c5966ff3
commit ab03b03c4b
29 changed files with 756 additions and 1373 deletions

View File

@ -1323,8 +1323,8 @@ _0805DC02:
.pool
thumb_func_end mplay_80342A4
thumb_func_start sub_805DC0C
sub_805DC0C: @ 805DC0C
thumb_func_start BattleLoadOpponentMonSpriteGfx
BattleLoadOpponentMonSpriteGfx: @ 805DC0C
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -1474,10 +1474,10 @@ _0805DD46:
pop {r0}
bx r0
.pool
thumb_func_end sub_805DC0C
thumb_func_end BattleLoadOpponentMonSpriteGfx
thumb_func_start sub_805DD7C
sub_805DD7C: @ 805DD7C
thumb_func_start BattleLoadPlayerMonSpriteGfx
BattleLoadPlayerMonSpriteGfx: @ 805DD7C
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -1658,7 +1658,7 @@ _0805DEFC:
pop {r0}
bx r0
.pool
thumb_func_end sub_805DD7C
thumb_func_end BattleLoadPlayerMonSpriteGfx
thumb_func_start nullsub_23
nullsub_23: @ 805DF30
@ -1703,8 +1703,8 @@ sub_805DF38: @ 805DF38
.pool
thumb_func_end sub_805DF38
thumb_func_start sub_805DF84
sub_805DF84: @ 805DF84
thumb_func_start LoadBackTrainerBankSpriteGfx
LoadBackTrainerBankSpriteGfx: @ 805DF84
push {r4,r5,lr}
adds r5, r0, 0
adds r4, r1, 0
@ -1742,7 +1742,7 @@ sub_805DF84: @ 805DF84
pop {r0}
bx r0
.pool
thumb_func_end sub_805DF84
thumb_func_end LoadBackTrainerBankSpriteGfx
thumb_func_start nullsub_25
nullsub_25: @ 805DFE0
@ -1772,7 +1772,7 @@ sub_805DFFC: @ 805DFFC
adds r4, 0x8
adds r0, r4, 0
bl LoadSpritePalette
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _0805E034
@ -1821,8 +1821,8 @@ _0805E076:
.pool
thumb_func_end sub_805DFFC
thumb_func_start sub_805E08C
sub_805E08C: @ 805E08C
thumb_func_start BattleLoadAllHealthBoxesGfx
BattleLoadAllHealthBoxesGfx: @ 805E08C
push {r4-r6,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -1843,7 +1843,7 @@ _0805E09C:
b _0805E1AE
.pool
_0805E0B8:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _0805E120
@ -1953,7 +1953,7 @@ _0805E1AE:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_805E08C
thumb_func_end BattleLoadAllHealthBoxesGfx
thumb_func_start load_gfxc_health_bar
load_gfxc_health_bar: @ 805E1B8
@ -2002,7 +2002,7 @@ _0805E214:
b _0805E324
_0805E21A:
ldrb r0, [r4]
bl sub_805E08C
bl BattleLoadAllHealthBoxesGfx
lsls r0, 24
cmp r0, 0
beq _0805E228
@ -2022,12 +2022,12 @@ _0805E230:
ldrb r0, [r4]
cmp r0, 0
bne _0805E24C
bl battle_make_oam_safari_battle
bl CreateSafariPlayerHealthboxSprites
b _0805E252
.pool
_0805E24C:
ldrb r0, [r4]
bl battle_make_oam_normal_battle
bl CreateBankHealthboxSprites
_0805E252:
ldr r2, =gHealthBoxesIds
ldrb r1, [r4]
@ -2037,7 +2037,7 @@ _0805E252:
.pool
_0805E260:
ldrb r0, [r4]
bl sub_8072B18
bl SetBankHealthboxSpritePos
ldr r0, =gBanksBySide
ldrb r1, [r4]
adds r0, r1, r0
@ -2084,7 +2084,7 @@ _0805E29C:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
b _0805E302
.pool
_0805E2E4:
@ -2101,13 +2101,13 @@ _0805E2E4:
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
_0805E302:
ldr r1, =gHealthBoxesIds
ldrb r0, [r4]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
_0805E30E:
ldrb r0, [r4]
adds r0, 0x1
@ -2128,7 +2128,7 @@ _0805E324:
b _0805E346
.pool
_0805E33C:
bl sub_805EC84
bl LoadAndCreateEnemyShadowSprites
bl sub_81B8C68
movs r6, 0x1
_0805E346:
@ -2541,7 +2541,7 @@ _0805E662:
ldr r1, =gSprites
adds r1, 0x8
adds r0, r1
ldr r1, =gUnknown_08309AAC
ldr r1, =gMonAnimationsSpriteAnimsPtrTable
mov r3, r8
lsls r2, r3, 2
adds r1, r2
@ -2630,8 +2630,8 @@ _0805E77A:
.pool
thumb_func_end sub_805E448
thumb_func_start sub_805E7DC
sub_805E7DC: @ 805E7DC
thumb_func_start BattleLoadSubstituteSpriteGfx
BattleLoadSubstituteSpriteGfx: @ 805E7DC
push {r4-r7,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -2732,7 +2732,7 @@ _0805E898:
ldr r1, =gEnemyParty
adds r0, r1
adds r1, r4, 0
bl sub_805DC0C
bl BattleLoadOpponentMonSpriteGfx
b _0805E8E6
.pool
_0805E8D0:
@ -2745,13 +2745,13 @@ _0805E8D0:
ldr r1, =gPlayerParty
adds r0, r1
adds r1, r5, 0
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
_0805E8E6:
pop {r4-r7}
pop {r0}
bx r0
.pool
thumb_func_end sub_805E7DC
thumb_func_end BattleLoadSubstituteSpriteGfx
thumb_func_start refresh_graphics_maybe
refresh_graphics_maybe: @ 805E8F4
@ -2766,7 +2766,7 @@ refresh_graphics_maybe: @ 805E8F4
lsrs r4, 24
adds r0, r6, 0
adds r1, r5, 0
bl sub_805E7DC
bl BattleLoadSubstituteSpriteGfx
lsls r0, r4, 4
adds r0, r4
lsls r0, 2
@ -2905,7 +2905,7 @@ _0805EA08:
negs r0, r0
ands r0, r2
strb r0, [r1]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _0805EA34
@ -2914,7 +2914,7 @@ _0805EA08:
b _0805EA5A
.pool
_0805EA34:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805EA5A
@ -2955,7 +2955,7 @@ BattleMusicStop: @ 805EA60
adds r0, r6, 0
ands r0, r2
strb r0, [r1]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805EAA2
@ -3059,7 +3059,7 @@ sub_805EAE8: @ 805EAE8
mov r1, r8
bl sub_805E990
_0805EB5A:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805EB7E
@ -3195,8 +3195,8 @@ _0805EC6C:
.pool
thumb_func_end sub_805EB9C
thumb_func_start sub_805EC84
sub_805EC84: @ 805EC84
thumb_func_start LoadAndCreateEnemyShadowSprites
LoadAndCreateEnemyShadowSprites: @ 805EC84
push {r4-r7,lr}
mov r7, r8
push {r7}
@ -3247,7 +3247,7 @@ sub_805EC84: @ 805EC84
lsls r0, 2
adds r0, r7
strh r5, [r0, 0x2E]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805ED56
@ -3299,7 +3299,7 @@ _0805ED56:
pop {r0}
bx r0
.pool
thumb_func_end sub_805EC84
thumb_func_end LoadAndCreateEnemyShadowSprites
thumb_func_start sub_805ED70
@ int sub_805ED70(obj *a1)
@ -3418,8 +3418,8 @@ sub_805EE48: @ 805EE48
bx lr
thumb_func_end sub_805EE48
thumb_func_start sub_805EE54
sub_805EE54: @ 805EE54
thumb_func_start SetBankEnemyShadowSpriteCallback
SetBankEnemyShadowSpriteCallback: @ 805EE54
push {r4-r6,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -3482,7 +3482,7 @@ _0805EED0:
pop {r0}
bx r0
.pool
thumb_func_end sub_805EE54
thumb_func_end SetBankEnemyShadowSpriteCallback
thumb_func_start sub_805EEE0
sub_805EEE0: @ 805EEE0

View File

@ -4047,7 +4047,7 @@ sub_80A5AFC: @ 80A5AFC
lsls r0, 24
cmp r0, 0
bne _080A5BA6
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _080A5BA6
@ -4129,7 +4129,7 @@ sub_80A5BAC: @ 80A5BAC
lsls r0, 24
cmp r0, 0
bne _080A5C38
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _080A5C38

View File

@ -721,7 +721,7 @@ sub_80FEE1C: @ 80FEE1C
lsls r0, 24
cmp r0, 0
bne _080FEE36
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _080FEE3E
@ -1260,7 +1260,7 @@ _080FF260:
sub_80FF268: @ 80FF268
push {r4,lr}
adds r4, r0, 0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -5433,7 +5433,7 @@ _08101378:
ldr r0, =gAnimationBankTarget
_0810137A:
ldrb r6, [r0]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _081013C4
@ -7557,7 +7557,7 @@ _08102448:
bne _08102464
adds r0, r4, r5
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
_08102464:
movs r1, 0x2
ldrsh r0, [r6, r1]
@ -7571,7 +7571,7 @@ _08102464:
bne _08102482
adds r0, r4, r5
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
_08102482:
adds r0, r4, 0x1
lsls r0, 24
@ -7600,7 +7600,7 @@ _081024B2:
ldr r0, =gHealthBoxesIds
adds r0, r4, r0
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
adds r0, r4, 0x1
lsls r0, 24
lsrs r4, r0, 24
@ -13205,7 +13205,7 @@ _081051F2:
movs r0, 0x1
adds r4, r0, 0
eors r4, r1
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0810526A
@ -26794,7 +26794,7 @@ _0810BF90:
ldrsh r0, [r0, r1]
cmp r0, 0
beq _0810BFA8
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _0810BFB4
@ -33105,7 +33105,7 @@ _0810F284:
mov r0, r8
cmp r0, 0
bne _0810F2B8
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0810F2B8
@ -33501,7 +33501,7 @@ _0810F5A6:
lsls r0, 24
cmp r0, 0
bne _0810F5EE
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0810F5EE
@ -43194,7 +43194,7 @@ sub_81144F8: @ 81144F8
movs r2, 0x1
bl lcd_bg_operations
_0811455C:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _081145D6
@ -47859,7 +47859,7 @@ sub_8116B14: @ 8116B14
movs r0, 0xA
bl SetGpuReg
_08116BA2:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08116C26
@ -48295,7 +48295,7 @@ _08116F5C:
movs r2, 0x1
bl lcd_bg_operations
_08116FBA:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08117036

View File

@ -3256,7 +3256,7 @@ _0815BAB6:
lsls r1, r0, 2
adds r1, r2
ldrh r1, [r1, 0x2]
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
_0815BAF6:
mov r0, r8
bl move_anim_task_del
@ -4001,7 +4001,7 @@ _0815C15C:
bl GetBankIdentity
lsls r0, 24
lsrs r4, r0, 24
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -9334,7 +9334,7 @@ sub_815EC48: @ 815EC48
lsls r0, 24
cmp r0, 0
bne _0815ECD0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r7, r0, 24
cmp r7, 0x1

View File

@ -199,11 +199,11 @@ sub_8064520: @ 8064520
movs r0, 0
mov r8, r0
movs r4, 0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0806454C
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08064584
@ -531,7 +531,7 @@ _080647B4:
ands r0, r1
cmp r0, 0
bne _0806487A
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0806484A
@ -557,7 +557,7 @@ _080647B4:
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
mov r1, r9
ldrb r0, [r1]
eors r0, r7
@ -567,7 +567,7 @@ _080647B4:
eors r0, r7
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_0806484A:
ldr r5, =gHealthBoxesIds
ldr r4, =gActiveBank
@ -583,13 +583,13 @@ _0806484A:
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_0806487A:
ldr r4, =gBattleSpritesDataPtr
ldr r0, [r4]
@ -760,7 +760,7 @@ _08064998:
movs r1, 0
strb r1, [r0, 0x9]
_080649E2:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08064A3A
@ -799,7 +799,7 @@ _080649E2:
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
_08064A3A:
ldr r1, =gUnknown_03005D7C
ldr r4, =gActiveBank
@ -827,7 +827,7 @@ _08064A3A:
lsls r1, 16
lsrs r1, 16
adds r0, r5, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r3, =gBattleSpritesDataPtr
ldr r0, [r3]
ldr r2, [r0, 0x8]
@ -974,7 +974,7 @@ sub_8064BC0: @ 8064BC0
ldrb r0, [r6]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
@ -1017,7 +1017,7 @@ sub_8064C14: @ 8064C14
ldr r0, =gHealthBoxesIds
adds r0, r3, r0
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl LinkOpponentBufferExecCompleted
_08064C42:
pop {r0}
@ -1065,7 +1065,7 @@ sub_8064C58: @ 8064C58
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl LinkOpponentBufferExecCompleted
_08064CB2:
pop {r4-r6}
@ -1321,13 +1321,13 @@ sub_8064E50: @ 8064E50
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r5]
bl sub_8076918
ldrb r0, [r5]
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldrb r0, [r5]
bl sub_805E408
ldr r1, =gBattleBankFunc
@ -1413,7 +1413,7 @@ _08064F72:
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3583,7 +3583,7 @@ sub_80662F8: @ 80662F8
muls r2, r0
adds r0, r2, 0
add r0, r9
bl sub_805DC0C
bl BattleLoadOpponentMonSpriteGfx
ldrb r0, [r6]
bl GetBankIdentity
adds r1, r0, 0
@ -3673,7 +3673,7 @@ sub_80662F8: @ 80662F8
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r1, =gBattleBankFunc
ldrb r0, [r6]
lsls r0, 2
@ -3772,7 +3772,7 @@ sub_8066494: @ 8066494
adds r0, r1, 0
adds r0, r5
adds r1, r6, 0
bl sub_805DC0C
bl BattleLoadOpponentMonSpriteGfx
adds r0, r6, 0
bl GetBankIdentity
adds r1, r0, 0
@ -3947,7 +3947,7 @@ _0806666C:
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl LinkOpponentBufferExecCompleted
_080666A8:
pop {r4-r6}
@ -5242,7 +5242,7 @@ sub_806719C: @ 806719C
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0x9
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r2, [r4]
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
@ -5779,7 +5779,7 @@ c3_08038DC4: @ 8067618
adds r0, r1
ldrh r0, [r0, 0x8]
strb r0, [r7]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08067652

View File

@ -168,11 +168,11 @@ _0814AFF4:
sub_814B004: @ 814B004
push {r4-r6,lr}
movs r6, 0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0814B028
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0814B05C
@ -348,7 +348,7 @@ _0814B136:
lsls r0, 2
adds r0, r2
strb r6, [r0, 0x9]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0814B1F0
@ -383,7 +383,7 @@ _0814B136:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r7]
mov r1, r8
eors r0, r1
@ -393,7 +393,7 @@ _0814B136:
eors r0, r1
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_0814B1F0:
ldr r1, =gUnknown_03005D7C
ldr r4, =gActiveBank
@ -419,13 +419,13 @@ _0814B1F0:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldr r2, [r0, 0x8]
@ -498,7 +498,7 @@ bx_t4_healthbar_update: @ 814B2D0
ldrb r0, [r5]
adds r0, r6
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
@ -587,7 +587,7 @@ sub_814B340: @ 814B340
ldrb r0, [r4]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl LinkPartnerBufferExecCompleted
_0814B3BC:
pop {r4-r6}
@ -634,7 +634,7 @@ sub_814B3DC: @ 814B3DC
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl LinkPartnerBufferExecCompleted
_0814B430:
pop {r4-r6}
@ -878,13 +878,13 @@ sub_814B5A8: @ 814B5A8
muls r1, r6
adds r1, r5
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r7]
bl sub_8076918
ldrb r0, [r7]
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldr r1, =gBattleBankFunc
ldrb r0, [r7]
lsls r0, 2
@ -3154,7 +3154,7 @@ sub_814CB0C: @ 814CB0C
muls r0, r5
ldr r4, =gPlayerParty
adds r0, r4
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r6]
lsls r0, 1
add r0, r8
@ -3283,7 +3283,7 @@ sub_814CC28: @ 814CC28
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r5]
lsls r1, r0, 9
adds r1, r6
@ -3514,7 +3514,7 @@ _0814CE5C:
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl LinkPartnerBufferExecCompleted
_0814CE92:
pop {r4-r6}
@ -3696,7 +3696,7 @@ _0814D002:
ldr r5, =gActiveBank
ldrb r1, [r5]
adds r0, r4, 0
bl sub_805DF84
bl LoadBackTrainerBankSpriteGfx
ldrb r0, [r5]
bl GetBankIdentity
adds r1, r0, 0
@ -3706,7 +3706,7 @@ _0814D002:
bl sub_806A12C
ldr r6, =gUnknown_0202499C
mov r8, r7
ldr r0, =gUnknown_08305D2C
ldr r0, =gTrainerBackPicCoords
lsls r4, 2
adds r4, r0
ldrb r0, [r4]
@ -4551,7 +4551,7 @@ sub_814D738: @ 814D738
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0x9
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r2, [r4]
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
@ -5217,7 +5217,7 @@ _0814DCF8:
mov r9, r0
ldrh r0, [r1, 0x8]
strb r0, [r7]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0814DD18
@ -5276,7 +5276,7 @@ _0814DD48:
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r7]
movs r1, 0
bl sub_814CC98

View File

@ -200,11 +200,11 @@ sub_805F2F0: @ 805F2F0
push {r5-r7}
movs r0, 0
mov r10, r0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805F32C
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805F31E
@ -520,7 +520,7 @@ _0805F5A6:
ands r0, r1
cmp r0, 0
bne _0805F5EE
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805F5EE
@ -583,7 +583,7 @@ _0805F5EE:
ands r0, r1
cmp r0, 0
bne _0805F6B4
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805F684
@ -609,7 +609,7 @@ _0805F5EE:
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
mov r1, r8
ldrb r0, [r1]
eors r0, r7
@ -619,7 +619,7 @@ _0805F5EE:
eors r0, r7
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_0805F684:
ldr r5, =gHealthBoxesIds
ldr r4, =gActiveBank
@ -635,13 +635,13 @@ _0805F684:
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_0805F6B4:
ldr r3, =gBattleSpritesDataPtr
ldr r2, [r3]
@ -739,11 +739,11 @@ _0805F774:
movs r0, 0x1
str r0, [sp]
_0805F792:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805F7B2
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805F810
@ -838,7 +838,7 @@ _0805F86E:
mov r0, r10
cmp r0, 0
beq _0805F958
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805F8D2
@ -877,7 +877,7 @@ _0805F86E:
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
_0805F8D2:
ldr r1, =gUnknown_03005D7C
ldr r4, =gActiveBank
@ -905,7 +905,7 @@ _0805F8D2:
lsls r1, 16
lsrs r1, 16
adds r0, r5, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r3, =gBattleSpritesDataPtr
ldr r0, [r3]
ldr r2, [r0, 0x8]
@ -1068,7 +1068,7 @@ sub_805FA70: @ 805FA70
ldrb r0, [r6]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
@ -1111,7 +1111,7 @@ sub_805FAC4: @ 805FAC4
ldr r0, =gHealthBoxesIds
adds r0, r3, r0
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl OpponentBufferExecCompleted
_0805FAF2:
pop {r0}
@ -1159,7 +1159,7 @@ sub_805FB08: @ 805FB08
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl OpponentBufferExecCompleted
_0805FB62:
pop {r4-r6}
@ -1415,13 +1415,13 @@ sub_805FD00: @ 805FD00
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r5]
bl sub_8076918
ldrb r0, [r5]
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldrb r0, [r5]
bl sub_805E408
ldr r1, =gBattleBankFunc
@ -1507,7 +1507,7 @@ _0805FE22:
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3730,7 +3730,7 @@ sub_8061224: @ 8061224
ldrh r0, [r0]
muls r0, r7
add r0, r10
bl sub_805DC0C
bl BattleLoadOpponentMonSpriteGfx
ldrb r0, [r6]
bl GetBankIdentity
adds r1, r0, 0
@ -3828,7 +3828,7 @@ sub_8061224: @ 8061224
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r1, =gBattleBankFunc
ldrb r0, [r6]
lsls r0, 2
@ -3934,7 +3934,7 @@ sub_80613DC: @ 80613DC
adds r0, r1, 0
adds r0, r5
adds r1, r6, 0
bl sub_805DC0C
bl BattleLoadOpponentMonSpriteGfx
adds r0, r6, 0
bl GetBankIdentity
adds r1, r0, 0
@ -4109,7 +4109,7 @@ _080615B4:
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl OpponentBufferExecCompleted
_080615F0:
pop {r4-r6}
@ -5692,7 +5692,7 @@ sub_8062390: @ 8062390
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0x9
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r2, [r4]
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
@ -6244,7 +6244,7 @@ sub_8062828: @ 8062828
adds r0, r1
ldrh r0, [r0, 0x8]
strb r0, [r7]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0806286C

View File

@ -249,7 +249,7 @@ _08057674:
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
ldrb r1, [r4]
adds r1, r5
ldrb r0, [r1]
@ -277,7 +277,7 @@ _080576B4:
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
ldrb r1, [r4]
adds r1, r5
ldrb r0, [r1]
@ -321,7 +321,7 @@ _0805771A:
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
ldrb r1, [r4]
adds r1, r5
ldrb r0, [r1]
@ -333,7 +333,7 @@ _08057732:
adds r0, r5
ldrb r0, [r0]
movs r1, 0
bl sub_8059CB4
bl ActionSelectionCreateCursorAt
b _080577E8
.pool
_0805774C:
@ -2385,11 +2385,11 @@ sub_805896C: @ 805896C
mov r5, r8
push {r5-r7}
movs r7, 0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08058998
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _080589D0
@ -2541,7 +2541,7 @@ _08058A0E:
ldr r4, =gPlayerParty
adds r0, r4
bl sub_805E990
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08058AE4
@ -2672,7 +2672,7 @@ _08058BB2:
ands r0, r1
cmp r0, 0
bne _08058C68
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08058C38
@ -2697,7 +2697,7 @@ _08058BB2:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r7]
eors r0, r6
bl sub_8076918
@ -2705,7 +2705,7 @@ _08058BB2:
eors r0, r6
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_08058C38:
ldr r5, =gHealthBoxesIds
ldr r4, =gActiveBank
@ -2721,13 +2721,13 @@ _08058C38:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_08058C68:
ldr r0, =gBattleSpritesDataPtr
ldr r2, [r0]
@ -2817,11 +2817,11 @@ _08058D14:
movs r0, 0x1
mov r9, r0
_08058D32:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08058D52
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08058DAC
@ -2915,7 +2915,7 @@ _08058E0A:
mov r0, r8
cmp r0, 0
beq _08058EAA
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08058E48
@ -3207,13 +3207,13 @@ _0805905E:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r5]
bl sub_8076918
ldrb r0, [r5]
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3267,7 +3267,7 @@ bx_t1_healthbar_update: @ 8059130
ldrb r0, [r5]
adds r0, r6
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
@ -3338,7 +3338,7 @@ sub_80591B8: @ 80591B8
str r7, [sp, 0x8]
ldrh r2, [r1, 0xA]
str r2, [sp, 0xC]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -3415,7 +3415,7 @@ _080591FE:
movs r1, 0xB
bl dp01_build_cmdbuf_x21_a_bb
strb r5, [r4]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -3616,7 +3616,7 @@ _08059430:
lsls r4, 16
lsrs r4, 16
ldrb r0, [r5]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r4, 16
movs r0, 0x1
@ -3729,7 +3729,7 @@ sub_8059544: @ 8059544
adds r0, r1
ldrb r4, [r0, 0xC]
ldrb r6, [r0, 0x8]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -3795,7 +3795,7 @@ sub_80595A4: @ 80595A4
adds r0, r7, 0
movs r1, 0x38
bl GetMonData
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -3814,7 +3814,7 @@ sub_80595A4: @ 80595A4
ldrb r0, [r0]
adds r1, r7, 0
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
b _08059638
.pool
_08059624:
@ -3826,7 +3826,7 @@ _08059624:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
_08059638:
ldr r0, =gTasks
lsls r1, r6, 2
@ -3930,7 +3930,7 @@ sub_80596A8: @ 80596A8
ldrb r0, [r4]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl PlayerBufferExecCompleted
_08059724:
pop {r4-r6}
@ -3977,7 +3977,7 @@ sub_8059744: @ 8059744
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl PlayerBufferExecCompleted
_08059798:
pop {r4-r6}
@ -4561,8 +4561,8 @@ battle_menu_cursor_related: @ 8059C70
.pool
thumb_func_end battle_menu_cursor_related
thumb_func_start sub_8059CB4
sub_8059CB4: @ 8059CB4
thumb_func_start ActionSelectionCreateCursorAt
ActionSelectionCreateCursorAt: @ 8059CB4
push {r4,lr}
sub sp, 0x10
adds r3, r0, 0
@ -4595,10 +4595,10 @@ sub_8059CB4: @ 8059CB4
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_8059CB4
thumb_func_end ActionSelectionCreateCursorAt
thumb_func_start sub_8059CF8
sub_8059CF8: @ 8059CF8
thumb_func_start ActionSelectionDestroyCursorAt
ActionSelectionDestroyCursorAt: @ 8059CF8
push {lr}
sub sp, 0x10
adds r3, r0, 0
@ -4632,7 +4632,7 @@ sub_8059CF8: @ 8059CF8
pop {r0}
bx r0
.pool
thumb_func_end sub_8059CF8
thumb_func_end ActionSelectionDestroyCursorAt
thumb_func_start sub_8059D40
sub_8059D40: @ 8059D40
@ -6866,7 +6866,7 @@ sub_805B164: @ 805B164
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldr r2, =gSprites
ldr r0, =gBankSpriteIds
ldrb r3, [r4]
@ -6923,7 +6923,7 @@ sub_805B1CC: @ 805B1CC
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldr r1, =gActionSelectionCursor
ldrb r0, [r5]
adds r0, r1
@ -7162,7 +7162,7 @@ _0805B41C:
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl PlayerBufferExecCompleted
_0805B452:
pop {r4-r6}
@ -7375,7 +7375,7 @@ _0805B5E0:
b _0805B642
.pool
_0805B618:
ldr r1, =gUnknown_08305D2C
ldr r1, =gTrainerBackPicCoords
lsls r0, r4, 2
adds r0, r1
ldrb r1, [r0]
@ -7392,7 +7392,7 @@ _0805B618:
_0805B63C:
movs r0, 0x50
mov r9, r0
ldr r1, =gUnknown_08305D2C
ldr r1, =gTrainerBackPicCoords
_0805B642:
lsls r0, r4, 2
adds r0, r1
@ -7542,7 +7542,7 @@ _0805B794:
ldr r5, =gActiveBank
ldrb r1, [r5]
adds r0, r4, 0
bl sub_805DF84
bl LoadBackTrainerBankSpriteGfx
ldrb r0, [r5]
bl GetBankIdentity
adds r1, r0, 0
@ -7724,7 +7724,7 @@ _0805B926:
ldr r5, =gActiveBank
ldrb r1, [r5]
adds r0, r4, 0
bl sub_805DF84
bl LoadBackTrainerBankSpriteGfx
ldrb r0, [r5]
bl GetBankIdentity
adds r1, r0, 0
@ -7733,7 +7733,7 @@ _0805B926:
adds r0, r4, 0
bl sub_806A12C
ldr r0, =gUnknown_0202499C
ldr r1, =gUnknown_08305D2C
ldr r1, =gTrainerBackPicCoords
lsls r4, 2
adds r4, r1
ldrb r1, [r4]
@ -8539,7 +8539,7 @@ dp01t_12_6_battle_menu: @ 805C044
_0805C062:
lsls r0, r4, 24
lsrs r0, 24
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
adds r4, 0x1
cmp r4, 0x3
ble _0805C062
@ -8549,7 +8549,7 @@ _0805C062:
adds r0, r1
ldrb r0, [r0]
movs r1, 0
bl sub_8059CB4
bl ActionSelectionCreateCursorAt
ldr r0, =gText_WhatWillPkmnDo
bl BattleStringExpandPlaceholdersToDisplayedString
ldr r0, =gDisplayedStringBattle
@ -9130,7 +9130,7 @@ sub_805C5C4: @ 805C5C4
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0x9
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r2, [r4]
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
@ -9860,7 +9860,7 @@ sub_805CC00: @ 805CC00
ldr r1, =gPlayerParty
adds r0, r1
adds r1, r4, 0
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldr r0, =gBankSpriteIds
adds r4, r0
ldrb r1, [r4]
@ -9906,7 +9906,7 @@ _0805CC94:
mov r9, r0
ldrh r0, [r1, 0x8]
strb r0, [r7]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0805CCB4
@ -9965,7 +9965,7 @@ _0805CCE4:
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r7]
movs r1, 0
bl sub_805B258

View File

@ -169,11 +169,11 @@ _081BAF38:
sub_81BAF48: @ 81BAF48
push {r4-r6,lr}
movs r6, 0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _081BAF6C
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _081BAFA0
@ -349,7 +349,7 @@ _081BB07A:
lsls r0, 2
adds r0, r2
strb r6, [r0, 0x9]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _081BB134
@ -384,7 +384,7 @@ _081BB07A:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r7]
mov r1, r8
eors r0, r1
@ -394,7 +394,7 @@ _081BB07A:
eors r0, r1
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_081BB134:
ldr r1, =gUnknown_03005D7C
ldr r4, =gActiveBank
@ -420,13 +420,13 @@ _081BB134:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldr r2, [r0, 0x8]
@ -499,7 +499,7 @@ bx_t3_healthbar_update: @ 81BB214
ldrb r0, [r5]
adds r0, r6
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
@ -570,7 +570,7 @@ sub_81BB29C: @ 81BB29C
str r7, [sp, 0x8]
ldrh r2, [r1, 0xA]
str r2, [sp, 0xC]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -647,7 +647,7 @@ _081BB2E2:
movs r1, 0xB
bl dp01_build_cmdbuf_x21_a_bb
strb r5, [r4]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -848,7 +848,7 @@ _081BB514:
lsls r4, 16
lsrs r4, 16
ldrb r0, [r5]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r4, 16
movs r0, 0x1
@ -961,7 +961,7 @@ sub_81BB628: @ 81BB628
adds r0, r1
ldrb r4, [r0, 0xC]
ldrb r6, [r0, 0x8]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -1027,7 +1027,7 @@ sub_81BB688: @ 81BB688
adds r0, r7, 0
movs r1, 0x38
bl GetMonData
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -1046,7 +1046,7 @@ sub_81BB688: @ 81BB688
ldrb r0, [r0]
adds r1, r7, 0
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
b _081BB71C
.pool
_081BB708:
@ -1058,7 +1058,7 @@ _081BB708:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
_081BB71C:
ldr r0, =gTasks
lsls r1, r6, 2
@ -1162,7 +1162,7 @@ sub_81BB78C: @ 81BB78C
ldrb r0, [r4]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl PlayerPartnerBufferExecCompleted
_081BB808:
pop {r4-r6}
@ -1209,7 +1209,7 @@ sub_81BB828: @ 81BB828
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl PlayerPartnerBufferExecCompleted
_081BB87C:
pop {r4-r6}
@ -1453,13 +1453,13 @@ sub_81BB9F4: @ 81BB9F4
muls r1, r6
adds r1, r5
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r7]
bl sub_8076918
ldrb r0, [r7]
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldr r1, =gBattleBankFunc
ldrb r0, [r7]
lsls r0, 2
@ -3729,7 +3729,7 @@ sub_81BCF58: @ 81BCF58
muls r0, r5
ldr r4, =gPlayerParty
adds r0, r4
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r6]
lsls r0, 1
add r0, r8
@ -3858,7 +3858,7 @@ sub_81BD074: @ 81BD074
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r5]
lsls r1, r0, 9
adds r1, r6
@ -4089,7 +4089,7 @@ _081BD2A8:
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl PlayerPartnerBufferExecCompleted
_081BD2DE:
pop {r4-r6}
@ -4182,7 +4182,7 @@ sub_81BD37C: @ 81BD37C
movs r4, 0x7
movs r0, 0x5A
mov r9, r0
ldr r0, =gUnknown_08305D2C
ldr r0, =gTrainerBackPicCoords
ldrb r1, [r0, 0x1C]
b _081BD3BE
.pool
@ -4213,7 +4213,7 @@ _081BD3BE:
ldr r5, =gActiveBank
ldrb r1, [r5]
adds r0, r4, 0
bl sub_805DF84
bl LoadBackTrainerBankSpriteGfx
ldrb r0, [r5]
bl GetBankIdentity
adds r1, r0, 0
@ -5338,7 +5338,7 @@ sub_81BDD9C: @ 81BDD9C
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0x9
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r2, [r4]
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
@ -5950,7 +5950,7 @@ _081BE2F4:
mov r9, r0
ldrh r0, [r1, 0x8]
strb r0, [r7]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _081BE314
@ -6009,7 +6009,7 @@ _081BE344:
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r7]
movs r1, 0
bl sub_81BD0E4

View File

@ -198,11 +198,11 @@ sub_8186678: @ 8186678
push {r6,r7}
movs r0, 0
mov r9, r0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _081866A4
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _081866F8
@ -504,7 +504,7 @@ _081868DE:
ands r0, r1
cmp r0, 0
bne _08186994
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08186964
@ -529,7 +529,7 @@ _081868DE:
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r7]
eors r0, r6
bl sub_8076918
@ -537,7 +537,7 @@ _081868DE:
eors r0, r6
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_08186964:
ldr r5, =gHealthBoxesIds
ldr r4, =gActiveBank
@ -553,13 +553,13 @@ _08186964:
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_08186994:
ldr r0, =gBattleSpritesDataPtr
ldr r2, [r0]
@ -655,7 +655,7 @@ _08186A4C:
movs r0, 0x1
mov r9, r0
_08186A6A:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _08186AC8
@ -742,7 +742,7 @@ _08186B26:
mov r0, r8
cmp r0, 0
beq _08186C10
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08186B8A
@ -781,7 +781,7 @@ _08186B26:
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
_08186B8A:
ldr r1, =gUnknown_03005D7C
ldr r4, =gActiveBank
@ -809,7 +809,7 @@ _08186B8A:
lsls r1, 16
lsrs r1, 16
adds r0, r5, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r3, =gBattleSpritesDataPtr
ldr r0, [r3]
ldr r2, [r0, 0x8]
@ -955,7 +955,7 @@ sub_8186D04: @ 8186D04
ldrb r0, [r6]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
@ -998,7 +998,7 @@ sub_8186D58: @ 8186D58
ldr r0, =gHealthBoxesIds
adds r0, r3, r0
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl RecordedOpponentBufferExecCompleted
_08186D86:
pop {r0}
@ -1046,7 +1046,7 @@ sub_8186D9C: @ 8186D9C
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl RecordedOpponentBufferExecCompleted
_08186DF6:
pop {r4-r6}
@ -1302,13 +1302,13 @@ sub_8186F94: @ 8186F94
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r5]
bl sub_8076918
ldrb r0, [r5]
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldrb r0, [r5]
bl sub_805E408
ldr r1, =gBattleBankFunc
@ -1394,7 +1394,7 @@ _081870B6:
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r1, =gBattleBankFunc
ldrb r0, [r5]
lsls r0, 2
@ -3564,7 +3564,7 @@ sub_818843C: @ 818843C
muls r2, r0
adds r0, r2, 0
add r0, r9
bl sub_805DC0C
bl BattleLoadOpponentMonSpriteGfx
ldrb r0, [r6]
bl GetBankIdentity
adds r1, r0, 0
@ -3654,7 +3654,7 @@ sub_818843C: @ 818843C
lsls r1, 16
lsrs r1, 16
adds r0, r4, 0
bl sub_805EE54
bl SetBankEnemyShadowSpriteCallback
ldr r1, =gBattleBankFunc
ldrb r0, [r6]
lsls r0, 2
@ -3753,7 +3753,7 @@ sub_81885D8: @ 81885D8
adds r0, r1, 0
adds r0, r5
adds r1, r6, 0
bl sub_805DC0C
bl BattleLoadOpponentMonSpriteGfx
adds r0, r6, 0
bl GetBankIdentity
adds r1, r0, 0
@ -3928,7 +3928,7 @@ _081887B0:
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl RecordedOpponentBufferExecCompleted
_081887EC:
pop {r4-r6}
@ -4981,7 +4981,7 @@ sub_81890CC: @ 81890CC
ldr r2, =gEnemyParty
adds r1, r2
movs r2, 0x9
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r2, [r4]
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
@ -5518,7 +5518,7 @@ c3_0803D564: @ 8189548
adds r0, r1
ldrh r0, [r0, 0x8]
strb r0, [r7]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08189582

View File

@ -180,11 +180,11 @@ sub_8189AA0: @ 8189AA0
beq _08189ABA
b _08189C60
_08189ABA:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08189ADA
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08189B0C
@ -337,7 +337,7 @@ _08189B86:
ldr r4, =gPlayerParty
adds r0, r4
bl sub_805E990
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08189C22
@ -366,11 +366,11 @@ _08189C22:
b _08189D10
.pool
_08189C60:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08189C80
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08189CB0
@ -561,7 +561,7 @@ _08189DBE:
ands r0, r1
cmp r0, 0
bne _08189E84
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08189E54
@ -587,7 +587,7 @@ _08189DBE:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
mov r1, r9
ldrb r0, [r1]
eors r0, r7
@ -597,7 +597,7 @@ _08189DBE:
eors r0, r7
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_08189E54:
ldr r5, =gHealthBoxesIds
ldr r4, =gActiveBank
@ -613,13 +613,13 @@ _08189E54:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_08189E84:
ldr r4, =gBattleSpritesDataPtr
ldr r0, [r4]
@ -747,7 +747,7 @@ _08189F62:
ldr r0, [r0]
cmp r0, r2
bne _0818A02A
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08189FC8
@ -874,7 +874,7 @@ sub_818A0A4: @ 818A0A4
ldrb r0, [r5]
adds r0, r6
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
@ -963,7 +963,7 @@ sub_818A114: @ 818A114
ldrb r0, [r4]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl RecordedPlayerBufferExecCompleted
_0818A190:
pop {r4-r6}
@ -1010,7 +1010,7 @@ sub_818A1B0: @ 818A1B0
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl RecordedPlayerBufferExecCompleted
_0818A204:
pop {r4-r6}
@ -1254,13 +1254,13 @@ sub_818A37C: @ 818A37C
muls r1, r6
adds r1, r5
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r7]
bl sub_8076918
ldrb r0, [r7]
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldr r1, =gBattleBankFunc
ldrb r0, [r7]
lsls r0, 2
@ -3530,7 +3530,7 @@ sub_818B8E0: @ 818B8E0
muls r0, r5
ldr r4, =gPlayerParty
adds r0, r4
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r6]
lsls r0, 1
add r0, r8
@ -3659,7 +3659,7 @@ sub_818B9FC: @ 818B9FC
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r5]
lsls r1, r0, 9
adds r1, r6
@ -3890,7 +3890,7 @@ _0818BC30:
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl RecordedPlayerBufferExecCompleted
_0818BC66:
pop {r4-r6}
@ -4040,7 +4040,7 @@ _0818BD98:
movs r0, 0x50
mov r9, r0
_0818BD9C:
ldr r1, =gUnknown_08305D2C
ldr r1, =gTrainerBackPicCoords
_0818BD9E:
lsls r0, r4, 2
adds r0, r1
@ -4182,7 +4182,7 @@ _0818BEDC:
ldr r5, =gActiveBank
ldrb r1, [r5]
adds r0, r4, 0
bl sub_805DF84
bl LoadBackTrainerBankSpriteGfx
ldrb r0, [r5]
bl GetBankIdentity
adds r1, r0, 0
@ -5132,7 +5132,7 @@ sub_818C6F4: @ 818C6F4
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0x9
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r2, [r4]
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
@ -5746,7 +5746,7 @@ _0818CC50:
mov r9, r0
ldrh r0, [r1, 0x8]
strb r0, [r7]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0818CC70
@ -5805,7 +5805,7 @@ _0818CCA0:
muls r0, r2
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
bl BattleLoadPlayerMonSpriteGfx
ldrb r0, [r7]
movs r1, 0
bl sub_818BA6C

View File

@ -132,7 +132,7 @@ _08159446:
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
ldrb r1, [r4]
adds r1, r5
ldrb r0, [r1]
@ -158,7 +158,7 @@ _08159484:
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
ldrb r1, [r4]
adds r1, r5
ldrb r0, [r1]
@ -184,7 +184,7 @@ _081594C0:
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
ldrb r1, [r4]
adds r1, r5
ldrb r0, [r1]
@ -196,7 +196,7 @@ _081594F2:
adds r0, r5
ldrb r0, [r0]
movs r1, 0
bl sub_8059CB4
bl ActionSelectionCreateCursorAt
b _0815954E
.pool
_0815950C:
@ -218,7 +218,7 @@ _0815950C:
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
ldrb r1, [r4]
adds r1, r5
ldrb r0, [r1]
@ -229,7 +229,7 @@ _0815950C:
adds r0, r5
ldrb r0, [r0]
movs r1, 0
bl sub_8059CB4
bl ActionSelectionCreateCursorAt
_0815954E:
pop {r4,r5}
pop {r0}
@ -569,7 +569,7 @@ sub_8159800: @ 8159800
ldrb r0, [r0, 0x8]
ldr r5, =gActiveBank
ldrb r1, [r5]
bl sub_805DF84
bl LoadBackTrainerBankSpriteGfx
ldr r0, [r4]
ldrb r6, [r0, 0x8]
ldrb r0, [r5]
@ -580,7 +580,7 @@ sub_8159800: @ 8159800
adds r0, r6, 0
bl sub_806A12C
ldr r0, =gUnknown_0202499C
ldr r2, =gUnknown_08305D2C
ldr r2, =gTrainerBackPicCoords
ldr r1, [r4]
ldrb r1, [r1, 0x8]
lsls r1, 2
@ -867,7 +867,7 @@ sub_8159A94: @ 8159A94
_08159AAE:
lsls r0, r4, 24
lsrs r0, 24
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
adds r4, 0x1
cmp r4, 0x3
ble _08159AAE
@ -877,7 +877,7 @@ _08159AAE:
adds r0, r1
ldrb r0, [r0]
movs r1, 0
bl sub_8059CB4
bl ActionSelectionCreateCursorAt
ldr r0, =gText_WhatWillPkmnDo2
bl BattleStringExpandPlaceholdersToDisplayedString
ldr r0, =gDisplayedStringBattle
@ -981,7 +981,7 @@ sub_8159B84: @ 8159B84
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0xB
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
bl SafariBufferExecCompleted
pop {r0}
bx r0
@ -1256,13 +1256,13 @@ sub_8159D90: @ 8159D90
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0xA
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldr r1, =gBattleBankFunc
ldrb r0, [r4]
lsls r0, 2

View File

@ -180,10 +180,10 @@ _08168508:
movs r0, 0x5
bl PlaySE
movs r0, 0
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
movs r0, 0x1
movs r1, 0
bl sub_8059CB4
bl ActionSelectionCreateCursorAt
ldr r0, [r4]
adds r0, 0x96
movs r1, 0x40
@ -425,7 +425,7 @@ _081686D2:
ldr r0, [r0]
cmp r0, r3
bne _081687DC
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _0816877A
@ -459,7 +459,7 @@ _081686D2:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r5]
eors r0, r6
bl sub_8076918
@ -467,7 +467,7 @@ _081686D2:
eors r0, r6
adds r0, r4
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
_0816877A:
ldr r1, =gUnknown_03005D7C
ldr r4, =gActiveBank
@ -493,13 +493,13 @@ _0816877A:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldrb r0, [r4]
bl sub_8076918
ldrb r0, [r4]
adds r0, r5
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
ldr r0, =gBattleSpritesDataPtr
ldr r0, [r0]
ldr r2, [r0, 0x8]
@ -665,7 +665,7 @@ sub_8168934: @ 8168934
ldrb r0, [r5]
adds r0, r6
ldrb r0, [r0]
bl sub_80729D0
bl SetHealthboxSpriteVisible
lsls r4, 16
asrs r1, r4, 16
movs r0, 0x1
@ -796,7 +796,7 @@ sub_8168A20: @ 8168A20
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl WallyBufferExecCompleted
_08168A74:
pop {r4-r6}
@ -3015,7 +3015,7 @@ _08169E80:
ldrb r0, [r6]
adds r0, r1
ldrb r0, [r0]
bl sub_8072984
bl SetHealthboxSpriteInvisible
bl WallyBufferExecCompleted
_08169EB6:
pop {r4-r6}
@ -3030,7 +3030,7 @@ sub_8169EC8: @ 8169EC8
ldr r4, =gActiveBank
ldrb r1, [r4]
movs r0, 0x6
bl sub_805DF84
bl LoadBackTrainerBankSpriteGfx
ldrb r0, [r4]
bl GetBankIdentity
adds r1, r0, 0
@ -3039,7 +3039,7 @@ sub_8169EC8: @ 8169EC8
movs r0, 0x6
bl sub_806A12C
ldr r0, =gUnknown_0202499C
ldr r1, =gUnknown_08305D2C
ldr r1, =gTrainerBackPicCoords
ldrb r1, [r1, 0x18]
movs r2, 0x8
subs r2, r1
@ -3115,7 +3115,7 @@ dp01t_07_6_: @ 8169F94
ldr r4, =gActiveBank
ldrb r1, [r4]
movs r0, 0x6
bl sub_805DF84
bl LoadBackTrainerBankSpriteGfx
ldrb r0, [r4]
bl GetBankIdentity
adds r1, r0, 0
@ -3124,7 +3124,7 @@ dp01t_07_6_: @ 8169F94
movs r0, 0x6
bl sub_806A12C
ldr r0, =gUnknown_0202499C
ldr r1, =gUnknown_08305D2C
ldr r1, =gTrainerBackPicCoords
ldrb r1, [r1, 0x18]
movs r2, 0x8
subs r2, r1
@ -3681,7 +3681,7 @@ dp01t_12_1_battle_menu: @ 816A470
_0816A48A:
lsls r0, r4, 24
lsrs r0, 24
bl sub_8059CF8
bl ActionSelectionDestroyCursorAt
adds r4, 0x1
cmp r4, 0x3
ble _0816A48A
@ -3691,7 +3691,7 @@ _0816A48A:
adds r0, r1
ldrb r0, [r0]
movs r1, 0
bl sub_8059CB4
bl ActionSelectionCreateCursorAt
ldr r0, =gText_WhatWillWallyDo
bl BattleStringExpandPlaceholdersToDisplayedString
ldr r0, =gDisplayedStringBattle

View File

@ -261,8 +261,8 @@ sub_80724A8: @ 80724A8
bx r0
thumb_func_end sub_80724A8
thumb_func_start battle_make_oam_normal_battle
battle_make_oam_normal_battle: @ 80724DC
thumb_func_start CreateBankHealthboxSprites
CreateBankHealthboxSprites: @ 80724DC
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -274,7 +274,7 @@ battle_make_oam_normal_battle: @ 80724DC
mov r10, r0
movs r0, 0
str r0, [sp]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _080725F0
@ -608,10 +608,10 @@ _08072718:
pop {r1}
bx r1
.pool
thumb_func_end battle_make_oam_normal_battle
thumb_func_end CreateBankHealthboxSprites
thumb_func_start battle_make_oam_safari_battle
battle_make_oam_safari_battle: @ 8072804
thumb_func_start CreateSafariPlayerHealthboxSprites
CreateSafariPlayerHealthboxSprites: @ 8072804
push {r4-r7,lr}
mov r7, r9
mov r6, r8
@ -680,7 +680,7 @@ battle_make_oam_safari_battle: @ 8072804
pop {r1}
bx r1
.pool
thumb_func_end battle_make_oam_safari_battle
thumb_func_end CreateSafariPlayerHealthboxSprites
thumb_func_start sub_80728A4
sub_80728A4: @ 80728A4
@ -802,8 +802,8 @@ sub_807294C: @ 807294C
.pool
thumb_func_end sub_807294C
thumb_func_start sub_8072984
sub_8072984: @ 8072984
thumb_func_start SetHealthboxSpriteInvisible
SetHealthboxSpriteInvisible: @ 8072984
push {r4,lr}
lsls r0, 24
lsrs r0, 24
@ -841,10 +841,10 @@ sub_8072984: @ 8072984
pop {r0}
bx r0
.pool
thumb_func_end sub_8072984
thumb_func_end SetHealthboxSpriteInvisible
thumb_func_start sub_80729D0
sub_80729D0: @ 80729D0
thumb_func_start SetHealthboxSpriteVisible
SetHealthboxSpriteVisible: @ 80729D0
push {r4,r5,lr}
lsls r0, 24
lsrs r0, 24
@ -885,7 +885,7 @@ sub_80729D0: @ 80729D0
pop {r0}
bx r0
.pool
thumb_func_end sub_80729D0
thumb_func_end SetHealthboxSpriteVisible
thumb_func_start sub_8072A24
sub_8072A24: @ 8072A24
@ -1014,14 +1014,14 @@ _08072B00:
.pool
thumb_func_end sub_8072A88
thumb_func_start sub_8072B18
sub_8072B18: @ 8072B18
thumb_func_start SetBankHealthboxSpritePos
SetBankHealthboxSpritePos: @ 8072B18
push {r4-r6,lr}
lsls r0, 24
lsrs r6, r0, 24
movs r5, 0
movs r4, 0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _08072B44
@ -1081,7 +1081,7 @@ _08072B7C:
pop {r0}
bx r0
.pool
thumb_func_end sub_8072B18
thumb_func_end SetBankHealthboxSpritePos
thumb_func_start healthbar_draw_level
healthbar_draw_level: @ 8072B94
@ -1132,7 +1132,7 @@ healthbar_draw_level: @ 8072B94
lsls r0, 24
cmp r0, 0
bne _08072C18
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
ldr r2, =0x06010420
adds r1, r4, r2
@ -1187,7 +1187,7 @@ heathbar_draw_hp: @ 8072C38
lsls r0, 24
cmp r0, 0
bne _08072D10
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _08072D10
@ -1267,7 +1267,7 @@ _08072D10:
ldrh r0, [r6, 0x3A]
lsls r0, 24
lsrs r5, r0, 24
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
mov r10, r4
@ -1993,7 +1993,7 @@ _08073354:
bne _0807336A
b _080735A8
_0807336A:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _08073382
@ -2036,7 +2036,7 @@ _08073382:
lsls r0, 24
cmp r0, 0
bne _080734B0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _080733D0
@ -2107,7 +2107,7 @@ _08073468:
ldr r2, =gPlayerParty
adds r1, r2
movs r2, 0x5
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
movs r0, 0x75
bl sub_80728A4
ldrb r2, [r6]
@ -2209,7 +2209,7 @@ _0807355C:
ldr r4, =gEnemyParty
adds r1, r4
movs r2, 0x5
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x80
@ -2222,7 +2222,7 @@ _0807355C:
muls r1, r5
adds r1, r4
movs r2, 0x4
bl healthbar_draw_field_maybe
bl UpdateHealthboxAttribute
_08073592:
ldr r0, =gHealthBoxesIds
add r0, r9
@ -2303,7 +2303,7 @@ _08073630:
mov r9, r3
cmp r4, 0
beq _08073642
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _08073648
@ -3842,7 +3842,7 @@ _08074272:
adds r1, r6, 0
movs r2, 0x6
bl sub_8075198
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
ldr r1, =0x06010400
adds r5, r4, r1
@ -4013,7 +4013,7 @@ draw_status_ailment_maybe: @ 80743F8
movs r1, 0x37
bl GetMonData
adds r4, r0, 0
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
movs r3, 0x12
mov r8, r3
@ -4210,7 +4210,7 @@ _080745B8:
ldr r2, =0x04000018
adds r0, r6, 0
bl CpuSet
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -4468,8 +4468,8 @@ sub_80747D8: @ 80747D8
.pool
thumb_func_end sub_80747D8
thumb_func_start healthbar_draw_field_maybe
healthbar_draw_field_maybe: @ 8074860
thumb_func_start UpdateHealthboxAttribute
UpdateHealthboxAttribute: @ 8074860
push {r4-r7,lr}
mov r7, r10
mov r6, r9
@ -4492,7 +4492,7 @@ healthbar_draw_field_maybe: @ 8074860
mov r9, r0
cmp r7, 0
bne _0807489C
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _0807489C
@ -4581,7 +4581,7 @@ _08074914:
movs r3, 0
bl sub_8074AA0
_08074948:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
lsrs r0, 24
mov r10, r0
@ -4742,7 +4742,7 @@ _08074A8E:
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end healthbar_draw_field_maybe
thumb_func_end UpdateHealthboxAttribute
thumb_func_start sub_8074AA0
sub_8074AA0: @ 8074AA0

View File

@ -15872,7 +15872,7 @@ sub_81B8958: @ 81B8958
thumb_func_start sub_81B8984
sub_81B8984: @ 81B8984
push {lr}
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _081B8994
@ -16222,7 +16222,7 @@ _081B8CB0:
strb r0, [r6, 0x2]
b _081B8D58
_081B8CBE:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _081B8CFC
@ -16382,7 +16382,7 @@ _081B8DE2:
strb r0, [r5, 0x2]
b _081B8E72
_081B8DF0:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
bne _081B8E28

View File

@ -1211,7 +1211,7 @@ _08075DD4:
cmp r5, r0
bne _08075E56
_08075E00:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08075E56
@ -1243,7 +1243,7 @@ _08075E4C:
movs r2, 0x80
bl m4aMPlayVolumeControl
_08075E56:
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08075E70
@ -1815,7 +1815,7 @@ _080762F8:
ldrb r0, [r5, 0x6]
strh r0, [r5, 0x3A]
strh r1, [r5, 0x2E]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _08076358
@ -1888,7 +1888,7 @@ sub_8076398: @ 8076398
ble _080763EC
movs r0, 0
strh r0, [r5, 0x2E]
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _080763E8

File diff suppressed because it is too large Load Diff

View File

@ -1928,15 +1928,15 @@ _080A6B1A:
bx r1
thumb_func_end sub_80A6A90
thumb_func_start battle_type_is_double
battle_type_is_double: @ 80A6B20
thumb_func_start IsDoubleBattle
IsDoubleBattle: @ 80A6B20
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x1
ands r0, r1
bx lr
.pool
thumb_func_end battle_type_is_double
thumb_func_end IsDoubleBattle
thumb_func_start sub_80A6B30
sub_80A6B30: @ 80A6B30
@ -5807,7 +5807,7 @@ _080A8946:
bl sub_80A5C6C
lsls r0, 24
lsrs r7, r0, 24
bl battle_type_is_double
bl IsDoubleBattle
lsls r0, 24
cmp r0, 0
beq _080A8998

View File

@ -134,7 +134,7 @@ gUnknown_083054E0:: @ 83054E0
gUnknown_08305D0C:: @ 8305D0C
.incbin "baserom.gba", 0x305d0c, 0x20
gUnknown_08305D2C:: @ 8305D2C
gTrainerBackPicCoords:: @ 8305D2C
.incbin "baserom.gba", 0x305d2c, 0x20
@ 8305D4C
@ -146,7 +146,7 @@ gUnknown_08305D2C:: @ 8305D2C
gUnknown_08305DCC:: @ 8305DCC
.incbin "baserom.gba", 0x305dcc, 0x3ce0
gUnknown_08309AAC:: @ 8309AAC
gMonAnimationsSpriteAnimsPtrTable:: @ 8309AAC
.incbin "baserom.gba", 0x309aac, 0x6e0
@ 830A18C

View File

@ -808,8 +808,8 @@ struct BattleScripting
u8 atk6C_state;
u8 learnMoveState;
u8 field_20;
u8 field_21;
u8 field_22;
u8 reshowMainState;
u8 reshowHelperState;
u8 field_23;
u8 field_24;
u8 multiplayerId;
@ -842,6 +842,26 @@ void BattleMusicStop(void);
void sub_805E990(struct Pokemon *mon, u8 bank);
void sub_805EF14(void);
bool8 BattleInitAllSprites(u8 *state1, u8 *state2);
void sub_805E350(void);
bool8 BattleLoadAllHealthBoxesGfx(u8 state);
void LoadAndCreateEnemyShadowSprites(void);
void SetBankEnemyShadowSpriteCallback(u8 bank, u16 species);
void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank);
void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank);
void BattleLoadSubstituteSpriteGfx(u8 bank, bool8 arg1);
enum
{
BACK_PIC_BRENDAN,
BACK_PIC_MAY,
BACK_PIC_RED,
BACK_PIC_LEAF,
BACK_PIC_RS_BRENDAN,
BACK_PIC_RS_MAY,
BACK_PIC_WALLY,
BACK_PIC_STEVEN
};
void LoadBackTrainerBankSpriteGfx(u8 backPicId, u8 bank);
// rom_80A5C6C
u8 GetBankSide(u8 bank);

View File

@ -0,0 +1,7 @@
#ifndef GUARD_BATTLE_CONTROLLER_PLAYER_H
#define GUARD_BATTLE_CONTROLLER_PLAYER_H
void ActionSelectionCreateCursorAt(u8 cursorPos, u8 unused);
void ActionSelectionDestroyCursorAt(u8 cursorPos);
#endif // GUARD_BATTLE_CONTROLLER_PLAYER_H

View File

@ -1,6 +1,8 @@
#ifndef GUARD_BATTLE_CONTROLLERS_H
#define GUARD_BATTLE_CONTROLLERS_H
#include "battle_controller_player.h"
#define REQUEST_ALL_BATTLE 0x0
#define REQUEST_SPECIES_BATTLE 0x1
#define REQUEST_HELDITEM_BATTLE 0x2

View File

@ -0,0 +1,28 @@
#ifndef GUARD_BATTLE_INTERFACE_H
#define GUARD_BATTLE_INTERFACE_H
enum
{
HEALTHBOX_ALL,
HEALTHBOX_CURRENT_HP,
HEALTHBOX_MAX_HP,
HEALTHBOX_LEVEL,
HEALTHBOX_NICK,
HEALTHBOX_HEALTH_BAR,
HEALTHBOX_EXP_BAR,
HEALTHBOX_7,
HEALTHBOX_8,
HEALTHBOX_STATUS_ICON,
HEALTHBOX_SAFARI_ALL_TEXT,
HEALTHBOX_SAFARI_BALLS_TEXT
};
u8 CreateBankHealthboxSprites(u8 bank);
u8 CreateSafariPlayerHealthboxSprites(void);
void SetBankHealthboxSpritePos(u8 bank);
void SetHealthboxSpriteVisible(u8 healthboxSpriteId);
void SetHealthboxSpriteInvisible(u8 healthboxSpriteId);
void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId);
void nullsub_30(u8 healthboxSpriteId, bool8 isDoubleBattleBankOnly);
#endif // GUARD_BATTLE_INTERFACE_H

View File

@ -1,6 +1,7 @@
#ifndef GUARD_RESHOW_BATTLE_SCREEN_H
#define GUARD_RESHOW_BATTLE_SCREEN_H
void nullsub_35(void);
void ReshowBattleScreenAfterMenu(void);
#endif // GUARD_RESHOW_BATTLE_SCREEN_H

View File

@ -116,7 +116,7 @@ SECTIONS {
asm/battle_anim.o(.text);
asm/rom_80A5C6C.o(.text);
src/task.o(.text);
asm/reshow_battle_screen.o(.text);
src/reshow_battle_screen.o(.text);
asm/battle_anim_80A9C70.o(.text);
asm/title_screen.o(.text);
asm/field_screen.o(.text);

View File

@ -219,7 +219,7 @@ extern void sub_81B9150(void);
extern void sub_800AC34(void);
extern void sub_80B3AF8(u8 taskId); // cable club
extern void sub_8076918(u8 bank);
extern void sub_80729D0(u8 healthoxSpriteId);
extern void SetHealthboxSpriteVisible(u8 healthoxSpriteId);
extern void sub_81A56B4(void); // battle frontier 2
extern u8 sub_81A9E28(void); // battle frontier 2
extern void sub_81A56E8(u8 bank); // battle frontier 2
@ -2441,7 +2441,7 @@ static void sub_8039838(struct Sprite *sprite)
if (sprite->animEnded)
{
sub_8076918(sprite->tBank);
sub_80729D0(gHealthBoxesIds[sprite->tBank]);
SetHealthboxSpriteVisible(gHealthBoxesIds[sprite->tBank]);
sprite->callback = sub_8039894;
StartSpriteAnimIfDifferent(sprite, 0);
BeginNormalPaletteFade(0x20000, 0, 10, 0, 0x2108);

View File

@ -17,7 +17,7 @@ extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
extern const union AffineAnimCmd *const gUnknown_082FF618[];
extern const union AffineAnimCmd *const gUnknown_082FF694[];
extern const union AnimCmd *const gUnknown_082FF70C[];
extern const union AnimCmd *const *const gUnknown_08309AAC[NUM_SPECIES];
extern const union AnimCmd *const *const gMonAnimationsSpriteAnimsPtrTable[NUM_SPECIES];
extern const union AnimCmd *const *const gUnknown_0830536C[];
extern const u8 gUnknown_0831F578[];
@ -282,7 +282,7 @@ u16 sub_818D3E4(u16 species, u32 otId, u32 personality, u8 flags, s16 x, s16 y,
images[j].size = 0x800;
}
gUnknown_0203CCEC.tileTag = 0xFFFF;
gUnknown_0203CCEC.anims = gUnknown_08309AAC[species];
gUnknown_0203CCEC.anims = gMonAnimationsSpriteAnimsPtrTable[species];
gUnknown_0203CCEC.images = images;
if (flags2 == 0x01)
{

View File

@ -28,7 +28,7 @@ extern const u32 gBitTable[];
extern const struct SpriteTemplate gUnknown_08329D98[];
extern const struct SpriteTemplate gUnknown_08329DF8[];
extern const union AnimCmd* gUnknown_082FF70C[];
extern const union AnimCmd* const * const gUnknown_08309AAC[];
extern const union AnimCmd* const * const gMonAnimationsSpriteAnimsPtrTable[];
extern const union AnimCmd* const * const gUnknown_08305D0C[];
extern const union AnimCmd* const * const gUnknown_0830536C[];
extern const u8 gText_BadEgg[];
@ -165,9 +165,9 @@ void sub_806A068(u16 species, u8 bankIdentity)
if (bankIdentity == 0 || bankIdentity == 2)
gUnknown_0202499C.anims = gUnknown_082FF70C;
else if (species > 500)
gUnknown_0202499C.anims = gUnknown_08309AAC[species - 500];
gUnknown_0202499C.anims = gMonAnimationsSpriteAnimsPtrTable[species - 500];
else
gUnknown_0202499C.anims = gUnknown_08309AAC[species];
gUnknown_0202499C.anims = gMonAnimationsSpriteAnimsPtrTable[species];
}
void sub_806A12C(u16 trainerSpriteId, u8 bankIdentity)

365
src/reshow_battle_screen.c Normal file
View File

@ -0,0 +1,365 @@
#include "global.h"
#include "reshow_battle_screen.h"
#include "battle.h"
#include "palette.h"
#include "main.h"
#include "unknown_task.h"
#include "text.h"
#include "gpu_regs.h"
#include "bg.h"
#include "battle_controllers.h"
#include "link.h"
#include "sprite.h"
#include "species.h"
#include "battle_interface.h"
extern u16 gBattle_BG0_X;
extern u16 gBattle_BG0_Y;
extern u16 gBattle_BG1_X;
extern u16 gBattle_BG1_Y;
extern u16 gBattle_BG2_X;
extern u16 gBattle_BG2_Y;
extern u16 gBattle_BG3_X;
extern u16 gBattle_BG3_Y;
extern u8 gReservedSpritePaletteCount;
extern u8 gActionSelectionCursor[BATTLE_BANKS_COUNT];
extern u8 gBankInMenu;
extern u16 gBattlePartyID[BATTLE_BANKS_COUNT];
extern u8 gNoOfAllBanks;
extern u32 gBattleTypeFlags;
extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT];
extern u8 gBattleMonForms[BATTLE_BANKS_COUNT];
extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT];
extern struct SpriteTemplate gUnknown_0202499C;
extern const union AnimCmd * const * const gMonAnimationsSpriteAnimsPtrTable[];
extern void dp12_8087EA4(void);
extern void trs_config(void);
extern bool8 IsDoubleBattle(void);
extern u8 sub_80A614C(u8 bank);
extern u8 sub_80A6138(u8 bank);
extern u8 sub_80A82E4(u8 bank);
extern void sub_806A068(u16 species, u8 bankIdentity);
extern void sub_806A12C(u16 backPicId, u8 bankIdentity);
extern u8 sub_80A5C6C(u8 bank, u8 caseId);
// this file's functions
static void CB2_ReshowBattleScreenAfterMenu(void);
static bool8 LoadBankSpriteGfx(u8 bank);
static void CreateBankSprite(u8 bank);
static void CreateHealthboxSprite(u8 bank);
static void sub_80A95F4(void);
void nullsub_35(void)
{
}
void ReshowBattleScreenAfterMenu(void)
{
gPaletteFade.bufferTransferDisabled = 1;
SetHBlankCallback(NULL);
SetVBlankCallback(NULL);
SetGpuReg(REG_OFFSET_MOSAIC, 0);
gBattleScripting.reshowMainState = 0;
gBattleScripting.reshowHelperState = 0;
SetMainCallback2(CB2_ReshowBattleScreenAfterMenu);
}
static void CB2_ReshowBattleScreenAfterMenu(void)
{
switch (gBattleScripting.reshowMainState)
{
case 0:
dp12_8087EA4();
trs_config();
SetBgAttribute(1, BG_CTRL_ATTR_VISIBLE, 0);
SetBgAttribute(2, BG_CTRL_ATTR_VISIBLE, 0);
ShowBg(0);
ShowBg(1);
ShowBg(2);
ShowBg(3);
ResetPaletteFade();
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
gBattle_BG1_X = 0;
gBattle_BG1_Y = 0;
gBattle_BG2_X = 0;
gBattle_BG2_Y = 0;
gBattle_BG3_X = 0;
gBattle_BG3_Y = 0;
break;
case 1:
CpuFastFill(0, (void*)(VRAM), VRAM_SIZE);
break;
case 2:
LoadBattleTextboxAndBackground();
break;
case 3:
ResetSpriteData();
break;
case 4:
FreeAllSpritePalettes();
gReservedSpritePaletteCount = 4;
break;
case 5:
sub_805E350();
break;
case 6:
if (BattleLoadAllHealthBoxesGfx(gBattleScripting.reshowHelperState))
{
gBattleScripting.reshowHelperState = 0;
}
else
{
gBattleScripting.reshowHelperState++;
gBattleScripting.reshowMainState--;
}
break;
case 7:
if (!LoadBankSpriteGfx(0))
gBattleScripting.reshowMainState--;
break;
case 8:
if (!LoadBankSpriteGfx(1))
gBattleScripting.reshowMainState--;
break;
case 9:
if (!LoadBankSpriteGfx(2))
gBattleScripting.reshowMainState--;
break;
case 10:
if (!LoadBankSpriteGfx(3))
gBattleScripting.reshowMainState--;
break;
case 11:
CreateBankSprite(0);
break;
case 12:
CreateBankSprite(1);
break;
case 13:
CreateBankSprite(2);
break;
case 14:
CreateBankSprite(3);
break;
case 15:
CreateHealthboxSprite(0);
break;
case 16:
CreateHealthboxSprite(1);
break;
case 17:
CreateHealthboxSprite(2);
break;
case 18:
CreateHealthboxSprite(3);
break;
case 19:
{
u8 opponentBank;
u16 species;
LoadAndCreateEnemyShadowSprites();
opponentBank = GetBankByIdentity(IDENTITY_OPPONENT_MON1);
species = GetMonData(&gEnemyParty[gBattlePartyID[opponentBank]], MON_DATA_SPECIES);
SetBankEnemyShadowSpriteCallback(opponentBank, species);
if (IsDoubleBattle())
{
opponentBank = GetBankByIdentity(IDENTITY_OPPONENT_MON2);
species = GetMonData(&gEnemyParty[gBattlePartyID[opponentBank]], MON_DATA_SPECIES);
SetBankEnemyShadowSpriteCallback(opponentBank, species);
}
ActionSelectionCreateCursorAt(gActionSelectionCursor[gBankInMenu], 0);
if (gLinkVSyncDisabled != 0 && gReceivedRemoteLinkPlayers != 0)
{
sub_800E0E8();
sub_800DFB4(0, 0);
}
}
break;
default:
SetVBlankCallback(VBlankCB_Battle);
sub_80A95F4();
BeginHardwarePaletteFade(0xFF, 0, 0x10, 0, 1);
gPaletteFade.bufferTransferDisabled = 0;
SetMainCallback2(BattleMainCB2);
sub_805EF14();
break;
}
gBattleScripting.reshowMainState++;
}
// todo: find a better place for the struct declaration
struct BGCntrlBitfield
{
volatile u16 priority:2;
volatile u16 charBaseBlock:2;
volatile u16 field_0_2:4;
volatile u16 field_1_0:5;
volatile u16 areaOverflowMode:1;
volatile u16 screenSize:2;
};
static void sub_80A95F4(void)
{
struct BGCntrlBitfield *regBgcnt1, *regBgcnt2;
regBgcnt1 = (struct BGCntrlBitfield *)(&REG_BG1CNT);
regBgcnt1->charBaseBlock = 0;
regBgcnt2 = (struct BGCntrlBitfield *)(&REG_BG2CNT);
regBgcnt2->charBaseBlock = 0;
}
static bool8 LoadBankSpriteGfx(u8 bank)
{
if (bank < gNoOfAllBanks)
{
if (GetBankSide(bank) != SIDE_PLAYER)
{
if (!gBattleSpritesDataPtr->bankData[bank].behindSubstitute)
BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[bank]], bank);
else
BattleLoadSubstituteSpriteGfx(bank, FALSE);
}
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && bank == 0)
LoadBackTrainerBankSpriteGfx(gSaveBlock2Ptr->playerGender, bank);
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0)
LoadBackTrainerBankSpriteGfx(BACK_PIC_WALLY, bank);
else if (!gBattleSpritesDataPtr->bankData[bank].behindSubstitute)
BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlePartyID[bank]], bank);
else
BattleLoadSubstituteSpriteGfx(bank, FALSE);
gBattleScripting.reshowHelperState = 0;
}
return TRUE;
}
// todo: get rid of it once the struct is declared in a header
struct MonCoords
{
// This would use a bitfield, but sub_8079F44
// uses it as a u8 and casting won't match.
u8 coords; // u8 x:4, y:4;
u8 y_offset;
};
extern const struct MonCoords gTrainerBackPicCoords[];
static void CreateBankSprite(u8 bank)
{
if (bank < gNoOfAllBanks)
{
u8 posY;
if (gBattleSpritesDataPtr->bankData[bank].behindSubstitute)
posY = sub_80A614C(bank);
else
posY = sub_80A6138(bank);
if (GetBankSide(bank) != SIDE_PLAYER)
{
if (GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_HP) == 0)
return;
sub_806A068(GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankIdentity(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(bank, 2), posY, sub_80A82E4(bank));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_CASTFORM)
gSprites[gBankSpriteIds[bank]].anims = gMonAnimationsSpriteAnimsPtrTable[SPECIES_CASTFORM];
}
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && bank == 0)
{
sub_806A12C(gSaveBlock2Ptr->playerGender, GetBankIdentity(IDENTITY_PLAYER_MON1));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, 0x50,
(8 - gTrainerBackPicCoords[gSaveBlock2Ptr->playerGender].coords) * 4 + 80,
sub_80A82E4(0));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
}
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0)
{
sub_806A12C(BACK_PIC_WALLY, GetBankIdentity(0));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, 0x50,
(8 - gTrainerBackPicCoords[BACK_PIC_WALLY].coords) * 4 + 80,
sub_80A82E4(0));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
}
else
{
if (GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_HP) == 0)
return;
sub_806A068(GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES), GetBankIdentity(bank));
gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(bank, 2), posY, sub_80A82E4(bank));
gSprites[gBankSpriteIds[bank]].oam.paletteNum = bank;
gSprites[gBankSpriteIds[bank]].callback = SpriteCallbackDummy;
gSprites[gBankSpriteIds[bank]].data0 = bank;
gSprites[gBankSpriteIds[bank]].data2 = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_SPECIES);
StartSpriteAnim(&gSprites[gBankSpriteIds[bank]], gBattleMonForms[bank]);
if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_CASTFORM)
gSprites[gBankSpriteIds[bank]].anims = gMonAnimationsSpriteAnimsPtrTable[SPECIES_CASTFORM];
}
gSprites[gBankSpriteIds[bank]].invisible = gBattleSpritesDataPtr->bankData[bank].invisible;
}
}
static void CreateHealthboxSprite(u8 bank)
{
if (bank < gNoOfAllBanks)
{
u8 healthboxSpriteId;
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && bank == 0)
healthboxSpriteId = CreateSafariPlayerHealthboxSprites();
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0)
return;
else
healthboxSpriteId = CreateBankHealthboxSprites(bank);
gHealthBoxesIds[bank] = healthboxSpriteId;
SetBankHealthboxSpritePos(bank);
SetHealthboxSpriteVisible(healthboxSpriteId);
if (GetBankSide(bank) != SIDE_PLAYER)
UpdateHealthboxAttribute(gHealthBoxesIds[bank], &gEnemyParty[gBattlePartyID[bank]], HEALTHBOX_ALL);
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
UpdateHealthboxAttribute(gHealthBoxesIds[bank], &gPlayerParty[gBattlePartyID[bank]], HEALTHBOX_SAFARI_ALL_TEXT);
else
UpdateHealthboxAttribute(gHealthBoxesIds[bank], &gPlayerParty[gBattlePartyID[bank]], HEALTHBOX_ALL);
if (GetBankIdentity(bank) == IDENTITY_OPPONENT_MON2 || GetBankIdentity(bank) == IDENTITY_PLAYER_MON2)
nullsub_30(gHealthBoxesIds[bank], TRUE);
else
nullsub_30(gHealthBoxesIds[bank], FALSE);
if (GetBankSide(bank) != SIDE_PLAYER)
{
if (GetMonData(&gEnemyParty[gBattlePartyID[bank]], MON_DATA_HP) == 0)
SetHealthboxSpriteInvisible(healthboxSpriteId);
}
else if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI))
{
if (GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_HP) == 0)
SetHealthboxSpriteInvisible(healthboxSpriteId);
}
}
}