10
20 :
30 :
40 DEFPROCass
50 mc%=mc%:IFmc%:ENDPROC
60 DIM mc% &200
70 status=&FCF0:data=&FCF1
80 Clock=&70:Start=&75:pointer=&7A
90 FOR P=0 TO 1
100 P%=mc%
110 [OPT P*3
120 .rec
130 JSR GetClockStart
140 :
150 .rclp
160 BIT &FF:BMI done
170 LDA status:AND #1:BEQ rclp
180 LDA data:PHA
190 LDX #Clock AND 255:LDY #Clock DIV 256
200 LDA #1:JSR &FFF1
210 LDY #0:LDX #&FB:SEC
220 .rclp2
230 LDA Clock-&FB,X:SBC Start-&FB,X
240 STA (pointer),Y:INY
250 INX:BNE rclp2
260 PLA:STA (pointer),Y:INY
270 LDA #0:STA (pointer),Y
280 LDA pointer:CLC:ADC #6:STA pointer
290 LDA pointer+1:ADC #0:STA pointer+1
300 BPL rclp
310 .done
320 RTS
330 :
340 .play
350 JSR GetClockStart
360 :
370 .playLp
380 BIT &FF:BMI done
390 LDX #Clock AND 255:LDY #Clock DIV 256
400 LDA #1:JSR &FFF1
410 LDY #0:LDX #&FB:SEC
420 .playLp3
430 LDA Clock-&FB,X:SBC Start-&FB,X
440 STA Clock-&FB,X
450 INX:BNE playLp3
460 LDX #&FB:SEC
470 .playLp4
480 LDA Clock-&FB,X:SBC (pointer),Y
490 INY:INX:BNE playLp4
500 BCS playLp
510 LDA (pointer),Y:STA data
520 LDA pointer:CLC:ADC #6:STA pointer
530 LDA pointer+1:ADC #0:STA pointer+1
540 BPL playLp
550 :
560 :
570 :
580 .GetClockStart
590 JSR RdClock
600 LDX #&FB:.recLp0
610 LDA Clock-&FB,X:STA Start-&FB,X
620 INX:BNE recLp0:RTS
630 :
640 .RdClock
650 LDX #Clock AND 255:LDY #Clock DIV 256
660 LDA #1:JMP &FFF1
670 :
680 ]NEXT
690 ENDPROC