6502 command stream player, part 9

it plays!
This commit is contained in:
tildearrow 2025-04-18 17:39:14 -05:00
parent a694a6ff64
commit dc42a1d910
3 changed files with 27 additions and 7 deletions

1
.gitignore vendored
View file

@ -41,3 +41,4 @@ src/asm/6502/*.o
src/asm/6502/*.bin src/asm/6502/*.bin
src/asm/6502/nes/test.nes src/asm/6502/nes/test.nes
src/asm/6502/nes/test.o src/asm/6502/nes/test.o
src/asm/6502/nes/test.sym

View file

@ -1,6 +1,6 @@
all: test.nes all: test.nes
test.nes: test.o test.ini test.nes: test.o test.ini
wlalink -v test.ini test.nes wlalink -v -S test.ini test.nes
test.o: test.s nes.i chr.bin ../stream.s test.o: test.s nes.i chr.bin ../stream.s
wla-6502 -o test.o test.s wla-6502 -o test.o test.s

View file

@ -63,11 +63,16 @@ fcsDriverInfo:
fcsNoteOnNull: fcsNoteOnNull:
lda #0 lda #0
sta chanVibratoPos,x sta chanVibratoPos,x
ldy #$00
jsr fcsDispatchCmd jsr fcsDispatchCmd
rts rts
; note off, note off env, env release ; note off, note off env, env release
fcsNoArgDispatch: fcsNoArgDispatch:
tya
sec
sbc #$b4
tay
jsr fcsDispatchCmd jsr fcsDispatchCmd
rts rts
@ -77,6 +82,8 @@ fcsOneByteDispatch:
jsr fcsReadNext jsr fcsReadNext
sta fcsArg0 sta fcsArg0
pla pla
sec
sbc #$b4
tay tay
jsr fcsDispatchCmd jsr fcsDispatchCmd
rts rts
@ -323,10 +330,10 @@ fcsReadNext:
; a=chanPC[x]+fcsPtr ; a=chanPC[x]+fcsPtr
clc clc
lda chanPC,x lda chanPC,x
adc #>fcsPtr adc #<fcsPtr
sta fcsTempPtr sta fcsTempPtr
lda chanPC+1,x lda chanPC+1,x
adc #<fcsPtr adc #>fcsPtr
sta fcsTempPtr+1 sta fcsTempPtr+1
; increase PC ; increase PC
@ -356,7 +363,7 @@ fcsChannelCmd:
; process and read arguments ; process and read arguments
; if (a<0xb3) ; if (a<0xb3)
bmi fcsNote ; handle $00-$7f bpl fcsNote ; handle $00-$7f
cmp #$b4 cmp #$b4
bpl fcsCheckOther bpl fcsCheckOther
@ -421,7 +428,7 @@ fcsDoChannel:
; check whether this channel is halted (PC = 0) ; check whether this channel is halted (PC = 0)
lda chanPC,x lda chanPC,x
ora chanPC+1,x ora chanPC+1,x
beq + bne +
rts rts
; channel not halted... begin processing ; channel not halted... begin processing
; chanTicks-- ; chanTicks--
@ -490,6 +497,18 @@ fcsInit:
cpx #0 cpx #0
bne - bne -
; initialize channel stacks
lda #0
ldx #0
- sta chanStackPtr,x
clc
adc #FCS_MAX_STACK
inx
inx
cpx #(FCS_MAX_CHAN*2)
bne -
; set volumes ; set volumes
; TODO ; TODO
@ -549,12 +568,12 @@ fcsVibTable:
; $dd fcsWaitC, ; $dd fcsWaitC,
; $de fcsWait1, ; $de fcsWait1,
; $df fcsStop, ; $df fcsStop,
fcsInsTableLow: fcsInsTableHigh:
.db >fcsNoArgDispatch, >fcsNoArgDispatch, >fcsNoArgDispatch, >fcsNoArgDispatch, >fcsOneByteDispatch, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp .db >fcsNoArgDispatch, >fcsNoArgDispatch, >fcsNoArgDispatch, >fcsNoArgDispatch, >fcsOneByteDispatch, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp
.db >fcsPrePorta, >fcsArpTime, >fcsVibrato, >fcsVibRange, >fcsVibShape, >fcsPitch, >fcsArpeggio, >fcsVolume, >fcsVolSlide, >fcsPorta, >fcsLegato, >fcsVolSlideTarget, >fcsNoOpOneByte, >fcsNoOpOneByte, >fcsNoOpOneByte, >fcsPan .db >fcsPrePorta, >fcsArpTime, >fcsVibrato, >fcsVibRange, >fcsVibShape, >fcsPitch, >fcsArpeggio, >fcsVolume, >fcsVolSlide, >fcsPorta, >fcsLegato, >fcsVolSlideTarget, >fcsNoOpOneByte, >fcsNoOpOneByte, >fcsNoOpOneByte, >fcsPan
.db >fcsOptPlaceholder, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsCallI, >fcsOffWait, >fcsFullCmd, >fcsCall, >fcsRet, >fcsJump, >fcsTickRate, >fcsWaitS, >fcsWaitC, >fcsWait1, >fcsStop .db >fcsOptPlaceholder, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsCallI, >fcsOffWait, >fcsFullCmd, >fcsCall, >fcsRet, >fcsJump, >fcsTickRate, >fcsWaitS, >fcsWaitC, >fcsWait1, >fcsStop
fcsInsTableHigh: fcsInsTableLow:
.db <fcsNoArgDispatch, <fcsNoArgDispatch, <fcsNoArgDispatch, <fcsNoArgDispatch, <fcsOneByteDispatch, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp .db <fcsNoArgDispatch, <fcsNoArgDispatch, <fcsNoArgDispatch, <fcsNoArgDispatch, <fcsOneByteDispatch, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp
.db <fcsPrePorta, <fcsArpTime, <fcsVibrato, <fcsVibRange, <fcsVibShape, <fcsPitch, <fcsArpeggio, <fcsVolume, <fcsVolSlide, <fcsPorta, <fcsLegato, <fcsVolSlideTarget, <fcsNoOpOneByte, <fcsNoOpOneByte, <fcsNoOpOneByte, <fcsPan .db <fcsPrePorta, <fcsArpTime, <fcsVibrato, <fcsVibRange, <fcsVibShape, <fcsPitch, <fcsArpeggio, <fcsVolume, <fcsVolSlide, <fcsPorta, <fcsLegato, <fcsVolSlideTarget, <fcsNoOpOneByte, <fcsNoOpOneByte, <fcsNoOpOneByte, <fcsPan
.db <fcsOptPlaceholder, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsCallI, <fcsOffWait, <fcsFullCmd, <fcsCall, <fcsRet, <fcsJump, <fcsTickRate, <fcsWaitS, <fcsWaitC, <fcsWait1, <fcsStop .db <fcsOptPlaceholder, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsNoOp, <fcsCallI, <fcsOffWait, <fcsFullCmd, <fcsCall, <fcsRet, <fcsJump, <fcsTickRate, <fcsWaitS, <fcsWaitC, <fcsWait1, <fcsStop