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:
parent
3542229448
commit
1e98f0c4a1
19 changed files with 545 additions and 390 deletions
|
|
@ -90,16 +90,12 @@ void DivPlatformGenesis::acquire_nuked(short* bufL, short* bufR, size_t start, s
|
|||
dacPeriod-=6;
|
||||
if (dacPeriod<1) {
|
||||
DivSample* s=parent->song.sample[dacSample];
|
||||
if (s->rendLength>0) {
|
||||
if (s->samples>0) {
|
||||
if (!isMuted[5]) {
|
||||
if (s->depth==8) {
|
||||
immWrite(0x2a,(unsigned char)s->rendData[dacPos]+0x80);
|
||||
} else {
|
||||
immWrite(0x2a,((unsigned short)s->rendData[dacPos]+0x8000)>>8);
|
||||
}
|
||||
immWrite(0x2a,(unsigned char)s->data8[dacPos]+0x80);
|
||||
}
|
||||
if (++dacPos>=s->rendLength) {
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||
if (++dacPos>=s->samples) {
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->samples) {
|
||||
dacPos=s->loopStart;
|
||||
} else {
|
||||
dacSample=-1;
|
||||
|
|
@ -164,16 +160,12 @@ void DivPlatformGenesis::acquire_ymfm(short* bufL, short* bufR, size_t start, si
|
|||
dacPeriod-=24;
|
||||
if (dacPeriod<1) {
|
||||
DivSample* s=parent->song.sample[dacSample];
|
||||
if (s->rendLength>0) {
|
||||
if (s->samples>0) {
|
||||
if (!isMuted[5]) {
|
||||
if (s->depth==8) {
|
||||
immWrite(0x2a,(unsigned char)s->rendData[dacPos]+0x80);
|
||||
} else {
|
||||
immWrite(0x2a,((unsigned short)s->rendData[dacPos]+0x8000)>>8);
|
||||
}
|
||||
immWrite(0x2a,(unsigned char)s->data8[dacPos]+0x80);
|
||||
}
|
||||
if (++dacPos>=s->rendLength) {
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
|
||||
if (++dacPos>=s->samples) {
|
||||
if (s->loopStart>=0 && s->loopStart<=(int)s->samples) {
|
||||
dacPos=s->loopStart;
|
||||
} else {
|
||||
dacSample=-1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue