Prev: E3C2 Up: Map Next: E46F
E3E0: Handler: Explosion
Used by the routine at InitialiseGame.
Handler_Explosion E3E0 LD A,($F2DB) Return if *TableBombSparks is equal to 00.
E3E3 CP $00
E3E5 RET Z
E3E6 LD IX,$F2DB IX=TableBombSparks.
E3EA LD HL,$F15B Write F15B (Graphics_Spark) to *CHARS.
E3ED LD ($5C36),HL
E3F0 LD A,$10 Set INK: WHITE (07).
E3F2 RST $10
E3F3 LD A,$07
E3F5 RST $10
E3F6 LD B,$05 B=05 (five "sparks").
Handler_Explosion_Loop E3F8 PUSH BC Stash the sparks counter on the stack.
E3F9 LD B,(IX+$01) B=*IX+01.
E3FC LD DE,$0101 DE=Set the sprite width/ height (01/ 01).
E3FF LD C,(IX+$00) C=*IX+00.
E402 LD A,C Jump to Handler_Explosion_0 if C is higher than 22.
E403 CP $22
E405 JR NC,Handler_Explosion_0
E407 CP $02 Jump to Handler_Explosion_0 if C is lower than 02.
E409 JR C,Handler_Explosion_0
E40B PUSH BC Stash BC and DE on the stack.
E40C PUSH DE
E40D CALL PrintSpriteUpdateBuffer Call PrintSpriteUpdateBuffer.
E410 POP DE Restore DE and BC from the stack.
E411 POP BC
Handler_Explosion_0 E412 LD A,(IX+$03) B+=*IX+03.
E415 ADD A,B
E416 LD B,A
E417 LD A,(IX+$02) C+=*IX+02.
E41A ADD A,C
E41B LD C,A
E41C INC (IX+$05) Increment *IX+05 by one.
E41F LD A,(IX+$05) Jump to Handler_Explosion_Housekeep if *IX+05 is equal to 04.
E422 CP $04
E424 JR Z,Handler_Explosion_Housekeep
E426 LD A,C Jump to Handler_Explosion_Next if C is higher than 22.
E427 CP $22
E429 JR NC,Handler_Explosion_Next
E42B CP $02 Jump to Handler_Explosion_Next if C is lower than 02.
E42D JR C,Handler_Explosion_Next
E42F LD (IX+$00),C Write C to *IX+00.
E432 LD (IX+$01),B Write B to *IX+01.
E435 LD DE,$0101 DE=Set the sprite width/ height (01/ 01).
E438 LD A,$20 A=Sprite ID (20).
E43A CALL PrintSprite Call PrintSprite.
E43D LD B,(IX+$01) B=*IX+01.
E440 LD A,($F232) A=*F232.
E443 SUB B A-=B.
E444 CP $02 Jump to Handler_Explosion_Next if A is higher than 02.
E446 JR NC,Handler_Explosion_Next
E448 LD C,(IX+$00) C=*IX+00.
E44B LD A,($F231) A=*TablePlayerAttributes.
E44E SUB C A-=C.
E44F CP $02 Jump to Handler_Explosion_Next if A is higher than 02.
E451 JR NC,Handler_Explosion_Next
E453 LD A,$03 Write 03 to *SoundFlag_General.
E455 LD ($FFFE),A
E458 JP HousekeepStackThenLoseLife Jump to HousekeepStackThenLoseLife.
Handler_Explosion_Next E45B LD DE,$0006 IX+=0006.
E45E ADD IX,DE
E460 POP BC Restore sparks counter from the stack.
E461 DJNZ Handler_Explosion_Loop Decrease sparks counter by one and loop back to Handler_Explosion_Loop until counter is zero.
E463 RET Return.
This spark has run its course, remove it.
Handler_Explosion_Housekeep E464 LD (IX+$00),$00 Write 00 to *IX+00.
E468 LD A,$00 Write 00 to *SoundFlag_Bomb.
E46A LD ($FFFD),A
E46D JR Handler_Explosion_Next Jump to Handler_Explosion_Next.
Prev: E3C2 Up: Map Next: E46F