Prev: 47881 Up: Map Next: 47930
47897: 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 47902) is a delay constant that determines the speed at which the sound is played.
Used by the routines at 37764, 37880, 37951, 38024, 42494, 62330, 64230 and 64926.
Input
A (Entry at 47902 only) Delay constant
47897 XOR A Set A to 0
47898 LD B,13 Set B to 13 (DEC C)
47900 LD H,A Set HL to 0...
47901 LD L,A ...
This entry point is used by the routines at 47930 and 47938.
47902 LD (47916),A Modify instruction at 47915 with value of delay constant
47905 LD A,B Load B into A
47906 LD (47924),A Set instruction at 47924
47909 LD (47925),HL Set instructions at 47925 and 47926
47912 CALL 48018 Load A with current border colour
The operand of the instruction at 47915 represents the value of the delay constant. This is modified by the instruction at 47902.
47915 LD C,0 Load C with delay constant
47917 OUT (254),A Set border colour, and reset ear/speaker
47919 XOR 16 Invert ear/speaker bit of A
47921 LD B,C Load C (delay constant) into B...
47922 DJNZ 47922 ...and delay
The instructions at 47924 - 47926 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 47906 and 47909.
47924 DEC C Decrease / increase delay constant for next pass, increasing / decreasing pitch of tone respectively
47925 NOP Do nothing, or increase delay constant
47926 NOP Do nothing, or increase delay constant
47927 JR NZ,47917 If delay constant is not zero, then loop back to continue playing tone
47929 RET Return
Prev: 47881 Up: Map Next: 47930