Prev: 35674 Up: Map Next: 35723
35690: Set parameters for and play upward scale sound
The value of A (set to zero at the start of this routine, or set to 1 before jumps from other routines into 35695) is a delay constant that determines the speed at which the sound is played.
Used by the routines at 26745, 26855, 26926, 26997, 30001, 32694, 55138 and 55887.
Input
A (Entry at 35695 only) Delay constant
35690 XOR A Set A to 0
35691 LD B,13 Set B to 13 (DEC C)
35693 LD H,A Set HL to 0...
35694 LD L,A ...
This entry point is used by the routines at 35723 and 35731.
35695 LD (35709),A Modify instruction at 35708 with value of delay constant
35698 LD A,B Load B into A
35699 LD (35717),A Set instruction at 35717
35702 LD (35718),HL Set instructions at 35718 and 35719
35705 CALL 35819 Load A with current border colour
The operand of the instruction at 35708 represents the value of the delay constant. This is modified by the instruction at 35695.
35708 LD C,0 Load C with delay constant
35710 OUT (254),A Set border colour, and reset ear/speaker
35712 XOR 16 Invert ear/speaker bit of A
35714 LD B,C Load C (delay constant) into B...
35715 DJNZ 35715 ...and delay
The instructions at 35717 - 35719 represent the manipulation of the delay constant between iterations of this routine. These instructions may decrease C by one, increase C by three or do nothing. These instructions are modified by the instructions at 35699 and 35702.
35717 DEC C Decrease / increase delay constant for next pass, increasing / decreasing pitch of tone respectively
35718 NOP Do nothing, or increase delay constant (modified by instruction at 35702)
35719 NOP Do nothing, or increase delay constant (modified by instruction at 35702)
35720 JR NZ,35710 If delay constant is not zero, then loop back to continue playing tone
35722 RET Return
Prev: 35674 Up: Map Next: 35723