![]() |
Routines |
| Prev: 58306 | Up: Map | Next: 58479 |
|
Used by the routine at InitialiseGame.
|
||||
| Handler_Explosion | 58336 | LD A,(62171) | Return if *TableBombSparks is equal to 0. | |
| 58339 | CP 0 | |||
| 58341 | RET Z | |||
| 58342 | LD IX,62171 | IX=TableBombSparks. | ||
| 58346 | LD HL,61787 | Write 61787 (Graphics_Spark) to *CHARS. | ||
| 58349 | LD (23606),HL | |||
| 58352 | LD A,16 | Set INK: WHITE (7). | ||
| 58354 | RST 16 | |||
| 58355 | LD A,7 | |||
| 58357 | RST 16 | |||
| 58358 | LD B,5 | B=5 (five "sparks"). | ||
| Handler_Explosion_Loop | 58360 | PUSH BC | Stash the sparks counter on the stack. | |
| 58361 | LD B,(IX+1) | B=*IX+1. | ||
| 58364 | LD DE,257 | DE=Set the sprite width/ height (1/ 1). | ||
| 58367 | LD C,(IX+0) | C=*IX+0. | ||
| 58370 | LD A,C | Jump to Handler_Explosion_0 if C is higher than 34. | ||
| 58371 | CP 34 | |||
| 58373 | JR NC,Handler_Explosion_0 | |||
| 58375 | CP 2 | Jump to Handler_Explosion_0 if C is lower than 2. | ||
| 58377 | JR C,Handler_Explosion_0 | |||
| 58379 | PUSH BC | Stash BC and DE on the stack. | ||
| 58380 | PUSH DE | |||
| 58381 | CALL PrintSpriteUpdateBuffer | Call PrintSpriteUpdateBuffer. | ||
| 58384 | POP DE | Restore DE and BC from the stack. | ||
| 58385 | POP BC | |||
| Handler_Explosion_0 | 58386 | LD A,(IX+3) | B+=*IX+3. | |
| 58389 | ADD A,B | |||
| 58390 | LD B,A | |||
| 58391 | LD A,(IX+2) | C+=*IX+2. | ||
| 58394 | ADD A,C | |||
| 58395 | LD C,A | |||
| 58396 | INC (IX+5) | Increment *IX+5 by one. | ||
| 58399 | LD A,(IX+5) | Jump to Handler_Explosion_Housekeep if *IX+5 is equal to 4. | ||
| 58402 | CP 4 | |||
| 58404 | JR Z,Handler_Explosion_Housekeep | |||
| 58406 | LD A,C | Jump to Handler_Explosion_Next if C is higher than 34. | ||
| 58407 | CP 34 | |||
| 58409 | JR NC,Handler_Explosion_Next | |||
| 58411 | CP 2 | Jump to Handler_Explosion_Next if C is lower than 2. | ||
| 58413 | JR C,Handler_Explosion_Next | |||
| 58415 | LD (IX+0),C | Write C to *IX+0. | ||
| 58418 | LD (IX+1),B | Write B to *IX+1. | ||
| 58421 | LD DE,257 | DE=Set the sprite width/ height (1/ 1). | ||
| 58424 | LD A,32 | A=Sprite ID (32). | ||
| 58426 | CALL PrintSprite | Call PrintSprite. | ||
| 58429 | LD B,(IX+1) | B=*IX+1. | ||
| 58432 | LD A,(62002) | A=*62002. | ||
| 58435 | SUB B | A-=B. | ||
| 58436 | CP 2 | Jump to Handler_Explosion_Next if A is higher than 2. | ||
| 58438 | JR NC,Handler_Explosion_Next | |||
| 58440 | LD C,(IX+0) | C=*IX+0. | ||
| 58443 | LD A,(62001) | A=*TablePlayerAttributes. | ||
| 58446 | SUB C | A-=C. | ||
| 58447 | CP 2 | Jump to Handler_Explosion_Next if A is higher than 2. | ||
| 58449 | JR NC,Handler_Explosion_Next | |||
| 58451 | LD A,3 | Write 3 to *SoundFlag_General. | ||
| 58453 | LD (65534),A | |||
| 58456 | JP HousekeepStackThenLoseLife | Jump to HousekeepStackThenLoseLife. | ||
| Handler_Explosion_Next | 58459 | LD DE,6 | IX+=0006. | |
| 58462 | ADD IX,DE | |||
| 58464 | POP BC | Restore sparks counter from the stack. | ||
| 58465 | DJNZ Handler_Explosion_Loop | Decrease sparks counter by one and loop back to Handler_Explosion_Loop until counter is zero. | ||
| 58467 | RET | Return. | ||
|
This spark has run its course, remove it.
|
||||
| Handler_Explosion_Housekeep | 58468 | LD (IX+0),0 | Write 0 to *IX+0. | |
| 58472 | LD A,0 | Write 0 to *SoundFlag_Bomb. | ||
| 58474 | LD (65533),A | |||
| 58477 | JR Handler_Explosion_Next | Jump to Handler_Explosion_Next. | ||
| Prev: 58306 | Up: Map | Next: 58479 |