Prev: E46F Up: Map Next: E4F1
E47A: Handler: Bomb
Used by the routine at InitialiseGame.
Handler_Bomb E47A LD A,($E479) Return if *TableBomb_Flag shows no bomb on screen.
E47D CP $00
E47F RET Z
Only continue every other frame.
Handler_Bomb_FrameSkip E480 LD A,($F341) A=*BombFrameSkip.
E483 INC A Increment A by one.
E484 AND %00000001 Keep *BombFrameSkip as 00 or 01.
E486 LD ($F341),A Write A back to *BombFrameSkip.
E489 CP $00 Return if *BombFrameSkip is a skipped frame.
E48B RET NZ
Set up the bomb graphic.
E48C LD HL,$924C Write 924C to *CHARS.
E48F LD ($5C36),HL
E492 LD A,$10 Set INK: YELLOW (06).
E494 RST $10
E495 LD A,$06
E497 RST $10
The fuse burning down acts as a countdown before the explosion.
E498 LD A,($E475) A=*TableBomb_SpriteID.
E49B ADD A,$04 Advance to the next fuse frame.
E49D CP $40 Jump to IgniteBomb if the fuse has burned down.
E49F JR Z,IgniteBomb
E4A1 LD ($E475),A Write the new fuse frame back to *TableBomb_SpriteID.
Print the bomb on the screen.
E4A4 LD BC,($E46F) BC=*TableBomb_Position.
E4A8 LD DE,$0202 Set the bomb width/ height to 02/ 02.
E4AB CALL PrintSprite Print the bomb.
E4AE RET Return.
The fuse has burned down; start the explosion.
IgniteBomb E4AF LD BC,($E46F) BC=*TableBomb_Position.
E4B3 LD DE,$0202 Set the bomb width/ height to 02/ 02.
E4B6 CALL PrintSpriteUpdateBuffer Erase the bomb from the room.
E4B9 LD A,$00 Write 00 to:
E4BB LD ($FFFD),A
E4BE LD ($E479),A
E4C1 LD A,($F2DB) Return if *TableBombSparks already has an explosion in progress.
E4C4 CP $00
E4C6 RET NZ
There are 05 sparks, and each occupies 06 bytes.
E4C7 LD DE,$F2DB Copy the default sparks from TableDefaultBombSparks to TableBombSparks.
E4CA LD HL,$F2F9
E4CD LD BC,$001E
E4D0 LDIR
E4D2 LD BC,($E46F) BC=*TableBomb_Position.
E4D6 DEC B Move down one row from the bomb.
Give every spark the bomb's starting co-ordinates.
E4D7 LD IX,$F2DB Point IX at TableBombSparks.
E4DB LD L,$05 L=05 (number of sparks).
SetSparksStartingPosition E4DD LD (IX+$00),C Write the bomb column to this spark.
E4E0 LD (IX+$01),B Write the bomb row to this spark.
E4E3 LD DE,$0006 Move IX on to the next spark.
E4E6 ADD IX,DE
E4E8 DEC L Decrease the spark counter by one.
E4E9 JR NZ,SetSparksStartingPosition Jump to SetSparksStartingPosition until every spark has a start position.
E4EB LD A,$02 Queue the sparks sound at SoundFlag_Bomb.
E4ED LD ($FFFD),A
E4F0 RET Return.
Prev: E46F Up: Map Next: E4F1