Play recorded sounds: Difference between revisions

m
Line 22:
<lang 68000devpac>dac_data equ $2A
dac_enable equ $2B
LEA bummer,a1
Test_DAC:
LEA pcmSample$A04000,a1A3
MOVE.B MOVEQ #dac_enable$2B,D0
MOVE.B MOVEQ #$80,D1
JSR jsr FMRegWrite
subq.b #1,d0
SUBQ.B #1,d0 ;move.b #dac_data,D0
.dac_loop:
MOVE.B (a1)+,d1 ;read the next byte from the stream.
BEQ beq .dac_done ;exit on null terminator
sub.b #$30,d1
JSR FMRegWrite
 
BRA .dac_loop
;the core functionality of FMRegWrite had to be reproduced inline
.dac_done:
;in order to play the sample back quickly enough for it to sound correct.
 
.wait1:
BTST #7,(A3)
BNE .wait1
MOVE.B D0,(A3) ;register
.wait2:
BTST #7,(A3)
BNE .wait2
MOVE.B D1,(1,A3) ;data
BRA .dac_loop
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1,489

edits