diff --git a/src/engine/instrument.h b/src/engine/instrument.h index 68cd0b3cc..e95ef0b66 100644 --- a/src/engine/instrument.h +++ b/src/engine/instrument.h @@ -60,14 +60,16 @@ enum DivInstrumentType: unsigned short { DIV_INS_SU=30, DIV_INS_NAMCO=31, DIV_INS_OPL_DRUMS=32, - DIV_INS_MSM6258=33, - DIV_INS_MSM6295=34, - DIV_INS_ADPCMA=35, - DIV_INS_ADPCMB=36, - DIV_INS_SEGAPCM=37, - DIV_INS_QSOUND=38, - DIV_INS_YMZ280B=39, - DIV_INS_RF5C68=40, + //33 + //34 + DIV_INS_MSM6258=35, + DIV_INS_MSM6295=36, + DIV_INS_ADPCMA=37, + DIV_INS_ADPCMB=38, + DIV_INS_SEGAPCM=39, + DIV_INS_QSOUND=40, + DIV_INS_YMZ280B=41, + DIV_INS_RF5C68=42, DIV_INS_MAX, DIV_INS_NULL }; diff --git a/src/engine/platform/amiga.cpp b/src/engine/platform/amiga.cpp index 764c4332c..d229998e2 100644 --- a/src/engine/platform/amiga.cpp +++ b/src/engine/platform/amiga.cpp @@ -95,8 +95,8 @@ void DivPlatformAmiga::acquire(short* bufL, short* bufR, size_t start, size_t le } } else { DivSample* s=parent->getSample(chan[i].sample); - if (s->getEndPosition()>0) { - if (chan[i].audPos<(unsigned int)s->getEndPosition()) { + if (s->samples>0) { + if (chan[i].audPossamples) { writeAudDat(s->data8[chan[i].audPos++]); } if (s->isLoopable() && chan[i].audPos>=MIN(131071,(unsigned int)s->getLoopEndPosition())) { diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index de5dd6e78..b7871b680 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -90,7 +90,7 @@ void DivPlatformAY8910::acquire(short* bufL, short* bufR, size_t start, size_t l int prev_out = chan[i].dac.out; while (chan[i].dac.period>rate && !end) { DivSample* s=parent->getSample(chan[i].dac.sample); - if (s->getEndPosition()<=0) { + if (s->samples<=0) { chan[i].dac.sample=-1; rWrite(0x08+i,0); end=true; diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index 2dd4ca8de..2943ac177 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -94,7 +94,7 @@ void DivPlatformAY8930::acquire(short* bufL, short* bufR, size_t start, size_t l int prev_out = chan[i].dac.out; while (chan[i].dac.period>rate && !end) { DivSample* s=parent->getSample(chan[i].dac.sample); - if (s->getEndPosition()<=0) { + if (s->samples<=0) { chan[i].dac.sample=-1; rWrite(0x08+i,0); end=true; diff --git a/src/engine/platform/mmc5.cpp b/src/engine/platform/mmc5.cpp index 3b9f9b58e..de997a025 100644 --- a/src/engine/platform/mmc5.cpp +++ b/src/engine/platform/mmc5.cpp @@ -49,7 +49,7 @@ void DivPlatformMMC5::acquire(short* bufL, short* bufR, size_t start, size_t len dacPeriod+=dacRate; if (dacPeriod>=rate) { DivSample* s=parent->getSample(dacSample); - if (s->getEndPosition()>0) { + if (s->samples>0) { if (!isMuted[2]) { rWrite(0x5011,((unsigned char)s->data8[dacPos]+0x80)); } diff --git a/src/engine/platform/nes.cpp b/src/engine/platform/nes.cpp index 7827cbac1..fbb7fa3a8 100644 --- a/src/engine/platform/nes.cpp +++ b/src/engine/platform/nes.cpp @@ -76,7 +76,7 @@ void DivPlatformNES::doWrite(unsigned short addr, unsigned char data) { dacPeriod+=dacRate; \ if (dacPeriod>=rate) { \ DivSample* s=parent->getSample(dacSample); \ - if (s->getEndPosition()>0) { \ + if (s->samples>0) { \ if (!isMuted[4]) { \ unsigned char next=((unsigned char)s->data8[dacPos]+0x80)>>1; \ if (dacAntiClickOn && dacAntiClickrate) { DivSample* s=parent->getSample(chan[i].dacSample); - if (s->getEndPosition()<=0) { + if (s->samples<=0) { chan[i].dacSample=-1; continue; } diff --git a/src/engine/platform/pcmdac.cpp b/src/engine/platform/pcmdac.cpp index 57f5c0026..8f1440878 100644 --- a/src/engine/platform/pcmdac.cpp +++ b/src/engine/platform/pcmdac.cpp @@ -50,7 +50,7 @@ void DivPlatformPCMDAC::acquire(short* bufL, short* bufR, size_t start, size_t l output=(chan.ws.output[chan.audPos]^0x80)<<8; } else { DivSample* s=parent->getSample(chan.sample); - if (s->getEndPosition()>0) { + if (s->samples>0) { if (chan.audDir) { if (s->isLoopable()) { switch (s->loopMode) { diff --git a/src/engine/platform/segapcm.cpp b/src/engine/platform/segapcm.cpp index 2ff7552d2..93481d94f 100644 --- a/src/engine/platform/segapcm.cpp +++ b/src/engine/platform/segapcm.cpp @@ -36,7 +36,7 @@ void DivPlatformSegaPCM::acquire(short* bufL, short* bufR, size_t start, size_t for (int i=0; i<16; i++) { if (chan[i].pcm.sample>=0 && chan[i].pcm.samplesong.sampleLen) { DivSample* s=parent->getSample(chan[i].pcm.sample); - if (s->getEndPosition()<=0) { + if (s->samples<=0) { chan[i].pcm.sample=-1; oscBuf[i]->data[oscBuf[i]->needle++]=0; continue; diff --git a/src/engine/platform/swan.cpp b/src/engine/platform/swan.cpp index 0d264f714..e6242c795 100644 --- a/src/engine/platform/swan.cpp +++ b/src/engine/platform/swan.cpp @@ -57,7 +57,7 @@ void DivPlatformSwan::acquire(short* bufL, short* bufR, size_t start, size_t len dacPeriod+=dacRate; while (dacPeriod>rate) { DivSample* s=parent->getSample(dacSample); - if (s->getEndPosition()<=0) { + if (s->samples<=0) { dacSample=-1; continue; } diff --git a/src/engine/platform/vera.cpp b/src/engine/platform/vera.cpp index 9d22a854d..22be5e984 100644 --- a/src/engine/platform/vera.cpp +++ b/src/engine/platform/vera.cpp @@ -58,7 +58,7 @@ void DivPlatformVERA::acquire(short* bufL, short* bufR, size_t start, size_t len size_t pos=start; DivSample* s=parent->getSample(chan[16].pcm.sample); while (len>0) { - if (s->getEndPosition()>0) { + if (s->samples>0) { while (pcm_is_fifo_almost_empty(pcm)) { short tmp_l=0; short tmp_r=0; diff --git a/src/engine/platform/vrc6.cpp b/src/engine/platform/vrc6.cpp index 2f670bf26..134905479 100644 --- a/src/engine/platform/vrc6.cpp +++ b/src/engine/platform/vrc6.cpp @@ -54,7 +54,7 @@ void DivPlatformVRC6::acquire(short* bufL, short* bufR, size_t start, size_t len chan[i].dacPeriod+=chan[i].dacRate; if (chan[i].dacPeriod>rate) { DivSample* s=parent->getSample(chan[i].dacSample); - if (s->getEndPosition()<=0) { + if (s->samples<=0) { chan[i].dacSample=-1; chWrite(i,0,0); continue; diff --git a/src/engine/platform/zxbeeper.cpp b/src/engine/platform/zxbeeper.cpp index 2869c38aa..5fa3840bb 100644 --- a/src/engine/platform/zxbeeper.cpp +++ b/src/engine/platform/zxbeeper.cpp @@ -34,9 +34,9 @@ void DivPlatformZXBeeper::acquire(short* bufL, short* bufR, size_t start, size_t if (curSample>=0 && curSamplesong.sampleLen) { if (--curSamplePeriod<0) { DivSample* s=parent->getSample(curSample); - if (s->getEndPosition()>0) { + if (s->samples>0) { sampleOut=(s->data8[curSamplePos++]>0); - if (curSamplePos>=(unsigned int)s->getEndPosition()) curSample=-1; + if (curSamplePos>=s->samples) curSample=-1; // 256 bits if (curSamplePos>2047) curSample=-1;