prepare for command stream compression
don't optimize waits (this will be the final pass)
This commit is contained in:
parent
b5faddf319
commit
93e3ccf93f
|
@ -20,6 +20,7 @@
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "../ta-log.h"
|
#include "../ta-log.h"
|
||||||
|
|
||||||
|
/*
|
||||||
#define WRITE_TICK(x) \
|
#define WRITE_TICK(x) \
|
||||||
if (!wroteTick[x]) { \
|
if (!wroteTick[x]) { \
|
||||||
wroteTick[x]=true; \
|
wroteTick[x]=true; \
|
||||||
|
@ -35,6 +36,7 @@
|
||||||
} \
|
} \
|
||||||
lastTick[x]=tick; \
|
lastTick[x]=tick; \
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void writePackedCommandValues(SafeWriter* w, const DivCommand& c) {
|
void writePackedCommandValues(SafeWriter* w, const DivCommand& c) {
|
||||||
switch (c.cmd) {
|
switch (c.cmd) {
|
||||||
|
@ -274,7 +276,6 @@ SafeWriter* DivEngine::saveCommand() {
|
||||||
memset(wroteTick,0,DIV_MAX_CHANS*sizeof(bool));
|
memset(wroteTick,0,DIV_MAX_CHANS*sizeof(bool));
|
||||||
if (curDivider!=divider) {
|
if (curDivider!=divider) {
|
||||||
curDivider=divider;
|
curDivider=divider;
|
||||||
WRITE_TICK(0);
|
|
||||||
chanStream[0]->writeC(0xfb);
|
chanStream[0]->writeC(0xfb);
|
||||||
chanStream[0]->writeI((int)(curDivider*65536));
|
chanStream[0]->writeI((int)(curDivider*65536));
|
||||||
}
|
}
|
||||||
|
@ -294,19 +295,18 @@ SafeWriter* DivEngine::saveCommand() {
|
||||||
case DIV_CMD_PRE_NOTE:
|
case DIV_CMD_PRE_NOTE:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
WRITE_TICK(i.chan);
|
|
||||||
cmdPopularity[i.cmd]++;
|
cmdPopularity[i.cmd]++;
|
||||||
writePackedCommandValues(chanStream[i.chan],i);
|
writePackedCommandValues(chanStream[i.chan],i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmdStream.clear();
|
cmdStream.clear();
|
||||||
|
for (int i=0; i<chans; i++) {
|
||||||
|
chanStream[i]->writeC(0xfe);
|
||||||
|
}
|
||||||
tick++;
|
tick++;
|
||||||
}
|
}
|
||||||
memset(wroteTick,0,DIV_MAX_CHANS*sizeof(bool));
|
memset(wroteTick,0,DIV_MAX_CHANS*sizeof(bool));
|
||||||
for (int i=0; i<chans; i++) {
|
|
||||||
WRITE_TICK(i);
|
|
||||||
}
|
|
||||||
cmdStreamEnabled=oldCmdStreamEnabled;
|
cmdStreamEnabled=oldCmdStreamEnabled;
|
||||||
|
|
||||||
int sortCand=-1;
|
int sortCand=-1;
|
||||||
|
|
Loading…
Reference in a new issue