diff options
Diffstat (limited to 'engine/battle_anims')
-rw-r--r-- | engine/battle_anims/anim_commands.asm | 195 | ||||
-rw-r--r-- | engine/battle_anims/bg_effects.asm | 261 | ||||
-rw-r--r-- | engine/battle_anims/core.asm | 26 | ||||
-rw-r--r-- | engine/battle_anims/functions.asm | 456 | ||||
-rw-r--r-- | engine/battle_anims/helpers.asm | 18 | ||||
-rw-r--r-- | engine/battle_anims/pokeball_wobble.asm | 2 |
6 files changed, 415 insertions, 543 deletions
diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 1f4da606d..600168a9a 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -1,7 +1,6 @@ ; Battle animation command interpreter. -PlayBattleAnim: ; cc0d6 - +PlayBattleAnim: ld a, [rSVBK] push af @@ -13,10 +12,8 @@ PlayBattleAnim: ; cc0d6 pop af ld [rSVBK], a ret -; cc0e4 - -_PlayBattleAnim: ; cc0e4 +_PlayBattleAnim: ld c, 6 .wait call BattleAnimDelayFrame @@ -52,10 +49,8 @@ _PlayBattleAnim: ; cc0e4 call BattleAnimDelayFrame call WaitSFX ret -; cc11c - -BattleAnimRunScript: ; cc11c +BattleAnimRunScript: ld a, [wFXAnimID + 1] and a jr nz, .hi_byte @@ -97,10 +92,8 @@ BattleAnimRunScript: ; cc11c .done call BattleAnim_RevertPals ret -; cc163 - -RunBattleAnimScript: ; cc163 +RunBattleAnimScript: call ClearBattleAnims .playframe @@ -140,10 +133,8 @@ RunBattleAnimScript: ; cc163 call BattleAnim_ClearCGB_OAMFlags ret -; cc1a1 - -BattleAnimClearHud: ; cc1a1 +BattleAnimClearHud: call BattleAnimDelayFrame call WaitTop call ClearActorHud @@ -154,10 +145,8 @@ BattleAnimClearHud: ; cc1a1 call BattleAnimDelayFrame call WaitTop ret -; cc1bb - -BattleAnimRestoreHuds: ; cc1bb +BattleAnimRestoreHuds: call BattleAnimDelayFrame call WaitTop @@ -180,10 +169,8 @@ BattleAnimRestoreHuds: ; cc1bb call BattleAnimDelayFrame call WaitTop ret -; cc1e2 - -BattleAnimRequestPals: ; cc1e2 +BattleAnimRequestPals: ld a, [hCGB] and a ret z @@ -200,9 +187,8 @@ BattleAnimRequestPals: ; cc1e2 cp b call nz, BattleAnim_SetOBPals ret -; cc1fb -BattleAnimDelayFrame: ; cc1fb +BattleAnimDelayFrame: ; Like DelayFrame but wastes battery life. ld a, 1 @@ -212,10 +198,8 @@ BattleAnimDelayFrame: ; cc1fb and a jr nz, .wait ret -; cc207 - -ClearActorHud: ; cc207 +ClearActorHud: ld a, [hBattleTurn] and a jr z, .player @@ -230,9 +214,8 @@ ClearActorHud: ; cc207 lb bc, 5, 11 call ClearBox ret -; cc220 -Unreferenced_Functioncc220: ; cc220 +Unreferenced_Functioncc220: xor a ld [hBGMapMode], a ld a, LOW(vBGMap0 tile $28) @@ -248,11 +231,8 @@ Unreferenced_Functioncc220: ; cc220 ld [hBGMapAddress + 1], a call BattleAnimDelayFrame ret -; cc23d - - -BattleAnim_ClearCGB_OAMFlags: ; cc23d +BattleAnim_ClearCGB_OAMFlags: ld a, [wBattleAnimFlags] bit 3, a jr z, .delete @@ -279,16 +259,14 @@ endr dec c jr nz, .loop2 ret -; cc25f -RunBattleAnimCommand: ; cc25f +RunBattleAnimCommand: call .CheckTimer ret nc call .RunScript ret -; cc267 -.CheckTimer: ; cc267 +.CheckTimer: ld a, [wBattleAnimDuration] and a jr z, .done @@ -301,13 +279,12 @@ RunBattleAnimCommand: ; cc25f .done scf ret -; cc275 -.RunScript: ; cc275 +.RunScript: .loop call GetBattleAnimByte - cp $ff + cp anim_ret_command jr nz, .not_done_with_anim ; Return from a subroutine. @@ -329,9 +306,8 @@ RunBattleAnimCommand: ; cc25f call .DoCommand jr .loop -; cc293 -.DoCommand: ; cc293 +.DoCommand: ; Execute battle animation command in [wBattleAnimByte]. ld a, [wBattleAnimByte] sub $d0 @@ -346,10 +322,8 @@ RunBattleAnimCommand: ; cc25f ld h, [hl] ld l, a jp hl -; cc2a4 - -BattleAnimCommands:: ; cc2a4 (33:42a4) +BattleAnimCommands:: ; entries correspond to macros/scripts/battle_anims.asm enumeration dw BattleAnimCmd_Obj dw BattleAnimCmd_1GFX @@ -400,14 +374,13 @@ BattleAnimCommands:: ; cc2a4 (33:42a4) dw BattleAnimCmd_Call dw BattleAnimCmd_Ret - BattleAnimCmd_EA: BattleAnimCmd_EB: BattleAnimCmd_EC: -BattleAnimCmd_ED: ; cc304 (33:4304) +BattleAnimCmd_ED: ret -BattleAnimCmd_Ret: ; cc305 (33:4305) +BattleAnimCmd_Ret: ld hl, wBattleAnimFlags res 1, [hl] ld hl, wBattleAnimParent @@ -420,7 +393,7 @@ BattleAnimCmd_Ret: ; cc305 (33:4305) ld [hl], d ret -BattleAnimCmd_Call: ; cc317 (33:4317) +BattleAnimCmd_Call: call GetBattleAnimByte ld e, a call GetBattleAnimByte @@ -443,7 +416,7 @@ BattleAnimCmd_Call: ; cc317 (33:4317) set 1, [hl] ret -BattleAnimCmd_Jump: ; cc339 (33:4339) +BattleAnimCmd_Jump: call GetBattleAnimByte ld e, a call GetBattleAnimByte @@ -454,7 +427,7 @@ BattleAnimCmd_Jump: ; cc339 (33:4339) ld [hl], d ret -BattleAnimCmd_Loop: ; cc348 (33:4348) +BattleAnimCmd_Loop: call GetBattleAnimByte ld hl, wBattleAnimFlags bit 2, [hl] @@ -495,7 +468,7 @@ BattleAnimCmd_Loop: ; cc348 (33:4348) ld [hl], e ret -BattleAnimCmd_JumpUntil: ; cc383 (33:4383) +BattleAnimCmd_JumpUntil: ld hl, wBattleAnimParam ld a, [hl] and a @@ -524,17 +497,17 @@ BattleAnimCmd_JumpUntil: ; cc383 (33:4383) ld [hl], e ret -BattleAnimCmd_SetVar: ; cc3a6 (33:43a6) +BattleAnimCmd_SetVar: call GetBattleAnimByte ld [wBattleAnimVar], a ret -BattleAnimCmd_IncVar: ; cc3ad (33:43ad) +BattleAnimCmd_IncVar: ld hl, wBattleAnimVar inc [hl] ret -BattleAnimCmd_IfVarEqual: ; cc3b2 (33:43b2) +BattleAnimCmd_IfVarEqual: call GetBattleAnimByte ld hl, wBattleAnimVar cp [hl] @@ -562,7 +535,7 @@ BattleAnimCmd_IfVarEqual: ; cc3b2 (33:43b2) ld [hl], d ret -BattleAnimCmd_IfParamEqual: ; cc3d6 (33:43d6) +BattleAnimCmd_IfParamEqual: call GetBattleAnimByte ld hl, wBattleAnimParam cp [hl] @@ -590,7 +563,7 @@ BattleAnimCmd_IfParamEqual: ; cc3d6 (33:43d6) ld [hl], d ret -BattleAnimCmd_IfParamAnd: ; cc3fa (33:43fa) +BattleAnimCmd_IfParamAnd: call GetBattleAnimByte ld e, a ld a, [wBattleAnimParam] @@ -619,7 +592,7 @@ BattleAnimCmd_IfParamAnd: ; cc3fa (33:43fa) ld [hl], d ret -BattleAnimCmd_Obj: ; cc41f (33:441f) +BattleAnimCmd_Obj: ; index, x, y, param call GetBattleAnimByte ld [wBattleAnimTemp0], a @@ -632,7 +605,7 @@ BattleAnimCmd_Obj: ; cc41f (33:441f) call QueueBattleAnimation ret -BattleAnimCmd_BGEffect: ; cc43b (33:443b) +BattleAnimCmd_BGEffect: call GetBattleAnimByte ld [wBattleAnimTemp0], a call GetBattleAnimByte @@ -644,22 +617,22 @@ BattleAnimCmd_BGEffect: ; cc43b (33:443b) call _QueueBGEffect ret -BattleAnimCmd_BGP: ; cc457 (33:4457) +BattleAnimCmd_BGP: call GetBattleAnimByte ld [wBGP], a ret -BattleAnimCmd_OBP0: ; cc45e (33:445e) +BattleAnimCmd_OBP0: call GetBattleAnimByte ld [wOBP0], a ret -BattleAnimCmd_OBP1: ; cc465 (33:4465) +BattleAnimCmd_OBP1: call GetBattleAnimByte ld [wOBP1], a ret -BattleAnimCmd_ResetObp0: ; cc46c (33:446c) +BattleAnimCmd_ResetObp0: ld a, [hSGB] and a ld a, $e0 @@ -669,7 +642,7 @@ BattleAnimCmd_ResetObp0: ; cc46c (33:446c) ld [wOBP0], a ret -BattleAnimCmd_ClearObjs: ; cc479 (33:4479) +BattleAnimCmd_ClearObjs: ld hl, wActiveAnimObjects ld a, $a0 .loop @@ -683,7 +656,7 @@ BattleAnimCmd_1GFX: BattleAnimCmd_2GFX: BattleAnimCmd_3GFX: BattleAnimCmd_4GFX: -BattleAnimCmd_5GFX: ; cc485 (33:4485) +BattleAnimCmd_5GFX: ld a, [wBattleAnimByte] and $f ld c, a @@ -718,7 +691,7 @@ endr jr nz, .loop ret -BattleAnimCmd_IncObj: ; cc4c0 (33:44c0) +BattleAnimCmd_IncObj: call GetBattleAnimByte ld e, 10 ld bc, wActiveAnimObjects @@ -743,7 +716,7 @@ BattleAnimCmd_IncObj: ; cc4c0 (33:44c0) inc [hl] ret -BattleAnimCmd_IncBGEffect: ; cc4e3 (33:44e3) +BattleAnimCmd_IncBGEffect: call GetBattleAnimByte ld e, 5 ld bc, wActiveBGEffects @@ -768,7 +741,7 @@ BattleAnimCmd_IncBGEffect: ; cc4e3 (33:44e3) inc [hl] ret -BattleAnimCmd_SetObj: ; cc506 (33:4506) +BattleAnimCmd_SetObj: call GetBattleAnimByte ld e, 10 ld bc, wActiveAnimObjects @@ -794,8 +767,7 @@ BattleAnimCmd_SetObj: ; cc506 (33:4506) ld [hl], a ret -BattleAnimCmd_EnemyFeetObj: ; cc52c (33:452c) - +BattleAnimCmd_EnemyFeetObj: ld hl, wBattleAnimTileDict .loop ld a, [hl] @@ -828,7 +800,7 @@ BattleAnimCmd_EnemyFeetObj: ; cc52c (33:452c) call .LoadFootprint ret -.LoadFootprint: ; cc561 (33:4561) +.LoadFootprint: push af push hl push de @@ -849,8 +821,7 @@ BattleAnimCmd_EnemyFeetObj: ; cc52c (33:452c) jr nz, .LoadFootprint ret -BattleAnimCmd_PlayerHeadObj: ; cc57e (33:457e) - +BattleAnimCmd_PlayerHeadObj: ld hl, wBattleAnimTileDict .loop ld a, [hl] @@ -883,7 +854,7 @@ BattleAnimCmd_PlayerHeadObj: ; cc57e (33:457e) call .LoadHead ret -.LoadHead: ; cc5b3 (33:45b3) +.LoadHead: push af push hl push de @@ -904,16 +875,16 @@ BattleAnimCmd_PlayerHeadObj: ; cc57e (33:457e) jr nz, .LoadHead ret -BattleAnimCmd_CheckPokeball: ; cc5d0 (33:45d0) +BattleAnimCmd_CheckPokeball: callfar GetPokeBallWobble ld a, c ld [wBattleAnimVar], a ret -BattleAnimCmd_E7: ; cc5db (33:45db) +BattleAnimCmd_E7: ret -BattleAnimCmd_Transform: ; cc5dc (33:45dc) +BattleAnimCmd_Transform: ld a, [rSVBK] push af ld a, BANK(wCurPartySpecies) @@ -948,8 +919,7 @@ BattleAnimCmd_Transform: ; cc5dc (33:45dc) ld [rSVBK], a ret -BattleAnimCmd_UpdateActorPic: ; cc622 (33:4622) - +BattleAnimCmd_UpdateActorPic: ld de, vTiles0 tile $00 ld a, [hBattleTurn] and a @@ -968,8 +938,7 @@ BattleAnimCmd_UpdateActorPic: ; cc622 (33:4622) call Request2bpp ret -BattleAnimCmd_RaiseSub: ; cc640 (33:4640) - +BattleAnimCmd_RaiseSub: ld a, [rSVBK] push af ld a, 1 ; unnecessary bankswitch? @@ -977,7 +946,7 @@ BattleAnimCmd_RaiseSub: ; cc640 (33:4640) xor a ; sScratch call GetSRAMBank -GetSubstitutePic: ; cc64c +GetSubstitutePic: ; used only for BANK(GetSubstitutePic) ld hl, sScratch ld bc, (7 * 7) tiles @@ -1037,13 +1006,13 @@ GetSubstitutePic: ; cc64c ld [rSVBK], a ret -.CopyTile: ; cc6c6 (33:46c6) +.CopyTile: ld bc, 1 tiles ld a, BANK(MonsterSpriteGFX) call FarCopyBytes ret -BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf) +BattleAnimCmd_MinimizeOpp: ld a, [rSVBK] push af ld a, 1 ; unnecessary bankswitch? @@ -1057,7 +1026,7 @@ BattleAnimCmd_MinimizeOpp: ; cc6cf (33:46cf) ld [rSVBK], a ret -GetMinimizePic: ; cc6e7 (33:46e7) +GetMinimizePic: ld hl, sScratch ld bc, $31 tiles .loop @@ -1087,19 +1056,17 @@ GetMinimizePic: ; cc6e7 (33:46e7) lb bc, BANK(GetMinimizePic), 6 * 6 ret -CopyMinimizePic: ; cc719 (33:4719) +CopyMinimizePic: ld hl, MinimizePic ld bc, $10 ld a, BANK(MinimizePic) call FarCopyBytes ret -; cc725 (33:4725) -MinimizePic: ; cc725 +MinimizePic: INCBIN "gfx/battle/minimize.2bpp" -; cc735 -BattleAnimCmd_Minimize: ; cc735 (33:4735) +BattleAnimCmd_Minimize: ld a, [rSVBK] push af ld a, 1 ; unnecessary bankswitch? @@ -1114,7 +1081,7 @@ BattleAnimCmd_Minimize: ; cc735 (33:4735) ld [rSVBK], a ret -BattleAnimCmd_DropSub: ; cc750 (33:4750) +BattleAnimCmd_DropSub: ld a, [rSVBK] push af ld a, BANK(wCurPartySpecies) @@ -1139,7 +1106,7 @@ BattleAnimCmd_DropSub: ; cc750 (33:4750) ld [rSVBK], a ret -BattleAnimCmd_BeatUp: ; cc776 (33:4776) +BattleAnimCmd_BeatUp: ld a, [rSVBK] push af ld a, BANK(wCurPartySpecies) @@ -1175,31 +1142,31 @@ BattleAnimCmd_BeatUp: ; cc776 (33:4776) ld [rSVBK], a ret -BattleAnimCmd_OAMOn: ; cc7bb (33:47bb) +BattleAnimCmd_OAMOn: xor a ld [hOAMUpdate], a ret -BattleAnimCmd_OAMOff: ; cc7bf (33:47bf) +BattleAnimCmd_OAMOff: ld a, $1 ld [hOAMUpdate], a ret -BattleAnimCmd_ClearSprites: ; cc7c4 (33:47c4) +BattleAnimCmd_ClearSprites: ld hl, wBattleAnimFlags set 3, [hl] ret -BattleAnimCmd_F5: ; cc7ca (33:47ca) +BattleAnimCmd_F5: ret -BattleAnimCmd_F6: ; cc7cb (33:47cb) +BattleAnimCmd_F6: ret -BattleAnimCmd_F7: ; cc7cc (33:47cc) +BattleAnimCmd_F7: ret -BattleAnimCmd_Sound: ; cc7cd (33:47cd) +BattleAnimCmd_Sound: call GetBattleAnimByte ld e, a srl a @@ -1222,13 +1189,11 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd) callfar PlayStereoSFX ret -; cc7f8 (33:47f8) -.GetPanning: ; cc7f8 +.GetPanning: db $f0, $0f, $f0, $0f -; cc7fc -.GetCryTrack: ; cc7fc (33:47fc) +.GetCryTrack: ld a, [hBattleTurn] and a jr nz, .enemy @@ -1241,7 +1206,7 @@ BattleAnimCmd_Sound: ; cc7cd (33:47cd) xor 1 ret -BattleAnimCmd_Cry: ; cc807 (33:4807) +BattleAnimCmd_Cry: call GetBattleAnimByte maskbits NUM_NOISE_CHANS ld e, a @@ -1315,18 +1280,15 @@ endr pop af ld [rSVBK], a ret -; cc871 (33:4871) -.CryData: ; cc871 +.CryData: ; +pitch, +length dw $0000, $00c0 dw $0000, $0040 dw $0000, $0000 dw $0000, $0000 -; cc881 - -PlayHitSound: ; cc881 +PlayHitSound: ld a, [wNumHits] cp $1 jr z, .okay @@ -1350,9 +1312,8 @@ PlayHitSound: ; cc881 .play call PlaySFX ret -; cc8a4 -BattleAnimAssignPals: ; cc8a4 +BattleAnimAssignPals: ld a, [hCGB] and a jr nz, .cgb @@ -1378,9 +1339,8 @@ BattleAnimAssignPals: ; cc8a4 lb de, %11100100, %11100100 call DmgToCgbObjPals ret -; cc8d3 -ClearBattleAnims: ; cc8d3 +ClearBattleAnims: ; Clear animation block ld hl, wLYOverrides ld bc, wBattleAnimEnd - wLYOverrides @@ -1403,9 +1363,8 @@ ClearBattleAnims: ; cc8d3 call BattleAnimAssignPals call BattleAnimDelayFrame ret -; cc8f6 -BattleAnim_RevertPals: ; cc8f6 +BattleAnim_RevertPals: call WaitTop ld a, %11100100 ld [wBGP], a @@ -1421,9 +1380,8 @@ BattleAnim_RevertPals: ; cc8f6 ld a, $1 ld [hBGMapMode], a ret -; cc91a -BattleAnim_SetBGPals: ; cc91a +BattleAnim_SetBGPals: ld [rBGP], a ld a, [hCGB] and a @@ -1449,9 +1407,8 @@ BattleAnim_SetBGPals: ; cc91a ld a, $1 ld [hCGBPalUpdate], a ret -; cc94b -BattleAnim_SetOBPals: ; cc94b +BattleAnim_SetOBPals: ld [rOBP0], a ld a, [hCGB] and a @@ -1471,9 +1428,8 @@ BattleAnim_SetOBPals: ; cc94b ld a, $1 ld [hCGBPalUpdate], a ret -; cc96e -BattleAnim_UpdateOAM_All: ; cc96e +BattleAnim_UpdateOAM_All: ld a, $0 ld [wBattleAnimOAMPointerLo], a ld hl, wActiveAnimObjects @@ -1510,4 +1466,3 @@ BattleAnim_UpdateOAM_All: ; cc96e .done ret -; cc9a1 diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm index 3192774dd..e5e186ab7 100644 --- a/engine/battle_anims/bg_effects.asm +++ b/engine/battle_anims/bg_effects.asm @@ -8,7 +8,7 @@ ; BG effects for use in battle animations. -ExecuteBGEffects: ; c8000 (32:4000) +ExecuteBGEffects: ld hl, wActiveBGEffects ld e, 5 .loop @@ -29,7 +29,7 @@ ExecuteBGEffects: ; c8000 (32:4000) jr nz, .loop ret -QueueBGEffect: ; c801a (32:401a) +QueueBGEffect: ld hl, wActiveBGEffects ld e, 5 .loop @@ -58,13 +58,13 @@ QueueBGEffect: ; c801a (32:401a) ld [hl], a ret -EndBattleBGEffect: ; c8043 (32:4043) +EndBattleBGEffect: ld hl, BG_EFFECT_STRUCT_FUNCTION add hl, bc ld [hl], 0 ret -DoBattleBGEffectFunction: ; c804a (32:404a) +DoBattleBGEffectFunction: ld hl, BG_EFFECT_STRUCT_FUNCTION add hl, bc ld e, [hl] @@ -77,7 +77,7 @@ DoBattleBGEffectFunction: ; c804a (32:404a) ld l, a jp hl -BattleBGEffects: ; c805a (32:405a) +BattleBGEffects: ; entries correspond to ANIM_BG_* constants dw BattleBGEffect_End dw BattleBGEffect_FlashInverted @@ -134,12 +134,11 @@ BattleBGEffects: ; c805a (32:405a) dw BattleBGEffect_WobbleMon dw BattleBGEffect_35 - -BattleBGEffect_End: ; c80c6 (32:40c6) +BattleBGEffect_End: call EndBattleBGEffect ret -BatttleBGEffects_GetNamedJumptablePointer: ; c80ca (32:40ca) +BatttleBGEffects_GetNamedJumptablePointer: ld hl, BG_EFFECT_STRUCT_JT_INDEX add hl, bc ld l, [hl] @@ -151,7 +150,7 @@ BatttleBGEffects_GetNamedJumptablePointer: ; c80ca (32:40ca) ld l, a ret -BattleBGEffects_AnonJumptable: ; c80d7 (32:40d7) +BattleBGEffects_AnonJumptable: pop de ld hl, BG_EFFECT_STRUCT_JT_INDEX add hl, bc @@ -164,31 +163,29 @@ BattleBGEffects_AnonJumptable: ; c80d7 (32:40d7) ld l, a jp hl -BattleBGEffects_IncrementJumptable: ; c80e5 (32:40e5) +BattleBGEffects_IncrementJumptable: ld hl, BG_EFFECT_STRUCT_JT_INDEX add hl, bc inc [hl] ret -BattleBGEffect_FlashInverted: ; c80eb (32:40eb) +BattleBGEffect_FlashInverted: ld de, .inverted jp BattleBGEffect_FlashContinue .inverted db %11100100 ; 3210 db %00011011 ; 0123 -; c80f3 -BattleBGEffect_FlashWhite: ; c80f3 (32:40f3) +BattleBGEffect_FlashWhite: ld de, .white jp BattleBGEffect_FlashContinue .white db %11100100 ; 3210 db %00000000 ; 0000 -; c80fb -BattleBGEffect_FlashContinue: ; c80fb (32:40fb) +BattleBGEffect_FlashContinue: ; current timer, flash duration, number of flashes ld a, $1 ld [wBattleAnimTemp0], a @@ -226,7 +223,7 @@ BattleBGEffect_FlashContinue: ; c80fb (32:40fb) ld [wBGP], a ret -BattleBGEffect_WhiteHues: ; c812d (32:412d) +BattleBGEffect_WhiteHues: ld de, .Pals call BattleBGEffect_GetNthDMGPal jr c, .quit @@ -242,9 +239,8 @@ BattleBGEffect_WhiteHues: ; c812d (32:412d) db %11100000 db %11010000 db -1 -; c8141 -BattleBGEffect_BlackHues: ; c8141 (32:4141) +BattleBGEffect_BlackHues: ld de, .Pals call BattleBGEffect_GetNthDMGPal jr c, .quit @@ -260,9 +256,8 @@ BattleBGEffect_BlackHues: ; c8141 (32:4141) db %11110100 db %11111000 db -1 -; c8155 -BattleBGEffect_AlternateHues: ; c8155 (32:4155) +BattleBGEffect_AlternateHues: ld de, .Pals call BattleBGEffect_GetNthDMGPal jr c, .quit @@ -284,9 +279,8 @@ BattleBGEffect_AlternateHues: ; c8155 (32:4155) db %01000000 db %10010000 db -2 -; c8171 -BattleBGEffect_06: ; c8171 (32:4171) +BattleBGEffect_06: call BattleBGEffects_CheckSGB jr nz, .sgb ld de, .PalsCGB @@ -308,9 +302,8 @@ BattleBGEffect_06: ; c8171 (32:4171) db %11110000 db %11000000 db -2 -; c818b -BattleBGEffect_07: ; c818b (32:418b) +BattleBGEffect_07: call BattleBGEffects_CheckSGB jr nz, .sgb ld de, .PalsCGB @@ -332,9 +325,8 @@ BattleBGEffect_07: ; c818b (32:418b) db %11110000 db %11001100 db -2 -; c81a5 -BattleBGEffect_08: ; c81a5 (32:41a5) +BattleBGEffect_08: ld de, .Pals call BattleBGEffect_GetNthDMGPal ld [wBGP], a @@ -345,9 +337,8 @@ BattleBGEffect_08: ; c81a5 (32:41a5) db %01100011 db %10000111 db -2 -; c81b3 -BattleBGEffect_HideMon: ; c81b3 (32:41b3) +BattleBGEffect_HideMon: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -356,7 +347,6 @@ BattleBGEffect_HideMon: ; c81b3 (32:41b3) dw BattleBGEffects_IncrementJumptable dw .four - .zero call BattleBGEffects_IncrementJumptable push bc @@ -384,7 +374,7 @@ BattleBGEffect_HideMon: ; c81b3 (32:41b3) call EndBattleBGEffect ret -BattleBGEffect_ShowMon: ; c81ea (32:41ea) +BattleBGEffect_ShowMon: call BGEffect_CheckFlyDigStatus jr z, .not_flying call EndBattleBGEffect @@ -412,9 +402,8 @@ BattleBGEffect_ShowMon: ; c81ea (32:41ea) .EnemyData: db 3, $00, 3 db -1 -; c8214 -BattleBGEffect_FeetFollow: ; c8214 (32:4214) +BattleBGEffect_FeetFollow: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -424,7 +413,6 @@ BattleBGEffect_FeetFollow: ; c8214 (32:4214) dw BattleBGEffects_IncrementJumptable dw .five - .zero call BGEffect_CheckFlyDigStatus jr z, .not_flying_digging @@ -482,7 +470,7 @@ BattleBGEffect_FeetFollow: ; c8214 (32:4214) call EndBattleBGEffect ret -BattleBGEffect_HeadFollow: ; c8281 (32:4281) +BattleBGEffect_HeadFollow: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -492,7 +480,6 @@ BattleBGEffect_HeadFollow: ; c8281 (32:4281) dw BattleBGEffects_IncrementJumptable dw .five - .zero call BGEffect_CheckFlyDigStatus jr z, .not_flying_digging @@ -550,11 +537,11 @@ BattleBGEffect_HeadFollow: ; c8281 (32:4281) call EndBattleBGEffect ret -_QueueBattleAnimation: ; c82ee (32:42ee) +_QueueBattleAnimation: callfar QueueBattleAnimation ret -BattleBGEffect_27: ; c82f5 (32:42f5) +BattleBGEffect_27: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -563,7 +550,6 @@ BattleBGEffect_27: ; c82f5 (32:42f5) dw BattleBGEffects_IncrementJumptable dw .four - .zero call BattleBGEffects_IncrementJumptable call BGEffect_CheckBattleTurn @@ -655,7 +641,7 @@ BattleBGEffect_27: ; c82f5 (32:42f5) call EndBattleBGEffect ret -BattleBGEffect_EnterMon: ; c837b (32:437b) +BattleBGEffect_EnterMon: call BGEffect_CheckBattleTurn jr nz, .player_turn ld de, .EnemyData @@ -681,9 +667,8 @@ BattleBGEffect_EnterMon: ; c837b (32:437b) db 4, $00, 4 db 3, $00, 3 db -1 -; c83a8 -BattleBGEffect_ReturnMon: ; c83a8 (32:43a8) +BattleBGEffect_ReturnMon: call BGEffect_CheckBattleTurn jr nz, .player_turn ld de, .EnemyData @@ -717,9 +702,8 @@ BattleBGEffect_ReturnMon: ; c83a8 (32:43a8) db -2, $33, 5 db -3, $00, 0 db -1 -; c83ed -BattleBGEffect_RunPicResizeScript: ; c83ed (32:43ed) +BattleBGEffect_RunPicResizeScript: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -728,7 +712,6 @@ BattleBGEffect_RunPicResizeScript: ; c83ed (32:43ed) dw .restart dw .end - .zero ld hl, BG_EFFECT_STRUCT_03 add hl, bc @@ -918,16 +901,14 @@ ENDM db $00, $15, $2a db $03, $18, $2d db $06, $1b, $30 -; c8545 -BattleBGEffect_Surf: ; c8545 (32:4545) +BattleBGEffect_Surf: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable lb de, 2, 2 @@ -987,14 +968,13 @@ BattleBGEffect_Surf: ; c8545 (32:4545) jr c, .loop2 ret -BattleBGEffect_Whirlpool: ; c8599 (32:4599) +BattleBGEffect_Whirlpool: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1016,14 +996,14 @@ BattleBGEffect_Whirlpool: ; c8599 (32:4599) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_30: ; c85c2 (32:45c2) +BattleBGEffect_30: call BattleBGEffects_ClearLYOverrides ld a, rSCY - $ff00 call BattleBGEffect_SetLCDStatCustoms1 call EndBattleBGEffect ret -BattleBGEffect_31: ; c85ce (32:45ce) +BattleBGEffect_31: ld hl, BG_EFFECT_STRUCT_03 add hl, bc ld a, [hl] @@ -1057,18 +1037,17 @@ BattleBGEffect_31: ; c85ce (32:45ce) call EndBattleBGEffect ret -BattleBGEffect_32: ; c8603 (32:4603) +BattleBGEffect_32: call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_Psychic: ; c8607 (32:4607) +BattleBGEffect_Psychic: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1099,14 +1078,13 @@ BattleBGEffect_Psychic: ; c8607 (32:4607) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_Teleport: ; c863f (32:463f) +BattleBGEffect_Teleport: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1124,14 +1102,13 @@ BattleBGEffect_Teleport: ; c863f (32:463f) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_NightShade: ; c8662 (32:4662) +BattleBGEffect_NightShade: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1152,7 +1129,7 @@ BattleBGEffect_NightShade: ; c8662 (32:4662) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_DoubleTeam: ; c8689 (32:4689) +BattleBGEffect_DoubleTeam: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -1162,7 +1139,6 @@ BattleBGEffect_DoubleTeam: ; c8689 (32:4689) dw .four dw .five - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1247,14 +1223,13 @@ BattleBGEffect_DoubleTeam: ; c8689 (32:4689) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_AcidArmor: ; c8709 (32:4709) +BattleBGEffect_AcidArmor: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1310,14 +1285,13 @@ BattleBGEffect_AcidArmor: ; c8709 (32:4709) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_Withdraw: ; c8761 (32:4761) +BattleBGEffect_Withdraw: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1359,7 +1333,7 @@ BattleBGEffect_Withdraw: ; c8761 (32:4761) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_Dig: ; c87a7 (32:47a7) +BattleBGEffect_Dig: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -1367,7 +1341,6 @@ BattleBGEffect_Dig: ; c87a7 (32:47a7) dw .two dw .three - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1426,7 +1399,7 @@ BattleBGEffect_Dig: ; c87a7 (32:47a7) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_Tackle: ; c8805 (32:4805) +BattleBGEffect_Tackle: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -1434,7 +1407,6 @@ BattleBGEffect_Tackle: ; c8805 (32:4805) dw Tackle_BGEffect25_2d_two dw .three - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1461,7 +1433,7 @@ BattleBGEffect_Tackle: ; c8805 (32:4805) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_25: ; c8837 (32:4837) +BattleBGEffect_25: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -1469,7 +1441,6 @@ BattleBGEffect_25: ; c8837 (32:4837) dw Tackle_BGEffect25_2d_two dw .three - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1537,7 +1508,7 @@ Tackle_BGEffect25_2d_two: ld [hl], a ret -Functionc88a5: ; c88a5 (32:48a5) +Functionc88a5: push af ld a, [wFXAnimID + 1] ; FXAnimID + 1 or a @@ -1589,7 +1560,7 @@ Functionc88a5: ; c88a5 (32:48a5) jr nz, .loop ret -BattleBGEffect_2d: ; c88e7 (32:48e7) +BattleBGEffect_2d: call BattleBGEffects_AnonJumptable .anon_dw dw BGEffect2d_2f_zero @@ -1597,7 +1568,6 @@ BattleBGEffect_2d: ; c88e7 (32:48e7) dw Tackle_BGEffect25_2d_two dw .three - .three call BattleAnim_ResetLCDStatCustom ret @@ -1624,7 +1594,7 @@ BGEffect2d_2f_zero: ld [hl], a ret -BattleBGEffect_2f: ; c8919 (32:4919) +BattleBGEffect_2f: call BattleBGEffects_AnonJumptable .anon_dw dw BGEffect2d_2f_zero @@ -1638,14 +1608,13 @@ BattleBGEffect_2f: ; c8919 (32:4919) .two ret -BattleBGEffect_26: ; c892a (32:492a) +BattleBGEffect_26: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1677,14 +1646,13 @@ BattleBGEffect_26: ; c892a (32:492a) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_2c: ; c8964 (32:4964) +BattleBGEffect_2c: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1732,14 +1700,13 @@ BattleBGEffect_2c: ; c8964 (32:4964) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_28: ; c89b5 (32:49b5) +BattleBGEffect_28: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1775,14 +1742,13 @@ BattleBGEffect_28: ; c89b5 (32:49b5) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_BounceDown: ; c89ee (32:49ee) +BattleBGEffect_BounceDown: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1826,7 +1792,7 @@ BattleBGEffect_BounceDown: ; c89ee (32:49ee) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_2a: ; c8a3a (32:4a3a) +BattleBGEffect_2a: call BattleBGEffects_AnonJumptable .anon_dw dw .zero @@ -1933,15 +1899,13 @@ BattleBGEffect_2a: ; c8a3a (32:4a3a) .data db $00, $40, $90, $e4 db -1 -; c8acc -BattleBGEffect_2b: ; c8acc (32:4acc) +BattleBGEffect_2b: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one - .zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides @@ -1972,7 +1936,7 @@ BattleBGEffect_2b: ; c8acc (32:4acc) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_1c: ; c8b00 (32:4b00) +BattleBGEffect_1c: ld a, [hCGB] and a jr nz, .cgb @@ -1982,7 +1946,6 @@ BattleBGEffect_1c: ; c8b00 (32:4b00) dw .one dw .two - .zero call BattleBGEffects_IncrementJumptable ld a, $e4 @@ -2130,97 +2093,86 @@ BattleBGEffect_1c: ; c8b00 (32:4b00) db $90, $f8 db $40, $fc db $90, $f8 -; c8be8 -BattleBGEffect_RapidFlash: ; c8be8 (32:4be8) +BattleBGEffect_RapidFlash: ld de, .FlashPals call BGEffect_RapidCyclePals ret .FlashPals: db $e4, $6c, $fe -; c8bf2 -BattleBGEffect_16: ; c8bf2 (32:4bf2) +BattleBGEffect_16: ld de, .Pals call BGEffect_RapidCyclePals ret .Pals: db $e4, $90, $40, $ff -; c8bfd -BattleBGEffect_17: ; c8bfd (32:4bfd) +BattleBGEffect_17: ld de, .Pals call BGEffect_RapidCyclePals ret .Pals: db $e4, $f8, $fc, $ff -; c8c08 -BattleBGEffect_18: ; c8c08 (32:4c08) +BattleBGEffect_18: ld de, .Pals call BGEffect_RapidCyclePals ret .Pals: db $e4, $90, $40, $90, $fe -; c8c14 -BattleBGEffect_19: ; c8c14 (32:4c14) +BattleBGEffect_19: ld de, .Pals call BGEffect_RapidCyclePals ret .Pals: db $e4, $f8, $fc, $f8, $fe -; c8c20 -BattleBGEffect_1a: ; c8c20 (32:4c20) +BattleBGEffect_1a: ld de, .Pals call BGEffect_RapidCyclePals ret .Pals: db $e4, $f8, $fc, $f8, $e4, $90, $40, $90, $fe -; c8c30 -BattleBGEffect_1b: ; c8c30 (32:4c30) +BattleBGEffect_1b: ld de, .Pals call BGEffect_RapidCyclePals ret .Pals: db $e4, $fc, $e4, $00, $fe -; c8c3c -BattleBGEffect_1d: ; c8c3c (32:4c3c) +BattleBGEffect_1d: ld de, .Pals call BGEffect_RapidCyclePals ret .Pals: db $e4, $90, $40, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $40, $90, $e4, $ff -; c8c55 -BattleBGEffect_1e: ; c8c55 (32:4c55) +BattleBGEffect_1e: ld de, .Pals call BGEffect_RapidCyclePals ret .Pals: db $00, $40, $90, $e4, $ff -; c8c61 -BattleBGEffect_VibrateMon: ; c8c61 (32:4c61) +BattleBGEffect_VibrateMon: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one - -.zero ; c8c68 (32:4c68) +.zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides ld a, rSCX - $ff00 @@ -2236,7 +2188,7 @@ BattleBGEffect_VibrateMon: ; c8c61 (32:4c61) ld [hl], $20 ret -.one ; c8c85 (32:4c85) +.one ld hl, BG_EFFECT_STRUCT_03 add hl, bc ld a, [hl] @@ -2258,15 +2210,14 @@ BattleBGEffect_VibrateMon: ; c8c61 (32:4c61) call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_WobbleMon: ; c8ca2 (32:4ca2) +BattleBGEffect_WobbleMon: call BattleBGEffects_AnonJumptable .anon_dw dw .zero dw .one dw .two - -.zero ; c8cab (32:4cab) +.zero call BattleBGEffects_IncrementJumptable call BattleBGEffects_ClearLYOverrides ld a, rSCX - $ff00 @@ -2280,7 +2231,7 @@ BattleBGEffect_WobbleMon: ; c8ca2 (32:4ca2) ld [hl], $0 ret -.one ; c8cc3 (32:4cc3) +.one ld hl, BG_EFFECT_STRUCT_03 add hl, bc ld a, [hl] @@ -2296,11 +2247,11 @@ BattleBGEffect_WobbleMon: ; c8ca2 (32:4ca2) ld [hl], a ret -.two ; c8cdd (32:4cdd) +.two call BattleAnim_ResetLCDStatCustom ret -BattleBGEffect_2e: ; c8ce1 (32:4ce1) +BattleBGEffect_2e: call Functionc8d0b jr c, .xor_a bit 7, a @@ -2317,7 +2268,7 @@ BattleBGEffect_2e: ; c8ce1 (32:4ce1) ld [wAnimObject01YOffset], a ret -BattleBGEffect_1f: ; c8cf9 (32:4cf9) +BattleBGEffect_1f: call Functionc8d0b jr nc, .skip xor a @@ -2325,7 +2276,7 @@ BattleBGEffect_1f: ; c8cf9 (32:4cf9) ld [hSCX], a ret -BattleBGEffect_20: ; c8d02 (32:4d02) +BattleBGEffect_20: call Functionc8d0b jr nc, .skip xor a @@ -2333,7 +2284,7 @@ BattleBGEffect_20: ; c8d02 (32:4d02) ld [hSCY], a ret -Functionc8d0b: ; c8d0b (32:4d0b) +Functionc8d0b: ld hl, BG_EFFECT_STRUCT_JT_INDEX add hl, bc ld a, [hl] @@ -2371,7 +2322,7 @@ Functionc8d0b: ; c8d0b (32:4d0b) and a ret -BattleBGEffect_35: ; c8d3a (32:4d3a) +BattleBGEffect_35: ld hl, BG_EFFECT_STRUCT_03 add hl, bc ld a, [hl] @@ -2392,7 +2343,7 @@ BattleBGEffect_35: ; c8d3a (32:4d3a) ld [hSCX], a ret -BattleBGEffect_GetNthDMGPal: ; c8d57 (32:4d57) +BattleBGEffect_GetNthDMGPal: ld hl, BG_EFFECT_STRUCT_JT_INDEX add hl, bc ld a, [hl] @@ -2415,7 +2366,7 @@ BattleBGEffect_GetNthDMGPal: ; c8d57 (32:4d57) call BattleBGEffect_GetFirstDMGPal ret -BGEffect_RapidCyclePals: ; c8d77 (32:4d77) +BGEffect_RapidCyclePals: ld a, [hCGB] and a jr nz, .cgb @@ -2430,8 +2381,7 @@ BGEffect_RapidCyclePals: ; c8d77 (32:4d77) dw .one_dmg dw .two_dmg - -.zero_dmg ; c8d8b (32:4d8b) +.zero_dmg call BattleBGEffects_IncrementJumptable ld a, $e4 call BattleBGEffects_SetLYOverrides @@ -2449,7 +2399,7 @@ BGEffect_RapidCyclePals: ; c8d77 (32:4d77) ld [hl], a ret -.one_dmg ; c8daa (32:4daa) +.one_dmg ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld a, [hl] @@ -2474,7 +2424,7 @@ BGEffect_RapidCyclePals: ; c8d77 (32:4d77) dec [hl] ret -.two_dmg ; c8dc9 (32:4dc9) +.two_dmg call BattleBGEffects_ResetVideoHRAM ld a, %11100100 ld [rBGP], a @@ -2488,15 +2438,14 @@ BGEffect_RapidCyclePals: ; c8d77 (32:4d77) pop de jp hl -.Jumptable_CGB: ; c8ddd (32:4ddd) +.Jumptable_CGB: dw .zero_cgb dw .one_cgb dw .two_cgb dw .three_cgb dw .four_cgb - -.zero_cgb ; c8de7 (32:4de7) +.zero_cgb call BGEffect_CheckBattleTurn jr nz, .player_turn_cgb call BattleBGEffects_IncrementJumptable @@ -2512,7 +2461,7 @@ BGEffect_RapidCyclePals: ; c8d77 (32:4d77) ld [hl], a ret -.one_cgb ; c8e02 (32:4e02) +.one_cgb ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld a, [hl] @@ -2537,13 +2486,13 @@ BGEffect_RapidCyclePals: ; c8d77 (32:4d77) dec [hl] ret -.two_cgb ; c8e21 (32:4e21) +.two_cgb ld a, $e4 call BGEffects_LoadBGPal0_OBPal1 call EndBattleBGEffect ret -.three_cgb ; c8e2a (32:4e2a) +.three_cgb ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld a, [hl] @@ -2568,13 +2517,13 @@ BGEffect_RapidCyclePals: ; c8d77 (32:4d77) dec [hl] ret -.four_cgb ; c8e49 (32:4e49) +.four_cgb ld a, $e4 call BGEffects_LoadBGPal1_OBPal0 call EndBattleBGEffect ret -BGEffects_LoadBGPal0_OBPal1: ; c8e52 (32:4e52) +BGEffects_LoadBGPal0_OBPal1: ld h, a ld a, [rSVBK] push af @@ -2601,7 +2550,7 @@ BGEffects_LoadBGPal0_OBPal1: ; c8e52 (32:4e52) ld [hCGBPalUpdate], a ret -BGEffects_LoadBGPal1_OBPal0: ; c8e7f (32:4e7f) +BGEffects_LoadBGPal1_OBPal0: ld h, a ld a, [rSVBK] push af @@ -2628,12 +2577,12 @@ BGEffects_LoadBGPal1_OBPal0: ; c8e7f (32:4e7f) ld [hCGBPalUpdate], a ret -BattleBGEffect_GetFirstDMGPal: ; c8eac (32:4eac) +BattleBGEffect_GetFirstDMGPal: ld hl, BG_EFFECT_STRUCT_03 add hl, bc ld a, [hl] inc [hl] -BattleBGEffect_GetNextDMGPal: ; c8eb2 (32:4eb2) +BattleBGEffect_GetNextDMGPal: ld l, a ld h, $0 add hl, de @@ -2654,9 +2603,9 @@ BattleBGEffect_GetNextDMGPal: ; c8eb2 (32:4eb2) scf ret -BattleBGEffects_ClearLYOverrides: ; c8eca (32:4eca) +BattleBGEffects_ClearLYOverrides: xor a -BattleBGEffects_SetLYOverrides: ; c8ecb (32:4ecb) +BattleBGEffects_SetLYOverrides: ld hl, wLYOverrides ; wListPointer ld e, $99 .loop1 @@ -2671,7 +2620,7 @@ BattleBGEffects_SetLYOverrides: ; c8ecb (32:4ecb) jr nz, .loop2 ret -BattleBGEffect_SetLCDStatCustoms1: ; c8ede (32:4ede) +BattleBGEffect_SetLCDStatCustoms1: ld [hLCDCPointer], a call BGEffect_CheckBattleTurn jr nz, .player_turn @@ -2687,7 +2636,7 @@ BattleBGEffect_SetLCDStatCustoms1: ; c8ede (32:4ede) ld [hLYOverrideEnd], a ret -BattleBGEffect_SetLCDStatCustoms2: ; c8ef4 (32:4ef4) +BattleBGEffect_SetLCDStatCustoms2: ld [hLCDCPointer], a call BGEffect_CheckBattleTurn jr nz, .player_turn @@ -2703,7 +2652,7 @@ BattleBGEffect_SetLCDStatCustoms2: ; c8ef4 (32:4ef4) ld [hLYOverrideEnd], a ret -BattleAnim_ResetLCDStatCustom: ; c8f0a (32:4f0a) +BattleAnim_ResetLCDStatCustom: xor a ld [hLYOverrideStart], a ld [hLYOverrideEnd], a @@ -2713,7 +2662,7 @@ BattleAnim_ResetLCDStatCustom: ; c8f0a (32:4f0a) call EndBattleBGEffect ret -BattleBGEffects_ResetVideoHRAM: ; c8f19 (32:4f19) +BattleBGEffects_ResetVideoHRAM: xor a ld [hLCDCPointer], a ld a, %11100100 @@ -2725,7 +2674,7 @@ BattleBGEffects_ResetVideoHRAM: ; c8f19 (32:4f19) call BattleBGEffects_ClearLYOverrides ret -Functionc8f2e: ; c8f2e (32:4f2e) +Functionc8f2e: push bc xor a ld [wBattleAnimTemp0], a @@ -2760,7 +2709,7 @@ Functionc8f2e: ; c8f2e (32:4f2e) pop bc ret -InitSurfWaves: ; c8f69 (32:4f69) +InitSurfWaves: push bc xor a ld [wBattleAnimTemp0], a @@ -2788,7 +2737,7 @@ InitSurfWaves: ; c8f69 (32:4f69) pop bc ret -Functionc8f9a: ; c8f9a (32:4f9a) +Functionc8f9a: push bc ld [wBattleAnimTemp3], a ld a, e @@ -2847,7 +2796,7 @@ Functionc8f9a: ; c8f9a (32:4f9a) ld d, $0 ret -BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef) +BattleBGEffect_WavyScreenFX: push bc ld a, [hLYOverrideStart] ld l, a @@ -2874,7 +2823,7 @@ BattleBGEffect_WavyScreenFX: ; c8fef (32:4fef) pop bc ret -BGEffect_FillLYOverridesBackup: ; c900b (32:500b) +BGEffect_FillLYOverridesBackup: push af ld h, HIGH(wLYOverridesBackup) ld a, [hLYOverrideStart] @@ -2889,7 +2838,7 @@ BGEffect_FillLYOverridesBackup: ; c900b (32:500b) jr nz, .loop ret -BGEffect_DisplaceLYOverridesBackup: ; c901b (32:501b) +BGEffect_DisplaceLYOverridesBackup: ; e = a; d = [hLYOverrideEnd] - [hLYOverrideStart] - a push af ld e, a @@ -2915,7 +2864,7 @@ BGEffect_DisplaceLYOverridesBackup: ; c901b (32:501b) jr nz, .loop2 ret -BGEffect_CheckBattleTurn: ; c9038 (32:5038) +BGEffect_CheckBattleTurn: ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld a, [hBattleTurn] @@ -2923,7 +2872,7 @@ BGEffect_CheckBattleTurn: ; c9038 (32:5038) xor [hl] ret -BGEffect_CheckFlyDigStatus: ; c9042 (32:5042) +BGEffect_CheckFlyDigStatus: ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld a, [hBattleTurn] @@ -2939,21 +2888,19 @@ BGEffect_CheckFlyDigStatus: ; c9042 (32:5042) and 1 << SUBSTATUS_FLYING | 1 << SUBSTATUS_UNDERGROUND ret -BattleBGEffects_CheckSGB: ; c9059 (32:5059) +BattleBGEffects_CheckSGB: ld a, [hSGB] and a ret -BattleBGEffects_Sine: ; c905d (32:505d) +BattleBGEffects_Sine: ld e, a callfar BattleAnim_Sine_e ld a, e ret -BattleBGEffects_Cosine: ; c9066 (32:5066) +BattleBGEffects_Cosine: ld e, a callfar BattleAnim_Cosine_e ld a, e ret - -; c906f (32:506f) diff --git a/engine/battle_anims/core.asm b/engine/battle_anims/core.asm index 11578f7f0..0f3bb8488 100644 --- a/engine/battle_anims/core.asm +++ b/engine/battle_anims/core.asm @@ -1,4 +1,4 @@ -QueueBattleAnimation: ; cc9a1 (33:49a1) +QueueBattleAnimation: ld hl, wActiveAnimObjects ld e, 10 .loop @@ -20,15 +20,13 @@ QueueBattleAnimation: ; cc9a1 (33:49a1) call InitBattleAnimation ret -DeinitBattleAnimation: ; cc9bd +DeinitBattleAnimation: ld hl, BATTLEANIMSTRUCT_INDEX add hl, bc ld [hl], $0 ret -; cc9c4 - -InitBattleAnimation: ; cc9c4 (33:49c4) +InitBattleAnimation: ld a, [wBattleAnimTemp0] ld e, a ld d, 0 @@ -79,7 +77,7 @@ endr ld [hl], a ; 10 ret -BattleAnimOAMUpdate: ; cca09 +BattleAnimOAMUpdate: call InitBattleAnimBuffer call GetBattleAnimFrame cp -3 @@ -191,9 +189,7 @@ BattleAnimOAMUpdate: ; cca09 scf ret -; ccaaa - -InitBattleAnimBuffer: ; ccaaa +InitBattleAnimBuffer: ld hl, BATTLEANIMSTRUCT_01 add hl, bc ld a, [hl] @@ -276,9 +272,7 @@ InitBattleAnimBuffer: ; ccaaa ld [wBattleAnimTempXOffset], a ret -; ccb31 - -GetBattleAnimTileOffset: ; ccb31 (33:4b31) +GetBattleAnimTileOffset: push hl push bc ld hl, wBattleAnimTileDict @@ -301,14 +295,10 @@ GetBattleAnimTileOffset: ; ccb31 (33:4b31) pop hl ret -_ExecuteBGEffects: ; ccb48 +_ExecuteBGEffects: callfar ExecuteBGEffects ret -; ccb4f - -_QueueBGEffect: ; ccb4f (33:4b4f) +_QueueBGEffect: callfar QueueBGEffect ret - -; ccb56 (33:4b56) diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm index e0eedec86..d631ca72f 100644 --- a/engine/battle_anims/functions.asm +++ b/engine/battle_anims/functions.asm @@ -1,4 +1,4 @@ -DoBattleAnimFrame: ; ccfbe +DoBattleAnimFrame: ld hl, BATTLEANIMSTRUCT_FUNCTION add hl, bc ld e, [hl] @@ -10,7 +10,6 @@ DoBattleAnimFrame: ; ccfbe ld h, [hl] ld l, a jp hl -; ccfce .Jumptable: ; entries correspond to BATTLEANIMFUNC_* constants @@ -95,7 +94,7 @@ DoBattleAnimFrame: ; ccfbe dw BattleAnimFunction_4E ; 4e dw BattleAnimFunction_4F ; 4f -BattleAnimFunction_Null: ; cd06e (33:506e) +BattleAnimFunction_Null: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -105,13 +104,13 @@ BattleAnimFunction_Null: ; cd06e (33:506e) .zero ret -BattleAnimFunction_ThrowFromPlayerToEnemyAndDisappear: ; cd079 (33:5079) +BattleAnimFunction_ThrowFromPlayerToEnemyAndDisappear: call BattleAnimFunction_ThrowFromPlayerToEnemy ret c call DeinitBattleAnimation ret -BattleAnimFunction_ThrowFromPlayerToEnemy: ; cd081 (33:5081) +BattleAnimFunction_ThrowFromPlayerToEnemy: ; If x coord at $88 or beyond, abort. ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc @@ -143,7 +142,7 @@ BattleAnimFunction_ThrowFromPlayerToEnemy: ; cd081 (33:5081) scf ret -BattleAnimFunction_04: ; cd0a6 (33:50a6) +BattleAnimFunction_04: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -184,7 +183,7 @@ BattleAnimFunction_04: ; cd0a6 (33:50a6) ld [hl], a ret -BattleAnimFunction_03: ; cd0e3 (33:50e3) +BattleAnimFunction_03: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -230,7 +229,7 @@ BattleAnimFunction_03: ; cd0e3 (33:50e3) inc [hl] ret -BattleAnimFunction_01: ; cd12a (33:512a) +BattleAnimFunction_01: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -251,7 +250,7 @@ BattleAnimFunction_01: ; cd12a (33:512a) call Functionce70a ret -BattleAnimFunction_02: ; cd146 (33:5146) +BattleAnimFunction_02: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -267,7 +266,7 @@ BattleAnimFunction_02: ; cd146 (33:5146) call DeinitBattleAnimation ret -BattleAnimFunction_PokeBall: ; cd15c (33:515c) +BattleAnimFunction_PokeBall: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -384,7 +383,7 @@ BattleAnimFunction_PokeBall: ; cd15c (33:515c) call DeinitBattleAnimation ret -BattleAnimFunction_PokeBallBlocked: ; cd212 (33:5212) +BattleAnimFunction_PokeBallBlocked: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -424,7 +423,7 @@ BattleAnimFunction_PokeBallBlocked: ; cd212 (33:5212) call DeinitBattleAnimation ret -GetBallAnimPal: ; cd249 (33:5249) +GetBallAnimPal: ld hl, BallColors ld a, [rSVBK] push af @@ -449,11 +448,10 @@ GetBallAnimPal: ; cd249 (33:5249) add hl, bc ld [hl], a ret -; cd26c (33:526c) INCLUDE "data/battle_anims/ball_colors.asm" -BattleAnimFunction_10: ; cd284 (33:5284) +BattleAnimFunction_10: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -495,7 +493,7 @@ BattleAnimFunction_10: ; cd284 (33:5284) .four ret -BattleAnimFunction_07: ; cd2be (33:52be) +BattleAnimFunction_07: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -542,7 +540,7 @@ BattleAnimFunction_07: ; cd2be (33:52be) call DeinitBattleAnimation ret -BattleAnimFunction_08: ; cd306 (33:5306) +BattleAnimFunction_08: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -654,7 +652,7 @@ BattleAnimFunction_08: ; cd306 (33:5306) jr nz, .loop ret -BattleAnimFunction_09: ; cd3ae (33:53ae) +BattleAnimFunction_09: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -702,7 +700,7 @@ BattleAnimFunction_09: ; cd3ae (33:53ae) call DeinitBattleAnimation ret -BattleAnimFunction_0A: ; cd3f2 (33:53f2) +BattleAnimFunction_0A: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -798,7 +796,7 @@ BattleAnimFunction_0A: ; cd3f2 (33:53f2) .six ret -BattleAnimFunction_RazorLeaf: ; cd478 (33:5478) +BattleAnimFunction_RazorLeaf: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -945,7 +943,7 @@ BattleAnimFunction_RazorLeaf: ; cd478 (33:5478) call Functionce70a ret -Functioncd557: ; cd557 (33:5557) +Functioncd557: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -983,7 +981,7 @@ Functioncd557: ; cd557 (33:5557) ld de, -$100 ret -BattleAnimFunction_4E: ; cd58a (33:558a) +BattleAnimFunction_4E: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -1045,7 +1043,7 @@ BattleAnimFunction_4E: ; cd58a (33:558a) ld [hl], e ret -BattleAnimFunction_0C: ; cd5e9 (33:55e9) +BattleAnimFunction_0C: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -1129,7 +1127,7 @@ BattleAnimFunction_0C: ; cd5e9 (33:55e9) ld [hl], d ret -BattleAnimFunction_0D: ; cd66a (33:566a) +BattleAnimFunction_0D: call BattleAnim_AnonJumptable .anon_dw dw .zero @@ -1205,7 +1203,7 @@ BattleAnimFunction_0D: ; cd66a (33:566a) call DeinitBattleAnimation ret -asm_cd6da: ; cd6da (33:56da) +asm_cd6da: inc a inc a ld [hl], a @@ -1214,13 +1212,13 @@ asm_cd6da: ; cd6da (33:56da) ld [hLYOverrideStart], a ret -BattleAnimFunction_0E: ; cd6e3 (33:56e3) +BattleAnimFunction_0E: call BattleAnim_AnonJumptable .anon_dw dw Functioncd6ea dw Functioncd6f7 -Functioncd6ea: ; cd6ea (33:56ea) +Functioncd6ea: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -1228,7 +1226,7 @@ Functioncd6ea: ; cd6ea (33:56ea) add [hl] ; offset call ReinitBattleAnimFrameset -Functioncd6f7: ; cd6f7 (33:56f7) +Functioncd6f7: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -1251,7 +1249,7 @@ Functioncd6f7: ; cd6f7 (33:56f7) ld [hl], a ret -BattleAnimFunction_0F: ; cd71a (33:571a) +BattleAnimFunction_0F: call BattleAnim_AnonJumptable .anon_dw dw Functioncd725 @@ -1259,9 +1257,9 @@ BattleAnimFunction_0F: ; cd71a (33:571a) dw Functioncd763 dw Functioncd776 -Functioncd725: ; cd725 (33:5725) +Functioncd725: call BattleAnim_IncAnonJumptableIndex -Functioncd728: ; cd728 (33:5728) +Functioncd728: ld hl, BATTLEANIMSTRUCT_YCOORD add hl, bc ld a, [hl] @@ -1295,7 +1293,7 @@ Functioncd728: ; cd728 (33:5728) ld a, [hl] and $1 ld [hl], a -Functioncd763: ; cd763 (33:5763) +Functioncd763: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -1308,10 +1306,10 @@ Functioncd763: ; cd763 (33:5763) call BattleAnim_IncAnonJumptableIndex ld a, BATTLEANIMFRAMESET_29 call ReinitBattleAnimFrameset -Functioncd776: ; cd776 (33:5776) +Functioncd776: ret -BattleAnimFunction_11: ; cd777 (33:5777) +BattleAnimFunction_11: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -1343,13 +1341,13 @@ BattleAnimFunction_11: ; cd777 (33:5777) ld [hl], a ret -BattleAnimFunction_14: ; cd7a4 (33:57a4) +BattleAnimFunction_14: call BattleAnim_AnonJumptable .anon_dw dw Functioncd7ab dw Functioncd7d2 -Functioncd7ab: ; cd7ab (33:57ab) +Functioncd7ab: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -1371,7 +1369,7 @@ Functioncd7ab: ; cd7ab (33:57ab) ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld [hl], $1 -Functioncd7d2: ; cd7d2 (33:57d2) +Functioncd7d2: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -1411,7 +1409,7 @@ Functioncd7d2: ; cd7d2 (33:57d2) dec [hl] ret -BattleAnimFunction_15: ; cd80c (33:580c) +BattleAnimFunction_15: call BattleAnim_AnonJumptable .anon_dw dw Functioncd81f @@ -1419,18 +1417,18 @@ BattleAnimFunction_15: ; cd80c (33:580c) dw Functioncd81f dw Functioncd820 -Functioncd817: ; cd817 (33:5817) +Functioncd817: call BattleAnim_IncAnonJumptableIndex ld a, BATTLEANIMFRAMESET_35 call ReinitBattleAnimFrameset -Functioncd81f: ; cd81f (33:581f) +Functioncd81f: ret -Functioncd820: ; cd820 (33:5820) +Functioncd820: call DeinitBattleAnimation ret -BattleAnimFunction_16: ; cd824 (33:5824) +BattleAnimFunction_16: call BattleAnim_AnonJumptable .anon_dw dw Functioncd835 @@ -1441,7 +1439,7 @@ BattleAnimFunction_16: ; cd824 (33:5824) dw Functioncd88f dw Functioncd893 -Functioncd835: ; cd835 (33:5835) +Functioncd835: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_FRAMESET_ID add hl, bc @@ -1468,7 +1466,7 @@ Functioncd835: ; cd835 (33:5835) ld a, [hl] and $7f ld [hl], a -Functioncd860: ; cd860 (33:5860) +Functioncd860: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -1499,17 +1497,17 @@ Functioncd860: ; cd860 (33:5860) ld a, [hl] and $1f ret nz -Functioncd88f: ; cd88f (33:588f) +Functioncd88f: call BattleAnim_IncAnonJumptableIndex ret -Functioncd893: ; cd893 (33:5893) +Functioncd893: ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX add hl, bc ld [hl], $1 ret -BattleAnimFunction_17: ; cd89a (33:589a) +BattleAnimFunction_17: call BattleAnim_AnonJumptable .anon_dw dw Functioncd8ab @@ -1520,7 +1518,7 @@ BattleAnimFunction_17: ; cd89a (33:589a) dw Functioncd8f5 dw Functioncd8f9 -Functioncd8ab: ; cd8ab (33:58ab) +Functioncd8ab: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -1542,7 +1540,7 @@ Functioncd8ab: ; cd8ab (33:58ab) and $7f ld [hl], a -Functioncd8cc: ; cd8cc (33:58cc) +Functioncd8cc: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -1570,30 +1568,30 @@ Functioncd8cc: ; cd8cc (33:58cc) and $1f ret nz -Functioncd8f5: ; cd8f5 (33:58f5) +Functioncd8f5: call BattleAnim_IncAnonJumptableIndex ret -Functioncd8f9: ; cd8f9 (33:58f9) +Functioncd8f9: ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX add hl, bc ld [hl], $1 ret -BattleAnimFunction_18: ; cd900 (33:5900) +BattleAnimFunction_18: call BattleAnim_AnonJumptable .anon_dw dw Functioncd907 dw Functioncd913 -Functioncd907: ; cd907 (33:5907) +Functioncd907: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld [hl], $28 inc hl ld [hl], $0 -Functioncd913: ; cd913 (33:5913) +Functioncd913: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -1637,7 +1635,7 @@ Functioncd913: ; cd913 (33:5913) call DeinitBattleAnimation ret -BattleAnimFunction_19: ; cd954 (33:5954) +BattleAnimFunction_19: call BattleAnim_AnonJumptable .anon_dw dw Functioncd961 @@ -1646,16 +1644,16 @@ BattleAnimFunction_19: ; cd954 (33:5954) dw Functioncd96a dw Functioncd97b -Functioncd961: ; cd961 (33:5961) +Functioncd961: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld [hl], $0 -Functioncd96a: ; cd96a (33:596a) +Functioncd96a: call Functioncd99a ret -Functioncd96e: ; cd96e (33:596e) +Functioncd96e: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -1664,7 +1662,7 @@ Functioncd96e: ; cd96e (33:596e) call BattleAnim_IncAnonJumptableIndex ret -Functioncd97b: ; cd97b (33:597b) +Functioncd97b: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -1673,7 +1671,7 @@ Functioncd97b: ; cd97b (33:597b) call DeinitBattleAnimation ret -asm_cd988: ; cd988 (33:5988) +asm_cd988: call Functioncd99a ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc @@ -1686,7 +1684,7 @@ asm_cd988: ; cd988 (33:5988) dec [hl] ret -Functioncd99a: ; cd99a (33:599a) +Functioncd99a: call Functioncd9f4 ld hl, BATTLEANIMSTRUCT_0F add hl, bc @@ -1746,7 +1744,7 @@ Functioncd99a: ; cd99a (33:599a) ld [hl], a ret -Functioncd9f4: ; cd9f4 (33:59f4) +Functioncd9f4: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld e, [hl] @@ -1756,12 +1754,10 @@ Functioncd9f4: ; cd9f4 (33:59f4) ld d, [hl] ret -; cda01 (33:5a01) -Unknown_cda01: ; cda01 +Unknown_cda01: db 8, 6, 5, 4, 5, 6, 8, 12, 16 -; cda0a -BattleAnimFunction_1C: ; cda0a (33:5a0a) +BattleAnimFunction_1C: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -1790,14 +1786,14 @@ BattleAnimFunction_1C: ; cda0a (33:5a0a) jr nz, .asm_cda2c ret -BattleAnimFunction_1F: ; cda31 (33:5a31) +BattleAnimFunction_1F: call BattleAnim_AnonJumptable .anon_dw dw Functioncda4c dw Functioncda3a dw Functioncda4c -Functioncda3a: ; cda3a (33:5a3a) +Functioncda3a: ld hl, BATTLEANIMSTRUCT_FRAMESET_ID add hl, bc ld a, [hl] @@ -1807,24 +1803,24 @@ Functioncda3a: ; cda3a (33:5a3a) ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld [hl], $8 -Functioncda4c: ; cda4c (33:5a4c) +Functioncda4c: ret -BattleAnimFunction_LeechSeed: ; cda4d (33:5a4d) +BattleAnimFunction_LeechSeed: call BattleAnim_AnonJumptable .anon_dw dw .zero dw .one dw .two dw .three -.zero: ; cda58 (33:5a58) +.zero: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld [hl], $40 ret -.one: ; cda62 (33:5a62) +.one: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -1840,7 +1836,7 @@ BattleAnimFunction_LeechSeed: ; cda4d (33:5a4d) call BattleAnim_IncAnonJumptableIndex ret -.two: ; cda7a (33:5a7a) +.two: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -1853,10 +1849,10 @@ BattleAnimFunction_LeechSeed: ; cda4d (33:5a4d) call BattleAnim_IncAnonJumptableIndex ld a, BATTLEANIMFRAMESET_58 call ReinitBattleAnimFrameset -.three: ; cda8c (33:5a8c) +.three: ret -Functioncda8d: ; cda8d (33:5a8d) +Functioncda8d: dec [hl] ld d, $20 call BattleAnim_Sine @@ -1904,21 +1900,21 @@ Functioncda8d: ; cda8d (33:5a8d) dec [hl] ret -BattleAnimFunction_3F: ; cdad6 (33:5ad6) +BattleAnimFunction_3F: call BattleAnim_AnonJumptable .anon_dw dw Functioncdadf dw Functioncdae9 dw Functioncdaf9 -Functioncdadf: ; cdadf (33:5adf) +Functioncdadf: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld [hl], $40 ret -Functioncdae9: ; cdae9 (33:5ae9) +Functioncdae9: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -1929,10 +1925,10 @@ Functioncdae9: ; cdae9 (33:5ae9) .asm_cdaf6 call BattleAnim_IncAnonJumptableIndex -Functioncdaf9: ; cdaf9 (33:5af9) +Functioncdaf9: ret -BattleAnimFunction_1A: ; cdafa (33:5afa) +BattleAnimFunction_1A: call BattleAnimFunction_03 ld hl, BATTLEANIMSTRUCT_0F add hl, bc @@ -1941,7 +1937,7 @@ BattleAnimFunction_1A: ; cdafa (33:5afa) ld [hl], a ret -BattleAnimFunction_1B: ; cdb06 (33:5b06) +BattleAnimFunction_1B: call BattleAnim_AnonJumptable .anon_dw dw Functioncdb13 @@ -1950,10 +1946,10 @@ BattleAnimFunction_1B: ; cdb06 (33:5b06) dw Functioncdb50 dw Functioncdb65 -Functioncdb13: ; cdb13 (33:5b13) +Functioncdb13: ret -Functioncdb14: ; cdb14 (33:5b14) +Functioncdb14: ld hl, BATTLEANIMSTRUCT_YCOORD add hl, bc ld a, [hl] @@ -1969,7 +1965,7 @@ Functioncdb14: ; cdb14 (33:5b14) ld [hl], a ret -Functioncdb28: ; cdb28 (33:5b28) +Functioncdb28: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -1994,7 +1990,7 @@ Functioncdb28: ; cdb28 (33:5b28) dec [hl] ret -Functioncdb50: ; cdb50 (33:5b50) +Functioncdb50: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0F add hl, bc @@ -2005,7 +2001,7 @@ Functioncdb50: ; cdb50 (33:5b50) ld hl, BATTLEANIMSTRUCT_DURATION add hl, bc ld [hl], $80 -Functioncdb65: ; cdb65 (33:5b65) +Functioncdb65: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -2024,7 +2020,7 @@ Functioncdb65: ; cdb65 (33:5b65) ld [hl], a ret -BattleAnimFunction_1D: ; cdb80 (33:5b80) +BattleAnimFunction_1D: call BattleAnim_AnonJumptable .anon_dw dw Functioncdb9f @@ -2042,7 +2038,7 @@ BattleAnimFunction_1D: ; cdb80 (33:5b80) dw Functioncdc57 dw Functioncdc74 -Functioncdb9f: ; cdb9f (33:5b9f) +Functioncdb9f: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld [hl], $28 @@ -2056,7 +2052,7 @@ Functioncdb9f: ; cdb9f (33:5b9f) ld [hl], a ret -Functioncdbb3: ; cdbb3 (33:5bb3) +Functioncdbb3: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -2067,7 +2063,7 @@ Functioncdbb3: ; cdbb3 (33:5bb3) call Functioncdc75 ret -Functioncdbc1: ; cdbc1 (33:5bc1) +Functioncdbc1: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -2078,7 +2074,7 @@ Functioncdbc1: ; cdbc1 (33:5bc1) call Functioncdc75 ret -Functioncdbcf: ; cdbcf (33:5bcf) +Functioncdbcf: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -2097,7 +2093,7 @@ Functioncdbcf: ; cdbcf (33:5bcf) inc [hl] ret -Functioncdbeb: ; cdbeb (33:5beb) +Functioncdbeb: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -2110,7 +2106,7 @@ Functioncdbeb: ; cdbeb (33:5beb) ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX add hl, bc dec [hl] -asm_cdbfa: ; cdbfa (33:5bfa) +asm_cdbfa: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc inc [hl] @@ -2132,17 +2128,17 @@ asm_cdbfa: ; cdbfa (33:5bfa) ld [hl], e ret -Functioncdc1a: ; cdc1a (33:5c1a) +Functioncdc1a: call DeinitBattleAnimation ret -Functioncdc1e: ; cdc1e (33:5c1e) +Functioncdc1e: ld a, BATTLEANIMFRAMESET_4E call ReinitBattleAnimFrameset call BattleAnim_IncAnonJumptableIndex ret -Functioncdc27: ; cdc27 (33:5c27) +Functioncdc27: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2155,7 +2151,7 @@ Functioncdc27: ; cdc27 (33:5c27) ld [hl], a ret -Functioncdc39: ; cdc39 (33:5c39) +Functioncdc39: ld a, BATTLEANIMFRAMESET_50 call ReinitBattleAnimFrameset ld hl, BATTLEANIMSTRUCT_YOFFSET @@ -2164,7 +2160,7 @@ Functioncdc39: ; cdc39 (33:5c39) call BattleAnim_IncAnonJumptableIndex ret -Functioncdc48: ; cdc48 (33:5c48) +Functioncdc48: ld a, BATTLEANIMFRAMESET_4F call ReinitBattleAnimFrameset call BattleAnim_IncAnonJumptableIndex @@ -2173,7 +2169,7 @@ Functioncdc48: ; cdc48 (33:5c48) ld [hl], $40 ret -Functioncdc57: ; cdc57 (33:5c57) +Functioncdc57: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2192,10 +2188,10 @@ Functioncdc57: ; cdc57 (33:5c57) .asm_cdc71 call BattleAnim_IncAnonJumptableIndex -Functioncdc74: ; cdc74 (33:5c74) +Functioncdc74: ret -Functioncdc75: ; cdc75 (33:5c75) +Functioncdc75: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hli] @@ -2227,7 +2223,7 @@ Functioncdc75: ; cdc75 (33:5c75) call BattleAnim_IncAnonJumptableIndex ret -BattleAnimFunction_1E: ; cdca6 (33:5ca6) +BattleAnimFunction_1E: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -2249,13 +2245,13 @@ BattleAnimFunction_1E: ; cdca6 (33:5ca6) ld [hl], a ret -BattleAnimFunction_21: ; cdcc3 (33:5cc3) +BattleAnimFunction_21: call BattleAnim_AnonJumptable .anon_dw dw Functioncdcca dw Functioncdced -Functioncdcca: ; cdcca (33:5cca) +Functioncdcca: ld a, [hBattleTurn] and a jr z, .asm_cdcd9 @@ -2277,7 +2273,7 @@ Functioncdcca: ; cdcca (33:5cca) call ReinitBattleAnimFrameset ret -Functioncdced: ; cdced (33:5ced) +Functioncdced: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2291,7 +2287,7 @@ Functioncdced: ; cdced (33:5ced) call DeinitBattleAnimation ret -Functioncdcfe: ; cdcfe (33:5cfe) +Functioncdcfe: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -2324,13 +2320,13 @@ Functioncdcfe: ; cdcfe (33:5cfe) ld [hl], a ret -BattleAnimFunction_22: ; cdd2a (33:5d2a) +BattleAnimFunction_22: call BattleAnim_AnonJumptable .anon_dw dw Functioncdd31 dw Functioncdd4f -Functioncdd31: ; cdd31 (33:5d31) +Functioncdd31: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -2349,7 +2345,7 @@ Functioncdd31: ; cdd31 (33:5d31) call ReinitBattleAnimFrameset ret -Functioncdd4f: ; cdd4f (33:5d4f) +Functioncdd4f: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -2392,13 +2388,13 @@ Functioncdd4f: ; cdd4f (33:5d4f) inc [hl] ret -BattleAnimFunction_23: ; cdd90 (33:5d90) +BattleAnimFunction_23: call BattleAnim_AnonJumptable .anon_dw dw Functioncdd97 dw Functioncddbc -Functioncdd97: ; cdd97 (33:5d97) +Functioncdd97: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_FRAMESET_ID add hl, bc @@ -2420,7 +2416,7 @@ Functioncdd97: ; cdd97 (33:5d97) ld a, [hl] and $7f ld [hl], a -Functioncddbc: ; cddbc (33:5dbc) +Functioncddbc: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -2461,14 +2457,14 @@ Functioncddbc: ; cddbc (33:5dbc) call ReinitBattleAnimFrameset ret -BattleAnimFunction_24: ; cddf9 (33:5df9) +BattleAnimFunction_24: call BattleAnim_AnonJumptable .anon_dw dw Functioncde02 dw Functioncde20 dw Functioncde21 -Functioncde02: ; cde02 (33:5e02) +Functioncde02: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -2485,19 +2481,17 @@ Functioncde02: ; cde02 (33:5e02) ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld [hl], a -Functioncde20: ; cde20 (33:5e20) +Functioncde20: ret -Functioncde21: ; cde21 (33:5e21) +Functioncde21: call DeinitBattleAnimation ret -; cde25 (33:5e25) -Unknown_cde25: ; cde25 +Unknown_cde25: db $ec, $f8, $00 -; cde28 -BattleAnimFunction_25: ; cde28 (33:5e28) +BattleAnimFunction_25: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2526,7 +2520,7 @@ BattleAnimFunction_25: ; cde28 (33:5e28) ld [hl], e ret -BattleAnimFunction_26: ; cde54 (33:5e54) +BattleAnimFunction_26: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2542,13 +2536,13 @@ BattleAnimFunction_26: ; cde54 (33:5e54) inc [hl] ret -BattleAnimFunction_27: ; cde6b (33:5e6b) +BattleAnimFunction_27: call BattleAnim_AnonJumptable .anon_dw dw Functioncde72 dw Functioncde88 -Functioncde72: ; cde72 (33:5e72) +Functioncde72: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -2561,16 +2555,16 @@ Functioncde72: ; cde72 (33:5e72) .asm_cde83 add BATTLEANIMFRAMESET_6A call ReinitBattleAnimFrameset -Functioncde88: ; cde88 (33:5e88) +Functioncde88: ret -BattleAnimFunction_28: ; cde89 (33:5e89) +BattleAnimFunction_28: call BattleAnim_AnonJumptable .anon_dw dw Functioncde90 dw Functioncdebf -Functioncde90: ; cde90 (33:5e90) +Functioncde90: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0F add hl, bc @@ -2602,7 +2596,7 @@ Functioncde90: ; cde90 (33:5e90) call ReinitBattleAnimFrameset ret -Functioncdebf: ; cdebf (33:5ebf) +Functioncdebf: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2626,7 +2620,7 @@ Functioncdebf: ; cdebf (33:5ebf) ld [hl], a ret -BattleAnimFunction_SpiralDescent: ; cdedd (33:5edd) +BattleAnimFunction_SpiralDescent: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2667,7 +2661,7 @@ BattleAnimFunction_SpiralDescent: ; cdedd (33:5edd) call DeinitBattleAnimation ret -BattleAnimFunction_2D: ; cdf1b (33:5f1b) +BattleAnimFunction_2D: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2708,13 +2702,13 @@ BattleAnimFunction_2D: ; cdf1b (33:5f1b) call DeinitBattleAnimation ret -BattleAnimFunction_PoisonGas: ; cdf59 (33:5f59) +BattleAnimFunction_PoisonGas: call BattleAnim_AnonJumptable .anon_dw dw Functioncdf60 dw BattleAnimFunction_SpiralDescent -Functioncdf60: ; cdf60 (33:5f60) +Functioncdf60: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -2744,7 +2738,7 @@ Functioncdf60: ; cdf60 (33:5f60) call BattleAnim_IncAnonJumptableIndex ret -BattleAnimFunction_34: ; cdf8c (33:5f8c) +BattleAnimFunction_34: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -2786,7 +2780,7 @@ BattleAnimFunction_34: ; cdf8c (33:5f8c) call DeinitBattleAnimation ret -BattleAnimFunction_3C: ; cdfcb (33:5fcb) +BattleAnimFunction_3C: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -2829,14 +2823,14 @@ BattleAnimFunction_3C: ; cdfcb (33:5fcb) call DeinitBattleAnimation ret -BattleAnimFunction_35: ; ce00b (33:600b) +BattleAnimFunction_35: call BattleAnim_AnonJumptable .anon_dw dw Functionce014 dw Functionce023 dw Functionce05f -Functionce014: ; ce014 (33:6014) +Functionce014: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0F add hl, bc @@ -2844,7 +2838,7 @@ Functionce014: ; ce014 (33:6014) ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld [hl], $10 -Functionce023: ; ce023 (33:6023) +Functionce023: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -2883,18 +2877,18 @@ Functionce023: ; ce023 (33:6023) srl [hl] ret -Functionce05f: ; ce05f (33:605f) +Functionce05f: call DeinitBattleAnimation ret -BattleAnimFunction_Horn: ; ce063 (33:6063) +BattleAnimFunction_Horn: call BattleAnim_AnonJumptable .anon_dw dw .zero dw .one dw .two dw Functionce09e -.zero: ; ce06e (33:606e) +.zero: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -2909,7 +2903,7 @@ BattleAnimFunction_Horn: ; ce063 (33:6063) ld [hl], a ret -.one: ; ce083 (33:6083) +.one: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -2919,7 +2913,7 @@ BattleAnimFunction_Horn: ; ce063 (33:6063) call Functionce70a ret -.two: ; ce091 (33:6091) +.two: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -2928,7 +2922,7 @@ BattleAnimFunction_Horn: ; ce063 (33:6063) call DeinitBattleAnimation ret -Functionce09e: ; ce09e (33:609e) +Functionce09e: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -2953,14 +2947,14 @@ Functionce09e: ; ce09e (33:609e) ld [hl], a ret -BattleAnimFunction_2C: ; ce0c5 (33:60c5) +BattleAnimFunction_2C: call BattleAnim_AnonJumptable .anon_dw dw Functionce0ce dw Functionce0f8 dw Functionce0dd -Functionce0ce: ; ce0ce (33:60ce) +Functionce0ce: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -2971,7 +2965,7 @@ Functionce0ce: ; ce0ce (33:60ce) ld [hl], a ret -Functionce0dd: ; ce0dd (33:60dd) +Functionce0dd: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -2988,7 +2982,7 @@ Functionce0dd: ; ce0dd (33:60dd) ld a, [hl] sub $4 ld [hl], a -Functionce0f8: ; ce0f8 (33:60f8) +Functionce0f8: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -3004,13 +2998,13 @@ Functionce0f8: ; ce0f8 (33:60f8) call Functionce70a ret -BattleAnimFunction_2E: ; ce10e (33:610e) +BattleAnimFunction_2E: call BattleAnim_AnonJumptable .anon_dw dw Functionce115 dw Functionce12a -Functionce115: ; ce115 (33:6115) +Functionce115: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0F add hl, bc @@ -3022,7 +3016,7 @@ Functionce115: ; ce115 (33:6115) ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld [hl], a -Functionce12a: ; ce12a (33:612a) +Functionce12a: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hli] @@ -3055,7 +3049,7 @@ Functionce12a: ; ce12a (33:612a) srl [hl] ret -BattleAnimFunction_2F: ; ce15c (33:615c) +BattleAnimFunction_2F: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3114,7 +3108,7 @@ BattleAnimFunction_2F: ; ce15c (33:615c) call DeinitBattleAnimation ret -BattleAnimFunction_42: ; ce1b0 (33:61b0) +BattleAnimFunction_42: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3153,13 +3147,13 @@ BattleAnimFunction_42: ; ce1b0 (33:61b0) call DeinitBattleAnimation ret -BattleAnimFunction_30: ; ce1e7 (33:61e7) +BattleAnimFunction_30: call BattleAnim_AnonJumptable .anon_dw dw Functionce1ee dw Functionce1fb -Functionce1ee: ; ce1ee (33:61ee) +Functionce1ee: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_YCOORD add hl, bc @@ -3167,7 +3161,7 @@ Functionce1ee: ; ce1ee (33:61ee) ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld [hl], a -Functionce1fb: ; ce1fb (33:61fb) +Functionce1fb: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3193,13 +3187,13 @@ Functionce1fb: ; ce1fb (33:61fb) inc [hl] ret -BattleAnimFunction_31: ; ce226 (33:6226) +BattleAnimFunction_31: call BattleAnim_AnonJumptable .anon_dw dw Functionce22d dw Functionce254 -Functionce22d: ; ce22d (33:622d) +Functionce22d: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -3220,10 +3214,10 @@ Functionce22d: ; ce22d (33:622d) ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld [hl], $f -Functionce254: ; ce254 (33:6254) +Functionce254: ret -BattleAnimFunction_32: ; ce255 (33:6255) +BattleAnimFunction_32: call BattleAnim_AnonJumptable .anon_dw dw Functionce260 @@ -3231,7 +3225,7 @@ BattleAnimFunction_32: ; ce255 (33:6255) dw Functionce278 dw Functionce289 -Functionce260: ; ce260 (33:6260) +Functionce260: call BattleAnim_IncAnonJumptableIndex ld a, [hBattleTurn] and a @@ -3247,11 +3241,11 @@ Functionce260: ; ce260 (33:6260) ld [hl], a ret -Functionce274: ; ce274 (33:6274) +Functionce274: call Functionce29f ret -Functionce278: ; ce278 (33:6278) +Functionce278: call Functionce29f ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc @@ -3262,7 +3256,7 @@ Functionce278: ; ce278 (33:6278) call Functionce70a ret -Functionce289: ; ce289 (33:6289) +Functionce289: call Functionce29f ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc @@ -3277,7 +3271,7 @@ Functionce289: ; ce289 (33:6289) call DeinitBattleAnimation ret -Functionce29f: ; ce29f (33:629f) +Functionce29f: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -3303,14 +3297,12 @@ Functionce29f: ; ce29f (33:629f) ld [wOBP0], a ret -; ce2c4 (33:62c4) -Unknown_ce2c4: ; ce2c4 +Unknown_ce2c4: db $ff, $aa, $55, $aa -Unknown_ce2c8: ; ce2c8 +Unknown_ce2c8: db $ff, $ff, $00, $00 -; ce2cc -BattleAnimFunction_33: ; ce2cc (33:62cc) +BattleAnimFunction_33: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3340,14 +3332,14 @@ BattleAnimFunction_33: ; ce2cc (33:62cc) dec [hl] ret -BattleAnimFunction_36: ; ce2fd (33:62fd) +BattleAnimFunction_36: call BattleAnim_AnonJumptable .anon_dw dw Functionce306 dw Functionce330 dw Functionce34c -Functionce306: ; ce306 (33:6306) +Functionce306: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3376,7 +3368,7 @@ Functionce306: ; ce306 (33:6306) ld [hl], e ret -Functionce330: ; ce330 (33:6330) +Functionce330: ld hl, BATTLEANIMSTRUCT_10 add hl, bc ld a, [hl] @@ -3399,7 +3391,7 @@ Functionce330: ; ce330 (33:6330) ld [hl], a ret -Functionce34c: ; ce34c (33:634c) +Functionce34c: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -3413,13 +3405,13 @@ Functionce34c: ; ce34c (33:634c) call DeinitBattleAnimation ret -BattleAnimFunction_37: ; ce35f (33:635f) +BattleAnimFunction_37: call BattleAnim_AnonJumptable .anon_dw dw Functionce366 dw Functionce375 -Functionce366: ; ce366 (33:6366) +Functionce366: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -3427,7 +3419,7 @@ Functionce366: ; ce366 (33:6366) and $7f add BATTLEANIMFRAMESET_81 call ReinitBattleAnimFrameset -Functionce375: ; ce375 (33:6375) +Functionce375: ld hl, BATTLEANIMSTRUCT_0B add hl, bc bit 7, [hl] @@ -3443,21 +3435,21 @@ Functionce375: ; ce375 (33:6375) dec [hl] ret -BattleAnimFunction_38: ; ce389 (33:6389) +BattleAnimFunction_38: call BattleAnim_AnonJumptable .anon_dw dw Functionce392 dw Functionce39c dw Functionce3ae -Functionce392: ; ce392 (33:6392) +Functionce392: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld [hl], $c ret -Functionce39c: ; ce39c (33:639c) +Functionce39c: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -3470,13 +3462,13 @@ Functionce39c: ; ce39c (33:639c) call BattleAnim_IncAnonJumptableIndex ld a, BATTLEANIMFRAMESET_20 call ReinitBattleAnimFrameset -Functionce3ae: ; ce3ae (33:63ae) +Functionce3ae: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc dec [hl] ret -BattleAnimFunction_39: ; ce3b4 (33:63b4) +BattleAnimFunction_39: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -3496,7 +3488,7 @@ BattleAnimFunction_39: ; ce3b4 (33:63b4) ld [hl], a ret -BattleAnimFunction_3A: ; ce3d2 (33:63d2) +BattleAnimFunction_3A: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3526,13 +3518,13 @@ BattleAnimFunction_3A: ; ce3d2 (33:63d2) inc [hl] ret -BattleAnimFunction_3B: ; ce3ff (33:63ff) +BattleAnimFunction_3B: call BattleAnim_AnonJumptable .anon_dw dw Functionce406 dw Functionce412 -Functionce406: ; ce406 (33:6406) +Functionce406: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3542,11 +3534,11 @@ Functionce406: ; ce406 (33:6406) ld [hl], a ret -Functionce412: ; ce412 (33:6412) +Functionce412: call DeinitBattleAnimation ret -BattleAnimFunction_3D: ; ce416 (33:6416) +BattleAnimFunction_3D: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3570,14 +3562,14 @@ BattleAnimFunction_3D: ; ce416 (33:6416) inc [hl] ret -BattleAnimFunction_3E: ; ce43a (33:643a) +BattleAnimFunction_3E: call BattleAnim_AnonJumptable .anon_dw dw Functionce443 dw Functionce465 dw Functionce490 -Functionce443: ; ce443 (33:6443) +Functionce443: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0F add hl, bc @@ -3596,7 +3588,7 @@ Functionce443: ; ce443 (33:6443) and $f0 or $8 ld [hl], a -Functionce465: ; ce465 (33:6465) +Functionce465: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -3625,7 +3617,7 @@ Functionce465: ; ce465 (33:6465) .asm_ce48b ld [hl], $10 call BattleAnim_IncAnonJumptableIndex -Functionce490: ; ce490 (33:6490) +Functionce490: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -3635,20 +3627,20 @@ Functionce490: ; ce490 (33:6490) call DeinitBattleAnimation ret -BattleAnimFunction_40: ; ce49c (33:649c) +BattleAnimFunction_40: call BattleAnim_AnonJumptable .anon_dw dw Functionce4a3 dw Functionce4b0 -Functionce4a3: ; ce4a3 (33:64a3) +Functionce4a3: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, BATTLEANIMFRAMESET_24 add [hl] call ReinitBattleAnimFrameset -Functionce4b0: ; ce4b0 (33:64b0) +Functionce4b0: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3678,7 +3670,7 @@ Functionce4b0: ; ce4b0 (33:64b0) call DeinitBattleAnimation ret -BattleAnimFunction_41: ; ce4dc (33:64dc) +BattleAnimFunction_41: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3708,7 +3700,7 @@ BattleAnimFunction_41: ; ce4dc (33:64dc) srl [hl] ret -BattleAnimFunction_43: ; ce508 (33:6508) +BattleAnimFunction_43: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -3738,7 +3730,7 @@ BattleAnimFunction_43: ; ce508 (33:6508) call DeinitBattleAnimation ret -BattleAnimFunction_44: ; ce532 (33:6532) +BattleAnimFunction_44: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld e, [hl] @@ -3767,14 +3759,14 @@ BattleAnimFunction_44: ; ce532 (33:6532) ld [hl], a ret -BattleAnimFunction_45: ; ce55b (33:655b) +BattleAnimFunction_45: call BattleAnim_AnonJumptable .anon_dw dw Functionce564 dw Functionce56e dw Functionce577 -Functionce564: ; ce564 (33:6564) +Functionce564: ld d, $18 ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -3782,12 +3774,12 @@ Functionce564: ; ce564 (33:6564) inc [hl] jr asm_ce58f -Functionce56e: ; ce56e (33:656e) +Functionce56e: call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld [hl], $18 -Functionce577: ; ce577 (33:6577) +Functionce577: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -3805,17 +3797,17 @@ Functionce577: ; ce577 (33:6577) call DeinitBattleAnimation ret -asm_ce58f: ; ce58f (33:658f) +asm_ce58f: call Functionce6f1 ret -BattleAnimFunction_46: ; ce593 (33:6593) +BattleAnimFunction_46: call BattleAnim_AnonJumptable .anon_dw dw Functionce5b3 dw Functionce59a -Functionce59a: ; ce59a (33:659a) +Functionce59a: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld a, [hl] @@ -3833,10 +3825,10 @@ Functionce59a: ; ce59a (33:659a) .asm_ce5b0 call DeinitBattleAnimation -Functionce5b3: ; ce5b3 (33:65b3) +Functionce5b3: ret -BattleAnimFunction_47: ; ce5b4 (33:65b4) +BattleAnimFunction_47: ld d, $50 ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -3863,7 +3855,7 @@ BattleAnimFunction_47: ; ce5b4 (33:65b4) ld [hl], a ret -BattleAnimFunction_48: ; ce5dc (33:65dc) +BattleAnimFunction_48: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3879,7 +3871,7 @@ BattleAnimFunction_48: ; ce5dc (33:65dc) call DeinitBattleAnimation ret -BattleAnimFunction_49: ; ce5ee (33:65ee) +BattleAnimFunction_49: call BattleAnim_AnonJumptable .anon_dw dw Functionce5f9 @@ -3887,7 +3879,7 @@ BattleAnimFunction_49: ; ce5ee (33:65ee) dw Functionce622 dw Functionce618 -Functionce5f9: ; ce5f9 (33:65f9) +Functionce5f9: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3897,7 +3889,7 @@ Functionce5f9: ; ce5f9 (33:65f9) ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld [hl], $ec -Functionce60a: ; ce60a (33:660a) +Functionce60a: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3909,14 +3901,14 @@ Functionce60a: ; ce60a (33:660a) inc [hl] ret -Functionce618: ; ce618 (33:6618) +Functionce618: call DeinitBattleAnimation ret -asm_ce61c: ; ce61c (33:661c) +asm_ce61c: call BattleAnim_IncAnonJumptableIndex call BattleAnim_IncAnonJumptableIndex -Functionce622: ; ce622 (33:6622) +Functionce622: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3928,7 +3920,7 @@ Functionce622: ; ce622 (33:6622) dec [hl] ret -BattleAnimFunction_4A: ; ce62f (33:662f) +BattleAnimFunction_4A: call BattleAnim_AnonJumptable .anon_dw dw Functionce63a @@ -3936,7 +3928,7 @@ BattleAnimFunction_4A: ; ce62f (33:662f) dw Functionce65c dw Functionce672 -Functionce63a: ; ce63a (33:663a) +Functionce63a: ld hl, BATTLEANIMSTRUCT_0B add hl, bc ld a, [hl] @@ -3946,7 +3938,7 @@ Functionce63a: ; ce63a (33:663a) call BattleAnim_IncAnonJumptableIndex ret -Functionce648: ; ce648 (33:6648) +Functionce648: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3962,7 +3954,7 @@ Functionce648: ; ce648 (33:6648) inc [hl] ret -Functionce65c: ; ce65c (33:665c) +Functionce65c: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3979,7 +3971,7 @@ Functionce65c: ; ce65c (33:665c) ld [hl], a ret -Functionce672: ; ce672 (33:6672) +Functionce672: ld hl, BATTLEANIMSTRUCT_YOFFSET add hl, bc ld a, [hl] @@ -3996,7 +3988,7 @@ Functionce672: ; ce672 (33:6672) ld [hl], a ret -BattleAnimFunction_4B: ; ce688 (33:6688) +BattleAnimFunction_4B: ld hl, BATTLEANIMSTRUCT_XCOORD add hl, bc ld d, [hl] @@ -4027,7 +4019,7 @@ BattleAnimFunction_4B: ; ce688 (33:6688) ld [hl], e ret -BattleAnimFunction_4C: ; ce6b3 (33:66b3) +BattleAnimFunction_4C: ld d, $18 ld hl, BATTLEANIMSTRUCT_0B add hl, bc @@ -4036,7 +4028,7 @@ BattleAnimFunction_4C: ; ce6b3 (33:66b3) call Functionce6f1 ret -BattleAnimFunction_4F: ; ce6bf (33:66bf) +BattleAnimFunction_4F: ld d, $18 ld hl, BATTLEANIMSTRUCT_10 add hl, bc @@ -4049,7 +4041,7 @@ BattleAnimFunction_4F: ; ce6bf (33:66bf) call Functionce6f1 ret -BattleAnimFunction_4D: ; ce6d2 (33:66d2) +BattleAnimFunction_4D: ld hl, BATTLEANIMSTRUCT_0F add hl, bc ld a, [hl] @@ -4071,7 +4063,7 @@ BattleAnimFunction_4D: ; ce6d2 (33:66d2) call DeinitBattleAnimation ret -Functionce6f1: ; ce6f1 (33:66f1) +Functionce6f1: push af push de call BattleAnim_Sine @@ -4088,7 +4080,7 @@ Functionce6f1: ; ce6f1 (33:66f1) ld [hl], a ret -Functionce70a: ; ce70a (33:670a) +Functionce70a: and $f ld e, a ld hl, BATTLEANIMSTRUCT_XCOORD @@ -4104,7 +4096,7 @@ Functionce70a: ; ce70a (33:670a) jr nz, .asm_ce719 ret -BattleAnim_AnonJumptable: ; ce71e (33:671e) +BattleAnim_AnonJumptable: pop de ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX add hl, bc @@ -4117,49 +4109,45 @@ BattleAnim_AnonJumptable: ; ce71e (33:671e) ld l, a jp hl -BattleAnim_IncAnonJumptableIndex: ; ce72c (33:672c) +BattleAnim_IncAnonJumptableIndex: ld hl, BATTLEANIMSTRUCT_ANON_JT_INDEX add hl, bc inc [hl] ret -BattleAnim_Cosine: ; ce732 (33:6732) +BattleAnim_Cosine: ; a = d * cos(a * pi/32) add %010000 ; cos(x) = sin(x + pi/2) ; fallthrough -BattleAnim_Sine: ; ce734 (33:6734) +BattleAnim_Sine: ; a = d * sin(a * pi/32) calc_sine_wave BattleAnimSineWave -BattleAnim_Sine_e: ; ce765 (33:6765) +BattleAnim_Sine_e: ld a, e call BattleAnim_Sine ld e, a ret -BattleAnim_Cosine_e: ; ce76b (33:676b) +BattleAnim_Cosine_e: ld a, e call BattleAnim_Cosine ld e, a ret -; ce771 (33:6771) -BattleAnim_AbsSinePrecise: ; ce771 +BattleAnim_AbsSinePrecise: ld a, e call BattleAnim_Sine ld e, l ld d, h ret -; ce778 -BattleAnim_AbsCosinePrecise: ; ce778 +BattleAnim_AbsCosinePrecise: ld a, e call BattleAnim_Cosine ld e, l ld d, h ret -; ce77f -BattleAnimSineWave: ; ce77f +BattleAnimSineWave: sine_table 32 -; ce7bf diff --git a/engine/battle_anims/helpers.asm b/engine/battle_anims/helpers.asm index 0a00b65a4..63177b1b1 100644 --- a/engine/battle_anims/helpers.asm +++ b/engine/battle_anims/helpers.asm @@ -1,4 +1,4 @@ -ReinitBattleAnimFrameset: ; ce7bf (33:67bf) +ReinitBattleAnimFrameset: ld hl, BATTLEANIMSTRUCT_FRAMESET_ID add hl, bc ld [hl], a @@ -10,7 +10,7 @@ ReinitBattleAnimFrameset: ; ce7bf (33:67bf) ld [hl], -1 ret -GetBattleAnimFrame: ; ce7d1 +GetBattleAnimFrame: .loop ld hl, BATTLEANIMSTRUCT_DURATION add hl, bc @@ -72,9 +72,7 @@ GetBattleAnimFrame: ; ce7d1 ld [hl], a jr .loop -; ce823 - -.GetPointer: ; ce823 +.GetPointer: ld hl, BATTLEANIMSTRUCT_FRAMESET_ID add hl, bc ld e, [hl] @@ -93,9 +91,7 @@ GetBattleAnimFrame: ; ce7d1 add hl, de ret -; ce83c - -GetBattleAnimOAMPointer: ; ce83c +GetBattleAnimOAMPointer: ld l, a ld h, 0 ld de, BattleAnimOAMData @@ -104,9 +100,7 @@ GetBattleAnimOAMPointer: ; ce83c add hl, de ret -; ce846 - -LoadBattleAnimObj: ; ce846 (33:6846) +LoadBattleAnimObj: push hl ld l, a ld h, 0 @@ -126,5 +120,3 @@ LoadBattleAnimObj: ; ce846 (33:6846) call DecompressRequest2bpp pop bc ret - -; ce85e (33:685e) diff --git a/engine/battle_anims/pokeball_wobble.asm b/engine/battle_anims/pokeball_wobble.asm index d85240f08..21f963f7e 100644 --- a/engine/battle_anims/pokeball_wobble.asm +++ b/engine/battle_anims/pokeball_wobble.asm @@ -1,4 +1,4 @@ -GetPokeBallWobble: ; f971 (3:7971) +GetPokeBallWobble: ; Returns whether a Poke Ball will wobble in the catch animation. ; Whether a Pokemon is caught is determined beforehand. |