mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 06:53:01 +00:00
neo geo: ADPCM!!
This commit is contained in:
parent
a95ee7b7ba
commit
fbd94bbce9
3 changed files with 11 additions and 4 deletions
|
@ -869,6 +869,8 @@ void DivEngine::renderSamples() {
|
|||
s->rendLength=(double)s->length/samplePitches[s->pitch];
|
||||
s->rendData=new short[s->rendLength];
|
||||
size_t adpcmLen=((s->rendLength>>1)+255)&0xffffff00;
|
||||
s->adpcmRendLength=adpcmLen;
|
||||
printf("al: %x\n",s->adpcmRendLength);
|
||||
s->adpcmRendData=new unsigned char[adpcmLen];
|
||||
memset(s->adpcmRendData,0,adpcmLen);
|
||||
|
||||
|
|
|
@ -187,10 +187,10 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
|
|||
}
|
||||
writes.emplace(0x110+c.chan-7,0);
|
||||
writes.emplace(0x118+c.chan-7,c.value%12);
|
||||
int sampleLen=(parent->song.sample[12*sampleBank+c.value%12]->rendLength+255)>>8;
|
||||
int sampleLen=(parent->song.sample[12*sampleBank+c.value%12]->adpcmRendLength-1)>>8;
|
||||
writes.emplace(0x120+c.chan-7,sampleLen&0xff);
|
||||
writes.emplace(0x128+c.chan-7,(c.value%12)+(sampleLen>>8));
|
||||
writes.emplace(0x108+c.chan-7,0xff);
|
||||
writes.emplace(0x108+(c.chan-7),0xc0|chan[c.chan].vol);
|
||||
writes.emplace(0x100,0x00|(1<<(c.chan-7)));
|
||||
break;
|
||||
}
|
||||
|
@ -251,7 +251,11 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
|
|||
case DIV_CMD_VOLUME: {
|
||||
chan[c.chan].vol=c.value;
|
||||
DivInstrument* ins=parent->getIns(chan[c.chan].ins);
|
||||
if (c.chan>3) {
|
||||
if (c.chan>6) { // ADPCM
|
||||
writes.emplace(0x108+(c.chan-7),0xc0|chan[c.chan].vol);
|
||||
break;
|
||||
}
|
||||
if (c.chan>3) { // PSG
|
||||
if (!chan[c.chan].std.hasVol) {
|
||||
chan[c.chan].outVol=c.value;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ struct DivSample {
|
|||
signed char vol, pitch;
|
||||
unsigned char depth;
|
||||
short* data;
|
||||
int rendLength;
|
||||
int rendLength, adpcmRendLength;
|
||||
short* rendData;
|
||||
unsigned char* adpcmRendData;
|
||||
|
||||
|
@ -17,6 +17,7 @@ struct DivSample {
|
|||
depth(16),
|
||||
data(NULL),
|
||||
rendLength(0),
|
||||
adpcmRendLength(0),
|
||||
rendData(NULL),
|
||||
adpcmRendData(NULL) {}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue