Animation_Wait_Mode: LD A, $mem_current_mode CP $enum_animation_wait_mode RET NZ LD A, $mem_animation_wait_frames DEC A LD $mem_animation_wait_frames, A CP $00 RET NZ LD A, $enum_dungeon_mode LD $mem_current_mode, A LD $mem_requested_mode, A CALL =Update_VBlank_Handler RET Display_Animation_List: LD HL, $mem_animation_list CALL =Display_Animation CALL =Display_Animation CALL =Display_Animation JP =Display_Animation Display_Animation: PUSH HL LD A, (HL) AND $3f LD BC, =Animation_Jump_table .JUMP_TABLE POP HL LD A, L ADD $08 LD L, A RET Try_Launch_Animation: ; XY in BC, jump_table index in A, number of steps in E, entity_effect in D PUSH HL PUSH AF LD HL, $mem_animation_list XOR A CP (HL) JP Z, =Try_Launch_Animation.Free_slot_Found LD A, $08 ADD L LD L, A XOR A CP (HL) JP Z, =Try_Launch_Animation.Free_slot_Found LD A, $08 ADD L LD L, A XOR A CP (HL) JP Z, =Try_Launch_Animation.Free_slot_Found LD A, $08 ADD L LD L, A XOR A CP (HL) JP NZ, =Try_Launch_Animation.No_Free_slot_found Try_Launch_Animation.Free_slot_Found: POP AF LD (HL+), A LD A, B LD (HL+), A LD A, C LD (HL+), A LD A, E LD (HL+), A LD (HL), D POP HL RET Try_Launch_Animation.No_Free_slot_found: POP AF POP HL RET End_animation: LD A, L AND $f8 LD L, A LD (HL), $00 LD A, L ADD $04 LD L, A LD A, $f0 AND (HL) CP $10 RET NZ LD A, (HL) AND $0f SWAP A PUSH HL ADD $07 LD L, A LD H, high($mem_entities_list) SET 3, (HL) LD A, $1f LD $mem_blinking_animation_counter, A .SET_SOUND_EFFECT =_sound_effect_Damage POP HL RET Animation_Jump_table: ; 00 RET NOP NOP NOP ; 01 JP =Sparkle_Animation NOP ; 02 JP =Rotating_Ball_Animation NOP ; 03 JP =Laser_Animation NOP ; 04 JP =Bubbles_Animation NOP .INCLUDE "animations/sparkles.gbasm" .INCLUDE "animations/rotatingball.gbasm" .INCLUDE "animations/laser.gbasm" .INCLUDE "animations/bubbles.gbasm"