![]() |
Routines |
| Prev: B8F2 | Up: Map | Next: B918 |
|
Falling pitch played when an explosion animation ends.
|
||||
|
Play a falling-pitch explosion, stepping D down from 07.
|
||||
| SoundsExplosion | B8FF | LD D,$07 | D=07. | |
| SoundsExplosion_Loop | B901 | LD A,D | Copy the step into A. | |
| B902 | DAA | Convert it to packed BCD. | ||
| B903 | XOR %11110000 | Flip bits 4-7. | ||
| B905 | RLCA | Rotate it left. | ||
| B906 | LD C,A | Copy it into the pitch. | ||
|
Mix two bits of GameTimer into the pitch to add noise.
|
||||
| B907 | LD A,($5E42) | Fetch GameTimer. | ||
| B90A | RRCA | Rotate it right three times. | ||
| B90B | RRCA | |||
| B90C | RRCA | |||
| B90D | AND %01100000 | Keep only bits 5-6. | ||
| B90F | XOR C | Flip the bits from the pitch. | ||
| B910 | LD C,A | Write the mixed pitch. | ||
|
Play the note, then repeat for the next step.
|
||||
| B911 | CALL PlaySquareWave | Call PlaySquareWave. | ||
| B914 | DEC D | Decrease the step by one. | ||
| B915 | JR NZ,SoundsExplosion_Loop | Jump back to SoundsExplosion_Loop until it is zero. | ||
| B917 | RET | Return. | ||
|
View the equivalent code in;
|
||||
| Prev: B8F2 | Up: Map | Next: B918 |