mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-01 04:21:44 +00:00
parent
c8eeac4f63
commit
bd8c06bbb7
5 changed files with 58 additions and 34 deletions
|
@ -10,21 +10,25 @@ void DivPlatformAmiga::acquire(short* bufL, short* bufR, size_t start, size_t le
|
||||||
bufL[h]=0;
|
bufL[h]=0;
|
||||||
bufR[h]=0;
|
bufR[h]=0;
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
if (chan[i].sample!=-1) {
|
if (chan[i].sample>=0 && chan[i].sample<parent->song.sampleLen) {
|
||||||
chan[i].audSub-=AMIGA_DIVIDER;
|
chan[i].audSub-=AMIGA_DIVIDER;
|
||||||
if (chan[i].audSub<0) {
|
if (chan[i].audSub<0) {
|
||||||
DivSample* s=parent->song.sample[chan[i].sample];
|
DivSample* s=parent->song.sample[chan[i].sample];
|
||||||
if (s->depth==8) {
|
if (s->rendLength>0) {
|
||||||
chan[i].audDat=s->rendData[chan[i].audPos++];
|
if (s->depth==8) {
|
||||||
} else {
|
chan[i].audDat=s->rendData[chan[i].audPos++];
|
||||||
chan[i].audDat=s->rendData[chan[i].audPos++]>>8;
|
|
||||||
}
|
|
||||||
if (chan[i].audPos>=s->rendLength || chan[i].audPos>=131071) {
|
|
||||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
|
||||||
chan[i].audPos=s->loopStart;
|
|
||||||
} else {
|
} else {
|
||||||
chan[i].sample=-1;
|
chan[i].audDat=s->rendData[chan[i].audPos++]>>8;
|
||||||
}
|
}
|
||||||
|
if (chan[i].audPos>=s->rendLength || chan[i].audPos>=131071) {
|
||||||
|
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||||
|
chan[i].audPos=s->loopStart;
|
||||||
|
} else {
|
||||||
|
chan[i].sample=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
chan[i].sample=-1;
|
||||||
}
|
}
|
||||||
/*if (chan[i].freq<124) {
|
/*if (chan[i].freq<124) {
|
||||||
// ???
|
// ???
|
||||||
|
|
|
@ -61,6 +61,10 @@ void DivPlatformArcade::acquire_nuked(short* bufL, short* bufR, size_t start, si
|
||||||
for (int i=8; i<13; i++) {
|
for (int i=8; i<13; i++) {
|
||||||
if (chan[i].pcm.sample>=0) {
|
if (chan[i].pcm.sample>=0) {
|
||||||
DivSample* s=parent->song.sample[chan[i].pcm.sample];
|
DivSample* s=parent->song.sample[chan[i].pcm.sample];
|
||||||
|
if (s->rendLength<=0) {
|
||||||
|
chan[i].pcm.sample=-1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!isMuted[i]) {
|
if (!isMuted[i]) {
|
||||||
if (s->depth==8) {
|
if (s->depth==8) {
|
||||||
pcmL+=(s->rendData[chan[i].pcm.pos>>8]*chan[i].chVolL);
|
pcmL+=(s->rendData[chan[i].pcm.pos>>8]*chan[i].chVolL);
|
||||||
|
@ -123,6 +127,10 @@ void DivPlatformArcade::acquire_ymfm(short* bufL, short* bufR, size_t start, siz
|
||||||
for (int i=8; i<13; i++) {
|
for (int i=8; i<13; i++) {
|
||||||
if (chan[i].pcm.sample>=0 && chan[i].pcm.sample<parent->song.sampleLen) {
|
if (chan[i].pcm.sample>=0 && chan[i].pcm.sample<parent->song.sampleLen) {
|
||||||
DivSample* s=parent->song.sample[chan[i].pcm.sample];
|
DivSample* s=parent->song.sample[chan[i].pcm.sample];
|
||||||
|
if (s->rendLength<=0) {
|
||||||
|
chan[i].pcm.sample=-1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!isMuted[i]) {
|
if (!isMuted[i]) {
|
||||||
if (s->depth==8) {
|
if (s->depth==8) {
|
||||||
pcmL+=(s->rendData[chan[i].pcm.pos>>8]*chan[i].chVolL);
|
pcmL+=(s->rendData[chan[i].pcm.pos>>8]*chan[i].chVolL);
|
||||||
|
|
|
@ -18,21 +18,25 @@ void DivPlatformGenesis::acquire(short* bufL, short* bufR, size_t start, size_t
|
||||||
dacPeriod-=6;
|
dacPeriod-=6;
|
||||||
if (dacPeriod<1) {
|
if (dacPeriod<1) {
|
||||||
DivSample* s=parent->song.sample[dacSample];
|
DivSample* s=parent->song.sample[dacSample];
|
||||||
if (!isMuted[5]) {
|
if (s->rendLength>0) {
|
||||||
if (s->depth==8) {
|
if (!isMuted[5]) {
|
||||||
immWrite(0x2a,(unsigned char)s->rendData[dacPos++]+0x80);
|
if (s->depth==8) {
|
||||||
} else {
|
immWrite(0x2a,(unsigned char)s->rendData[dacPos++]+0x80);
|
||||||
immWrite(0x2a,((unsigned short)s->rendData[dacPos++]+0x8000)>>8);
|
} else {
|
||||||
|
immWrite(0x2a,((unsigned short)s->rendData[dacPos++]+0x8000)>>8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (dacPos>=s->rendLength) {
|
||||||
if (dacPos>=s->rendLength) {
|
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
dacPos=s->loopStart;
|
||||||
dacPos=s->loopStart;
|
} else {
|
||||||
} else {
|
dacSample=-1;
|
||||||
dacSample=-1;
|
}
|
||||||
}
|
}
|
||||||
|
dacPeriod+=MAX(40,dacRate);
|
||||||
|
} else {
|
||||||
|
dacSample=-1;
|
||||||
}
|
}
|
||||||
dacPeriod+=MAX(40,dacRate);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,21 +15,25 @@ void DivPlatformNES::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
||||||
dacPeriod+=dacRate;
|
dacPeriod+=dacRate;
|
||||||
if (dacPeriod>=rate) {
|
if (dacPeriod>=rate) {
|
||||||
DivSample* s=parent->song.sample[dacSample];
|
DivSample* s=parent->song.sample[dacSample];
|
||||||
if (!isMuted[4]) {
|
if (s->rendLength>0) {
|
||||||
if (s->depth==8) {
|
if (!isMuted[4]) {
|
||||||
rWrite(0x4011,((unsigned char)s->rendData[dacPos++]+0x80)>>1);
|
if (s->depth==8) {
|
||||||
} else {
|
rWrite(0x4011,((unsigned char)s->rendData[dacPos++]+0x80)>>1);
|
||||||
rWrite(0x4011,((unsigned short)s->rendData[dacPos++]+0x8000)>>9);
|
} else {
|
||||||
|
rWrite(0x4011,((unsigned short)s->rendData[dacPos++]+0x8000)>>9);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (dacPos>=s->rendLength) {
|
||||||
if (dacPos>=s->rendLength) {
|
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
dacPos=s->loopStart;
|
||||||
dacPos=s->loopStart;
|
} else {
|
||||||
} else {
|
dacSample=-1;
|
||||||
dacSample=-1;
|
}
|
||||||
}
|
}
|
||||||
|
dacPeriod-=rate;
|
||||||
|
} else {
|
||||||
|
dacSample=-1;
|
||||||
}
|
}
|
||||||
dacPeriod-=rate;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,10 @@ void DivPlatformPCE::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
||||||
chan[i].dacPeriod-=6;
|
chan[i].dacPeriod-=6;
|
||||||
if (chan[i].dacPeriod<1) {
|
if (chan[i].dacPeriod<1) {
|
||||||
DivSample* s=parent->song.sample[chan[i].dacSample];
|
DivSample* s=parent->song.sample[chan[i].dacSample];
|
||||||
|
if (s->rendLength<=0) {
|
||||||
|
chan[i].dacSample=-1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
chWrite(i,0x07,0);
|
chWrite(i,0x07,0);
|
||||||
if (s->depth==8) {
|
if (s->depth==8) {
|
||||||
chWrite(i,0x04,0xdf);
|
chWrite(i,0x04,0xdf);
|
||||||
|
|
Loading…
Reference in a new issue