diff --git a/src/engine/platform/genesis.cpp b/src/engine/platform/genesis.cpp index 46e243332..10a8762c0 100644 --- a/src/engine/platform/genesis.cpp +++ b/src/engine/platform/genesis.cpp @@ -92,7 +92,9 @@ void DivPlatformGenesis::acquire_nuked(short* bufL, short* bufR, size_t start, s DivSample* s=parent->getSample(dacSample); if (s->samples>0) { if (!isMuted[5]) { - urgentWrite(0x2a,(unsigned char)s->data8[dacPos]+0x80); + if (writes.size()<16) { + urgentWrite(0x2a,(unsigned char)s->data8[dacPos]+0x80); + } } if (++dacPos>=s->samples) { if (s->loopStart>=0 && s->loopStart<(int)s->samples) { @@ -159,7 +161,9 @@ void DivPlatformGenesis::acquire_ymfm(short* bufL, short* bufR, size_t start, si DivSample* s=parent->getSample(dacSample); if (s->samples>0) { if (!isMuted[5]) { - urgentWrite(0x2a,(unsigned char)s->data8[dacPos]+0x80); + if (writes.size()<16) { + urgentWrite(0x2a,(unsigned char)s->data8[dacPos]+0x80); + } } if (++dacPos>=s->samples) { if (s->loopStart>=0 && s->loopStart<(int)s->samples) { diff --git a/src/engine/platform/genesisshared.h b/src/engine/platform/genesisshared.h index 6410ddb27..3d5320f6b 100644 --- a/src/engine/platform/genesisshared.h +++ b/src/engine/platform/genesisshared.h @@ -44,6 +44,6 @@ static int orderedOps[4]={ #define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;} #define immWrite(a,v) if (!skipRegisterWrites) {writes.push_back(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} } -#define urgentWrite(a,v) if (!skipRegisterWrites) {if (writes.empty() || writes.front().addrOrVal) {writes.push_back(QueuedWrite(a,v));} else {writes.push_front(QueuedWrite(a,v));}; if (dumpWrites) {addWrite(a,v);} } +#define urgentWrite(a,v) if (!skipRegisterWrites) {if (writes.empty() || writes.size()>16 || writes.front().addrOrVal) {writes.push_back(QueuedWrite(a,v));} else {writes.push_front(QueuedWrite(a,v));}; if (dumpWrites) {addWrite(a,v);} } #include "fmshared_OPN.h"