mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-24 05:25:12 +00:00
Fix 1701 command for X1-010
This commit is contained in:
parent
70e0b4ab52
commit
ece4eb9a57
1 changed files with 11 additions and 10 deletions
|
@ -240,15 +240,15 @@ u8 DivPlatformX1_010::read_byte(u32 address) {
|
||||||
}
|
}
|
||||||
|
|
||||||
double DivPlatformX1_010::NoteX1_010(int ch, int note) {
|
double DivPlatformX1_010::NoteX1_010(int ch, int note) {
|
||||||
if (chan[ch].pcm) { // PCM note
|
if (chan[ch].furnacePCM) { // PCM note
|
||||||
double off=8192.0;
|
double off=4194304.0;
|
||||||
int sample=chan[ch].sample;
|
int sample=chan[ch].sample;
|
||||||
if (sample>=0 && sample<parent->song.sampleLen) {
|
if (sample>=0 && sample<parent->song.sampleLen) {
|
||||||
DivSample* s=parent->getSample(sample);
|
DivSample* s=parent->getSample(sample);
|
||||||
if (s->centerRate<1) {
|
if (s->centerRate<1) {
|
||||||
off=8192.0;
|
off=4194304.0;
|
||||||
} else {
|
} else {
|
||||||
off=8192.0*(s->centerRate/8363.0);
|
off=4194304.0*(s->centerRate/8363.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return parent->calcBaseFreq(chipClock,off,note,false);
|
return parent->calcBaseFreq(chipClock,off,note,false);
|
||||||
|
@ -463,20 +463,21 @@ void DivPlatformX1_010::tick(bool sysTick) {
|
||||||
chan[i].envChanged=false;
|
chan[i].envChanged=false;
|
||||||
}
|
}
|
||||||
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
|
||||||
double off=8192.0;
|
if (chan[i].furnacePCM) {
|
||||||
if (chan[i].pcm) {
|
double off=4194304.0;
|
||||||
int sample=chan[i].sample;
|
int sample=chan[i].sample;
|
||||||
if (sample>=0 && sample<parent->song.sampleLen) {
|
if (sample>=0 && sample<parent->song.sampleLen) {
|
||||||
DivSample* s=parent->getSample(sample);
|
DivSample* s=parent->getSample(sample);
|
||||||
if (s->centerRate<1) {
|
if (s->centerRate<1) {
|
||||||
off=8192.0;
|
off=4194304.0;
|
||||||
} else {
|
} else {
|
||||||
off=8192.0*(s->centerRate/8363.0);
|
off=4194304.0*(s->centerRate/8363.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,2,chan[i].pitch2,chipClock,chan[i].pcm?off:CHIP_FREQBASE);
|
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE);
|
||||||
if (chan[i].pcm) {
|
if (chan[i].pcm) {
|
||||||
|
chan[i].freq>>=8;
|
||||||
if (chan[i].freq<1) chan[i].freq=1;
|
if (chan[i].freq<1) chan[i].freq=1;
|
||||||
if (chan[i].freq>255) chan[i].freq=255;
|
if (chan[i].freq>255) chan[i].freq=255;
|
||||||
chWrite(i,2,chan[i].freq&0xff);
|
chWrite(i,2,chan[i].freq&0xff);
|
||||||
|
@ -591,7 +592,7 @@ int DivPlatformX1_010::dispatch(DivCommand c) {
|
||||||
int end=(sampleOffX1[chan[c.chan].sample]+s->length8+0xfff)&~0xfff; // padded
|
int end=(sampleOffX1[chan[c.chan].sample]+s->length8+0xfff)&~0xfff; // padded
|
||||||
chWrite(c.chan,5,(0x100-(end>>12))&0xff);
|
chWrite(c.chan,5,(0x100-(end>>12))&0xff);
|
||||||
}
|
}
|
||||||
chan[c.chan].baseFreq=(((unsigned int)s->rate)<<4)/(chipClock/512);
|
chan[c.chan].baseFreq=(((unsigned int)s->rate)<<14)/(chipClock/384);
|
||||||
chan[c.chan].freqChanged=true;
|
chan[c.chan].freqChanged=true;
|
||||||
}
|
}
|
||||||
} else if (c.value!=DIV_NOTE_NULL) {
|
} else if (c.value!=DIV_NOTE_NULL) {
|
||||||
|
|
Loading…
Reference in a new issue