Revert "Fix 1701 command for X1-010"

This reverts commit ece4eb9a57.
This commit is contained in:
tildearrow 2022-10-03 23:52:52 -05:00
parent ece4eb9a57
commit 204af47421
1 changed files with 10 additions and 11 deletions

View File

@ -240,15 +240,15 @@ u8 DivPlatformX1_010::read_byte(u32 address) {
}
double DivPlatformX1_010::NoteX1_010(int ch, int note) {
if (chan[ch].furnacePCM) { // PCM note
double off=4194304.0;
if (chan[ch].pcm) { // PCM note
double off=8192.0;
int sample=chan[ch].sample;
if (sample>=0 && sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(sample);
if (s->centerRate<1) {
off=4194304.0;
off=8192.0;
} else {
off=4194304.0*(s->centerRate/8363.0);
off=8192.0*(s->centerRate/8363.0);
}
}
return parent->calcBaseFreq(chipClock,off,note,false);
@ -463,21 +463,20 @@ void DivPlatformX1_010::tick(bool sysTick) {
chan[i].envChanged=false;
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
if (chan[i].furnacePCM) {
double off=4194304.0;
double off=8192.0;
if (chan[i].pcm) {
int sample=chan[i].sample;
if (sample>=0 && sample<parent->song.sampleLen) {
DivSample* s=parent->getSample(sample);
if (s->centerRate<1) {
off=4194304.0;
off=8192.0;
} else {
off=4194304.0*(s->centerRate/8363.0);
off=8192.0*(s->centerRate/8363.0);
}
}
}
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE);
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,2,chan[i].pitch2,chipClock,chan[i].pcm?off:CHIP_FREQBASE);
if (chan[i].pcm) {
chan[i].freq>>=8;
if (chan[i].freq<1) chan[i].freq=1;
if (chan[i].freq>255) chan[i].freq=255;
chWrite(i,2,chan[i].freq&0xff);
@ -592,7 +591,7 @@ int DivPlatformX1_010::dispatch(DivCommand c) {
int end=(sampleOffX1[chan[c.chan].sample]+s->length8+0xfff)&~0xfff; // padded
chWrite(c.chan,5,(0x100-(end>>12))&0xff);
}
chan[c.chan].baseFreq=(((unsigned int)s->rate)<<14)/(chipClock/384);
chan[c.chan].baseFreq=(((unsigned int)s->rate)<<4)/(chipClock/512);
chan[c.chan].freqChanged=true;
}
} else if (c.value!=DIV_NOTE_NULL) {