diff --git a/papers/export-tech.md b/papers/export-tech.md index f8673d223..1f13b639d 100644 --- a/papers/export-tech.md +++ b/papers/export-tech.md @@ -99,7 +99,7 @@ hex | description d0 | UNUSED - placeholder used during optimization passes (3-byte nonce follows) d1 | no operation d2 | UNUSED - d3 | loop (negative offset and count follow... both are 8-bit) + d3 | UNUSED d4 | UNUSED - call symbol (32-bit index follows; only used internally) d5 | call sub-block (32-bit address follows) d6 | note off + wait one tick diff --git a/src/asm/6502/stream.s b/src/asm/6502/stream.s index bcfb6bf2b..8f8fb89b3 100644 --- a/src/asm/6502/stream.s +++ b/src/asm/6502/stream.s @@ -176,6 +176,23 @@ fcsNoOpOneByte: jsr fcsReadNext rts +fcsPan: + jsr fcsReadNext + sta chanPan,x + sta fcsArg0 + jsr fcsReadNext + sta chanPan+1,x + sta fcsArg1 + ldy #10 + jsr fcsDispatchCmd + rts + +fcsOptPlaceholder: + jsr fcsReadNext + jsr fcsReadNext + jsr fcsReadNext + rts + fcsNoOp: rts @@ -211,7 +228,7 @@ fcsNoOp: ; $d0 fcsOptPlaceholder, ; $d1 fcsNoOp, ; $d2 fcsNoOp, -; $d3 fcsLoop, +; $d3 fcsNoOp, ; $d4 fcsNoOp, ; $d5 fcsCallI, ; $d6 fcsOffWait, diff --git a/src/engine/cmdStream.cpp b/src/engine/cmdStream.cpp index f2c51ae39..9f6b75a37 100644 --- a/src/engine/cmdStream.cpp +++ b/src/engine/cmdStream.cpp @@ -220,23 +220,6 @@ bool DivCSPlayer::tick() { break; case 0xd1: // nop break; - case 0xd3: { // loop - unsigned char loopOff=stream.readC(); - if (chan[i].loopCount>0) { - stream.readC(); - if (--chan[i].loopCount) { - // jump - chan[i].readPos-=loopOff; - mustTell=false; - } - } else { - chan[i].loopCount=stream.readC(); - // jump - chan[i].readPos-=loopOff; - mustTell=false; - } - break; - } case 0xd6: // note off + wait 1 e->dispatchCmd(DivCommand(DIV_CMD_NOTE_OFF,i)); chan[i].waitTicks=1; diff --git a/src/engine/cmdStream.h b/src/engine/cmdStream.h index 6af0d6d99..326134dbd 100644 --- a/src/engine/cmdStream.h +++ b/src/engine/cmdStream.h @@ -38,7 +38,7 @@ struct DivCSChannelState { int volume, volMax, volSpeed, volSpeedTarget; int vibratoDepth, vibratoRate, vibratoPos, vibratoRange, vibratoShape; int portaTarget, portaSpeed; - unsigned char arp, arpStage, arpTicks, loopCount; + unsigned char arp, arpStage, arpTicks; unsigned int callStack[DIV_MAX_CSSTACK]; unsigned char callStackPos; @@ -66,7 +66,6 @@ struct DivCSChannelState { arp(0), arpStage(0), arpTicks(0), - loopCount(0), callStackPos(0), tracePos(0) { for (int i=0; i=bufLen) return "???"; return fmt::sprintf("callsym $%.4x",(int)(buf[addr+1]|(buf[addr+2]<<8)));