sample system rewrite! **PLEASE READ**

this commit mostly rewrites the sample system.
as of now samples can be ADPCM, 8-bit, BRR or 16-bit
or something...

consider this VERY EXPERIMENTAL.
if you find any issues REPORT THEM immediately.

it's nearly 4am...
This commit is contained in:
tildearrow 2022-02-24 03:57:45 -05:00
parent 3542229448
commit 1e98f0c4a1
19 changed files with 545 additions and 390 deletions

View file

@ -72,14 +72,10 @@ void DivPlatformAmiga::acquire(short* bufL, short* bufR, size_t start, size_t le
chan[i].audSub-=AMIGA_DIVIDER;
if (chan[i].audSub<0) {
DivSample* s=parent->song.sample[chan[i].sample];
if (s->rendLength>0) {
if (s->depth==8) {
chan[i].audDat=s->rendData[chan[i].audPos++];
} else {
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) {
if (s->samples>0) {
chan[i].audDat=s->data8[chan[i].audPos++];
if (chan[i].audPos>=s->samples || chan[i].audPos>=131071) {
if (s->loopStart>=0 && s->loopStart<=(int)s->samples) {
chan[i].audPos=s->loopStart;
} else {
chan[i].sample=-1;