![]() |
Routines |
| Prev: 29236 | Up: Map | Next: 29276 |
|
Used by the routines at CompletePlanet, ApplyCollisionEffects, DamageShip, AddFuel, AddShip, CheckShotCollisions, UpdateType19 and UpdateCrystalStack.
Plays a falling note of 16 beeps. It is used when an object is hit, destroyed or damaged.
|
||||
| PlayHitSound | 29260 | LD C,16 | The falling note has 16 beeps. | |
|
This entry point is used by the routine at PlayExplosionHitSound.
|
||||
| PlayHitSound_Loop | 29262 | LD A,C | The pitch starts at the number of beeps left. | |
| 29263 | ADD A,A | Double it. | ||
| 29264 | ADD A,A | Double it again, so the note falls quickly. | ||
| 29265 | CPL | Invert it so the note falls as the count does. | ||
| 29266 | AND %01111111 | Keep the bits of A that are set in 127. | ||
| 29268 | LD B,A | That is the half-period of this beep. | ||
| 29269 | CALL PlaySquareWave | Call PlaySquareWave. | ||
| 29272 | DEC C | One beep of the falling note has been played. | ||
| 29273 | JR NZ,PlayHitSound_Loop | Jump to PlayHitSound_Loop if the zero flag is clear. | ||
| 29275 | RET | Return. | ||
| Prev: 29236 | Up: Map | Next: 29276 |