Prev: A33B Up: Map Next: A471
A3E1: Explode
Used by the routine at died.
explode A3E1 LD A,$2A
A3E3 LD ($7003),A
A3E6 CALL display_ship_background_patterns Display ship background patterns
A3E9 LD A,$7F Not allocated
A3EB LD (sprite_data),A 1st sprite
A3EE LD ($700E),A 2nd sprite
A3F1 LD A,(active_shots) Active shots
A3F4 OR A If zero
A3F5 JR Z,explode_2 Then skip ahead
Deallocate all shots
A3F7 LD IX,sprite_data Sprite data table
A3FB LD DE,$000C Size of each sprite
A3FE LD B,$20 32 sprites
A400 LD A,$02 Is it type $02 (shot)?
explode_0 A402 CP (IX+$00) ...
A405 JR NZ,explode_1 No, then skip
A407 LD (IX+$00),$7F Set as not allocated
A40B LD (IX+$08),$F8 Set y
explode_1 A40F ADD IX,DE Next sprite
A411 DJNZ explode_0 Loop 32 times
Set center of projection for explosion
explode_2 A413 LD HL,($700A) Y and X of 1st sprite
A416 LD BC,$0404 Add 4 to each
A419 ADD HL,BC ...
A41A LD (tmp_center_of_projection),HL Save it in tmp_center_of_projection, which will be copied to center_of_projection
A41D LD A,($7004) Byte 2 of 1st sprite
A420 LD (tmp_sprite_data),A Save it temporary
Allocate 6 sprites for explosion
A423 LD IY,LA4B8
A427 LD B,$06 Allocate 6 sprites
explode_3 A429 RST $28 Allocate sprite
A42A LD (IX+$00),$0D Sprite type is $0D (a dot)
A42E LD (IX+$01),$00 Polar y
A432 LD (IX+$02),$00 Polar x
A436 LD (IX+$0B),$09 Set color (pink)
A43A RST $30 Load sprite pattern
A43B LD A,(tmp_sprite_data) Restore byte 2 of 1st sprite
A43E ADD A,(IY+$00) Add data from table
A441 AND $3F Mod $40
A443 LD (IX+$02),A Set polar x on new sprite
A446 LD (IX+$01),$2A Set polar y
A44A INC IY Next init data
A44C DJNZ explode_3 Loop for 6 sprites
Game loop for 3 seconds
A44E LD B,$14 20
explode_4 A450 PUSH BC Outer loop
A451 CALL move_dots Move dots
A454 CALL upload_sprite_data Upload sprite data
A457 LD B,$09 9
explode_5 A459 HALT Inner loop
A45A PUSH BC
A45B CALL display_stars Display stars
A45E CALL process_sprites Process sprites
A461 CALL display_center_enemies Display center enemies
A464 CALL create_or_display_mines
A467 CALL next_frame_upl_sprites Upload sprites
A46A POP BC
A46B DJNZ explode_5 Loop 9 times
A46D POP BC
A46E DJNZ explode_4 Loop 20 times
A470 RET
Prev: A33B Up: Map Next: A471