Prev: A1CC Up: Map Next: A226
A20F: Play Rest
Used by the routine at PlayNote.
Plays a rest, which is a fixed length of silence, in a piece of music.
Input
DE The address of the byte of the music
Output
DE The address of the next byte of the music
PlayRest A20F LD A,(DE) Fetch the byte of the music again.
A210 INC DE Move onto the next byte of the music.
A211 RLCA Rotate bits 6 and 7 of the note down...
A212 RLCA ...to bits 0 and 1.
A213 AND %00000011 Keep them, but the result is not used.
A215 XOR A Set the multiplier to zero...
A216 INC A ...and then to one.
A217 LD L,A Store it in L.
A218 LD BC,$430B Set the length of the delay.
PlayRest_Loop A21B PUSH BC Save the length of the delay.
PlayRest_Delay A21C DEC BC Count the delay down.
A21D LD A,B Combine the two bytes...
A21E OR C ...to test whether it is zero.
A21F JR NZ,PlayRest_Delay Jump back until the delay has finished.
A221 POP BC Restore the length of the delay.
A222 DEC L Decrease the multiplier by one.
A223 JR NZ,PlayRest_Loop Jump back until none remain.
A225 RET Return.
View the equivalent code in;
Prev: A1CC Up: Map Next: A226