battle2 3500 C lines

This commit is contained in:
DizzyEggg 2017-10-02 23:32:39 +02:00
parent d4e1c417d3
commit db58d5e24a
19 changed files with 1545 additions and 4165 deletions

File diff suppressed because it is too large Load Diff

View File

@ -191,7 +191,7 @@ _080575F0:
beq _08057658
movs r0, 0x5
bl PlaySE
ldr r1, =gUnknown_020244AC
ldr r1, =gActionSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
@ -233,7 +233,7 @@ _08057658:
ands r0, r2
cmp r0, 0
beq _08057698
ldr r5, =gUnknown_020244AC
ldr r5, =gActionSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r5
@ -261,7 +261,7 @@ _08057698:
ands r0, r2
cmp r0, 0
beq _080576D8
ldr r5, =gUnknown_020244AC
ldr r5, =gActionSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r5
@ -290,7 +290,7 @@ _080576D8:
ands r0, r2
cmp r0, 0
beq _08057700
ldr r5, =gUnknown_020244AC
ldr r5, =gActionSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r5
@ -306,7 +306,7 @@ _08057700:
ands r0, r2
cmp r0, 0
beq _0805774C
ldr r5, =gUnknown_020244AC
ldr r5, =gActionSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r5
@ -508,7 +508,7 @@ _080578A0:
adds r0, r2
ldr r1, =sub_8039B2C
str r1, [r0]
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
@ -664,7 +664,7 @@ _08057A32:
muls r0, r1
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
adds r2, r1
ldrb r1, [r2]
adds r1, 0xD
@ -792,7 +792,7 @@ _08057B56:
muls r0, r1
ldr r1, =gPlayerParty
adds r0, r1
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
adds r2, r1
ldrb r1, [r2]
adds r1, 0xD
@ -890,7 +890,7 @@ _08057C48:
_08057C58:
movs r0, 0x5
bl PlaySE
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
@ -977,7 +977,7 @@ _08057D18:
movs r0, 0x1
add r8, r0
_08057D24:
ldr r0, =gUnknown_020244B0
ldr r0, =gMoveSelectionCursor
adds r0, r3, r0
adds r1, r6, 0
adds r1, 0x8
@ -1008,7 +1008,7 @@ _08057D5A:
cmp r0, 0
bne _08057D80
_08057D62:
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldrb r0, [r7]
adds r0, r1
ldrb r2, [r0]
@ -1095,7 +1095,7 @@ _08057E30:
ands r0, r2
cmp r0, 0
beq _08057E60
ldr r4, =gUnknown_020244B0
ldr r4, =gMoveSelectionCursor
ldrb r0, [r7]
adds r2, r0, r4
ldrb r1, [r2]
@ -1119,7 +1119,7 @@ _08057E60:
ands r0, r2
cmp r0, 0
beq _08057EA4
ldr r4, =gUnknown_020244B0
ldr r4, =gMoveSelectionCursor
ldrb r0, [r7]
adds r3, r0, r4
ldrb r2, [r3]
@ -1151,7 +1151,7 @@ _08057EA4:
ands r0, r2
cmp r0, 0
beq _08057ED4
ldr r4, =gUnknown_020244B0
ldr r4, =gMoveSelectionCursor
ldrb r0, [r7]
adds r2, r0, r4
ldrb r1, [r2]
@ -1173,7 +1173,7 @@ _08057ED4:
ands r0, r2
cmp r0, 0
beq _08057F30
ldr r4, =gUnknown_020244B0
ldr r4, =gMoveSelectionCursor
ldrb r0, [r7]
adds r3, r0, r4
ldrb r2, [r3]
@ -1221,7 +1221,7 @@ _08057F30:
ands r5, r6
cmp r5, 0
bne _08057F9E
ldr r4, =gUnknown_020244B0
ldr r4, =gMoveSelectionCursor
ldrb r0, [r7]
adds r0, r4
ldrb r0, [r0]
@ -1302,7 +1302,7 @@ _08057FF8:
ands r0, r1
cmp r0, 0
beq _08058038
ldr r5, =gUnknown_020244B0
ldr r5, =gMoveSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r2, r0, r5
@ -1333,7 +1333,7 @@ _08058038:
ands r0, r1
cmp r0, 0
beq _08058086
ldr r5, =gUnknown_020244B0
ldr r5, =gMoveSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r3, r0, r5
@ -1370,7 +1370,7 @@ _08058086:
ands r0, r1
cmp r0, 0
beq _080580C8
ldr r5, =gUnknown_020244B0
ldr r5, =gMoveSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r2, r0, r5
@ -1401,7 +1401,7 @@ _080580C8:
ands r0, r1
cmp r0, 0
beq _08058116
ldr r5, =gUnknown_020244B0
ldr r5, =gMoveSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r3, r0, r5
@ -1457,7 +1457,7 @@ sub_8058138: @ 8058138
_08058152:
movs r0, 0x5
bl PlaySE
ldr r0, =gUnknown_020244B0
ldr r0, =gMoveSelectionCursor
mov r10, r0
ldr r1, =gActiveBank
mov r8, r1
@ -1594,7 +1594,7 @@ _0805824E:
adds r6, 0x1
cmp r6, 0x3
ble _0805824E
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldrb r0, [r7]
adds r0, r1
ldrb r0, [r0]
@ -1758,7 +1758,7 @@ _08058392:
adds r6, 0x1
cmp r6, 0x3
ble _08058392
ldr r4, =gUnknown_020244B0
ldr r4, =gMoveSelectionCursor
ldr r3, =gActiveBank
ldrb r0, [r3]
adds r0, r4
@ -1892,7 +1892,7 @@ _080584A8:
adds r0, r1
ldr r1, =sub_8057BFC
str r1, [r0]
ldr r3, =gUnknown_020244B0
ldr r3, =gMoveSelectionCursor
ldrb r0, [r2]
adds r0, r3
ldr r1, =gUnknown_03005D74
@ -1915,7 +1915,7 @@ _08058500:
ldr r0, =gUnknown_03005D74
ldrb r0, [r0]
bl battle_menu_cursor_related
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r1
@ -1947,7 +1947,7 @@ _08058554:
bne _0805856A
b _080586E8
_0805856A:
ldr r0, =gUnknown_020244B0
ldr r0, =gMoveSelectionCursor
ldr r1, =gActiveBank
ldrb r1, [r1]
adds r1, r0
@ -1990,7 +1990,7 @@ _080585BA:
bcc _080585C8
b _080586E8
_080585C8:
ldr r0, =gUnknown_020244B0
ldr r0, =gMoveSelectionCursor
ldr r1, =gActiveBank
ldrb r1, [r1]
adds r1, r0
@ -2010,7 +2010,7 @@ _080585E8:
ands r0, r2
cmp r0, 0
beq _080586E8
ldr r0, =gUnknown_020244B0
ldr r0, =gMoveSelectionCursor
ldr r1, =gActiveBank
ldrb r1, [r1]
adds r1, r0
@ -2034,7 +2034,7 @@ _0805862C:
strb r0, [r4]
movs r0, 0x5
bl PlaySE
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
@ -2064,7 +2064,7 @@ _0805865C:
ldrb r1, [r1]
cmp r0, r1
bcs _080586E8
ldr r0, =gUnknown_020244B0
ldr r0, =gMoveSelectionCursor
ldr r1, =gActiveBank
ldrb r1, [r1]
adds r1, r0
@ -2087,7 +2087,7 @@ _080586AA:
strb r0, [r4]
movs r0, 0x5
bl PlaySE
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
@ -4407,7 +4407,7 @@ sub_8059B3C: @ 8059B3C
adds r0, r5, 0x4
adds r4, r0
ldr r6, =gDisplayedStringBattle
ldr r5, =gUnknown_020244B0
ldr r5, =gMoveSelectionCursor
adds r1, r5
adds r0, r4, 0
adds r0, 0x8
@ -4462,7 +4462,7 @@ sub_8059BB0: @ 8059BB0
strb r1, [r0]
adds r0, 0x1
ldr r3, =gBattleMoves
ldr r2, =gUnknown_020244B0
ldr r2, =gMoveSelectionCursor
ldrb r1, [r5]
adds r1, r2
ldrb r1, [r1]
@ -6924,11 +6924,11 @@ sub_805B1CC: @ 805B1CC
ldr r2, =gPlayerParty
adds r0, r2
bl sub_805DD7C
ldr r1, =gUnknown_020244AC
ldr r1, =gActionSelectionCursor
ldrb r0, [r5]
adds r0, r1
strb r4, [r0]
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldrb r0, [r5]
adds r0, r1
strb r4, [r0]
@ -8543,7 +8543,7 @@ _0805C062:
adds r4, 0x1
cmp r4, 0x3
ble _0805C062
ldr r1, =gUnknown_020244AC
ldr r1, =gActionSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
@ -8715,7 +8715,7 @@ sub_805C210: @ 805C210
ldr r1, =gUnknown_03005D74
movs r0, 0xFF
strb r0, [r1]
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
@ -10333,21 +10333,21 @@ _0805D054:
beq _0805D07C
b _0805D084
_0805D05A:
ldr r0, =gUnknown_020244AC
ldr r0, =gActionSelectionCursor
adds r0, r3, r0
strb r2, [r0]
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldrb r0, [r4]
adds r0, r1
strb r2, [r0]
b _0805D084
.pool
_0805D074:
ldr r0, =gUnknown_020244AC
ldr r0, =gActionSelectionCursor
b _0805D07E
.pool
_0805D07C:
ldr r0, =gUnknown_020244B0
ldr r0, =gMoveSelectionCursor
_0805D07E:
adds r0, r3, r0
movs r1, 0

View File

@ -71,7 +71,7 @@ bx_battle_menu_t6_2: @ 81593D8
beq _08159446
movs r0, 0x5
bl PlaySE
ldr r1, =gUnknown_020244AC
ldr r1, =gActionSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1
@ -118,7 +118,7 @@ _08159446:
ands r0, r1
cmp r0, 0
beq _08159484
ldr r5, =gUnknown_020244AC
ldr r5, =gActionSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r5
@ -144,7 +144,7 @@ _08159484:
ands r0, r1
cmp r0, 0
beq _081594C0
ldr r5, =gUnknown_020244AC
ldr r5, =gActionSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r5
@ -170,7 +170,7 @@ _081594C0:
ands r0, r1
cmp r0, 0
beq _0815950C
ldr r5, =gUnknown_020244AC
ldr r5, =gActionSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r5
@ -204,7 +204,7 @@ _0815950C:
ands r0, r1
cmp r0, 0
beq _0815954E
ldr r5, =gUnknown_020244AC
ldr r5, =gActionSelectionCursor
ldr r4, =gActiveBank
ldrb r0, [r4]
adds r0, r5
@ -871,7 +871,7 @@ _08159AAE:
adds r4, 0x1
cmp r4, 0x3
ble _08159AAE
ldr r1, =gUnknown_020244AC
ldr r1, =gActionSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1

View File

@ -3685,7 +3685,7 @@ _0816A48A:
adds r4, 0x1
cmp r4, 0x3
ble _0816A48A
ldr r1, =gUnknown_020244AC
ldr r1, =gActionSelectionCursor
ldr r0, =gActiveBank
ldrb r0, [r0]
adds r0, r1

View File

@ -4322,7 +4322,7 @@ _0817EF36:
b _0817F1FA
_0817EF44:
ldr r3, =gBattleMoves
ldr r2, =gUnknown_020244B0
ldr r2, =gMoveSelectionCursor
adds r0, r4, r2
ldrb r0, [r0]
lsls r0, 1
@ -4514,7 +4514,7 @@ _0817F0B4:
ble _0817EFC2
movs r5, 0
ldr r3, =gBankAttacker
ldr r6, =gUnknown_020244B0
ldr r6, =gMoveSelectionCursor
ldr r4, =gBattlePartyID
mov r8, r4
movs r7, 0x64
@ -4624,7 +4624,7 @@ _0817F1D4:
b _0817F0CC
_0817F1DC:
ldr r2, =gBattleMoveDamage
ldr r1, =gUnknown_020244B0
ldr r1, =gMoveSelectionCursor
ldr r0, =gBankAttacker
ldrb r0, [r0]
adds r0, r1

View File

@ -2998,7 +2998,7 @@ sub_814FBAC: @ 814FBAC
ldr r0, =gBattleBufferA + 4
adds r1, r0
ldr r4, =gUnknown_08D85620
ldr r0, =gUnknown_020244B0
ldr r0, =gMoveSelectionCursor
adds r2, r0
ldrb r2, [r2]
adds r0, r1, 0

View File

@ -264,7 +264,7 @@ _080A94F8:
adds r0, r4, 0
bl sub_805EE54
_080A955C:
ldr r1, =gUnknown_020244AC
ldr r1, =gActionSelectionCursor
ldr r0, =gBankInMenu
ldrb r0, [r0]
adds r0, r1

View File

@ -47,9 +47,9 @@ SetUpBattleVarsAndBirchZigzagoon: @ 803269C
str r0, [sp, 0x10]
movs r1, 0
ldr r7, =gBattleBankFunc
ldr r6, =gUnknown_020244AC
ldr r6, =gActionSelectionCursor
movs r2, 0
ldr r5, =gUnknown_020244B0
ldr r5, =gMoveSelectionCursor
ldr r4, =nullsub_21
ldr r3, =gBanksBySide
_080326B8:
@ -222,7 +222,7 @@ b_setup_bx: @ 8032824
cmp r5, 0
beq _080328E4
ldr r1, =gBattleMainFunc
ldr r0, =sub_8039ECC
ldr r0, =BeginBattleIntro
str r0, [r1]
movs r4, 0x80
lsls r4, 17
@ -286,7 +286,7 @@ _080328E4:
b _080329E0
_080328F0:
ldr r0, =gBattleMainFunc
ldr r2, =sub_8039ECC
ldr r2, =BeginBattleIntro
str r2, [r0]
movs r1, 0x80
ands r1, r3
@ -380,7 +380,7 @@ _080329CC:
b _08032CB2
.pool
_080329E0:
ldr r1, =sub_8039ECC
ldr r1, =BeginBattleIntro
ldr r2, =gBattleMainFunc
str r1, [r2]
ldr r2, =gBattleBankFunc
@ -419,7 +419,7 @@ _08032A20:
ands r0, r1
cmp r0, r1
bne _08032AA0
ldr r0, =sub_8039ECC
ldr r0, =BeginBattleIntro
ldr r1, =gBattleMainFunc
str r0, [r1]
ldr r0, =SetBankFuncToRecordedPlayerBufferRunCommand
@ -751,7 +751,7 @@ b_setup_bx_link: @ 8032CC0
cmp r4, 0
beq _08032D1C
ldr r1, =gBattleMainFunc
ldr r0, =sub_8039ECC
ldr r0, =BeginBattleIntro
str r0, [r1]
ldr r2, =gBattleBankFunc
ldr r0, =SetBankFuncToPlayerBufferRunCommand
@ -789,7 +789,7 @@ _08032D48:
cmp r3, 0
beq _08032D98
ldr r1, =gBattleMainFunc
ldr r0, =sub_8039ECC
ldr r0, =BeginBattleIntro
str r0, [r1]
ldr r2, =gBattleBankFunc
ldr r4, =SetBankFuncToPlayerBufferRunCommand
@ -840,7 +840,7 @@ _08032DD0:
cmp r3, 0
beq _08032E1C
ldr r1, =gBattleMainFunc
ldr r0, =sub_8039ECC
ldr r0, =BeginBattleIntro
str r0, [r1]
ldr r2, =gBattleBankFunc
ldr r0, =SetBankFuncToPlayerBufferRunCommand
@ -904,7 +904,7 @@ _08032E8C:
cmp r0, 0
beq _08032EA4
ldr r1, =gBattleMainFunc
ldr r0, =sub_8039ECC
ldr r0, =BeginBattleIntro
str r0, [r1]
_08032EA4:
movs r0, 0
@ -2247,8 +2247,8 @@ _0803396C:
.pool
thumb_func_end sub_8033940
thumb_func_start dp01_build_cmdbuf_x04_4_4_4
dp01_build_cmdbuf_x04_4_4_4: @ 8033980
thumb_func_start EmitLoadMonSprite
EmitLoadMonSprite: @ 8033980
push {lr}
lsls r0, 24
lsrs r0, 24
@ -2262,7 +2262,7 @@ dp01_build_cmdbuf_x04_4_4_4: @ 8033980
pop {r0}
bx r0
.pool
thumb_func_end dp01_build_cmdbuf_x04_4_4_4
thumb_func_end EmitLoadMonSprite
thumb_func_start EmitSwitchInAnim
EmitSwitchInAnim: @ 80339A0
@ -2301,8 +2301,8 @@ EmitReturnPokeToBall: @ 80339C4
.pool
thumb_func_end EmitReturnPokeToBall
thumb_func_start dp01_build_cmdbuf_x07_7_7_7
dp01_build_cmdbuf_x07_7_7_7: @ 80339E4
thumb_func_start EmitDrawTrainerPic
EmitDrawTrainerPic: @ 80339E4
push {lr}
lsls r0, 24
lsrs r0, 24
@ -2317,7 +2317,7 @@ dp01_build_cmdbuf_x07_7_7_7: @ 80339E4
pop {r0}
bx r0
.pool
thumb_func_end dp01_build_cmdbuf_x07_7_7_7
thumb_func_end EmitDrawTrainerPic
thumb_func_start EmitTrainerSlide
EmitTrainerSlide: @ 8033A04
@ -3532,8 +3532,8 @@ EmitFaintingCry: @ 803432C
.pool
thumb_func_end EmitFaintingCry
thumb_func_start dp01_build_cmdbuf_x2E_a
dp01_build_cmdbuf_x2E_a: @ 803434C
thumb_func_start EmitIntroSlide
EmitIntroSlide: @ 803434C
push {lr}
adds r3, r1, 0
lsls r0, 24
@ -3547,10 +3547,10 @@ dp01_build_cmdbuf_x2E_a: @ 803434C
pop {r0}
bx r0
.pool
thumb_func_end dp01_build_cmdbuf_x2E_a
thumb_func_end EmitIntroSlide
thumb_func_start dp01_build_cmdbuf_x2F_2F_2F_2F
dp01_build_cmdbuf_x2F_2F_2F_2F: @ 803436C
thumb_func_start EmitIntroTrainerBallThrow
EmitIntroTrainerBallThrow: @ 803436C
push {lr}
lsls r0, 24
lsrs r0, 24
@ -3565,10 +3565,10 @@ dp01_build_cmdbuf_x2F_2F_2F_2F: @ 803436C
pop {r0}
bx r0
.pool
thumb_func_end dp01_build_cmdbuf_x2F_2F_2F_2F
thumb_func_end EmitIntroTrainerBallThrow
thumb_func_start EmitCmd48
EmitCmd48: @ 803438C
thumb_func_start EmitDrawPartyStatusSummary
EmitDrawPartyStatusSummary: @ 803438C
push {r4,r5,lr}
adds r4, r1, 0
lsls r0, 24
@ -3604,7 +3604,7 @@ _080343B4:
pop {r0}
bx r0
.pool
thumb_func_end EmitCmd48
thumb_func_end EmitDrawPartyStatusSummary
thumb_func_start EmitCmd49
EmitCmd49: @ 80343D4

View File

@ -54,6 +54,7 @@
#define BATTLE_TYPE_GROUDON 0x10000000
#define BATTLE_TYPE_KYORGE 0x20000000
#define BATTLE_TYPE_RAYQUAZA 0x40000000
#define BATTLE_TYPE_x80000000 0x80000000
#define TRAINER_OPPONENT_C00 0xC00
#define TRAINER_OPPONENT_800 0x800
@ -178,6 +179,9 @@
#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
#define ABILITYEFFECT_SWITCH_IN_WEATHER 0xFF
#define ITEMEFFECT_ON_SWITCH_IN 0x0
#define WEATHER_HAS_EFFECT ((!AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_CLOUD_NINE, 0, 0) && !AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, ABILITY_AIR_LOCK, 0, 0)))
@ -228,6 +232,7 @@
#define MOVE_EFFECT_BYTE 0x3
#define MULTISTRING_CHOOSER 0x5
#define MSG_DISPLAY 0x7
#define BATTLE_COMMUNICATION_ENTRIES_COUNT 0x8
#define MOVE_TARGET_SELECTED 0x0
#define MOVE_TARGET_DEPENDS 0x1
@ -556,7 +561,7 @@ struct BattleResults
u16 caughtMonSpecies; // 0x28
u8 caughtMonNick[10]; // 0x2A
u8 filler34[2];
u8 catchAttempts[10]; // 0x36
u8 catchAttempts[12]; // 0x36
};
extern struct BattleResults gBattleResults;
@ -587,7 +592,7 @@ struct BattleStruct
u8 field_49;
u8 moneyMultiplier;
u8 field_4B;
u8 field_4C;
u8 switchInAbilitiesCounter;
u8 field_4D;
u8 field_4E;
u8 field_4F;
@ -650,7 +655,7 @@ struct BattleStruct
u16 choicedMove[BATTLE_BANKS_COUNT];
u16 changedItems[BATTLE_BANKS_COUNT];
u8 intimidateBank;
u8 fillerD9[0xDA-0xD9];
u8 switchInItemsCounter;
u8 field_DA;
u8 turnSideTracker;
u8 fillerDC[0xDF-0xDC];
@ -664,7 +669,7 @@ struct BattleStruct
struct BattleEnigmaBerry battleEnigmaBerry;
u8 field_1A0;
u8 field_1A1;
u8 filler1A2;
bool8 overworldWeatherDone;
u8 atkCancellerTracker;
u8 field_1A4[240];
u8 field_294[4];
@ -845,7 +850,7 @@ struct BattleScripting
u8 statChanger;
u8 field_1B;
u8 atk23_state;
u8 field_1D;
u8 battleStyle;
u8 atk6C_state;
u8 learnMoveState;
u8 field_20;
@ -874,9 +879,9 @@ void CancelMultiTurnMoves(u8 bank);
void PressurePPLose(u8 bankAtk, u8 bankDef, u16 move);
void PrepareStringBattle(u16 stringId, u8 bank);
u8 GetBattleBank(u8 caseId);
void UndoEffectsAfterFainting(void);
void FaintClearSetData(void);
bool8 HasMoveFailed(u8 bank);
void SwitchInClearStructs(void);
void SwitchInClearSetData(void);
void sub_803BDA0(u8 bank);
void sub_803FA70(u8 bank);
void BattleMainCB2(void);
@ -886,6 +891,9 @@ bool8 CanRunFromBattle(u8 bank);
bool8 IsRunningFromBattleImpossible(void);
void PressurePPLoseOnUsingPerishSong(u8 bankAtk);
void PressurePPLoseOnUsingImprision(u8 bankAtk);
u8 GetWhoStrikesFirst(u8 bankAtk, u8 bankDef, bool8 ignoreChosenMoves);
void sub_803CEDC(u8, u8);
void BattleTurnPassed(void);
// battle_3
#define MOVE_LIMITATION_ZEROMOVE (1 << 0)
@ -971,10 +979,28 @@ struct BattleAnimationInfo
u16 field; // to fill up later
};
struct BattleHealthboxInfo
{
u8 flag_x1 : 1;
u8 flag_x2 : 1;
u8 flag_x4 : 1;
u8 field_1;
u8 field_2;
u8 field_3;
u8 field_4;
u8 field_5;
u8 field_6;
u8 field_7;
u8 field_8;
u8 field_9;
u8 field_A;
u8 field_B;
};
struct BattleSpriteData
{
struct BattleSpriteInfo *bankData;
void* field_4;
struct BattleHealthboxInfo *healthBoxesData;
struct BattleAnimationInfo *animationData;
};

View File

@ -47,11 +47,15 @@ void EmitTrainerSlideBack(u8 bufferId);
void EmitFaintingCry(u8 bufferId);
void Emit_x37(u8 bufferId, u8 arg1);
void EmitHitAnimation(u8 bufferId);
void EmitCmd48(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 arg2);
void EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 arg2);
void EmitCmd49(u8 bufferId);
void EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status);
void EmitCmd13(u8 bufferId);
void EmitStatusIconUpdate(u8 bufferId, u32 status1, u32 status2);
void EmitIntroSlide(u8 bufferId, u8 terrainId);
void EmitDrawTrainerPic(u8 bufferId);
void EmitLoadMonSprite(u8 bufferId);
void EmitIntroTrainerBallThrow(u8 bufferId);
#define RESET_ACTION_MOVE_SELECTION 0
#define RESET_ACTION_SELECTION 1

View File

@ -633,10 +633,12 @@ s32 sub_806D864(u16 a1);
bool16 sub_806D82C(u8 id);
u16 MonTryLearningNewMove(struct Pokemon* mon, bool8);
void sub_8068AA4(void); // sets stats for deoxys
bool8 HasTwoFramesAnimation(u16 species);
#include "sprite.h"
void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u8 arg3);
void BattleAnimateBackSprite(struct Sprite* sprite, u16 species);
#endif // GUARD_POKEMON_H

View File

@ -9,6 +9,7 @@ void RecordedBattle_SetBankAction(u8 bank, u8 action);
void sub_8185F90(u16 arg0);
bool8 sub_8186450(void);
u8 sub_8185FAC(void);
u8 sub_8185FB8(void);
u8 MoveRecordedBattleToSaveData(void);
#endif // GUARD_RECORDED_BATTLE_H

View File

@ -212,14 +212,14 @@ struct Sprite
u16 flags_5:1; //0x20
u16 flags_6:1; //0x40
u16 flags_7:1; //0x80
/*0x3F*/ u16 hFlip:1;
u16 vFlip:1;
u16 animBeginning:1;
u16 affineAnimBeginning:1;
u16 animEnded:1;
u16 affineAnimEnded:1;
u16 usingSheet:1;
u16 flags_f:1;
/*0x3F*/ u16 hFlip:1; //1
u16 vFlip:1; //2
u16 animBeginning:1; //4
u16 affineAnimBeginning:1; //8
u16 animEnded:1; //0x10
u16 affineAnimEnded:1; //0x20
u16 usingSheet:1; //0x40
u16 flags_f:1; //0x80
/*0x40*/ u16 sheetTileStart;

File diff suppressed because it is too large Load Diff

View File

@ -178,9 +178,6 @@ extern const u8 gStatusConditionString_ConfusionJpn[];
extern const u8 gStatusConditionString_LoveJpn[];
extern const u16 gSoundMovesTable[];
extern u8 b_first_side(u8, u8, u8);
extern void sub_803CEDC(u8, u8);
extern void BattleTurnPassed(void);
extern void sub_803F9EC();
extern bool8 sub_80423F4(u8 bank, u8, u8);
extern u8 weather_get_current(void);
@ -414,7 +411,7 @@ u8 UpdateTurnCounters(void)
s32 j;
for (j = i + 1; j < gNoOfAllBanks; j++)
{
if (b_first_side(gTurnOrder[i], gTurnOrder[j], 0))
if (GetWhoStrikesFirst(gTurnOrder[i], gTurnOrder[j], 0))
sub_803CEDC(i, j);
}
}
@ -1667,7 +1664,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg)
gBankAttacker = bank;
switch (gLastUsedAbility)
{
case 0xFF: //weather from overworld
case ABILITYEFFECT_SWITCH_IN_WEATHER:
//_08042A86
switch (weather_get_current())
{

View File

@ -73,7 +73,7 @@ extern const struct BaseStats gBaseStats[];
extern const u32 gBitTable[];
extern u8 * const gBattleAI_ScriptsTable[];
extern u8 b_first_side(u8, u8, u8);
extern u8 GetWhoStrikesFirst(u8, u8, u8);
extern void AI_CalcDmg(u8, u8);
extern u8 CheckMoveLimitations();
@ -1756,7 +1756,7 @@ static void BattleAICmd_if_arg_not_equal(void)
static void BattleAICmd_if_would_go_first(void)
{
if (b_first_side(sBank_AI, gBankTarget, 1) == gAIScriptPtr[1])
if (GetWhoStrikesFirst(sBank_AI, gBankTarget, 1) == gAIScriptPtr[1])
gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2);
else
gAIScriptPtr += 6;
@ -1764,7 +1764,7 @@ static void BattleAICmd_if_would_go_first(void)
static void BattleAICmd_if_would_not_go_first(void)
{
if (b_first_side(sBank_AI, gBankTarget, 1) != gAIScriptPtr[1])
if (GetWhoStrikesFirst(sBank_AI, gBankTarget, 1) != gAIScriptPtr[1])
gAIScriptPtr = AIScriptReadPtr(gAIScriptPtr + 2);
else
gAIScriptPtr += 6;

View File

@ -360,7 +360,7 @@ static void atk5D_getmoneyreward(void);
static void atk5E_8025A70(void);
static void atk5F_8025B24(void);
static void atk60_increment_gamestat(void);
static void atk61_8025BA4(void);
static void atk61_draw_party_status_summary(void);
static void atk62_08025C6C(void);
static void atk63_jumptorandomattack(void);
static void atk64_statusanimation(void);
@ -612,7 +612,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
atk5E_8025A70,
atk5F_8025B24,
atk60_increment_gamestat,
atk61_8025BA4,
atk61_draw_party_status_summary,
atk62_08025C6C,
atk63_jumptorandomattack,
atk64_statusanimation,
@ -3251,7 +3251,7 @@ static void atk1B_faint_effects_clear(void)
MarkBufferBankForExecution(gActiveBank);
}
UndoEffectsAfterFainting(); // Effects like attractions, trapping, etc.
FaintClearSetData(); // Effects like attractions, trapping, etc.
gBattlescriptCurrInstr += 2;
}
}
@ -5366,7 +5366,7 @@ static void atk4D_switch_data_update(void)
gBattleMons[gActiveBank].status2 = oldData.status2;
}
SwitchInClearStructs();
SwitchInClearSetData();
if (gBattleTypeFlags & BATTLE_TYPE_PALACE && gBattleMons[gActiveBank].maxHP / 2 >= gBattleMons[gActiveBank].hp
&& gBattleMons[gActiveBank].hp != 0 && !(gBattleMons[gActiveBank].status1 & STATUS_SLEEP))
@ -6411,7 +6411,7 @@ static void atk60_increment_gamestat(void)
gBattlescriptCurrInstr += 2;
}
static void atk61_8025BA4(void)
static void atk61_draw_party_status_summary(void)
{
s32 i;
struct Pokemon* party;
@ -6442,7 +6442,7 @@ static void atk61_8025BA4(void)
}
}
EmitCmd48(0, hpStatuses, 1);
EmitDrawPartyStatusSummary(0, hpStatuses, 1);
MarkBufferBankForExecution(gActiveBank);
gBattlescriptCurrInstr += 2;

View File

@ -1519,8 +1519,6 @@ void BattleAnimateFrontSprite(struct Sprite* sprite, u16 species, bool8 noCry, u
DoMonFrontSpriteAnimation(sprite, species, noCry, arg3);
}
bool8 HasTwoFramesAnimation(u16 species);
extern void SpriteCallbackDummy_2(struct Sprite*);
extern void sub_817F60C(struct Sprite*);

View File

@ -445,7 +445,7 @@ gPauseCounterBattle: @ 202432C
gPaydayMoney: @ 202432E
.space 0x2
gUnknown_02024330: @ 2024330
gRandomTurnNumber: @ 2024330
.space 0x2
gBattleCommunication: @ 2024332
@ -499,10 +499,10 @@ gUnknown_020244A4: @ 20244A4
gBattleResources: @ 20244A8
.space 0x4
gUnknown_020244AC: @ 20244AC
gActionSelectionCursor: @ 20244AC
.space 0x4
gUnknown_020244B0: @ 20244B0
gMoveSelectionCursor: @ 20244B0
.space 0x4
gUnknown_020244B4: @ 20244B4