Prev: 29301 Up: Map Next: 29349
29331: Play Crash Sound
Used by the routine at CheckTerrainCollision.
Plays a burst of noise of 28 clicks. It is used when the ship hits the terrain. The entry point at PlayNoise makes the noise for any number of clicks.
PlayCrashSound 29331 LD C,28 The crash is 28 clicks.
PlayCrashSound_Pattern 29333 LD E,39 The crash uses pattern 39.
PlayNoise 29335 LD A,C The click length starts from the clicks left.
29336 XOR E Flip the bits of A that are set in E.
29337 ADD A,A Double it to make the on-time.
29338 LD B,A That on-time is passed to the click.
29339 AND %00011111 Keep the bits of A that are set in 31.
29341 LD D,A The low five bits are the off-time.
29342 CALL MakeClick Call MakeClick.
29345 DEC C One click of the noise has been played.
29346 JR NZ,PlayNoise Jump to PlayNoise if the zero flag is clear.
29348 RET Return.
View the equivalent code in;
Prev: 29301 Up: Map Next: 29349