mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-29 02:51:24 +00:00
implement sample loop on the rest of systems
This commit is contained in:
parent
3954a23f3e
commit
4ee17d35cd
4 changed files with 27 additions and 5 deletions
|
@ -70,7 +70,12 @@ void DivPlatformArcade::acquire_nuked(short* bufL, short* bufR, size_t start, si
|
|||
}
|
||||
chan[i].pcm.pos+=chan[i].pcm.freq;
|
||||
if (chan[i].pcm.pos>=(s->rendLength<<8)) {
|
||||
chan[i].pcm.sample=-1;
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||
// Sega PCM limitation
|
||||
chan[i].pcm.pos=(s->loopStart&(~0xff))<<8;
|
||||
} else {
|
||||
chan[i].pcm.sample=-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +132,12 @@ void DivPlatformArcade::acquire_ymfm(short* bufL, short* bufR, size_t start, siz
|
|||
}
|
||||
chan[i].pcm.pos+=chan[i].pcm.freq;
|
||||
if (chan[i].pcm.pos>=(s->rendLength<<8)) {
|
||||
chan[i].pcm.sample=-1;
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||
// Sega PCM limitation
|
||||
chan[i].pcm.pos=(s->loopStart&(~0xff))<<8;
|
||||
} else {
|
||||
chan[i].pcm.sample=-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,11 @@ void DivPlatformGenesis::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
}
|
||||
}
|
||||
if (dacPos>=s->rendLength) {
|
||||
dacSample=-1;
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||
dacPos=s->loopStart;
|
||||
} else {
|
||||
dacSample=-1;
|
||||
}
|
||||
}
|
||||
dacPeriod+=dacRate;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,11 @@ void DivPlatformNES::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
}
|
||||
}
|
||||
if (dacPos>=s->rendLength) {
|
||||
dacSample=-1;
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||
dacPos=s->loopStart;
|
||||
} else {
|
||||
dacSample=-1;
|
||||
}
|
||||
}
|
||||
dacPeriod-=rate;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,11 @@ void DivPlatformPCE::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
chWrite(i,0x06,(((unsigned short)s->rendData[chan[i].dacPos++]+0x8000)>>11));
|
||||
}
|
||||
if (chan[i].dacPos>=s->rendLength) {
|
||||
chan[i].dacSample=-1;
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||
chan[i].dacPos=s->loopStart;
|
||||
} else {
|
||||
chan[i].dacSample=-1;
|
||||
}
|
||||
}
|
||||
chan[i].dacPeriod+=chan[i].dacRate;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue