Prev: B950 Up: Map Next: B9D2
B9BC: Queue Tune
Copy a bit-7-terminated tune from DE into the sound buffer, working downwards from Tune_Buffer_End.
Input
DE Tune data
Copy a bit-7-terminated tune from DE into the buffer.
QueueTune B9BC DI Disable interrupts.
B9BD LD HL,$FF51 HL=Tune_Buffer_End.
Copy bytes until bit 7 marks the terminator.
QueueTune_Copy B9C0 LD A,(DE) A=*DE.
B9C1 INC DE Increment DE by one.
B9C2 BIT 7,A Jump to QueueTune_Terminator if bit 7 of A is set.
B9C4 JR NZ,QueueTune_Terminator
B9C6 LD (HL),A Write A to *HL.
B9C7 DEC HL Decrease HL by one.
B9C8 JR QueueTune_Copy Jump to QueueTune_Copy.
Store the terminator byte with bit 7 cleared.
QueueTune_Terminator B9CA AND %01111111 Keep only bits 0-6.
B9CC LD (HL),A Write A to *HL.
Save the buffer pointer and enable interrupts.
B9CD LD ($FF54),HL Write HL to Tune_Pointer.
B9D0 EI Enable interrupts.
B9D1 RET Return.
Prev: B950 Up: Map Next: B9D2