Add compatible flag for Y8950 ADPCM Frequency
This commit is contained in:
parent
a44d696f09
commit
b05dafe297
|
|
@ -179,6 +179,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
ds.brokenPortaArp=false;
|
ds.brokenPortaArp=false;
|
||||||
ds.snNoLowPeriods=true;
|
ds.snNoLowPeriods=true;
|
||||||
ds.ignorePCEDACVolume=true;
|
ds.ignorePCEDACVolume=true;
|
||||||
|
ds.newY8950PCMFreq=false;
|
||||||
ds.delayBehavior=0;
|
ds.delayBehavior=0;
|
||||||
ds.jumpTreatment=2;
|
ds.jumpTreatment=2;
|
||||||
|
|
||||||
|
|
@ -1102,6 +1103,7 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
||||||
ds.autoSystem=false;
|
ds.autoSystem=false;
|
||||||
}
|
}
|
||||||
ds.ignorePCEDACVolume=true;
|
ds.ignorePCEDACVolume=true;
|
||||||
|
ds.newY8950PCMFreq=false;
|
||||||
ds.isDMF=false;
|
ds.isDMF=false;
|
||||||
|
|
||||||
reader.readS(); // reserved
|
reader.readS(); // reserved
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#define KVSL(x,y) ((chan[x].state.op[orderedOpsL1[ops==4][y]].kvs==2 && isOutputL[ops==4][chan[x].state.alg][y]) || chan[x].state.op[orderedOpsL1[ops==4][y]].kvs==1)
|
#define KVSL(x,y) ((chan[x].state.op[orderedOpsL1[ops==4][y]].kvs==2 && isOutputL[ops==4][chan[x].state.alg][y]) || chan[x].state.op[orderedOpsL1[ops==4][y]].kvs==1)
|
||||||
|
|
||||||
|
#define OPLPCMDiv (parent->song.newY8950PCMFreq?((oplType==3)?288:72):144)
|
||||||
|
|
||||||
#define CHIP_FREQBASE chipFreqBase
|
#define CHIP_FREQBASE chipFreqBase
|
||||||
|
|
||||||
// N = invalid
|
// N = invalid
|
||||||
|
|
@ -274,7 +276,7 @@ double DivPlatformOPL::NOTE_ADPCMB(int note) {
|
||||||
if (adpcmChan<0) return 0;
|
if (adpcmChan<0) return 0;
|
||||||
if (chan[adpcmChan].sample>=0 && chan[adpcmChan].sample<parent->song.sampleLen) {
|
if (chan[adpcmChan].sample>=0 && chan[adpcmChan].sample<parent->song.sampleLen) {
|
||||||
double off=65535.0*(double)(parent->getSample(chan[adpcmChan].sample)->centerRate)/8363.0;
|
double off=65535.0*(double)(parent->getSample(chan[adpcmChan].sample)->centerRate)/8363.0;
|
||||||
return parent->calcBaseFreq((double)chipClock/((oplType==3)?288:72),off,note,false);
|
return parent->calcBaseFreq((double)chipClock/OPLPCMDiv,off,note,false);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -504,7 +506,7 @@ void DivPlatformOPL::tick(bool sysTick) {
|
||||||
if (chan[adpcmChan].freqChanged || chan[adpcmChan].keyOn || chan[adpcmChan].keyOff) {
|
if (chan[adpcmChan].freqChanged || chan[adpcmChan].keyOn || chan[adpcmChan].keyOff) {
|
||||||
if (chan[adpcmChan].sample>=0 && chan[adpcmChan].sample<parent->song.sampleLen) {
|
if (chan[adpcmChan].sample>=0 && chan[adpcmChan].sample<parent->song.sampleLen) {
|
||||||
double off=65535.0*(double)(parent->getSample(chan[adpcmChan].sample)->centerRate)/8363.0;
|
double off=65535.0*(double)(parent->getSample(chan[adpcmChan].sample)->centerRate)/8363.0;
|
||||||
chan[adpcmChan].freq=parent->calcFreq(chan[adpcmChan].baseFreq,chan[adpcmChan].pitch,false,4,chan[adpcmChan].pitch2,(double)chipClock/((oplType==3)?288:72),off);
|
chan[adpcmChan].freq=parent->calcFreq(chan[adpcmChan].baseFreq,chan[adpcmChan].pitch,false,4,chan[adpcmChan].pitch2,(double)chipClock/OPLPCMDiv,off);
|
||||||
} else {
|
} else {
|
||||||
chan[adpcmChan].freq=0;
|
chan[adpcmChan].freq=0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -512,6 +512,7 @@ struct DivSong {
|
||||||
bool brokenPortaArp;
|
bool brokenPortaArp;
|
||||||
bool snNoLowPeriods;
|
bool snNoLowPeriods;
|
||||||
bool ignorePCEDACVolume;
|
bool ignorePCEDACVolume;
|
||||||
|
bool newY8950PCMFreq;
|
||||||
bool autoSystem;
|
bool autoSystem;
|
||||||
|
|
||||||
std::vector<DivInstrument*> ins;
|
std::vector<DivInstrument*> ins;
|
||||||
|
|
@ -618,6 +619,7 @@ struct DivSong {
|
||||||
brokenPortaArp(false),
|
brokenPortaArp(false),
|
||||||
snNoLowPeriods(false),
|
snNoLowPeriods(false),
|
||||||
ignorePCEDACVolume(true),
|
ignorePCEDACVolume(true),
|
||||||
|
newY8950PCMFreq(false),
|
||||||
autoSystem(true) {
|
autoSystem(true) {
|
||||||
for (int i=0; i<32; i++) {
|
for (int i=0; i<32; i++) {
|
||||||
system[i]=DIV_SYSTEM_NULL;
|
system[i]=DIV_SYSTEM_NULL;
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,10 @@ void FurnaceGUI::drawCompatFlags() {
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip("when enabled, PC Engine DAC Volume is ignored.");
|
ImGui::SetTooltip("when enabled, PC Engine DAC Volume is ignored.");
|
||||||
}
|
}
|
||||||
|
ImGui::Checkbox("New Y8950 Frequency calculation",&e->song.newY8950PCMFreq);
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
ImGui::SetTooltip("when enabled, use corrected Y8950 frequency calculation");
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Text("Pitch linearity:");
|
ImGui::Text("Pitch linearity:");
|
||||||
if (ImGui::RadioButton("None",e->song.linearPitch==0)) {
|
if (ImGui::RadioButton("None",e->song.linearPitch==0)) {
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@
|
||||||
|
|
||||||
#define OPNB_CHIP_DEBUG \
|
#define OPNB_CHIP_DEBUG \
|
||||||
FM_OPN_CHIP_DEBUG; \
|
FM_OPN_CHIP_DEBUG; \
|
||||||
ImGui::Text("- adpcmAMemLen: %.8x",ch->adpcmAMemLen); \
|
ImGui::Text("- adpcmAMemLen: %lld",ch->adpcmAMemLen); \
|
||||||
ImGui::Text("- adpcmBMemLen: %.8x",ch->adpcmBMemLen); \
|
ImGui::Text("- adpcmBMemLen: %lld",ch->adpcmBMemLen); \
|
||||||
ImGui::Text("- sampleBank: %d",ch->sampleBank); \
|
ImGui::Text("- sampleBank: %d",ch->sampleBank); \
|
||||||
ImGui::Text("- writeADPCMAOff: %d",ch->writeADPCMAOff); \
|
ImGui::Text("- writeADPCMAOff: %d",ch->writeADPCMAOff); \
|
||||||
ImGui::Text("- writeADPCMAOn: %d",ch->writeADPCMAOn); \
|
ImGui::Text("- writeADPCMAOn: %d",ch->writeADPCMAOn); \
|
||||||
|
|
@ -335,7 +335,7 @@ void putDispatchChip(void* data, int type) {
|
||||||
DivPlatformYM2608* ch=(DivPlatformYM2608*)data;
|
DivPlatformYM2608* ch=(DivPlatformYM2608*)data;
|
||||||
ImGui::Text("> YM2608");
|
ImGui::Text("> YM2608");
|
||||||
FM_OPN_CHIP_DEBUG;
|
FM_OPN_CHIP_DEBUG;
|
||||||
ImGui::Text("- adpcmBMemLen: %.8x",ch->adpcmBMemLen);
|
ImGui::Text("- adpcmBMemLen: %lld",ch->adpcmBMemLen);
|
||||||
ImGui::Text("- sampleBank: %d",ch->sampleBank);
|
ImGui::Text("- sampleBank: %d",ch->sampleBank);
|
||||||
ImGui::Text("- writeRSSOff: %d",ch->writeRSSOff);
|
ImGui::Text("- writeRSSOff: %d",ch->writeRSSOff);
|
||||||
ImGui::Text("- writeRSSOn: %d",ch->writeRSSOn);
|
ImGui::Text("- writeRSSOn: %d",ch->writeRSSOn);
|
||||||
|
|
@ -397,7 +397,7 @@ void putDispatchChip(void* data, int type) {
|
||||||
ImGui::Text(" - Pos: %d",ch->dacPos);
|
ImGui::Text(" - Pos: %d",ch->dacPos);
|
||||||
ImGui::Text(" - AntiClick: %d",ch->dacAntiClick);
|
ImGui::Text(" - AntiClick: %d",ch->dacAntiClick);
|
||||||
ImGui::Text(" - Sample: %d",ch->dacSample);
|
ImGui::Text(" - Sample: %d",ch->dacSample);
|
||||||
ImGui::Text("- dpcmMemLen: %.8x",ch->dpcmMemLen);
|
ImGui::Text("- dpcmMemLen: %lld",ch->dpcmMemLen);
|
||||||
ImGui::Text("- dpcmBank: %d",ch->dpcmBank);
|
ImGui::Text("- dpcmBank: %d",ch->dpcmBank);
|
||||||
ImGui::Text("- sampleBank: %d",ch->sampleBank);
|
ImGui::Text("- sampleBank: %d",ch->sampleBank);
|
||||||
ImGui::Text("- writeOscBuf: %d",ch->writeOscBuf);
|
ImGui::Text("- writeOscBuf: %d",ch->writeOscBuf);
|
||||||
|
|
@ -504,7 +504,7 @@ void putDispatchChip(void* data, int type) {
|
||||||
ImGui::Text("* echo:");
|
ImGui::Text("* echo:");
|
||||||
ImGui::Text(" - delay: %d",ch->echoDelay);
|
ImGui::Text(" - delay: %d",ch->echoDelay);
|
||||||
ImGui::Text(" - feedback: %d",ch->echoFeedback);
|
ImGui::Text(" - feedback: %d",ch->echoFeedback);
|
||||||
ImGui::Text("- sampleMemLen: %.8x",ch->sampleMemLen);
|
ImGui::Text("- sampleMemLen: %lld",ch->sampleMemLen);
|
||||||
COMMON_CHIP_DEBUG_BOOL;
|
COMMON_CHIP_DEBUG_BOOL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -512,7 +512,7 @@ void putDispatchChip(void* data, int type) {
|
||||||
DivPlatformX1_010* ch=(DivPlatformX1_010*)data;
|
DivPlatformX1_010* ch=(DivPlatformX1_010*)data;
|
||||||
ImGui::Text("> X1-010");
|
ImGui::Text("> X1-010");
|
||||||
COMMON_CHIP_DEBUG;
|
COMMON_CHIP_DEBUG;
|
||||||
ImGui::Text("- sampleMemLen: %.8x",ch->sampleMemLen);
|
ImGui::Text("- sampleMemLen: %lld",ch->sampleMemLen);
|
||||||
ImGui::Text("- sampleBank: %d",ch->sampleBank);
|
ImGui::Text("- sampleBank: %d",ch->sampleBank);
|
||||||
ImGui::Text("- bankSlot: [%d,%d,%d,%d,%d,%d,%d,%d]",ch->bankSlot[0],ch->bankSlot[1],ch->bankSlot[2],ch->bankSlot[3],ch->bankSlot[4],ch->bankSlot[5],ch->bankSlot[6],ch->bankSlot[7]);
|
ImGui::Text("- bankSlot: [%d,%d,%d,%d,%d,%d,%d,%d]",ch->bankSlot[0],ch->bankSlot[1],ch->bankSlot[2],ch->bankSlot[3],ch->bankSlot[4],ch->bankSlot[5],ch->bankSlot[6],ch->bankSlot[7]);
|
||||||
COMMON_CHIP_DEBUG_BOOL;
|
COMMON_CHIP_DEBUG_BOOL;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue