Merge pull request #88 from DizzyEggg/decompile_battle_interface

decompile battle interface
This commit is contained in:
Diegoisawesome 2017-10-20 12:39:55 -05:00 committed by GitHub
commit 35a96cb0c0
24 changed files with 2781 additions and 6013 deletions

View File

@ -1955,8 +1955,8 @@ _0805E1AE:
bx r1
thumb_func_end BattleLoadAllHealthBoxesGfx
thumb_func_start load_gfxc_health_bar
load_gfxc_health_bar: @ 805E1B8
thumb_func_start LoadBattleBarGfx
LoadBattleBarGfx: @ 805E1B8
push {lr}
ldr r0, =gUnknown_08C093F0
ldr r1, =gMonSpritesGfxPtr
@ -1969,7 +1969,7 @@ load_gfxc_health_bar: @ 805E1B8
pop {r0}
bx r0
.pool
thumb_func_end load_gfxc_health_bar
thumb_func_end LoadBattleBarGfx
thumb_func_start BattleInitAllSprites
BattleInitAllSprites: @ 805E1D8
@ -2048,7 +2048,7 @@ _0805E260:
adds r0, r1, r0
ldrb r0, [r0]
movs r1, 0
bl nullsub_30
bl DummyBattleInterfaceFunc
b _0805E30E
.pool
_0805E288:
@ -2056,7 +2056,7 @@ _0805E288:
adds r0, r1, r0
ldrb r0, [r0]
movs r1, 0x1
bl nullsub_30
bl DummyBattleInterfaceFunc
b _0805E30E
.pool
_0805E29C:
@ -2857,7 +2857,7 @@ sub_805E990: @ 805E990
lsls r1, 16
asrs r1, 16
adds r0, r4, 0
bl sub_8075060
bl GetHPBarLevel
lsls r0, 24
lsrs r0, 24
cmp r0, 0x1
@ -2997,7 +2997,7 @@ sub_805EAB4: @ 805EAB4
lsls r1, 16
asrs r1, 16
adds r0, r4, 0
bl sub_8075060
bl GetHPBarLevel
lsls r0, 24
lsrs r0, 24
pop {r4,r5}
@ -3796,7 +3796,7 @@ sub_805F110: @ 805F110
lsls r1, 16
asrs r1, 16
adds r0, r4, 0
bl sub_8075060
bl GetHPBarLevel
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2

View File

@ -2379,7 +2379,7 @@ _0817185A:
movs r1, 0
strb r1, [r0]
movs r0, 0x1
bl sub_8072A88
bl UpdateOamPriorityInAllHealthboxes
bl m4aMPlayAllStop
ldr r0, =0x00000213
bl PlaySE
@ -2879,7 +2879,7 @@ _08171C24:
ldr r0, =gDoingBattleAnim
strb r6, [r0]
movs r0, 0x1
bl sub_8072A88
bl UpdateOamPriorityInAllHealthboxes
_08171C8A:
pop {r4-r7}
pop {r0}
@ -2974,7 +2974,7 @@ _08171D3E:
movs r0, 0
strb r0, [r1]
movs r0, 0x1
bl sub_8072A88
bl UpdateOamPriorityInAllHealthboxes
_08171D52:
pop {r4}
pop {r0}

View File

@ -985,7 +985,7 @@ sub_8064BC0: @ 8064BC0
adds r0, r5
ldrb r0, [r0]
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
b _08064C0C
.pool
_08064C08:
@ -5124,7 +5124,7 @@ sub_80670A0: @ 80670A0
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl load_gfxc_health_bar
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
@ -5171,7 +5171,7 @@ sub_80670A0: @ 80670A0
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl sub_807294C
bl SetBattleBarStruct
b _0806715A
.pool
_08067130:
@ -5193,7 +5193,7 @@ _08067130:
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl sub_807294C
bl SetBattleBarStruct
_0806715A:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
@ -5954,7 +5954,7 @@ _080677B4:
subs r4, 0x2
adds r3, r4
ldrb r3, [r3]
bl sub_80735DC
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2

View File

@ -509,7 +509,7 @@ bx_t4_healthbar_update: @ 814B2D0
adds r0, r6
ldrb r0, [r0]
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
b _0814B332
.pool
_0814B318:
@ -4433,7 +4433,7 @@ sub_814D63C: @ 814D63C
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl load_gfxc_health_bar
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
@ -4480,7 +4480,7 @@ sub_814D63C: @ 814D63C
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl sub_807294C
bl SetBattleBarStruct
b _0814D6F6
.pool
_0814D6CC:
@ -4502,7 +4502,7 @@ _0814D6CC:
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl sub_807294C
bl SetBattleBarStruct
_0814D6F6:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
@ -5349,7 +5349,7 @@ _0814DE08:
subs r4, 0x2
adds r3, r4
ldrb r3, [r3]
bl sub_80735DC
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2

View File

@ -1079,7 +1079,7 @@ sub_805FA70: @ 805FA70
adds r0, r5
ldrb r0, [r0]
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
b _0805FABC
.pool
_0805FAB8:
@ -5574,7 +5574,7 @@ sub_8062294: @ 8062294
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl load_gfxc_health_bar
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
@ -5621,7 +5621,7 @@ sub_8062294: @ 8062294
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl sub_807294C
bl SetBattleBarStruct
b _0806234E
.pool
_08062324:
@ -5643,7 +5643,7 @@ _08062324:
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl sub_807294C
bl SetBattleBarStruct
_0806234E:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
@ -6409,7 +6409,7 @@ _080629B4:
subs r4, 0x2
adds r3, r4
ldrb r3, [r3]
bl sub_80735DC
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2

View File

@ -403,7 +403,7 @@ _080577DC:
ands r0, r2
cmp r0, 0
beq _080577E8
bl sub_8073314
bl SwapHpBarsWithHpText
_080577E8:
pop {r4-r7}
pop {r0}
@ -3278,7 +3278,7 @@ bx_t1_healthbar_update: @ 8059130
adds r0, r6
ldrb r0, [r0]
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
b _08059192
.pool
_08059178:
@ -3557,7 +3557,7 @@ sub_8059330: @ 8059330
negs r0, r0
str r0, [sp]
mov r0, r10
bl sub_807294C
bl SetBattleBarStruct
movs r0, 0x21
bl PlaySE
ldr r0, =sub_8059400
@ -8936,7 +8936,7 @@ sub_805C410: @ 805C410
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl load_gfxc_health_bar
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
@ -8992,7 +8992,7 @@ _0805C44A:
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl sub_807294C
bl SetBattleBarStruct
b _0805C4F2
.pool
_0805C4B4:
@ -9016,14 +9016,14 @@ _0805C4B4:
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl sub_807294C
bl SetBattleBarStruct
mov r2, r9
ldrb r0, [r2]
adds r0, r4
ldrb r0, [r0]
movs r1, 0
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
_0805C4F2:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
@ -9067,7 +9067,7 @@ sub_805C528: @ 805C528
.pool
_0805C560:
movs r0, 0x1
bl load_gfxc_health_bar
bl LoadBattleBarGfx
adds r0, r4, 0
movs r1, 0xB
bl GetMonData
@ -10038,7 +10038,7 @@ _0805CDA4:
subs r4, 0x2
adds r3, r4
ldrb r3, [r3]
bl sub_80735DC
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2

View File

@ -510,7 +510,7 @@ bx_t3_healthbar_update: @ 81BB214
adds r0, r6
ldrb r0, [r0]
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
b _081BB276
.pool
_081BB25C:
@ -789,7 +789,7 @@ sub_81BB414: @ 81BB414
negs r0, r0
str r0, [sp]
mov r0, r10
bl sub_807294C
bl SetBattleBarStruct
movs r0, 0x21
bl PlaySE
ldr r0, =sub_81BB4E4
@ -5162,7 +5162,7 @@ sub_81BDC10: @ 81BDC10
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl load_gfxc_health_bar
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
@ -5209,7 +5209,7 @@ sub_81BDC10: @ 81BDC10
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl sub_807294C
bl SetBattleBarStruct
b _081BDCCA
.pool
_081BDCA0:
@ -5231,7 +5231,7 @@ _081BDCA0:
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl sub_807294C
bl SetBattleBarStruct
_081BDCCA:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
@ -5275,7 +5275,7 @@ sub_81BDD00: @ 81BDD00
.pool
_081BDD38:
movs r0, 0x1
bl load_gfxc_health_bar
bl LoadBattleBarGfx
adds r0, r4, 0
movs r1, 0xB
bl GetMonData
@ -6082,7 +6082,7 @@ _081BE404:
subs r4, 0x2
adds r3, r4
ldrb r3, [r3]
bl sub_80735DC
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2

View File

@ -966,7 +966,7 @@ sub_8186D04: @ 8186D04
adds r0, r5
ldrb r0, [r0]
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
b _08186D50
.pool
_08186D4C:
@ -4863,7 +4863,7 @@ sub_8188FD0: @ 8188FD0
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl load_gfxc_health_bar
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
@ -4910,7 +4910,7 @@ sub_8188FD0: @ 8188FD0
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl sub_807294C
bl SetBattleBarStruct
b _0818908A
.pool
_08189060:
@ -4932,7 +4932,7 @@ _08189060:
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl sub_807294C
bl SetBattleBarStruct
_0818908A:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
@ -5693,7 +5693,7 @@ _081896E4:
subs r4, 0x2
adds r3, r4
ldrb r3, [r3]
bl sub_80735DC
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2

View File

@ -885,7 +885,7 @@ sub_818A0A4: @ 818A0A4
adds r0, r6
ldrb r0, [r0]
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
b _0818A106
.pool
_0818A0EC:
@ -5007,7 +5007,7 @@ sub_818C5E8: @ 818C5E8
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl load_gfxc_health_bar
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
@ -5054,7 +5054,7 @@ sub_818C5E8: @ 818C5E8
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl sub_807294C
bl SetBattleBarStruct
b _0818C6B2
.pool
_0818C678:
@ -5076,14 +5076,14 @@ _0818C678:
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl sub_807294C
bl SetBattleBarStruct
mov r1, r9
ldrb r0, [r1]
adds r0, r4
ldrb r0, [r0]
movs r1, 0
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
_0818C6B2:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
@ -5878,7 +5878,7 @@ _0818CD60:
subs r4, 0x2
adds r3, r4
ldrb r3, [r3]
bl sub_80735DC
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2

View File

@ -676,7 +676,7 @@ sub_8168934: @ 8168934
adds r0, r6
ldrb r0, [r0]
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
b _08168996
.pool
_0816897C:
@ -3836,7 +3836,7 @@ sub_816A5D4: @ 816A5D4
push {r6,r7}
sub sp, 0x4
movs r0, 0
bl load_gfxc_health_bar
bl LoadBattleBarGfx
ldr r3, =gBattleBufferA
ldr r0, =gActiveBank
mov r9, r0
@ -3883,7 +3883,7 @@ sub_816A5D4: @ 816A5D4
ldrb r1, [r1]
str r7, [sp]
mov r2, r8
bl sub_807294C
bl SetBattleBarStruct
b _0816A69E
.pool
_0816A664:
@ -3905,14 +3905,14 @@ _0816A664:
ldrb r1, [r1]
str r7, [sp]
movs r3, 0
bl sub_807294C
bl SetBattleBarStruct
mov r1, r9
ldrb r0, [r1]
adds r0, r4
ldrb r0, [r0]
movs r1, 0
movs r2, 0
bl heathbar_draw_hp
bl UpdateHpTextInHealthbox
_0816A69E:
ldr r1, =gBattleBankFunc
ldr r0, =gActiveBank
@ -4645,7 +4645,7 @@ _0816ACA8:
subs r3, 0x2
adds r4, r3
ldrb r3, [r4]
bl sub_80735DC
bl CreatePartyStatusSummarySprites
ldr r2, =gUnknown_020244B4
ldrb r1, [r5]
adds r1, r2

File diff suppressed because it is too large Load Diff

View File

@ -5441,7 +5441,7 @@ sub_81B2E64: @ 81B2E64
mov r2, r9
lsls r1, r2, 16
asrs r1, 16
bl sub_8075060
bl GetHPBarLevel
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2
@ -10452,7 +10452,7 @@ sub_81B5A8C: @ 81B5A8C
asrs r2, 16
adds r0, r1, 0
adds r1, r2, 0
bl sub_8075060
bl GetHPBarLevel
lsls r0, 24
lsrs r0, 24
cmp r0, 0x2

View File

@ -5954,7 +5954,7 @@ _0807A488:
asrs r0, 16
lsls r1, 16
asrs r1, 16
bl sub_8075060
bl GetHPBarLevel
ldr r1, [r7]
adds r1, 0x5D
adds r1, r6
@ -5997,7 +5997,7 @@ _0807A4E8:
asrs r0, 16
lsls r1, 16
asrs r1, 16
bl sub_8075060
bl GetHPBarLevel
ldr r1, [r7]
adds r1, 0x63
adds r1, r6

View File

@ -1,180 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2, 0
gUnknown_0832C138:: @ 832C138
.byte 0x00, 0x40, 0x00, 0xc0, 0x00, 0x04, 0x00, 0x00
.align 2
gUnknown_0832C140:: @ 832C140
spr_template 0xd6ff, 0xd6ff, gUnknown_0832C138, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_0832C158:: @ 832C158
spr_template 0xd700, 0xd6ff, gUnknown_0832C138, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_0832C170:: @ 832C170
spr_template 0xd701, 0xd6ff, gUnknown_0832C138, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_0832C188:: @ 832C188
spr_template 0xd702, 0xd6ff, gUnknown_0832C138, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_0832C1A0:: @ 832C1A0
spr_template 0xd70b, 0xd6ff, gUnknown_0832C138, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
.align 2
gUnknown_0832C1B8:: @ 832C1B8
.byte 0x00, 0x40, 0x00, 0x40, 0x00, 0x04, 0x00, 0x00
.align 2
gUnknown_0832C1C0:: @ 832C1C0
spr_template 0xd704, 0xd704, gUnknown_0832C1B8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80728B4
.align 2
gUnknown_0832C1D8:: @ 832C1D8
spr_template 0xd705, 0xd704, gUnknown_0832C1B8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80728B4
.align 2
gUnknown_0832C1F0:: @ 832C1F0
spr_template 0xd706, 0xd704, gUnknown_0832C1B8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80728B4
.align 2
gUnknown_0832C208:: @ 832C208
spr_template 0xd707, 0xd704, gUnknown_0832C1B8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80728B4
.align 2
gUnknown_0832C220:: @ 832C220
.byte 0xf0, 0x00, 0x0d, 0x40, 0x30, 0x00, 0x08, 0x42
.byte 0xf0, 0x20, 0x05, 0x43, 0x10, 0x20, 0x45, 0x43
.byte 0x30, 0x20, 0x85, 0x43
.align 2
gUnknown_0832C234:: @ 832C234
.byte 0xf0, 0x00, 0x0d, 0x44, 0x30, 0x00, 0x08, 0x46
.byte 0xf0, 0x20, 0x05, 0x47, 0x10, 0x20, 0x45, 0x47
.byte 0x30, 0x20, 0x85, 0x47
.align 2
gUnknown_0832C248:: @ 832C248
.byte 0xf0, 0x00, 0x0d, 0x40, 0x30, 0x00, 0x08, 0x42
.align 2
gUnknown_0832C250:: @ 832C250
.byte 0xf0, 0x00, 0x0d, 0x40, 0x30, 0x00, 0x08, 0x42
.align 2
gUnknown_0832C258:: @ 832C258
.byte 0xf0, 0x00, 0x05, 0x40, 0x10, 0x00, 0x45, 0x40
.align 2
gUnknown_0832C260:: @ 832C260
.byte 0xf0, 0x00, 0x05, 0x40, 0x10, 0x00, 0x45, 0x40
.byte 0xe0, 0x00, 0x80, 0x40
.align 2
gUnknown_0832C26C:: @ 832C26C
.4byte 0x00000005, gUnknown_0832C220
.4byte 0x00000002, gUnknown_0832C248
.4byte 0x00000005, gUnknown_0832C234
.4byte 0x00000002, gUnknown_0832C250
.align 2
gUnknown_0832C28C:: @ 832C28C
.4byte 0x00000002, gUnknown_0832C258
.4byte 0x00000003, gUnknown_0832C260
.align 2
gUnknown_0832C29C:: @ 832C29C
.byte 0xa0, 0x00, 0x05, 0x40, 0xc0, 0x00, 0x45, 0x40
.byte 0xe0, 0x00, 0x85, 0x40, 0x00, 0x00, 0xc5, 0x40
.align 2
gUnknown_0832C2AC:: @ 832C2AC
.byte 0xa0, 0x00, 0x05, 0x40, 0xc0, 0x00, 0x45, 0x40
.byte 0xe0, 0x00, 0x85, 0x40, 0x00, 0x00, 0x85, 0x40
.byte 0x20, 0x00, 0x85, 0x40, 0x40, 0x00, 0xc5, 0x40
.align 2
gUnknown_0832C2C4:: @ 832C2C4
.4byte 0x00000004, gUnknown_0832C29C
.align 2
gUnknown_0832C2CC:: @ 832C2CC
.4byte 0x00000006, gUnknown_0832C2AC
.align 2
gUnknown_0832C2D4:: @ 832C2D4
.2byte 0x0000, 0x0000, 0x3333, 0x3333, 0x4444, 0x4444, 0x2222, 0x2222
.2byte 0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777
.2byte 0x0000, 0x0000, 0x3333, 0x3333, 0x4444, 0x4444, 0x2222, 0x2222
.2byte 0x7777, 0x7777, 0x7777, 0x7717, 0x1777, 0x7177, 0x7777, 0x7771
.2byte 0x0000, 0x0000, 0x3333, 0x3333, 0x4444, 0x4444, 0x2222, 0x2222
.2byte 0x7777, 0x7777, 0x7777, 0x7111, 0x7777, 0x7171, 0x7777, 0x7111
.align 2
gUnknown_0832C334:: @ 832C334
obj_tiles gBattleInterface_BallStatusBarGfx, 0x0200, 0xd70c
.align 2
gUnknown_0832C33C:: @ 832C33C
obj_pal gBattleInterface_BallStatusBarPal, 0xd710
.align 2
gUnknown_0832C344:: @ 832C344
obj_pal gBattleInterface_BallDisplayPal, 0xd712
.align 2
gUnknown_0832C34C:: @ 832C34C
obj_tiles gBattleInterface_BallDisplayGfx, 0x0080, 0xd714
.align 2
gUnknown_0832C354:: @ 832C354
.byte 0x00, 0x40, 0x00, 0xc0, 0x00, 0x04, 0x00, 0x00
.align 2
gUnknown_0832C35C:: @ 832C35C
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00
.align 2
gUnknown_0832C364:: @ 832C364
spr_template 0xd70c, 0xd710, gUnknown_0832C138, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_8074078
.align 2
gUnknown_0832C37C:: @ 832C37C
spr_template 0xd70c, 0xd710, gUnknown_0832C138, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_8074078
.align 2
gUnknown_0832C394:: @ 832C394
spr_template 0xd714, 0xd712, gUnknown_0832C35C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80740C4
.align 2
gUnknown_0832C3AC:: @ 832C3AC
spr_template 0xd714, 0xd712, gUnknown_0832C35C, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_80740C4
.align 2
gUnknown_0832C3C4:: @ 832C3C4
.byte 0xfc, 0x01, 0x01, 0xfc, 0x02, 0x02, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.align 2
gUnknown_0832C3D8:: @ 832C3D8
.byte 0xfc, 0x01, 0x01, 0xfc, 0x02, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00
.align 2
gUnknown_0832C3EC:: @ 832C3EC
.byte 0x98, 0x61, 0xf7, 0x0e, 0x94, 0x46, 0xd1, 0x72
.byte 0xdc, 0x29, 0x00, 0x00
.align 2
gUnknown_0832C3F8:: @ 832C3F8
.byte 0x00, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00

View File

@ -39,7 +39,7 @@ gBattleInterface_BallDisplayPal:: @ 8C11BBC
.incbin "graphics/battle_interface/ball_display.gbapal"
.align 2
gUnknown_08C11BDC:: @ 8C11BDC
gHealthboxElementsGfxTable:: @ 8C11BDC
.incbin "baserom.gba", 0xc11bdc, 0x840
.align 2

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

View File

@ -888,6 +888,19 @@ struct BattleSpriteInfo
struct BattleAnimationInfo
{
u16 field; // to fill up later
u8 field_2;
u8 field_3;
u8 field_4;
u8 field_5;
u8 field_6;
u8 field_7;
u8 field_8;
u8 field_9_x1 : 1;
u8 field_9_x2 : 1;
u8 field_9_x1C : 3;
u8 field_9_x20 : 1;
u8 field_9_x40 : 1;
u8 field_9_x80 : 1;
};
struct BattleHealthboxInfo
@ -910,11 +923,21 @@ struct BattleHealthboxInfo
u8 field_B;
};
struct BattleBarInfo
{
u8 healthboxSpriteId;
s32 maxValue;
s32 currentValue;
s32 field_C;
s32 field_10;
};
struct BattleSpriteData
{
struct BattleSpriteInfo *bankData;
struct BattleHealthboxInfo *healthBoxesData;
struct BattleAnimationInfo *animationData;
struct BattleBarInfo *battleBars;
};
extern struct BattleSpriteData *gBattleSpritesDataPtr;
@ -933,6 +956,8 @@ struct MonSpritesGfx
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
void* sprites[4];
struct SpriteTemplate templates[4];
u8 field_74[0x100];
u8 *fontPixels;
};
extern struct BattleSpritesGfx* gMonSpritesGfx;

View File

@ -39,8 +39,8 @@ struct BattleAnimBackground
#define ANIM_ARGS_COUNT 8
#define PAN_ATTACKER_PLAYER -64
#define PAN_ATTACKER_OPPONENT 63
#define PAN_SIDE_PLAYER -64
#define PAN_SIDE_OPPONENT 63
extern void (*gAnimScriptCallback)(void);
extern bool8 gAnimScriptActive;

View File

@ -1,6 +1,22 @@
#ifndef GUARD_BATTLE_INTERFACE_H
#define GUARD_BATTLE_INTERFACE_H
#include "battle_controllers.h"
#define TAG_HEALTHBOX_PLAYER1_TILE 0xD6FF
#define TAG_HEALTHBOX_PLAYER2_TILE 0xD700
#define TAG_HEALTHBOX_OPPONENT1_TILE 0xD701
#define TAG_HEALTHBOX_OPPONENT2_TILE 0xD702
#define TAG_HEALTHBOX_SAFARI_TILE 0xD70B
#define TAG_STATUS_SUMMARY_BAR_TILE 0xD70C
#define TAG_STATUS_SUMMARY_BALLS_TILE 0xD714
#define TAG_HEALTHBOX_PAL 0xD6FF
#define TAG_STATUS_SUMMARY_BAR_PAL 0xD710
#define TAG_STATUS_SUMMARY_BALLS_PAL 0xD712
enum
{
HEALTHBOX_ALL,
@ -10,8 +26,8 @@ enum
HEALTHBOX_NICK,
HEALTHBOX_HEALTH_BAR,
HEALTHBOX_EXP_BAR,
HEALTHBOX_7,
HEALTHBOX_8,
HEALTHBOX_UNUSED_7,
HEALTHBOX_UNUSED_8,
HEALTHBOX_STATUS_ICON,
HEALTHBOX_SAFARI_ALL_TEXT,
HEALTHBOX_SAFARI_BALLS_TEXT
@ -19,11 +35,20 @@ enum
u8 CreateBankHealthboxSprites(u8 bank);
u8 CreateSafariPlayerHealthboxSprites(void);
void SetBankHealthboxSpritePos(u8 bank);
void SetHealthboxSpriteVisible(u8 healthboxSpriteId);
void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 field_C);
void SetHealthboxSpriteInvisible(u8 healthboxSpriteId);
void SetHealthboxSpriteVisible(u8 healthboxSpriteId);
void DestoryHealthboxSprite(u8 healthboxSpriteId);
void DummyBattleInterfaceFunc(u8 healthboxSpriteId, bool8 isDoubleBattleBankOnly);
void UpdateOamPriorityInAllHealthboxes(u8 priority);
void SetBankHealthboxSpritePos(u8 bank);
void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent);
void SwapHpBarsWithHpText(void);
u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart);
void sub_8073C30(u8 taskId);
void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId);
void nullsub_30(u8 healthboxSpriteId, bool8 isDoubleBattleBankOnly);
void sub_8072A88(u8 arg0);
s32 sub_8074AA0(u8 bank, u8 healthboxSpriteId, u8 whichBar, u8 arg3);
u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale);
u8 GetHPBarLevel(s16 hp, s16 maxhp);
#endif // GUARD_BATTLE_INTERFACE_H

View File

@ -39,18 +39,18 @@ struct PlttData
struct OamData
{
/*0x00*/ u32 y:8;
/*0x01*/ u32 affineMode:2;
u32 objMode:2;
u32 mosaic:1;
u32 bpp:1;
u32 shape:2;
/*0x01*/ u32 affineMode:2; // 0x1, 0x2 -> 0x4
u32 objMode:2; // 0x4, 0x8 -> 0xC
u32 mosaic:1; // 0x10
u32 bpp:1; // 0x20
u32 shape:2; // 0x40, 0x80 -> 0xC0
/*0x02*/ u32 x:9;
u32 matrixNum:5; // bits 3/4 are h-flip/v-flip if not in affine mode
u32 size:2;
/*0x04*/ u16 tileNum:10;
u16 priority:2;
/*0x04*/ u16 tileNum:10; // 0x33F
u16 priority:2; // 0x400, 0x800 -> 0xC00
u16 paletteNum:4;
/*0x06*/ u16 affineParam;
};

View File

@ -79,7 +79,7 @@ SECTIONS {
src/blend_palette.o(.text);
asm/daycare.o(.text);
src/egg_hatch.o(.text);
asm/battle_interface.o(.text);
src/battle_interface.o(.text);
asm/smokescreen.o(.text);
asm/pokeball.o(.text);
src/load_save.o(.text);
@ -340,7 +340,7 @@ SECTIONS {
data/daycare.o(.rodata);
src/egg_hatch.o(.rodata);
data/battle_7.o(.rodata);
data/battle_interface.o(.rodata);
src/battle_interface.o(.rodata);
data/pokeball.o(.rodata);
data/trade.o(.rodata);
data/berry_blender.o(.rodata);

View File

@ -244,7 +244,7 @@ void DoBattleAnim(const u8 *const animsTable[], u16 tableId, bool8 isMoveAnim)
if (!IsContest())
{
sub_80A8278();
sub_8072A88(0);
UpdateOamPriorityInAllHealthboxes(0);
for (i = 0; i < BATTLE_BANKS_COUNT; i++)
{
if (GetBankSide(i) != 0)
@ -549,7 +549,7 @@ static void ScriptCmd_end(void)
if (!IsContest())
{
sub_80A8278();
sub_8072A88(1);
UpdateOamPriorityInAllHealthboxes(1);
}
gAnimScriptActive = FALSE;
}
@ -1284,39 +1284,39 @@ s8 BattleAnimAdjustPanning(s8 pan)
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].flag_x10)
{
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
pan = PAN_ATTACKER_OPPONENT;
pan = PAN_SIDE_OPPONENT;
else
pan = PAN_ATTACKER_PLAYER;
pan = PAN_SIDE_PLAYER;
}
else if (IsContest())
{
if (gAnimBankAttacker != gAnimBankTarget || gAnimBankAttacker != 2 || pan != PAN_ATTACKER_OPPONENT)
if (gAnimBankAttacker != gAnimBankTarget || gAnimBankAttacker != 2 || pan != PAN_SIDE_OPPONENT)
pan *= -1;
}
else if (GetBankSide(gAnimBankAttacker) == SIDE_PLAYER)
{
if (GetBankSide(gAnimBankTarget) == SIDE_PLAYER)
{
if (pan == PAN_ATTACKER_OPPONENT)
pan = PAN_ATTACKER_PLAYER;
else if (pan != PAN_ATTACKER_PLAYER)
if (pan == PAN_SIDE_OPPONENT)
pan = PAN_SIDE_PLAYER;
else if (pan != PAN_SIDE_PLAYER)
pan *= -1;
}
}
else if (GetBankSide(gAnimBankTarget) == SIDE_OPPONENT)
{
if (pan == PAN_ATTACKER_PLAYER)
pan = PAN_ATTACKER_OPPONENT;
if (pan == PAN_SIDE_PLAYER)
pan = PAN_SIDE_OPPONENT;
}
else
{
pan *= -1;
}
if (pan > PAN_ATTACKER_OPPONENT)
pan = PAN_ATTACKER_OPPONENT;
else if (pan < PAN_ATTACKER_PLAYER)
pan = PAN_ATTACKER_PLAYER;
if (pan > PAN_SIDE_OPPONENT)
pan = PAN_SIDE_OPPONENT;
else if (pan < PAN_SIDE_PLAYER)
pan = PAN_SIDE_PLAYER;
return pan;
}
@ -1326,9 +1326,9 @@ s8 BattleAnimAdjustPanning2(s8 pan)
if (!IsContest() && gBattleSpritesDataPtr->healthBoxesData[gAnimBankAttacker].flag_x10)
{
if (GetBankSide(gAnimBankAttacker) != SIDE_PLAYER)
pan = PAN_ATTACKER_OPPONENT;
pan = PAN_SIDE_OPPONENT;
else
pan = PAN_ATTACKER_PLAYER;
pan = PAN_SIDE_PLAYER;
}
else
{

2632
src/battle_interface.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -336,9 +336,9 @@ static void CreateHealthboxSprite(u8 bank)
UpdateHealthboxAttribute(gHealthBoxesIds[bank], &gPlayerParty[gBattlePartyID[bank]], HEALTHBOX_ALL);
if (GetBankIdentity(bank) == IDENTITY_OPPONENT_MON2 || GetBankIdentity(bank) == IDENTITY_PLAYER_MON2)
nullsub_30(gHealthBoxesIds[bank], TRUE);
DummyBattleInterfaceFunc(gHealthBoxesIds[bank], TRUE);
else
nullsub_30(gHealthBoxesIds[bank], FALSE);
DummyBattleInterfaceFunc(gHealthBoxesIds[bank], FALSE);
if (GetBankSide(bank) != SIDE_PLAYER)
{