Routines |
Prev: 58802 | Up: Map | Next: 58832 |
Used by the routines at Controls_CheckRight and Controls_CheckLeft.
|
||||
Sound_Cursor | 58803 | LD A,(55343) | Load *CurrentCursor_X_Position into A. | |
The value in C is used as a delay value.
|
||||
58806 | RLCA | Multiply A by 32 and store the result in C. | ||
58807 | RLCA | |||
58808 | RLCA | |||
58809 | RLCA | |||
58810 | LD C,A | |||
58811 | LD B,100 | Set the number of sound loops in B. | ||
58813 | LD HL,1000 | In HL set a pointer to an arbitrary area in ZX Spectrum ROM. | ||
Sound_Cursor_Loop | 58816 | LD A,(HL) | Fetch the byte from ZX Spectrum ROM and store it in A. | |
58817 | AND %00011000 | Keep only bits 3-4. | ||
58819 | OR %00000101 | Set bits 0, 2. | ||
58821 | OUT (254),A | Send to the speaker. | ||
58823 | INC HL | Increment the ZX Spectrum memory byte pointer by one. | ||
58824 | PUSH BC | Stash the sound loop counter on the stack. | ||
58825 | LD B,C | Write the delay value from C into B. | ||
Sound_Cursor_DelayLoop | 58826 | DJNZ Sound_Cursor_DelayLoop | Decrease the delay counter by one and loop back to Sound_Cursor_DelayLoop until the delay counter is zero. | |
58828 | POP BC | Restore the sound loop counter from the stack. | ||
58829 | DJNZ Sound_Cursor_Loop | Decrease the sound loop counter by one and loop back to Sound_Cursor_Loop until the sound loop counter is zero. | ||
58831 | RET | Return. |
Prev: 58802 | Up: Map | Next: 58832 |