Merge branch 'master' into field_map_obj

This commit is contained in:
PikalaxALT 2017-09-18 19:21:34 -04:00
commit ee73040717
21 changed files with 6969 additions and 11534 deletions

View File

@ -6434,7 +6434,7 @@ _08039FDC:
strb r1, [r0]
ldr r2, =gBattleWeather
strh r1, [r2]
ldr r1, =gUnknown_020243D0
ldr r1, =gWishFutureKnock
movs r2, 0
movs r3, 0
_0803A004:
@ -7808,7 +7808,7 @@ _0803ABD4:
movs r2, 0
bl dp01_build_cmdbuf_x00_a_b_0
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
ldrb r0, [r5]
adds r0, 0x1
strb r0, [r5]
@ -7857,7 +7857,7 @@ bc_load_battlefield: @ 803AC34
movs r0, 0
bl dp01_build_cmdbuf_x2E_a
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
ldr r1, =gBattleMainFunc
ldr r0, =sub_803AC84
str r0, [r1]
@ -8040,7 +8040,7 @@ _0803ADCA:
movs r0, 0
bl dp01_build_cmdbuf_x07_7_7_7
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803ADE4:
ldr r5, =gBattleTypeFlags
ldr r0, [r5]
@ -8057,7 +8057,7 @@ _0803ADE4:
movs r0, 0
bl dp01_build_cmdbuf_x07_7_7_7
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803AE0A:
ldrb r0, [r4]
bl GetBankSide
@ -8114,7 +8114,7 @@ _0803AE96:
movs r0, 0
bl dp01_build_cmdbuf_x04_4_4_4
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
ldr r1, =gBattlePartyID
ldrb r0, [r4]
lsls r0, 1
@ -8153,7 +8153,7 @@ _0803AEEA:
movs r0, 0
bl dp01_build_cmdbuf_x07_7_7_7
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803AEF6:
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
@ -8172,7 +8172,7 @@ _0803AEF6:
movs r0, 0
bl dp01_build_cmdbuf_x07_7_7_7
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803AF20:
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
@ -8282,7 +8282,7 @@ _0803AFFA:
movs r2, 0x80
bl dp01_build_cmdbuf_x30_TODO
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
movs r7, 0
mov r6, r8
mov r5, sp
@ -8334,7 +8334,7 @@ _0803B072:
movs r2, 0x80
bl dp01_build_cmdbuf_x30_TODO
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
ldr r1, =gBattleMainFunc
ldr r0, =bc_battle_begin_message
b _0803B10A
@ -8522,7 +8522,7 @@ _0803B20E:
movs r0, 0
bl dp01_build_cmdbuf_x2F_2F_2F_2F
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803B228:
ldrb r0, [r4]
adds r0, 0x1
@ -8596,7 +8596,7 @@ _0803B2B2:
movs r0, 0
bl dp01_build_cmdbuf_x2F_2F_2F_2F
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
ldr r1, =0x00008040
@ -8793,7 +8793,7 @@ _0803B45E:
movs r0, 0
bl dp01_build_cmdbuf_x2F_2F_2F_2F
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803B478:
ldrb r0, [r4]
adds r0, 0x1
@ -8877,7 +8877,7 @@ _0803B51A:
movs r0, 0
bl dp01_build_cmdbuf_x2F_2F_2F_2F
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
ldr r0, =gBattleTypeFlags
ldr r0, [r0]
movs r1, 0x40
@ -8949,7 +8949,7 @@ _0803B5B2:
movs r2, 0
bl dp01_build_cmdbuf_x05_a_b_c
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803B5D4:
ldrb r0, [r4]
adds r0, 0x1
@ -9177,7 +9177,7 @@ _0803B79A:
ldrb r1, [r0]
movs r0, 0
movs r2, 0
bl berry_effects_maybe
bl ItemBattleEffects
lsls r0, 24
cmp r0, 0
beq _0803B7BC
@ -9208,7 +9208,7 @@ _0803B7DA:
mov r8, r1
movs r7, 0x6
ldr r6, =gUnknown_0202421C
ldr r2, =gUnknown_02024274
ldr r2, =gChosenMovesByBanks
movs r4, 0xFF
movs r3, 0
_0803B7EA:
@ -9328,7 +9328,7 @@ bc_8013B1C: @ 803B904
cmp r0, 0
bne _0803B994
ldr r1, =gBattleMainFunc
ldr r0, =sub_803B9BC
ldr r0, =BattleTurnPassed
str r0, [r1]
ldr r3, =gNoOfAllBanks
ldr r1, =gBattleCommunication
@ -9404,8 +9404,8 @@ _0803B994:
.pool
thumb_func_end bc_8013B1C
thumb_func_start sub_803B9BC
sub_803B9BC: @ 803B9BC
thumb_func_start BattleTurnPassed
BattleTurnPassed: @ 803B9BC
push {r4-r7,lr}
mov r7, r9
mov r6, r8
@ -9416,13 +9416,13 @@ sub_803B9BC: @ 803B9BC
ldrb r0, [r0]
cmp r0, 0
bne _0803B9EA
bl sub_80401D0
bl UpdateTurnCounters
lsls r0, 24
cmp r0, 0
beq _0803B9DE
b _0803BB78
_0803B9DE:
bl sub_8040924
bl TurnBasedEffects
lsls r0, 24
cmp r0, 0
beq _0803B9EA
@ -9514,7 +9514,7 @@ _0803BAB2:
ldr r7, =gUnknown_0202421C
movs r6, 0xFF
movs r5, 0
ldr r3, =gUnknown_02024274
ldr r3, =gChosenMovesByBanks
_0803BACC:
adds r1, r2, r7
ldrb r0, [r1]
@ -9586,7 +9586,7 @@ _0803BB78:
pop {r0}
bx r0
.pool
thumb_func_end sub_803B9BC
thumb_func_end BattleTurnPassed
thumb_func_start sub_803BB88
sub_803BB88: @ 803BB88
@ -10178,7 +10178,7 @@ _0803C0A8:
.4byte _0803C6C4
.4byte _0803C4B4
_0803C0DC:
bl sub_80400C8
bl AreAllMovesUnusable
lsls r0, 24
cmp r0, 0
beq _0803C134
@ -10223,7 +10223,7 @@ _0803C134:
ldrh r2, [r0, 0x6]
cmp r2, 0
beq _0803C188
ldr r1, =gUnknown_02024274
ldr r1, =gChosenMovesByBanks
lsls r0, r4, 1
adds r0, r1
strh r2, [r0]
@ -10552,7 +10552,7 @@ _0803C410:
_0803C42E:
ldr r0, =gActiveBank
ldrb r0, [r0]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
b _0803C6C4
.pool
_0803C440:
@ -10596,7 +10596,7 @@ _0803C48C:
movs r0, 0
bl sub_8033E6C
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
b _0803C6C4
.pool
_0803C4B4:
@ -10660,7 +10660,7 @@ _0803C532:
movs r0, 0
bl dp01_build_cmdbuf_x32_32_32_32
ldrb r0, [r5]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
bl _0803CD70
.pool
_0803C550:
@ -10813,7 +10813,7 @@ _0803C6AE:
bl dp01_build_cmdbuf_x32_32_32_32
ldr r0, =gActiveBank
ldrb r0, [r0]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
b _0803CD70
.pool
_0803C6C4:
@ -11083,7 +11083,7 @@ _0803C942:
adds r0, r5
ldrb r0, [r0]
strb r0, [r1]
ldr r0, =gUnknown_02024274
ldr r0, =gChosenMovesByBanks
ldrb r2, [r6]
lsls r5, r2, 1
adds r5, r0
@ -11299,7 +11299,7 @@ _0803CB66:
ldr r4, =gActiveBank
_0803CB68:
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803CB6E:
ldr r0, =gBattleCommunication
ldrb r1, [r4]
@ -12704,7 +12704,7 @@ _0803D71C:
ldrb r0, [r1]
adds r0, 0x1
strb r0, [r1]
ldr r1, =gUnknown_02024274
ldr r1, =gChosenMovesByBanks
ldrb r3, [r5]
lsls r0, r3, 1
adds r0, r1
@ -13861,7 +13861,7 @@ _0803E2DC:
adds r0, r1
adds r3, 0xC
adds r0, r3
ldr r1, =gUnknown_02024274
ldr r1, =gChosenMovesByBanks
lsls r2, 1
adds r2, r1
ldrh r3, [r0]
@ -14400,7 +14400,7 @@ _0803E7EC:
movs r0, 0x4
strb r0, [r1, 0x5]
ldr r1, =gBattlescriptCurrInstr
ldr r0, =gUnknown_082DB6AD
ldr r0, =BattleScript_MoveUsedLoafingAround
str r0, [r1]
b _0803E824
.pool
@ -15661,7 +15661,7 @@ _0803F430:
b _0803F47A
.pool
_0803F43C:
ldr r0, =gUnknown_0202420E
ldr r0, =gEffectBank
ldrb r0, [r0]
b _0803F47A
.pool
@ -15674,7 +15674,7 @@ _0803F44C:
b _0803F47A
.pool
_0803F458:
ldr r0, =gUnknown_0202420D
ldr r0, =gBank1
ldrb r0, [r0]
b _0803F47A
.pool
@ -15786,9 +15786,9 @@ _0803F4DE:
movs r0, 0
movs r2, 0
movs r3, 0x1
bl dp01_build_cmdbuf_x02_a_b_varargs
bl EmitSetAttributes
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803F532:
add sp, 0x4
pop {r4-r7}
@ -15933,9 +15933,9 @@ _0803F5F0:
movs r0, 0
movs r2, 0
movs r3, 0x1
bl dp01_build_cmdbuf_x02_a_b_varargs
bl EmitSetAttributes
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803F658:
add sp, 0x4
pop {r3-r5}
@ -16065,9 +16065,9 @@ _0803F6FE:
movs r0, 0
movs r2, 0
movs r3, 0x1
bl dp01_build_cmdbuf_x02_a_b_varargs
bl EmitSetAttributes
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_0803F762:
add sp, 0x4
pop {r3-r5}
@ -16132,8 +16132,8 @@ _0803F7EE:
.pool
thumb_func_end sub_803F790
thumb_func_start dp01_battle_side_mark_buffer_for_execution
dp01_battle_side_mark_buffer_for_execution: @ 803F800
thumb_func_start MarkBufferBankForExecution
MarkBufferBankForExecution: @ 803F800
push {lr}
lsls r0, 24
lsrs r3, r0, 24
@ -16167,7 +16167,7 @@ _0803F844:
pop {r0}
bx r0
.pool
thumb_func_end dp01_battle_side_mark_buffer_for_execution
thumb_func_end MarkBufferBankForExecution
thumb_func_start sub_803F850
sub_803F850: @ 803F850
@ -16312,7 +16312,7 @@ b_std_message: @ 803F964
adds r1, r2, 0
bl dp01_build_cmdbuf_x10_TODO
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
pop {r4}
pop {r0}
bx r0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -398,7 +398,7 @@ _0805729A:
cmp r0, 0
beq _08057372
mov r0, r9
bl sub_8050650
bl UproarWakeUpCheck
lsls r0, 24
cmp r0, 0
beq _080572FC
@ -419,7 +419,7 @@ _0805729A:
mov r2, r10
strb r0, [r2, 0x5]
ldr r1, =gBattlescriptCurrInstr
ldr r0, =gUnknown_082DB220
ldr r0, =BattleScript_MoveUsedWokeUp
str r0, [r1]
movs r0, 0x2
mov r8, r0
@ -461,7 +461,7 @@ _08057322:
cmp r4, 0
beq _08057354
ldr r1, =gBattlescriptCurrInstr
ldr r0, =gUnknown_082DB213
ldr r0, =BattleScript_MoveUsedIsAsleep
str r0, [r1]
movs r1, 0x2
mov r8, r1
@ -478,7 +478,7 @@ _08057354:
ldr r0, =gBattleCommunication
strb r4, [r0, 0x5]
ldr r1, =gBattlescriptCurrInstr
ldr r0, =gUnknown_082DB220
ldr r0, =BattleScript_MoveUsedWokeUp
str r0, [r1]
movs r2, 0x2
mov r8, r2
@ -513,7 +513,7 @@ _08057390:
cmp r5, 0
beq _080573D4
ldr r1, =gBattlescriptCurrInstr
ldr r0, =gUnknown_082DB26A
ldr r0, =BattleScript_MoveUsedIsFrozen
str r0, [r1]
b _080573EC
.pool
@ -525,7 +525,7 @@ _080573D4:
str r0, [r4]
bl b_movescr_stack_push_cursor
ldr r1, =gBattlescriptCurrInstr
ldr r0, =gUnknown_082DB277
ldr r0, =BattleScript_MoveUsedUnfroze
str r0, [r1]
mov r0, r10
strb r5, [r0, 0x5]
@ -562,9 +562,9 @@ _08057406:
movs r1, 0x28
movs r2, 0
movs r3, 0x4
bl dp01_build_cmdbuf_x02_a_b_varargs
bl EmitSetAttributes
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
_08057430:
mov r0, r8
add sp, 0x4

View File

@ -50069,7 +50069,7 @@ sub_8117E94: @ 8117E94
ldrb r1, [r1]
strb r1, [r2]
ldr r2, =gAnimationBankTarget
ldr r1, =gUnknown_0202420E
ldr r1, =gEffectBank
ldrb r1, [r1]
strb r1, [r2]
bl move_anim_task_del
@ -50136,7 +50136,7 @@ sub_8117F30: @ 8117F30
ldrb r1, [r1]
strb r1, [r2]
ldr r2, =gAnimationBankTarget
ldr r1, =gUnknown_0202420E
ldr r1, =gEffectBank
ldrb r1, [r1]
strb r1, [r2]
bl move_anim_task_del

View File

@ -5069,7 +5069,7 @@ sub_8172ED0: @ 8172ED0
lsls r0, 24
lsrs r0, 24
ldr r2, =gAnimationBankTarget
ldr r1, =gUnknown_0202420E
ldr r1, =gEffectBank
ldrb r1, [r1]
strb r1, [r2]
bl move_anim_task_del

View File

@ -44,7 +44,7 @@ _0817C988:
bl GetBankSide
lsls r0, 24
lsrs r6, r0, 24
ldr r0, =gUnknown_0202420E
ldr r0, =gEffectBank
ldrb r0, [r0]
bl GetBankSide
lsls r0, 24
@ -145,7 +145,7 @@ _0817CA9C:
bl GetBankIdentity
lsls r0, 24
lsrs r5, r0, 25
ldr r0, =gUnknown_0202420E
ldr r0, =gEffectBank
ldrb r0, [r0]
bl GetBankIdentity
lsls r0, 24
@ -1302,7 +1302,7 @@ _0817D6F2:
bl _0817E0A6
_0817D704:
ldr r5, =gBattlePartyID
ldr r6, =gUnknown_0202420E
ldr r6, =gEffectBank
ldrb r0, [r6]
lsls r0, 1
adds r0, r5
@ -1396,7 +1396,7 @@ _0817D7B2:
.pool
_0817D7D8:
ldr r5, =gBattlePartyID
ldr r6, =gUnknown_0202420E
ldr r6, =gEffectBank
ldrb r0, [r6]
lsls r0, 1
adds r0, r5
@ -1440,7 +1440,7 @@ _0817D7D8:
.pool
_0817D838:
ldr r5, =gBattlePartyID
ldr r6, =gUnknown_0202420E
ldr r6, =gEffectBank
ldrb r0, [r6]
lsls r0, 1
adds r0, r5
@ -1628,7 +1628,7 @@ _0817D9AE:
b _0817E086
_0817D9C2:
ldr r5, =gBattlePartyID
ldr r6, =gUnknown_0202420E
ldr r6, =gEffectBank
ldrb r0, [r6]
lsls r0, 1
adds r0, r5
@ -1703,7 +1703,7 @@ _0817DA48:
.pool
_0817DA68:
ldr r5, =gBattlePartyID
ldr r6, =gUnknown_0202420E
ldr r6, =gEffectBank
ldrb r0, [r6]
lsls r0, 1
adds r0, r5
@ -1791,7 +1791,7 @@ _0817DB10:
.pool
_0817DB24:
ldr r5, =gBattlePartyID
ldr r6, =gUnknown_0202420E
ldr r6, =gEffectBank
ldrb r0, [r6]
lsls r0, 1
adds r0, r5

View File

@ -1349,7 +1349,7 @@ _0814ED5E:
bl _0814F5BE
.pool
_0814ED70:
ldr r5, =gUnknown_0202420E
ldr r5, =gEffectBank
ldrb r0, [r5]
bl GetBankSide
lsls r0, 24
@ -1695,7 +1695,7 @@ _0814F0A8:
.pool
_0814F0B8:
ldr r1, =gAbilitiesPerBank
ldr r0, =gUnknown_0202420E
ldr r0, =gEffectBank
_0814F0BC:
ldrb r0, [r0]
_0814F0BE:

View File

@ -1157,7 +1157,7 @@ _0806C6AE:
movs r2, 0
bl dp01_build_cmdbuf_x00_a_b_0
ldrb r0, [r4]
bl dp01_battle_side_mark_buffer_for_execution
bl MarkBufferBankForExecution
strb r5, [r4]
b _0806C6EC
.pool

View File

@ -2599,7 +2599,7 @@ _081863A2:
ldr r2, [sp, 0x40]
bl SetMonData
_081863CA:
ldr r2, =gUnknown_02024274
ldr r2, =gChosenMovesByBanks
ldr r3, [sp, 0x44]
adds r2, r3, r2
ldr r0, =gBattleStruct

View File

@ -1573,7 +1573,7 @@ _08033346:
ldrsh r1, [r0, r2]
ldr r0, [r4]
adds r1, r0
ldr r0, =gUnknown_0202420E
ldr r0, =gEffectBank
ldrb r0, [r0]
strb r0, [r1, 0x7]
movs r2, 0
@ -2084,7 +2084,7 @@ _080337D2:
adds r0, r1
ldrb r0, [r0, 0x6]
strb r0, [r2]
ldr r2, =gUnknown_0202420E
ldr r2, =gEffectBank
movs r4, 0x26
ldrsh r0, [r5, r4]
adds r0, r1
@ -2175,8 +2175,8 @@ dp01_build_cmdbuf_x01_a_b_0: @ 80338D8
.pool
thumb_func_end dp01_build_cmdbuf_x01_a_b_0
thumb_func_start dp01_build_cmdbuf_x02_a_b_varargs
dp01_build_cmdbuf_x02_a_b_varargs: @ 8033900
thumb_func_start EmitSetAttributes
EmitSetAttributes: @ 8033900
push {r4-r6,lr}
ldr r4, [sp, 0x10]
lsls r0, 24
@ -2209,7 +2209,7 @@ _0803392E:
pop {r0}
bx r0
.pool
thumb_func_end dp01_build_cmdbuf_x02_a_b_varargs
thumb_func_end EmitSetAttributes
thumb_func_start sub_8033940
sub_8033940: @ 8033940

View File

@ -21,7 +21,7 @@ gUnknown_082D8CD4:: @ 82D8CD4
gUnknown_082D8D65:: @ 82D8D65
.incbin "baserom.gba", 0x2d8d65, 0x6fd
gUnknown_082D9462:: @ 82D9462
BattleScript_MoveUsedMustRecharge:: @ 82D9462
.incbin "baserom.gba", 0x2d9462, 0xa7f
gUnknown_082D9EE1:: @ 82D9EE1
@ -120,16 +120,16 @@ gUnknown_082DACFA:: @ 82DACFA
gUnknown_082DAD0B:: @ 82DAD0B
.incbin "baserom.gba", 0x2dad0b, 0xa
gUnknown_082DAD15:: @ 82DAD15
BattleScript_LeechSeedTurnDrain:: @ 82DAD15
.incbin "baserom.gba", 0x2dad15, 0x5c
gUnknown_082DAD71:: @ 82DAD71
BattleScript_BideStoringEnergy:: @ 82DAD71
.incbin "baserom.gba", 0x2dad71, 0xb
gUnknown_082DAD7C:: @ 82DAD7C
BattleScript_BideAttack:: @ 82DAD7C
.incbin "baserom.gba", 0x2dad7c, 0x48
gUnknown_082DADC4:: @ 82DADC4
BattleScript_BideNoEnergyToAttack:: @ 82DADC4
.incbin "baserom.gba", 0x2dadc4, 0x14
gUnknown_082DADD8:: @ 82DADD8
@ -141,19 +141,19 @@ gUnknown_082DAE03:: @ 82DAE03
gUnknown_082DAE0D:: @ 82DAE0D
.incbin "baserom.gba", 0x2dae0d, 0x7
gUnknown_082DAE14:: @ 82DAE14
BattleScript_MoveUsedIsDisabled:: @ 82DAE14
.incbin "baserom.gba", 0x2dae14, 0xb
gUnknown_082DAE1F:: @ 82DAE1F
.incbin "baserom.gba", 0x2dae1f, 0x4
gUnknown_082DAE23:: @ 82DAE23
BattleScript_DisabledNoMore:: @ 82DAE23
.incbin "baserom.gba", 0x2dae23, 0x7
gUnknown_082DAE2A:: @ 82DAE2A
.incbin "baserom.gba", 0x2dae2a, 0xd
gUnknown_082DAE37:: @ 82DAE37
BattleScript_EncoredNoMore:: @ 82DAE37
.incbin "baserom.gba", 0x2dae37, 0x7
gUnknown_082DAE3E:: @ 82DAE3E
@ -192,7 +192,7 @@ gUnknown_082DAFDD:: @ 82DAFDD
gUnknown_082DAFE4:: @ 82DAFE4
.incbin "baserom.gba", 0x2dafe4, 0x8e
gUnknown_082DB072:: @ 82DB072
BattleScript_NoMovesLeft:: @ 82DB072
.incbin "baserom.gba", 0x2db072, 0x4
gUnknown_082DB076:: @ 82DB076
@ -210,16 +210,16 @@ gUnknown_082DB098:: @ 82DB098
gUnknown_082DB0A0:: @ 82DB0A0
.incbin "baserom.gba", 0x2db0a0, 0x4
gUnknown_082DB0A4:: @ 82DB0A4
BattleScript_MoveUsedIsTaunted:: @ 82DB0A4
.incbin "baserom.gba", 0x2db0a4, 0xb
gUnknown_082DB0AF:: @ 82DB0AF
.incbin "baserom.gba", 0x2db0af, 0x8
gUnknown_082DB0B7:: @ 82DB0B7
BattleScript_WishComesTrue:: @ 82DB0B7
.incbin "baserom.gba", 0x2db0b7, 0x37
gUnknown_082DB0EE:: @ 82DB0EE
BattleScript_IngrainTurnHeal:: @ 82DB0EE
.incbin "baserom.gba", 0x2db0ee, 0x29
gUnknown_082DB117:: @ 82DB117
@ -228,7 +228,7 @@ gUnknown_082DB117:: @ 82DB117
gUnknown_082DB168:: @ 82DB168
.incbin "baserom.gba", 0x2db168, 0xe
gUnknown_082DB176:: @ 82DB176
BattleScript_MoveUsedIsImprisoned:: @ 82DB176
.incbin "baserom.gba", 0x2db176, 0xb
gUnknown_082DB181:: @ 82DB181
@ -258,97 +258,97 @@ gUnknown_082DB1D5:: @ 82DB1D5
gUnknown_082DB1FF:: @ 82DB1FF
.incbin "baserom.gba", 0x2db1ff, 0x14
gUnknown_082DB213:: @ 82DB213
BattleScript_MoveUsedIsAsleep:: @ 82DB213
.incbin "baserom.gba", 0x2db213, 0xd
gUnknown_082DB220:: @ 82DB220
BattleScript_MoveUsedWokeUp:: @ 82DB220
.incbin "baserom.gba", 0x2db220, 0x14
gUnknown_082DB234:: @ 82DB234
.incbin "baserom.gba", 0x2db234, 0x9
gUnknown_082DB23D:: @ 82DB23D
BattleScript_PoisonTurnDmg:: @ 82DB23D
.incbin "baserom.gba", 0x2db23d, 0x22
gUnknown_082DB25F:: @ 82DB25F
BattleScript_BurnTurnDmg:: @ 82DB25F
.incbin "baserom.gba", 0x2db25f, 0xb
gUnknown_082DB26A:: @ 82DB26A
BattleScript_MoveUsedIsFrozen:: @ 82DB26A
.incbin "baserom.gba", 0x2db26a, 0xd
gUnknown_082DB277:: @ 82DB277
BattleScript_MoveUsedUnfroze:: @ 82DB277
.incbin "baserom.gba", 0x2db277, 0xb
gUnknown_082DB282:: @ 82DB282
.incbin "baserom.gba", 0x2db282, 0x9
gUnknown_082DB28B:: @ 82DB28B
BattleScript_MoveUsedIsParalyzed:: @ 82DB28B
.incbin "baserom.gba", 0x2db28b, 0x10
gUnknown_082DB29B:: @ 82DB29B
BattleScript_MoveUsedFlinched:: @ 82DB29B
.incbin "baserom.gba", 0x2db29b, 0xb
gUnknown_082DB2A6:: @ 82DB2A6
.incbin "baserom.gba", 0x2db2a6, 0x9
gUnknown_082DB2AF:: @ 82DB2AF
BattleScript_ThrashConfuses:: @ 82DB2AF
.incbin "baserom.gba", 0x2db2af, 0xe
gUnknown_082DB2BD:: @ 82DB2BD
BattleScript_MoveUsedIsConfused:: @ 82DB2BD
.incbin "baserom.gba", 0x2db2bd, 0x43
gUnknown_082DB300:: @ 82DB300
BattleScript_MoveUsedIsConfusedNoMore:: @ 82DB300
.incbin "baserom.gba", 0x2db300, 0x7
gUnknown_082DB307:: @ 82DB307
.incbin "baserom.gba", 0x2db307, 0x7
gUnknown_082DB30E:: @ 82DB30E
BattleScript_WrapTurnDmg:: @ 82DB30E
.incbin "baserom.gba", 0x2db30e, 0x12
gUnknown_082DB320:: @ 82DB320
BattleScript_WrapEnds:: @ 82DB320
.incbin "baserom.gba", 0x2db320, 0x7
gUnknown_082DB327:: @ 82DB327
BattleScript_MoveUsedIsInLove:: @ 82DB327
.incbin "baserom.gba", 0x2db327, 0xd
gUnknown_082DB334:: @ 82DB334
BattleScript_MoveUsedIsParalyzedCantAttack:: @ 82DB334
.incbin "baserom.gba", 0x2db334, 0xb
gUnknown_082DB33F:: @ 82DB33F
BattleScript_NightmareTurnDmg:: @ 82DB33F
.incbin "baserom.gba", 0x2db33f, 0x11
gUnknown_082DB350:: @ 82DB350
BattleScript_CurseTurnDmg:: @ 82DB350
.incbin "baserom.gba", 0x2db350, 0x11
gUnknown_082DB361:: @ 82DB361
.incbin "baserom.gba", 0x2db361, 0x17
gUnknown_082DB378:: @ 82DB378
BattleScript_YawnMakesAsleep:: @ 82DB378
.incbin "baserom.gba", 0x2db378, 0xaa
gUnknown_082DB422:: @ 82DB422
.incbin "baserom.gba", 0x2db422, 0xe
gUnknown_082DB430:: @ 82DB430
BattleScript_DrizzleActivates:: @ 82DB430
.incbin "baserom.gba", 0x2db430, 0x14
gUnknown_082DB444:: @ 82DB444
BattleScript_SpeedBoostActivates:: @ 82DB444
.incbin "baserom.gba", 0x2db444, 0xe
gUnknown_082DB452:: @ 82DB452
BattleScript_TraceActivates:: @ 82DB452
.incbin "baserom.gba", 0x2db452, 0xa
gUnknown_082DB45C:: @ 82DB45C
BattleScript_RainDishActivates:: @ 82DB45C
.incbin "baserom.gba", 0x2db45c, 0x14
gUnknown_082DB470:: @ 82DB470
BattleScript_SandstreamActivates:: @ 82DB470
.incbin "baserom.gba", 0x2db470, 0x14
gUnknown_082DB484:: @ 82DB484
BattleScript_ShedSkinActivates:: @ 82DB484
.incbin "baserom.gba", 0x2db484, 0x25
gUnknown_082DB4A9:: @ 82DB4A9
BattleScript_CastformChange:: @ 82DB4A9
.incbin "baserom.gba", 0x2db4a9, 0xf
gUnknown_082DB4B8:: @ 82DB4B8
@ -357,7 +357,7 @@ gUnknown_082DB4B8:: @ 82DB4B8
gUnknown_082DB4C1:: @ 82DB4C1
.incbin "baserom.gba", 0x2db4c1, 0x69
gUnknown_082DB52A:: @ 82DB52A
BattleScript_DroughtActivates:: @ 82DB52A
.incbin "baserom.gba", 0x2db52a, 0x14
gUnknown_082DB53E:: @ 82DB53E
@ -369,10 +369,10 @@ gUnknown_082DB552:: @ 82DB552
gUnknown_082DB560:: @ 82DB560
.incbin "baserom.gba", 0x2db560, 0xe
gUnknown_082DB56E:: @ 82DB56E
BattleScript_MoveHPDrain_PPLoss:: @ 82DB56E
.incbin "baserom.gba", 0x2db56e, 0x1
gUnknown_082DB56F:: @ 82DB56F
BattleScript_MoveHPDrain:: @ 82DB56F
.incbin "baserom.gba", 0x2db56f, 0x22
gUnknown_082DB591:: @ 82DB591
@ -381,10 +381,10 @@ gUnknown_082DB591:: @ 82DB591
gUnknown_082DB592:: @ 82DB592
.incbin "baserom.gba", 0x2db592, 0x15
gUnknown_082DB5A7:: @ 82DB5A7
BattleScript_FlashFireBoost_PPLoss:: @ 82DB5A7
.incbin "baserom.gba", 0x2db5a7, 0x1
gUnknown_082DB5A8:: @ 82DB5A8
BattleScript_FlashFireBoost:: @ 82DB5A8
.incbin "baserom.gba", 0x2db5a8, 0x1f
gUnknown_082DB5C7:: @ 82DB5C7
@ -405,7 +405,7 @@ gUnknown_082DB5F5:: @ 82DB5F5
gUnknown_082DB603:: @ 82DB603
.incbin "baserom.gba", 0x2db603, 0x1c
gUnknown_082DB61F:: @ 82DB61F
BattleScript_SoundproofProtected:: @ 82DB61F
.incbin "baserom.gba", 0x2db61f, 0x10
gUnknown_082DB62F:: @ 82DB62F
@ -414,19 +414,19 @@ gUnknown_082DB62F:: @ 82DB62F
gUnknown_082DB63F:: @ 82DB63F
.incbin "baserom.gba", 0x2db63f, 0xe
gUnknown_082DB64D:: @ 82DB64D
BattleScript_ColorChangeActivates:: @ 82DB64D
.incbin "baserom.gba", 0x2db64d, 0x7
gUnknown_082DB654:: @ 82DB654
BattleScript_RoughSkinActivates:: @ 82DB654
.incbin "baserom.gba", 0x2db654, 0x1b
gUnknown_082DB66F:: @ 82DB66F
BattleScript_CuteCharmActivates:: @ 82DB66F
.incbin "baserom.gba", 0x2db66f, 0xd
gUnknown_082DB67C:: @ 82DB67C
BattleScript_ApplySecondaryEffect:: @ 82DB67C
.incbin "baserom.gba", 0x2db67c, 0x3
gUnknown_082DB67F:: @ 82DB67F
BattleScript_SynchronizeActivates:: @ 82DB67F
.incbin "baserom.gba", 0x2db67f, 0x3
gUnknown_082DB682:: @ 82DB682
@ -441,7 +441,7 @@ gUnknown_082DB695:: @ 82DB695
gUnknown_082DB6A5:: @ 82DB6A5
.incbin "baserom.gba", 0x2db6a5, 0x8
gUnknown_082DB6AD:: @ 82DB6AD
BattleScript_MoveUsedLoafingAround:: @ 82DB6AD
.incbin "baserom.gba", 0x2db6ad, 0x2c
gUnknown_082DB6D9:: @ 82DB6D9
@ -453,64 +453,64 @@ gUnknown_082DB6F0:: @ 82DB6F0
gUnknown_082DB6FB:: @ 82DB6FB
.incbin "baserom.gba", 0x2db6fb, 0xb
gUnknown_082DB706:: @ 82DB706
BattleScript_BerryCurePrlzEnd2:: @ 82DB706
.incbin "baserom.gba", 0x2db706, 0x6
gUnknown_082DB70C:: @ 82DB70C
BattleScript_BerryCureParRet:: @ 82DB70C
.incbin "baserom.gba", 0x2db70c, 0x12
gUnknown_082DB71E:: @ 82DB71E
BattleScript_BerryCurePsnEnd2:: @ 82DB71E
.incbin "baserom.gba", 0x2db71e, 0x6
gUnknown_082DB724:: @ 82DB724
BattleScript_BerryCurePsnRet:: @ 82DB724
.incbin "baserom.gba", 0x2db724, 0x12
gUnknown_082DB736:: @ 82DB736
BattleScript_BerryCureBrnEnd2:: @ 82DB736
.incbin "baserom.gba", 0x2db736, 0x6
gUnknown_082DB73C:: @ 82DB73C
BattleScript_BerryCureBrnRet:: @ 82DB73C
.incbin "baserom.gba", 0x2db73c, 0x12
gUnknown_082DB74E:: @ 82DB74E
BattleScript_BerryCureFrzEnd2:: @ 82DB74E
.incbin "baserom.gba", 0x2db74e, 0x6
gUnknown_082DB754:: @ 82DB754
BattleScript_BerryCureFrzRet:: @ 82DB754
.incbin "baserom.gba", 0x2db754, 0x12
gUnknown_082DB766:: @ 82DB766
BattleScript_BerryCureSlpEnd2:: @ 82DB766
.incbin "baserom.gba", 0x2db766, 0x6
gUnknown_082DB76C:: @ 82DB76C
BattleScript_BerryCureSlpRet:: @ 82DB76C
.incbin "baserom.gba", 0x2db76c, 0x12
gUnknown_082DB77E:: @ 82DB77E
BattleScript_BerryCureConfusionEnd2:: @ 82DB77E
.incbin "baserom.gba", 0x2db77e, 0x6
gUnknown_082DB784:: @ 82DB784
BattleScript_BerryCureConfusionRet:: @ 82DB784
.incbin "baserom.gba", 0x2db784, 0x10
gUnknown_082DB794:: @ 82DB794
BattleScript_BerryCureChosenStatusEnd2:: @ 82DB794
.incbin "baserom.gba", 0x2db794, 0x6
gUnknown_082DB79A:: @ 82DB79A
BattleScript_BerryCureChosenStatusRet:: @ 82DB79A
.incbin "baserom.gba", 0x2db79a, 0x14
gUnknown_082DB7AE:: @ 82DB7AE
BattleScript_WhiteHerbEnd2:: @ 82DB7AE
.incbin "baserom.gba", 0x2db7ae, 0x6
gUnknown_082DB7B4:: @ 82DB7B4
BattleScript_WhiteHerbRet:: @ 82DB7B4
.incbin "baserom.gba", 0x2db7b4, 0x10
gUnknown_082DB7C4:: @ 82DB7C4
BattleScript_ItemHealHP_RemoveItem:: @ 82DB7C4
.incbin "baserom.gba", 0x2db7c4, 0x1d
gUnknown_082DB7E1:: @ 82DB7E1
BattleScript_BerryPPHealEnd2:: @ 82DB7E1
.incbin "baserom.gba", 0x2db7e1, 0x10
gUnknown_082DB7F1:: @ 82DB7F1
BattleScript_ItemHealHP_End2:: @ 82DB7F1
.incbin "baserom.gba", 0x2db7f1, 0x6
gUnknown_082DB7F7:: @ 82DB7F7
BattleScript_ItemHealHP_Ret:: @ 82DB7F7
.incbin "baserom.gba", 0x2db7f7, 0x1b
gUnknown_082DB812:: @ 82DB812
@ -519,13 +519,13 @@ gUnknown_082DB812:: @ 82DB812
gUnknown_082DB816:: @ 82DB816
.incbin "baserom.gba", 0x2db816, 0xe
gUnknown_082DB824:: @ 82DB824
BattleScript_BerryConfuseHealEnd2:: @ 82DB824
.incbin "baserom.gba", 0x2db824, 0x2a
gUnknown_082DB84E:: @ 82DB84E
BattleScript_BerryStatRaiseEnd2:: @ 82DB84E
.incbin "baserom.gba", 0x2db84e, 0x1b
gUnknown_082DB869:: @ 82DB869
BattleScript_BerryFocusEnergyEnd2:: @ 82DB869
.incbin "baserom.gba", 0x2db869, 0x10
gUnknown_082DB879:: @ 82DB879

View File

@ -227,25 +227,25 @@ gUnknown_0831BC0C:: @ 831BC0C
gUnknown_0831BC44:: @ 831BC44
.incbin "baserom.gba", 0x31bc44, 0x2c
gUnknown_0831BC70:: @ 831BC70
gStatusConditionString_PoisonJpn:: @ 831BC70
.incbin "baserom.gba", 0x31bc70, 0x8
gUnknown_0831BC78:: @ 831BC78
gStatusConditionString_SleepJpn:: @ 831BC78
.incbin "baserom.gba", 0x31bc78, 0x8
gUnknown_0831BC80:: @ 831BC80
gStatusConditionString_ParalysisJpn:: @ 831BC80
.incbin "baserom.gba", 0x31bc80, 0x8
gUnknown_0831BC88:: @ 831BC88
gStatusConditionString_BurnJpn:: @ 831BC88
.incbin "baserom.gba", 0x31bc88, 0x8
gUnknown_0831BC90:: @ 831BC90
gStatusConditionString_IceJpn:: @ 831BC90
.incbin "baserom.gba", 0x31bc90, 0x8
gUnknown_0831BC98:: @ 831BC98
gStatusConditionString_ConfusionJpn:: @ 831BC98
.incbin "baserom.gba", 0x31bc98, 0x8
gUnknown_0831BCA0:: @ 831BCA0
gStatusConditionString_LoveJpn:: @ 831BCA0
.incbin "baserom.gba", 0x31bca0, 0x8
gUnknown_0831BCA8:: @ 831BCA8
@ -260,6 +260,6 @@ gUnknown_0831BCEF:: @ 831BCEF
gUnknown_0831BCF3:: @ 831BCF3
.incbin "baserom.gba", 0x31bcf3, 0x5
gUnknown_0831BCF8:: @ 831BCF8
gSoundMovesTable:: @ 831BCF8
.incbin "baserom.gba", 0x31bcf8, 0x18

View File

@ -1,6 +1,8 @@
#ifndef GUARD_BATTLE_H
#define GUARD_BATTLE_H
#define BATTLE_BANKS_COUNT 4
#define BATTLE_TYPE_DOUBLE 0x0001
#define BATTLE_TYPE_LINK 0x0002
#define BATTLE_TYPE_WILD 0x0004
@ -24,6 +26,7 @@
#define BATTLE_TYPE_x100000 0x100000
#define BATTLE_TYPE_PYRAMID 0x200000
#define BATTLE_TYPE_INGAME_PARTNER 0x400000
#define BATTLE_TYPE_x800000 0x800000
#define BATTLE_TYPE_RECORDED 0x1000000
#define BATTLE_TYPE_x2000000 0x2000000
#define BATTLE_TYPE_x4000000 0x4000000
@ -135,26 +138,26 @@
#define SIDE_STATUS_MIST (1 << 8)
#define SIDE_STATUS_SPIKES_DAMAGED (1 << 9)
#define ABILITYEFFECT_ON_SWITCHIN 0x0
#define ABILITYEFFECT_ENDTURN 0x1
#define ABILITYEFFECT_MOVES_BLOCK 0x2
#define ABILITYEFFECT_ABSORBING 0x3
#define ABILITYEFFECT_CONTACT 0x4
#define ABILITYEFFECT_IMMUNITY 0x5
#define ABILITYEFFECT_FORECAST 0x6
#define ABILITYEFFECT_SYNCHRONIZE 0x7
#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
#define ABILITYEFFECT_INTIMIDATE1 0x9
#define ABILITYEFFECT_INTIMIDATE2 0xA
#define ABILITYEFFECT_TRACE 0xB
#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD
#define ABILITYEFFECT_FIELD_SPORT 0xE
#define ABILITYEFFECT_ON_SWITCHIN 0x0
#define ABILITYEFFECT_ENDTURN 0x1
#define ABILITYEFFECT_MOVES_BLOCK 0x2
#define ABILITYEFFECT_ABSORBING 0x3
#define ABILITYEFFECT_CONTACT 0x4
#define ABILITYEFFECT_IMMUNITY 0x5
#define ABILITYEFFECT_FORECAST 0x6
#define ABILITYEFFECT_SYNCHRONIZE 0x7
#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
#define ABILITYEFFECT_INTIMIDATE1 0x9
#define ABILITYEFFECT_INTIMIDATE2 0xA
#define ABILITYEFFECT_TRACE 0xB
#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
#define ABILITYEFFECT_CHECK_BANK_SIDE 0xD
#define ABILITYEFFECT_FIELD_SPORT 0xE
#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BANK 0xF
#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10
#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
#define ABILITYEFFECT_COUNT_OTHER_SIZE 0x10
#define ABILITYEFFECT_COUNT_BANK_SIDE 0x11
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
#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)))
@ -171,7 +174,6 @@
#define MAX_TRAINER_ITEMS 4
#define MAX_MON_MOVES 4
#define MAX_BANKS_BATTLE 4
#define WEATHER_RAIN_TEMPORARY (1 << 0)
#define WEATHER_RAIN_DOWNPOUR (1 << 1)
@ -186,8 +188,26 @@
#define WEATHER_HAIL (1 << 7)
#define WEATHER_HAIL_ANY ((WEATHER_HAIL))
u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
u8 GetBankSide(u8 bank);
#define REQUEST_ALL_BATTLE 0x0
#define REQUEST_SPECIES_BATTLE 0x1
#define REQUEST_HELDITEM_BATTLE 0x2
#define REQUEST_MOVES_PP_BATTLE 0x3
#define REQUEST_PPMOVE1_BATTLE 0x9
#define REQUEST_PPMOVE2_BATTLE 0xA
#define REQUEST_PPMOVE3_BATTLE 0xB
#define REQUEST_PPMOVE4_BATTLE 0xC
#define REQUEST_STATUS_BATTLE 0x28
#define REQUEST_HP_BATTLE 0x2A
// array entries for battle communication
#define MOVE_EFFECT_BYTE 0x3
#define MULTISTRING_CHOOSER 0x5
#define MSG_DISPLAY 0x7
// functions
extern u8 AbilityBattleEffects(u8 caseID, u8 bank, u8 ability, u8 special, u16 moveArg);
extern u8 GetBankSide(u8 bank);
struct Trainer
{
@ -248,9 +268,102 @@ struct DisableStruct
/*0x1A*/ u8 unk1A[2];
};
extern struct DisableStruct gDisableStructs[];
extern struct DisableStruct gDisableStructs[BATTLE_BANKS_COUNT];
struct ProtectStruct
{
/* field_0 */
u32 protected:1;
u32 endured:1;
u32 onlyStruggle:1;
u32 helpingHand:1;
u32 bounceMove:1;
u32 stealMove:1;
u32 flag0Unknown:1;
u32 prlzImmobility:1;
/* field_1 */
u32 confusionSelfDmg:1;
u32 notEffective:1;
u32 chargingTurn:1;
u32 fleeFlag:2; // for RunAway and Smoke Ball
u32 usedImprisionedMove:1;
u32 loveImmobility:1;
u32 usedDisabledMove:1;
/* field_2 */
u32 usedTauntedMove:1; // 0x1
u32 flag2Unknown:1; // 0x2
u32 flinchImmobility:1; // 0x4
u32 notFirstStrike:1; // 0x8
u32 flag_x10 : 1; // 0x10
u32 flag_x20 : 1; // 0x20
u32 flag_x40 : 1; // 0x40
u32 flag_x80 : 1; // 0x80
/* field_3 */
u32 field3 : 8;
/* field_4 */ u32 physicalDmg;
/* field_8 */ u32 specialDmg;
/* field_C */ u8 physicalBank;
/* field_D */ u8 specialBank;
/* field_E */ u16 fieldE;
};
extern struct ProtectStruct gProtectStructs[BATTLE_BANKS_COUNT];
struct SpecialStatus
{
u8 statLowered : 1;
u8 lightningRodRedirected : 1;
u8 restoredBankSprite: 1;
u8 intimidatedPoke : 1;
u8 traced : 1;
u8 flag20 : 1;
u8 flag40 : 1;
u8 focusBanded : 1;
u8 field1[3];
s32 moveturnLostHP;
s32 moveturnLostHP_physical;
s32 moveturnLostHP_special;
u8 moveturnPhysicalBank;
u8 moveturnSpecialBank;
u8 field12;
u8 field13;
};
extern struct SpecialStatus gSpecialStatuses[BATTLE_BANKS_COUNT];
struct SideTimer
{
/*0x00*/ u8 reflectTimer;
/*0x01*/ u8 reflectBank;
/*0x02*/ u8 lightscreenTimer;
/*0x03*/ u8 lightscreenBank;
/*0x04*/ u8 mistTimer;
/*0x05*/ u8 mistBank;
/*0x06*/ u8 safeguardTimer;
/*0x07*/ u8 safeguardBank;
/*0x08*/ u8 followmeTimer;
/*0x09*/ u8 followmeTarget;
/*0x0A*/ u8 spikesAmount;
/*0x0B*/ u8 fieldB;
};
extern struct SideTimer gSideTimers[];
struct WishFutureKnock
{
u8 futureSightCounter[BATTLE_BANKS_COUNT];
u8 futureSightAttacker[BATTLE_BANKS_COUNT];
s32 futureSightDmg[BATTLE_BANKS_COUNT];
u16 futureSightMove[BATTLE_BANKS_COUNT];
u8 wishCounter[BATTLE_BANKS_COUNT];
u8 wishUserID[BATTLE_BANKS_COUNT];
u8 weatherDuration;
u16 knockedOffPokes;
};
extern struct WishFutureKnock gWishFutureKnock;
//size should be 0x1C
struct AI_ThinkingStruct
{
u8 aiState;
@ -267,23 +380,28 @@ struct AI_ThinkingStruct
struct UsedMoves
{
u16 moves[4];
u16 unknown[4];
u16 moves[BATTLE_BANKS_COUNT];
u16 unknown[BATTLE_BANKS_COUNT];
};
//size should be 0x54
struct BattleHistory
{
struct UsedMoves usedMoves[4];
u8 abilities[4];
u8 itemEffects[4];
u16 TrainerItems[4];
struct UsedMoves usedMoves[BATTLE_BANKS_COUNT];
u8 abilities[BATTLE_BANKS_COUNT];
u8 itemEffects[BATTLE_BANKS_COUNT];
u16 TrainerItems[BATTLE_BANKS_COUNT];
u8 itemsNo;
};
struct BattleScriptsStack
{
u8 *ptr[8];
const u8 *ptr[8];
u8 size;
};
struct BattleCallbacksStack
{
void (*function[8])(void);
u8 size;
};
@ -292,7 +410,7 @@ struct BattleResources
struct SecretBaseRecord* secretBase;
struct UnknownFlags *flags;
struct BattleScriptsStack* battleScriptsStack;
void* battleCallbackStack;
struct BattleCallbacksStack* battleCallbackStack;
void* statsBeforeLvlUp;
struct AI_ThinkingStruct *ai;
struct BattleHistory *battleHistory;
@ -301,6 +419,9 @@ struct BattleResources
extern struct BattleResources* gBattleResources;
#define BATTLESCRIPTS_STACK (gBattleResources->battleScriptsStack)
#define BATTLE_CALLBACKS_STACK (gBattleResources->battleCallbackStack)
struct BattleResults
{
u8 playerFaintCounter; // 0x0
@ -331,12 +452,11 @@ extern struct BattleResults gBattleResults;
struct BattleStruct
{
u8 field_1;
u8 field_2;
u8 field_3;
u8 field_4;
u8 wrappedMove1[4];
u8 wrappedMove2[4];
u8 turnEffectsTracker;
u8 turnEffectsBank;
u8 filler2;
u8 turncountersTracker;
u8 wrappedMove[8]; // ask gamefreak why they declared it that way
u8 moveTarget[4];
u8 expGetterId;
u8 field_11;
@ -393,7 +513,7 @@ struct BattleStruct
u8 field_47;
u8 field_48;
u8 field_49;
u8 field_4A;
u8 moneyMultiplier;
u8 field_4B;
u8 field_4C;
u8 field_4D;
@ -411,10 +531,7 @@ struct BattleStruct
u8 field_59;
u8 field_5A;
u8 field_5B;
u8 field_5C;
u8 field_5D;
u8 field_5E;
u8 field_5F;
u8 field_5C[4];
u8 field_60;
u8 field_61;
u8 field_62;
@ -494,10 +611,31 @@ struct BattleStruct
u8 field_B6;
u8 field_B7;
u16 usedHeldItems[4];
u8 field_C0[8];
u16 choicedMove[4];
u8 field_D0[8];
u8 intimidateBank;
u8 fillerD9[0xDA-0xD9];
u8 field_DA;
u8 turnSideTracker;
u8 fillerDC[0xDF-0xDC];
u8 field_DF;
u8 fillerE0[0x1A0-0xE0];
u8 field_1A0;
u8 field_1A1;
u8 filler1A2;
u8 atkCancellerTracker;
};
extern struct BattleStruct* gBattleStruct;
#define MEME_ACCESS_U8(structName, structPtr, arrayId, offsetField, value) \
{ \
u8* var2 = (u8*)((u32)(arrayId)); \
var2 = (u32)(structPtr) + var2; \
var2[offsetof(struct structName, offsetField)] = value; \
}
struct BattleScripting
{
u8 field_0;
@ -513,6 +651,17 @@ struct BattleScripting
u8 field_D;
u8 dmgMultiplier;
u8 field_F;
u8 animArg1;
u8 animArg2;
u8 field_12;
u8 field_13;
u8 atk49_state;
u8 field_15;
u8 field_16;
u8 bank;
u8 field_18;
u8 field_19;
u8 statChanger;
};
extern struct BattleScripting gBattleScripting;

9
include/hall_of_fame.h Normal file
View File

@ -0,0 +1,9 @@
#ifndef GUARD_HALL_OF_FAME_H
#define GUARD_HALL_OF_FAME_H
void sub_8141F90(void);
void sub_8143648(u16 paletteTag, u8 arg1);
void sub_81428CC(void);
void sub_8143680(int, u8);
#endif // GUARD_HALL_OF_FAME_H

View File

@ -439,6 +439,12 @@ struct BattleMove
u8 flags;
};
#define FLAG_MAKES_CONTACT 0x1
#define FLAG_PROTECT_AFFECTED 0x2
#define FLAG_MAGICCOAT_AFFECTED 0x4
#define FLAG_SNATCH_AFFECTED 0x8
#define FLAG_KINGSROCK_AFFECTED 0x20
struct SpindaSpot
{
u8 x, y;

View File

@ -58,7 +58,7 @@ SECTIONS {
src/decompress.o(.text);
asm/battle_1.o(.text);
asm/battle_2.o(.text);
asm/battle_3.o(.text);
src/battle_3.o(.text);
src/battle_4.o(.text);
asm/battle_4.o(.text);
asm/battle_5.o(.text);

6431
src/battle_3.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -87,7 +87,7 @@ static u8 BattleAI_ChooseMoveOrAction_Singles(void);
static u8 BattleAI_ChooseMoveOrAction_Doubles(void);
static void RecordLastUsedMoveByTarget(void);
static void BattleAI_DoAIProcessing(void);
static void AIStackPushVar(u8 *);
static void AIStackPushVar(const u8 *);
static bool8 AIStackPop(void);
static void BattleAICmd_if_random_less_than(void);
@ -192,7 +192,7 @@ static void BattleAICmd_if_holds_item(void);
// ewram
EWRAM_DATA u8 *gAIScriptPtr = NULL;
EWRAM_DATA const u8 *gAIScriptPtr = NULL;
EWRAM_DATA static u8 sBank_AI = 0;
// const rom data
@ -2902,7 +2902,7 @@ static void BattleAICmd_if_flash_fired(void)
gAIScriptPtr += 6;
}
static void AIStackPushVar(u8 *var)
static void AIStackPushVar(const u8 *var)
{
gBattleResources->AI_ScriptsStack->ptr[gBattleResources->AI_ScriptsStack->size++] = var;
}

4
src/hall_of_fame.c Normal file
View File

@ -0,0 +1,4 @@
#include "global.h"
#include "hall_of_fame.h"

View File

@ -346,7 +346,7 @@ gBattleMoveDamage: @ 20241F0
gUnknown_020241F4: @ 20241F4
.space 0x4
gUnknown_020241F8: @ 20241F8
gTakenDmg: @ 20241F8
.space 0x10
gLastUsedItem: @ 2024208
@ -361,10 +361,10 @@ gBankAttacker: @ 202420B
gBankTarget: @ 202420C
.space 0x1
gUnknown_0202420D: @ 202420D
gBank1: @ 202420D
.space 0x1
gUnknown_0202420E: @ 202420E
gEffectBank: @ 202420E
.space 0x1
gStringBank: @ 202420F
@ -412,7 +412,7 @@ gUnknown_02024268: @ 2024268
gUnknown_02024270: @ 2024270
.space 0x4
gUnknown_02024274: @ 2024274
gChosenMovesByBanks: @ 2024274
.space 0x8
gBattleMoveFlags: @ 202427C
@ -424,7 +424,7 @@ gHitMarker: @ 2024280
gUnknown_02024284: @ 2024284
.space 0x4
gUnknown_02024288: @ 2024288
gTakenDmgBanks: @ 2024288
.space 0x4
gUnknown_0202428C: @ 202428C
@ -469,7 +469,7 @@ gSpecialStatuses: @ 202437C
gBattleWeather: @ 20243CC
.space 0x4
gUnknown_020243D0: @ 20243D0
gWishFutureKnock: @ 20243D0
.space 0x2C
gUnknown_020243FC: @ 20243FC