diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index 250bcdfef..06510d69f 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -26,6 +26,14 @@ #define rWrite(a,v) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v)); if (dumpWrites) {addWrite(a,v);} } #define rWriteDelay(a,v,d) if (!skipRegisterWrites) {writes.push(QueuedWrite(a,v,d)); if (dumpWrites) {addWrite(a,v);} } +#define setPhrase(c) \ + if (isBanked) { \ + rWrite(16+(c),bankedPhrase[chan[(c)].sample].bank); \ + rWrite(0,0x80|((c)<<5)|bankedPhrase[chan[(c)].sample].phrase); \ + } else { \ + rWrite(0,0x80|chan[(c)].sample); \ + } + const char** DivPlatformMSM6295::getRegisterSheet() { return NULL; } @@ -116,12 +124,7 @@ void DivPlatformMSM6295::tick(bool sysTick) { rWriteDelay(0,(8<=0 && chan[i].samplesong.sampleLen) { - if (isBanked) { - rWrite(16+i,bankedPhrase[chan[i].sample].bank); - rWrite(0,0x80|(i<<5)|bankedPhrase[chan[i].sample].phrase); - } else { - rWrite(0,0x80|chan[i].sample); // set phrase - } + setPhrase(i); rWrite(0,(16<getSample(12*sampleBank+c.value%12); chan[c.chan].sample=12*sampleBank+c.value%12; rWriteDelay(0,(8<