Play recorded sounds: Difference between revisions
m
→{{header|68000 Assembly}}
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 25:
LEA $A04000,A3
MOVEQ #$2B,D0
MOVEQ #$80,D1 ;assembler might not allow this notation, but MOVEQ #-128,D0 is equivalent.
jsr FMRegWrite ;this part is not time-critical so we can use the function call here.
subq.b #1,d0 ;move.b #dac_data,D0
.dac_loop:
MOVE.B (a1)+,d1
beq .dac_done ;exit on a zero value.
;the core functionality of FMRegWrite had to be reproduced inline
Line 37 ⟶ 36:
.wait1:
BTST #7,(A3) ;check if sound chip is busy
BNE .wait1 ;loop until it's not busy
MOVE.B D0,(A3)
.wait2:
BTST #7,(A3)
BNE .wait2
MOVE.B D1,(1,A3)
BRA .dac_loop
.dac_done:
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|