Prev: 38072 Up: Map Next: 38108
38075: 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 38080) is a delay constant that determines the speed at which the sound is played.
Used by the routines at 30222, 30439, 30602, 30880, 31370, 31636, 32035, 32194, 32258, 32390, 32655, 33312, 33593, 33663, 38749 and 54996.
Input
A (Entry at 38080 only) Delay constant
38075 XOR A Set A to 0
38076 LD B,13 Set B to 13 (DEC C)
38078 LD H,A Set HL to 0...
38079 LD L,A ...
This entry point is used by the routines at 38108 and 38116.
38080 LD (38094),A Modify instruction at 38093 with value of delay constant
38083 LD A,B Load B into A
38084 LD (38102),A Set instruction at 38102
38087 LD (38103),HL Set instructions at 38103 and 38104
38090 CALL 38212 Load A with current border colour
The operand of the instruction at 38093 represents the value of the delay constant. This is modified by the instruction at 38080.
38093 LD C,0 Load C with delay constant
38095 OUT (254),A Set border colour, and reset ear/speaker
38097 XOR 16 Invert ear/speaker bit of A
38099 LD B,C Load C (delay constant) into B...
38100 DJNZ 38100 ...and delay
The instructions at 38102 - 38104 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 38084 and 38087.
38102 DEC C Decrease / increase delay constant for next pass, increasing / decreasing pitch of tone respectively
38103 NOP Do nothing, or increase delay constant
38104 NOP Do nothing, or increase delay constant
38105 JR NZ,38095 If delay constant is not zero, then loop back to continue playing tone
38107 RET Return
Prev: 38072 Up: Map Next: 38108