potential flush needed here too

This commit is contained in:
MooingLemur 2023-08-15 00:47:08 -07:00
parent fd2c17e4f9
commit 5d63b253ce
1 changed files with 8 additions and 0 deletions

View File

@ -405,6 +405,10 @@ void DivZSM::flushWrites() {
pcmMeta.clear();
}
if (extCmd0Len) { // we have some PCM events to write
if (!hasFlushed) {
flushTicks();
hasFlushed=true;
}
w->writeC(ZSM_EXT);
w->writeC(ZSM_EXT_PCM|(unsigned char)extCmd0Len);
for (DivRegWrite& write: pcmMeta) {
@ -419,6 +423,10 @@ void DivZSM::flushWrites() {
}
n=0;
for (DivRegWrite& write: syncCache) {
if (!hasFlushed) {
flushTicks();
hasFlushed=true;
}
if (n%ZSM_SYNC_MAX_WRITES==0) {
w->writeC(ZSM_EXT);
if (syncCache.size()-n>ZSM_SYNC_MAX_WRITES) {