Prev: 63488 Up: Map Next: 64249
64193: Play Next Level Jingle
Used by the routine at Print_HighScore.
PlaySound_NextLevelJingle 64193 LD HL,64249 Load HL with a pointer to Audio_NextLevelJingle.
This entry point is used by the routine at Handle_Level_Complete.
PlaySound 64196 NOP No operation.
PlaySound_Loop 64197 LD A,(HL) Fetch the music data from *HL.
64198 CP 255 Return if this is the terminator (255).
64200 RET Z
64201 OR A Jump to PlaySound_Rest if this is a rest.
64202 JR Z,PlaySound_Rest
64204 XOR A Set the speaker port to off.
64205 OUT (254),A
64207 LD E,(HL) Load the pitch period into both E (reset value) and D (countdown).
64208 LD D,E
64209 INC HL Load the note duration into C.
64210 LD C,(HL)
PlaySound_NoteLoop 64211 OUT (254),A Send to the speaker to play the note.
64213 DEC D Decrease the period counter by one.
64214 JR NZ,PlaySound_NoteInnerLoop Jump to PlaySound_NoteInnerLoop if the period hasn't elapsed yet.
64216 LD D,E Reset the period counter from E.
64217 XOR %00011000 Toggle the speaker and MIC outputs.
PlaySound_NoteInnerLoop 64219 DJNZ PlaySound_NoteLoop Decrease counter by one and loop back to PlaySound_NoteLoop until counter is zero.
64221 DEC C Decrease the duration counter.
64222 JR NZ,PlaySound_NoteLoop Jump back to PlaySound_NoteLoop until the full duration has elapsed.
64224 INC HL Advance to the next sound data entry.
64225 LD A,191 Read from the keyboard;
Port Number Bit
0 1 2 3 4
191 ENTER L K J H
64227 IN A,(254)
64229 AND %00000001 Return if "ENTER" has been pressed.
64231 RET Z
64232 JR PlaySound_Loop Jump back to PlaySound_Loop.
PlaySound_Rest 64234 INC HL Increment HL by one.
64235 LD C,(HL) C=*HL.
PlaySound_RestOuterLoop 64236 NOP No operation.
PlaySound_RestInnerLoop 64237 NOP No operation.
64238 NOP No operation.
64239 NOP No operation.
64240 NOP No operation.
64241 DJNZ PlaySound_RestInnerLoop Decrease the counter by one and loop back to PlaySound_RestInnerLoop until counter is zero.
64243 DEC C Decrease the rest duration counter.
64244 JR NZ,PlaySound_RestOuterLoop Jump back to PlaySound_RestOuterLoop until the full rest duration has elapsed.
64246 INC HL Advance to the next sound data entry.
64247 JR PlaySound_Loop Jump back to PlaySound_Loop.
Prev: 63488 Up: Map Next: 64249