Prev: 6C30 Up: Map Next: 6C52
6C31: Play bonus life sound effect
Generates a rising pitch sound effect when player earns an extra life. Called once per interrupt while CONTROLS_BIT_BONUS_LIFE is set. The sound plays over 64 interrupts (~1.28 seconds).
  • Counter increments from 0 to 64 over successive interrupts
  • Pitch = ($40 - counter) >> 3, giving values 7→0 as counter increases
  • Lower pitch values = higher frequency, so sound rises in pitch
  • Calls ROM BEEPER routine at $03B5 with duration L=$FF, repeat DE=$0001
do_bonus_life 6C31 LD A,($6C30) Increment counter and check if reached $40 (64). If so, sound is complete.
6C34 INC A
6C35 LD ($6C30),A
6C38 CP $40 Check if counter reached BONUS_LIFE_SOUND_TICKS. If done, finish sound sequence.
6C3A JP Z,bonus_life_sound_done
6C3D LD B,A Calculate pitch: pitch = BONUS_LIFE_SOUND_TICKS - counter.
6C3E LD A,$40
6C40 SUB B
6C41 LD L,$FF Set up BEEPER parameters: H = pitch >> 3 (range 7-0), L = $FF (duration).
6C43 LD H,A
6C44 SRL H
6C46 SRL H
6C48 SRL H
6C4A LD DE,$0001 Call ROM BEEPER at $03B5 with DE=$0001 (one iteration). Disable interrupts after.
6C4D CALL $03B5
6C50 DI
6C51 RET
Prev: 6C30 Up: Map Next: 6C52