Prev: 58479 Up: Map Next: 58609
58490: Handler: Bomb
Used by the routine at InitialiseGame.
Handler_Bomb 58490 LD A,(58489) Return if *TableBomb_Flag shows no bomb on screen.
58493 CP 0
58495 RET Z
Only continue every other frame.
Handler_Bomb_FrameSkip 58496 LD A,(62273) A=*BombFrameSkip.
58499 INC A Increment A by one.
58500 AND %00000001 Keep *BombFrameSkip as 0 or 1.
58502 LD (62273),A Write A back to *BombFrameSkip.
58505 CP 0 Return if *BombFrameSkip is a skipped frame.
58507 RET NZ
Set up the bomb graphic.
58508 LD HL,37452 Write 37452 to *CHARS.
58511 LD (23606),HL
58514 LD A,16 Set INK: YELLOW (6).
58516 RST 16
58517 LD A,6
58519 RST 16
The fuse burning down acts as a countdown before the explosion.
58520 LD A,(58485) A=*TableBomb_SpriteID.
58523 ADD A,4 Advance to the next fuse frame.
58525 CP 64 Jump to IgniteBomb if the fuse has burned down.
58527 JR Z,IgniteBomb
58529 LD (58485),A Write the new fuse frame back to *TableBomb_SpriteID.
Print the bomb on the screen.
58532 LD BC,(58479) BC=*TableBomb_Position.
58536 LD DE,514 Set the bomb width/ height to 2/ 2.
58539 CALL PrintSprite Print the bomb.
58542 RET Return.
The fuse has burned down; start the explosion.
IgniteBomb 58543 LD BC,(58479) BC=*TableBomb_Position.
58547 LD DE,514 Set the bomb width/ height to 2/ 2.
58550 CALL PrintSpriteUpdateBuffer Erase the bomb from the room.
58553 LD A,0 Write 0 to:
58555 LD (65533),A
58558 LD (58489),A
58561 LD A,(62171) Return if *TableBombSparks already has an explosion in progress.
58564 CP 0
58566 RET NZ
There are 5 sparks, and each occupies 6 bytes.
58567 LD DE,62171 Copy the default sparks from TableDefaultBombSparks to TableBombSparks.
58570 LD HL,62201
58573 LD BC,30
58576 LDIR
58578 LD BC,(58479) BC=*TableBomb_Position.
58582 DEC B Move down one row from the bomb.
Give every spark the bomb's starting co-ordinates.
58583 LD IX,62171 Point IX at TableBombSparks.
58587 LD L,5 L=5 (number of sparks).
SetSparksStartingPosition 58589 LD (IX+0),C Write the bomb column to this spark.
58592 LD (IX+1),B Write the bomb row to this spark.
58595 LD DE,6 Move IX on to the next spark.
58598 ADD IX,DE
58600 DEC L Decrease the spark counter by one.
58601 JR NZ,SetSparksStartingPosition Jump to SetSparksStartingPosition until every spark has a start position.
58603 LD A,2 Queue the sparks sound at SoundFlag_Bomb.
58605 LD (65533),A
58608 RET Return.
Prev: 58479 Up: Map Next: 58609