command stream export: offset porta target

C-(-5) is now 0 and B-9 is 179 (offset by +60)
This commit is contained in:
tildearrow 2025-04-25 02:27:43 -05:00
parent 0a9b91c25c
commit da68b82df4
2 changed files with 7 additions and 2 deletions

View file

@ -169,7 +169,7 @@ bool DivCSPlayer::tick() {
chan[i].volSpeedTarget=-1;
break;
case 0xc9: // porta
chan[i].portaTarget=(signed char)stream.readC();
chan[i].portaTarget=(int)((unsigned char)stream.readC())-60;
chan[i].portaSpeed=(unsigned char)stream.readC();
break;
case 0xca: { // legato

View file

@ -378,10 +378,15 @@ void writeCommandValues(SafeWriter* w, const DivCommand& c, bool bigEndian) {
w->writeC(c.value);
break;
case DIV_CMD_HINT_PANNING:
case DIV_CMD_HINT_PORTA:
w->writeC(c.value);
w->writeC(c.value2);
break;
case DIV_CMD_HINT_PORTA: {
unsigned char val=CLAMP(c.value+60,0,255);
w->writeC(val);
w->writeC(c.value2);
break;
}
case DIV_CMD_PRE_PORTA:
w->writeC((c.value?0x80:0)|(c.value2?0x40:0));
break;