prepare to move things around
speed dial commands and speed delays will be moved to e0-ff in order to accelerate command check process (one cmp as opposed to a large command call table)
This commit is contained in:
parent
a2269bc2b1
commit
ecc60a3a64
|
@ -72,6 +72,7 @@ hex | description
|
|||
c0 | pre porta (X)
|
||||
| - bit 7: inPorta
|
||||
| - bit 6: isPortaOrSlide
|
||||
c1 | arpeggio speed (b)
|
||||
c2 | vibrato (bb) // speed, depth
|
||||
c3 | vibrato range (b)
|
||||
c4 | vibrato shape (b)
|
||||
|
@ -310,8 +311,6 @@ hex | description
|
|||
9f | envelope K1 ramp (bb)
|
||||
a0 | envelope K2 ramp (bb)
|
||||
a1 | pause (b)
|
||||
----|------------------------------------
|
||||
a2 | arpeggio speed (b)
|
||||
----|------------------------------------
|
||||
| **SNES commands (continued)**
|
||||
a3 | global vol left (c)
|
||||
|
|
|
@ -137,48 +137,72 @@ bool DivCSPlayer::tick() {
|
|||
case 0xc0:
|
||||
command=DIV_CMD_PRE_PORTA;
|
||||
break;
|
||||
case 0xc2:
|
||||
command=DIV_CMD_HINT_VIBRATO;
|
||||
case 0xc1: // arp time
|
||||
arpSpeed=(unsigned char)stream.readC();
|
||||
break;
|
||||
case 0xc3:
|
||||
command=DIV_CMD_HINT_VIBRATO_RANGE;
|
||||
case 0xc2: // vibrato
|
||||
chan[i].vibratoDepth=(signed char)stream.readC();
|
||||
chan[i].vibratoRate=(unsigned char)stream.readC();
|
||||
sendPitch=true;
|
||||
break;
|
||||
case 0xc4:
|
||||
command=DIV_CMD_HINT_VIBRATO_SHAPE;
|
||||
case 0xc3: // vibrato range
|
||||
chan[i].vibratoRange=(unsigned char)stream.readC();
|
||||
break;
|
||||
case 0xc5:
|
||||
command=DIV_CMD_HINT_PITCH;
|
||||
case 0xc4: // vibrato shape
|
||||
chan[i].vibratoShape=(unsigned char)stream.readC();
|
||||
break;
|
||||
case 0xc6:
|
||||
command=DIV_CMD_HINT_ARPEGGIO;
|
||||
case 0xc5: // pitch
|
||||
chan[i].pitch=(signed char)stream.readC();
|
||||
sendPitch=true;
|
||||
break;
|
||||
case 0xc7:
|
||||
command=DIV_CMD_HINT_VOLUME;
|
||||
case 0xc6: // arpeggio
|
||||
chan[i].arp=(unsigned char)stream.readC();
|
||||
break;
|
||||
case 0xc8:
|
||||
command=DIV_CMD_HINT_VOL_SLIDE;
|
||||
case 0xc7: // volume
|
||||
chan[i].volume=((unsigned char)stream.readC())<<8;
|
||||
sendVolume=true;
|
||||
break;
|
||||
case 0xc9:
|
||||
command=DIV_CMD_HINT_PORTA;
|
||||
case 0xc8: // vol slide
|
||||
chan[i].volSpeed=(short)(bigEndian?stream.readS_BE():stream.readS());
|
||||
chan[i].volSpeedTarget=-1;
|
||||
break;
|
||||
case 0xca:
|
||||
command=DIV_CMD_HINT_LEGATO;
|
||||
case 0xc9: // porta
|
||||
chan[i].portaTarget=(signed char)stream.readC();
|
||||
chan[i].portaSpeed=(unsigned char)stream.readC();
|
||||
break;
|
||||
case 0xcb:
|
||||
command=DIV_CMD_HINT_VOL_SLIDE_TARGET;
|
||||
case 0xca: { // legato
|
||||
int arg0=(unsigned char)stream.readC();
|
||||
if (arg0==0xff) {
|
||||
arg0=DIV_NOTE_NULL;
|
||||
} else {
|
||||
arg0-=60;
|
||||
}
|
||||
chan[i].note=arg0;
|
||||
e->dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note));
|
||||
break;
|
||||
case 0xcc:
|
||||
command=DIV_CMD_HINT_TREMOLO;
|
||||
}
|
||||
case 0xcb: { // vol slide target
|
||||
int arg0=(short)(bigEndian?stream.readS_BE():stream.readS());
|
||||
int arg1=(short)(bigEndian?stream.readS_BE():stream.readS());
|
||||
chan[i].volSpeed=arg0;
|
||||
chan[i].volSpeedTarget=arg0==0 ? -1 : arg1;
|
||||
break;
|
||||
case 0xcd:
|
||||
command=DIV_CMD_HINT_PANBRELLO;
|
||||
}
|
||||
case 0xcc: // tremolo (TODO)
|
||||
stream.readC();
|
||||
break;
|
||||
case 0xce:
|
||||
command=DIV_CMD_HINT_PAN_SLIDE;
|
||||
case 0xcd: // panbrello (TODO)
|
||||
stream.readC();
|
||||
break;
|
||||
case 0xcf:
|
||||
command=DIV_CMD_HINT_PANNING;
|
||||
case 0xce: // pan slide (TODO)
|
||||
stream.readC();
|
||||
break;
|
||||
case 0xcf: { // panning
|
||||
int panL=(unsigned char)stream.readC();
|
||||
int panR=(unsigned char)stream.readC();
|
||||
e->dispatchCmd(DivCommand(DIV_CMD_PANNING,i,panL,panR));
|
||||
break;
|
||||
}
|
||||
case 0xd0: case 0xd1: case 0xd2: case 0xd3:
|
||||
case 0xd4: case 0xd5: case 0xd6: case 0xd7:
|
||||
case 0xd8: case 0xd9: case 0xda: case 0xdb:
|
||||
|
@ -290,44 +314,13 @@ bool DivCSPlayer::tick() {
|
|||
int arg1=0;
|
||||
switch (command) {
|
||||
case DIV_CMD_INSTRUMENT:
|
||||
case DIV_CMD_HINT_VIBRATO_RANGE:
|
||||
case DIV_CMD_HINT_VIBRATO_SHAPE:
|
||||
case DIV_CMD_HINT_VOLUME:
|
||||
case DIV_CMD_HINT_ARPEGGIO:
|
||||
arg0=(unsigned char)stream.readC();
|
||||
break;
|
||||
case DIV_CMD_HINT_PITCH:
|
||||
arg0=(signed char)stream.readC();
|
||||
break;
|
||||
case DIV_CMD_HINT_VIBRATO:
|
||||
case DIV_CMD_HINT_PORTA:
|
||||
arg0=(signed char)stream.readC();
|
||||
arg1=(unsigned char)stream.readC();
|
||||
break;
|
||||
case DIV_CMD_HINT_PANNING: // TODO: panbrello
|
||||
arg0=(unsigned char)stream.readC();
|
||||
arg1=(unsigned char)stream.readC();
|
||||
break;
|
||||
case DIV_CMD_PRE_PORTA:
|
||||
arg0=(unsigned char)stream.readC();
|
||||
arg1=(arg0&0x40)?1:0;
|
||||
arg0=(arg0&0x80)?1:0;
|
||||
break;
|
||||
case DIV_CMD_HINT_VOL_SLIDE:
|
||||
arg0=(short)(bigEndian?stream.readS_BE():stream.readS());
|
||||
break;
|
||||
case DIV_CMD_HINT_VOL_SLIDE_TARGET:
|
||||
arg0=(short)(bigEndian?stream.readS_BE():stream.readS());
|
||||
arg1=(short)(bigEndian?stream.readS_BE():stream.readS());
|
||||
break;
|
||||
case DIV_CMD_HINT_LEGATO:
|
||||
arg0=(unsigned char)stream.readC();
|
||||
if (arg0==0xff) {
|
||||
arg0=DIV_NOTE_NULL;
|
||||
} else {
|
||||
arg0-=60;
|
||||
}
|
||||
break;
|
||||
// ONE BYTE COMMANDS
|
||||
case DIV_CMD_SAMPLE_MODE:
|
||||
case DIV_CMD_SAMPLE_FREQ:
|
||||
|
@ -377,7 +370,6 @@ bool DivCSPlayer::tick() {
|
|||
case DIV_CMD_MACRO_OFF:
|
||||
case DIV_CMD_MACRO_ON:
|
||||
case DIV_CMD_MACRO_RESTART:
|
||||
case DIV_CMD_HINT_ARP_TIME:
|
||||
case DIV_CMD_QSOUND_ECHO_FEEDBACK:
|
||||
case DIV_CMD_QSOUND_ECHO_LEVEL:
|
||||
case DIV_CMD_QSOUND_SURROUND:
|
||||
|
@ -548,49 +540,8 @@ bool DivCSPlayer::tick() {
|
|||
break;
|
||||
}
|
||||
|
||||
switch (command) {
|
||||
case DIV_CMD_HINT_VOLUME:
|
||||
chan[i].volume=arg0<<8;
|
||||
sendVolume=true;
|
||||
break;
|
||||
case DIV_CMD_HINT_VOL_SLIDE:
|
||||
chan[i].volSpeed=arg0;
|
||||
chan[i].volSpeedTarget=-1;
|
||||
break;
|
||||
case DIV_CMD_HINT_VOL_SLIDE_TARGET:
|
||||
chan[i].volSpeed=arg0;
|
||||
chan[i].volSpeedTarget=arg0==0 ? -1 : arg1;
|
||||
break;
|
||||
case DIV_CMD_HINT_PITCH:
|
||||
chan[i].pitch=arg0;
|
||||
sendPitch=true;
|
||||
break;
|
||||
case DIV_CMD_HINT_VIBRATO:
|
||||
chan[i].vibratoDepth=arg0;
|
||||
chan[i].vibratoRate=arg1;
|
||||
sendPitch=true;
|
||||
break;
|
||||
case DIV_CMD_HINT_PORTA:
|
||||
chan[i].portaTarget=arg0;
|
||||
chan[i].portaSpeed=arg1;
|
||||
break;
|
||||
case DIV_CMD_HINT_LEGATO:
|
||||
chan[i].note=arg0;
|
||||
e->dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note));
|
||||
break;
|
||||
case DIV_CMD_HINT_ARPEGGIO:
|
||||
chan[i].arp=(unsigned char)arg0;
|
||||
break;
|
||||
case DIV_CMD_HINT_ARP_TIME:
|
||||
arpSpeed=arg0;
|
||||
break;
|
||||
case DIV_CMD_HINT_PANNING:
|
||||
e->dispatchCmd(DivCommand(DIV_CMD_PANNING,i,arg0,arg1));
|
||||
break;
|
||||
default: // dispatch it
|
||||
e->dispatchCmd(DivCommand((DivDispatchCmds)command,i,arg0,arg1));
|
||||
break;
|
||||
}
|
||||
// dispatch it
|
||||
e->dispatchCmd(DivCommand((DivDispatchCmds)command,i,arg0,arg1));
|
||||
}
|
||||
|
||||
for (unsigned int j=accessTSBegin; j<stream.tell(); j++) {
|
||||
|
|
|
@ -36,7 +36,7 @@ struct DivCSChannelState {
|
|||
|
||||
int note, pitch;
|
||||
int volume, volMax, volSpeed, volSpeedTarget;
|
||||
int vibratoDepth, vibratoRate, vibratoPos;
|
||||
int vibratoDepth, vibratoRate, vibratoPos, vibratoRange, vibratoShape;
|
||||
int portaTarget, portaSpeed;
|
||||
unsigned char arp, arpStage, arpTicks, loopCount;
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ int DivCS::getCmdLength(unsigned char ext) {
|
|||
case DIV_CMD_MACRO_OFF:
|
||||
case DIV_CMD_MACRO_ON:
|
||||
case DIV_CMD_MACRO_RESTART:
|
||||
case DIV_CMD_HINT_ARP_TIME:
|
||||
case DIV_CMD_QSOUND_ECHO_FEEDBACK:
|
||||
case DIV_CMD_QSOUND_ECHO_LEVEL:
|
||||
case DIV_CMD_QSOUND_SURROUND:
|
||||
|
@ -234,6 +233,7 @@ int DivCS::getInsLength(unsigned char ins, unsigned char ext, unsigned char* spe
|
|||
switch (ins) {
|
||||
case 0xb8: // ins
|
||||
case 0xc0: // pre porta
|
||||
case 0xc1: // arp time
|
||||
case 0xc3: // vib range
|
||||
case 0xc4: // vib shape
|
||||
case 0xc5: // pitch
|
||||
|
@ -283,25 +283,64 @@ void writeCommandValues(SafeWriter* w, const DivCommand& c, bool bigEndian) {
|
|||
}
|
||||
break;
|
||||
case DIV_CMD_NOTE_OFF:
|
||||
w->writeC(0xb5);
|
||||
break;
|
||||
case DIV_CMD_NOTE_OFF_ENV:
|
||||
w->writeC(0xb6);
|
||||
break;
|
||||
case DIV_CMD_ENV_RELEASE:
|
||||
w->writeC(0xb7);
|
||||
break;
|
||||
case DIV_CMD_INSTRUMENT:
|
||||
w->writeC(0xb8);
|
||||
break;
|
||||
case DIV_CMD_PRE_PORTA:
|
||||
w->writeC(0xc0);
|
||||
break;
|
||||
case DIV_CMD_HINT_ARP_TIME:
|
||||
w->writeC(0xc1);
|
||||
break;
|
||||
case DIV_CMD_HINT_VIBRATO:
|
||||
w->writeC(0xc2);
|
||||
break;
|
||||
case DIV_CMD_HINT_VIBRATO_RANGE:
|
||||
w->writeC(0xc3);
|
||||
break;
|
||||
case DIV_CMD_HINT_VIBRATO_SHAPE:
|
||||
w->writeC(0xc4);
|
||||
break;
|
||||
case DIV_CMD_HINT_PITCH:
|
||||
w->writeC(0xc5);
|
||||
break;
|
||||
case DIV_CMD_HINT_ARPEGGIO:
|
||||
w->writeC(0xc6);
|
||||
break;
|
||||
case DIV_CMD_HINT_VOLUME:
|
||||
case DIV_CMD_HINT_PORTA:
|
||||
w->writeC(0xc7);
|
||||
break;
|
||||
case DIV_CMD_HINT_VOL_SLIDE:
|
||||
case DIV_CMD_HINT_VOL_SLIDE_TARGET:
|
||||
w->writeC(0xc8);
|
||||
break;
|
||||
case DIV_CMD_HINT_PORTA:
|
||||
w->writeC(0xc9);
|
||||
break;
|
||||
case DIV_CMD_HINT_LEGATO:
|
||||
w->writeC(0xca);
|
||||
break;
|
||||
case DIV_CMD_HINT_VOL_SLIDE_TARGET:
|
||||
w->writeC(0xcb);
|
||||
break;
|
||||
case DIV_CMD_HINT_TREMOLO:
|
||||
w->writeC(0xcc);
|
||||
break;
|
||||
case DIV_CMD_HINT_PANBRELLO:
|
||||
w->writeC(0xcd);
|
||||
break;
|
||||
case DIV_CMD_HINT_PAN_SLIDE:
|
||||
w->writeC(0xce);
|
||||
break;
|
||||
case DIV_CMD_HINT_PANNING:
|
||||
w->writeC((unsigned char)c.cmd+0xb4);
|
||||
w->writeC(0xcf);
|
||||
break;
|
||||
default:
|
||||
w->writeC(0xf7);
|
||||
|
@ -330,6 +369,7 @@ void writeCommandValues(SafeWriter* w, const DivCommand& c, bool bigEndian) {
|
|||
case DIV_CMD_HINT_PANBRELLO:
|
||||
case DIV_CMD_HINT_PAN_SLIDE:
|
||||
case DIV_CMD_HINT_ARPEGGIO:
|
||||
case DIV_CMD_HINT_ARP_TIME:
|
||||
w->writeC(c.value);
|
||||
break;
|
||||
case DIV_CMD_HINT_PANNING:
|
||||
|
@ -405,7 +445,6 @@ void writeCommandValues(SafeWriter* w, const DivCommand& c, bool bigEndian) {
|
|||
case DIV_CMD_MACRO_OFF:
|
||||
case DIV_CMD_MACRO_ON:
|
||||
case DIV_CMD_MACRO_RESTART:
|
||||
case DIV_CMD_HINT_ARP_TIME:
|
||||
case DIV_CMD_QSOUND_ECHO_FEEDBACK:
|
||||
case DIV_CMD_QSOUND_ECHO_LEVEL:
|
||||
case DIV_CMD_QSOUND_SURROUND:
|
||||
|
|
Loading…
Reference in a new issue