Prev: 683E Up: Map Next: 686A
6854: Play Level Tone
Used by the routine at HandleLevelIntroduction.
Plays eight cycles of a square wave. The period of the wave is taken from the table at LevelTonePeriods, using byte 06 of the actor as the index, which is then increased by one ready for the next call. This is used by the actor for the level introduction parade (see IntroductionCharlie). The audio is three calls, which are eight frames apart.
Input
IX Actor
LevelStartJingle 6854 LD C,(IX+$06) Fetch the index (byte 06 of the actor).
6857 INC (IX+$06) Increase the index by one, ready for the next call.
685A LD B,$00 Find the period in the table at LevelTonePeriods using the index.
685C LD HL,$686A
685F ADD HL,BC
6860 LD D,(HL) Fetch the period of the wave.
6861 LD C,$08 Set the cycle counter to 08.
This entry point is used by the routine at GameStartJingle.
LevelStartJingle_Loop 6863 CALL PlaySquareWave Play a cycle using PlaySquareWave.
6866 DEC C Decrease the cycle counter by one.
6867 JR NZ,LevelStartJingle_Loop Loop back to LevelStartJingle_Loop until the cycle counter is zero.
6869 RET Return.
Prev: 683E Up: Map Next: 686A