This commit is contained in:
tildearrow 2023-03-15 02:13:10 -05:00
parent ed3b0610d3
commit 557f77c3c6

View file

@ -5,43 +5,47 @@
VPOSR = $dff004
COLOR00 = $dff180
DMACONR = $dff002
DMACON = $dff096
AUD0LCH = $dff0a0
AUD0LCL = $dff0a2
AUD0LEN = $dff0a4
AUD0PER = $dff0a6
AUD0VOL = $dff0a8
AUD0DAT = $dff0aa
chipBase=$dff000
DMACONR = $02
DMACON = $96
AUD0LCH = $a0
AUD0LCL = $a2
AUD0LEN = $a4
AUD0PER = $a6
AUD0VOL = $a8
AUD0DAT = $aa
code_c
move.w #15,d0
move.w d0,DMACON
start:
lea chipBase,a0
move.w #15,DMACON(a0)
testDMACon:
move.w DMACON,d0
move.w DMACONR(a0),d0
btst #0,d0
bne testDMACon
lea sampleData(pc),a0
move.l a0,AUD0LCH
lea sampleData(pc),a1
move.l a1,AUD0LCH(a0)
move.w #$2000,d0
move.w d0,AUD0LEN
move.w #$a0,d0
move.w d0,AUD0PER
move.w #$40,d0
move.w d0,AUD0VOL
move.l #$8201,d0
move.w d0,DMACON
move.w d0,AUD0LEN(a0)
move.w #$a0,AUD0PER(a0)
move.w #$40,AUD0VOL(a0)
move.w #$8201,DMACON(a0)
main:
jsr waitVBlank
move.w curColor,d0
move.w d0,COLOR00
addi.w #1,d0
move.w d0,curColor
jsr nextTick
jmp main
waitVBlank:
@ -51,11 +55,44 @@ waitVBlank:
bne waitVBlank
rts
nextTick:
lea state(pc),a4
move.w (a4),d0
subi.w #1,d0
bmi nextTick1
move.w d0,(a4)
rts
nextTick1:
move.l seqAddr(pc),a2
; get next command
move.b (a2)+,d0
testSpecial:
cmp.b #$f0,d0
blt testChannel
cmp.b #$
testChannel:
cmp.b #$40,d0
bge nextTickPost
nextTickPost:
lea seqAddr(pc),a3
move.l a2,(a3)
bra nextTick1
data_c
curColor:
dc.w 0
state:
dc.w 0 ; ticks
seqAddr:
dc.l sequence
sampleData:
incbin "sample.bin"