Performance adjusts
This commit is contained in:
parent
f73d1bd82c
commit
a411e34a62
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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].audPos<s->samples) {
|
||||
writeAudDat(s->data8[chan[i].audPos++]);
|
||||
}
|
||||
if (s->isLoopable() && chan[i].audPos>=MIN(131071,(unsigned int)s->getLoopEndPosition())) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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 && dacAntiClick<next) { \
|
||||
|
|
|
@ -61,7 +61,7 @@ void DivPlatformPCE::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;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.sample<parent->song.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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -34,9 +34,9 @@ void DivPlatformZXBeeper::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
if (curSample>=0 && curSample<parent->song.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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue