From dc42a1d9108b85b1062e70df920bec0021f0c2bb Mon Sep 17 00:00:00 2001 From: tildearrow Date: Fri, 18 Apr 2025 17:39:14 -0500 Subject: [PATCH] 6502 command stream player, part 9 it plays! --- .gitignore | 1 + src/asm/6502/nes/Makefile | 2 +- src/asm/6502/stream.s | 31 +++++++++++++++++++++++++------ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index c73053f37..f1236736c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ src/asm/6502/*.o src/asm/6502/*.bin src/asm/6502/nes/test.nes src/asm/6502/nes/test.o +src/asm/6502/nes/test.sym diff --git a/src/asm/6502/nes/Makefile b/src/asm/6502/nes/Makefile index 647c81479..90cb3f508 100644 --- a/src/asm/6502/nes/Makefile +++ b/src/asm/6502/nes/Makefile @@ -1,6 +1,6 @@ all: test.nes 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 wla-6502 -o test.o test.s diff --git a/src/asm/6502/stream.s b/src/asm/6502/stream.s index 543e15e0f..a11e8e5a9 100644 --- a/src/asm/6502/stream.s +++ b/src/asm/6502/stream.s @@ -63,11 +63,16 @@ fcsDriverInfo: fcsNoteOnNull: lda #0 sta chanVibratoPos,x + ldy #$00 jsr fcsDispatchCmd rts ; note off, note off env, env release fcsNoArgDispatch: + tya + sec + sbc #$b4 + tay jsr fcsDispatchCmd rts @@ -77,6 +82,8 @@ fcsOneByteDispatch: jsr fcsReadNext sta fcsArg0 pla + sec + sbc #$b4 tay jsr fcsDispatchCmd rts @@ -323,10 +330,10 @@ fcsReadNext: ; a=chanPC[x]+fcsPtr clc lda chanPC,x - adc #>fcsPtr + adc #fcsPtr sta fcsTempPtr+1 ; increase PC @@ -356,7 +363,7 @@ fcsChannelCmd: ; process and read arguments ; if (a<0xb3) - bmi fcsNote ; handle $00-$7f + bpl fcsNote ; handle $00-$7f cmp #$b4 bpl fcsCheckOther @@ -421,7 +428,7 @@ fcsDoChannel: ; check whether this channel is halted (PC = 0) lda chanPC,x ora chanPC+1,x - beq + + bne + rts ; channel not halted... begin processing ; chanTicks-- @@ -490,6 +497,18 @@ fcsInit: cpx #0 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 ; TODO @@ -549,12 +568,12 @@ fcsVibTable: ; $dd fcsWaitC, ; $de fcsWait1, ; $df fcsStop, -fcsInsTableLow: +fcsInsTableHigh: .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 >fcsOptPlaceholder, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsNoOp, >fcsCallI, >fcsOffWait, >fcsFullCmd, >fcsCall, >fcsRet, >fcsJump, >fcsTickRate, >fcsWaitS, >fcsWaitC, >fcsWait1, >fcsStop -fcsInsTableHigh: +fcsInsTableLow: .db