command stream ending fix?

This commit is contained in:
tildearrow 2024-03-08 13:48:54 -05:00
parent 1e221393c4
commit 7d95e685ac

View file

@ -293,12 +293,13 @@ SafeWriter* DivEngine::saveCommand(bool binary) {
int lastTick[DIV_MAX_CHANS]; int lastTick[DIV_MAX_CHANS];
memset(lastTick,0,DIV_MAX_CHANS*sizeof(int)); memset(lastTick,0,DIV_MAX_CHANS*sizeof(int));
bool wroteTickGlobal=false;
while (!done) { while (!done) {
if (nextTick(false,true) || !playing) { if (nextTick(false,true) || !playing) {
done=true; done=true;
} }
// get command stream // get command stream
bool wroteTickGlobal=false; wroteTickGlobal=false;
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;
@ -339,6 +340,11 @@ SafeWriter* DivEngine::saveCommand(bool binary) {
cmdStream.clear(); cmdStream.clear();
tick++; tick++;
} }
wroteTickGlobal=false;
memset(wroteTick,0,DIV_MAX_CHANS*sizeof(bool));
for (int i=0; i<chans; i++) {
WRITE_TICK(i);
}
cmdStreamEnabled=oldCmdStreamEnabled; cmdStreamEnabled=oldCmdStreamEnabled;
if (binary) { if (binary) {