Add compatible flag for PCE DAC volume (always enabled for now)
Fix furnacePCM detection for MSM6295
This commit is contained in:
parent
cf1d4e55cf
commit
62ce5ae3ce
|
@ -178,6 +178,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
ds.e1e2StopOnSameNote=true;
|
ds.e1e2StopOnSameNote=true;
|
||||||
ds.brokenPortaArp=false;
|
ds.brokenPortaArp=false;
|
||||||
ds.snNoLowPeriods=true;
|
ds.snNoLowPeriods=true;
|
||||||
|
ds.ignorePCEDACVolume=true;
|
||||||
ds.delayBehavior=0;
|
ds.delayBehavior=0;
|
||||||
ds.jumpTreatment=2;
|
ds.jumpTreatment=2;
|
||||||
|
|
||||||
|
@ -1100,6 +1101,7 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
||||||
if (ds.version<115) {
|
if (ds.version<115) {
|
||||||
ds.autoSystem=false;
|
ds.autoSystem=false;
|
||||||
}
|
}
|
||||||
|
ds.ignorePCEDACVolume=true;
|
||||||
ds.isDMF=false;
|
ds.isDMF=false;
|
||||||
|
|
||||||
reader.readS(); // reserved
|
reader.readS(); // reserved
|
||||||
|
|
|
@ -126,7 +126,7 @@ int DivPlatformMSM6295::dispatch(DivCommand c) {
|
||||||
switch (c.cmd) {
|
switch (c.cmd) {
|
||||||
case DIV_CMD_NOTE_ON: {
|
case DIV_CMD_NOTE_ON: {
|
||||||
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_FM);
|
DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_FM);
|
||||||
if (ins->type==DIV_INS_AMIGA) {
|
if (ins->type==DIV_INS_MSM6295 || ins->type==DIV_INS_AMIGA) {
|
||||||
chan[c.chan].furnacePCM=true;
|
chan[c.chan].furnacePCM=true;
|
||||||
} else {
|
} else {
|
||||||
chan[c.chan].furnacePCM=false;
|
chan[c.chan].furnacePCM=false;
|
||||||
|
|
|
@ -69,7 +69,7 @@ void DivPlatformPCE::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
||||||
signed char dacData=((signed char)((unsigned char)s->data8[chan[i].dacPos]^0x80))>>3;
|
signed char dacData=((signed char)((unsigned char)s->data8[chan[i].dacPos]^0x80))>>3;
|
||||||
chan[i].dacOut=CLAMP(dacData,-16,15);
|
chan[i].dacOut=CLAMP(dacData,-16,15);
|
||||||
if (!isMuted[i]) {
|
if (!isMuted[i]) {
|
||||||
chWrite(i,0x04,0xc0|chan[i].outVol);
|
chWrite(i,0x04,parent->song.ignorePCEDACVolume?0xdf:(0xc0|chan[i].outVol));
|
||||||
chWrite(i,0x06,chan[i].dacOut&0x1f);
|
chWrite(i,0x06,chan[i].dacOut&0x1f);
|
||||||
} else {
|
} else {
|
||||||
chWrite(i,0x04,0xc0);
|
chWrite(i,0x04,0xc0);
|
||||||
|
@ -208,7 +208,7 @@ void DivPlatformPCE::tick(bool sysTick) {
|
||||||
if (chan[i].active && chan[i].dacSample>=0 && chan[i].dacSample<parent->song.sampleLen) {
|
if (chan[i].active && chan[i].dacSample>=0 && chan[i].dacSample<parent->song.sampleLen) {
|
||||||
chan[i].dacPos=0;
|
chan[i].dacPos=0;
|
||||||
chan[i].dacPeriod=0;
|
chan[i].dacPeriod=0;
|
||||||
chWrite(i,0x04,0xc0|chan[i].vol);
|
chWrite(i,0x04,parent->song.ignorePCEDACVolume?0xdf:(0xc0|chan[i].vol));
|
||||||
addWrite(0xffff0000+(i<<8),chan[i].dacSample);
|
addWrite(0xffff0000+(i<<8),chan[i].dacSample);
|
||||||
chan[i].keyOn=true;
|
chan[i].keyOn=true;
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ int DivPlatformPCE::dispatch(DivCommand c) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
chWrite(c.chan,0x04,0xc0|chan[c.chan].vol);
|
chWrite(c.chan,0x04,parent->song.ignorePCEDACVolume?0xdf:(0xc0|chan[c.chan].vol));
|
||||||
addWrite(0xffff0000+(c.chan<<8),chan[c.chan].dacSample);
|
addWrite(0xffff0000+(c.chan<<8),chan[c.chan].dacSample);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,7 @@ int DivPlatformPCE::dispatch(DivCommand c) {
|
||||||
chan[c.chan].dacPeriod=0;
|
chan[c.chan].dacPeriod=0;
|
||||||
chan[c.chan].dacRate=parent->getSample(chan[c.chan].dacSample)->rate;
|
chan[c.chan].dacRate=parent->getSample(chan[c.chan].dacSample)->rate;
|
||||||
if (dumpWrites) {
|
if (dumpWrites) {
|
||||||
chWrite(c.chan,0x04,0xc0|chan[c.chan].vol);
|
chWrite(c.chan,0x04,parent->song.ignorePCEDACVolume?0xdf:(0xc0|chan[c.chan].vol));
|
||||||
addWrite(0xffff0001+(c.chan<<8),chan[c.chan].dacRate);
|
addWrite(0xffff0001+(c.chan<<8),chan[c.chan].dacRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -362,7 +362,9 @@ int DivPlatformPCE::dispatch(DivCommand c) {
|
||||||
chan[c.chan].vol=c.value;
|
chan[c.chan].vol=c.value;
|
||||||
if (!chan[c.chan].std.vol.has) {
|
if (!chan[c.chan].std.vol.has) {
|
||||||
chan[c.chan].outVol=c.value;
|
chan[c.chan].outVol=c.value;
|
||||||
if (chan[c.chan].active) chWrite(c.chan,0x04,0x80|chan[c.chan].outVol);
|
if (chan[c.chan].active && !chan[c.chan].pcm) {
|
||||||
|
chWrite(c.chan,0x04,0x80|chan[c.chan].outVol);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -464,7 +466,7 @@ void DivPlatformPCE::muteChannel(int ch, bool mute) {
|
||||||
isMuted[ch]=mute;
|
isMuted[ch]=mute;
|
||||||
chWrite(ch,0x05,isMuted[ch]?0:chan[ch].pan);
|
chWrite(ch,0x05,isMuted[ch]?0:chan[ch].pan);
|
||||||
if (!isMuted[ch] && (chan[ch].pcm && chan[ch].dacSample!=-1)) {
|
if (!isMuted[ch] && (chan[ch].pcm && chan[ch].dacSample!=-1)) {
|
||||||
chWrite(ch,0x04,0xc0|chan[ch].outVol);
|
chWrite(ch,0x04,parent->song.ignorePCEDACVolume?0xdf:(0xc0|chan[ch].outVol));
|
||||||
chWrite(ch,0x06,chan[ch].dacOut&0x1f);
|
chWrite(ch,0x06,chan[ch].dacOut&0x1f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -511,6 +511,7 @@ struct DivSong {
|
||||||
bool e1e2StopOnSameNote;
|
bool e1e2StopOnSameNote;
|
||||||
bool brokenPortaArp;
|
bool brokenPortaArp;
|
||||||
bool snNoLowPeriods;
|
bool snNoLowPeriods;
|
||||||
|
bool ignorePCEDACVolume;
|
||||||
bool autoSystem;
|
bool autoSystem;
|
||||||
|
|
||||||
std::vector<DivInstrument*> ins;
|
std::vector<DivInstrument*> ins;
|
||||||
|
@ -616,6 +617,7 @@ struct DivSong {
|
||||||
e1e2StopOnSameNote(false),
|
e1e2StopOnSameNote(false),
|
||||||
brokenPortaArp(false),
|
brokenPortaArp(false),
|
||||||
snNoLowPeriods(false),
|
snNoLowPeriods(false),
|
||||||
|
ignorePCEDACVolume(true),
|
||||||
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;
|
||||||
|
|
|
@ -143,6 +143,10 @@ void FurnaceGUI::drawCompatFlags() {
|
||||||
if (ImGui::IsItemHovered()) {
|
if (ImGui::IsItemHovered()) {
|
||||||
ImGui::SetTooltip("when enabled, any SN period under 8 will be written as 1 instead.\nthis replicates DefleMask behavior, but reduces available period range.");
|
ImGui::SetTooltip("when enabled, any SN period under 8 will be written as 1 instead.\nthis replicates DefleMask behavior, but reduces available period range.");
|
||||||
}
|
}
|
||||||
|
ImGui::Checkbox("Ignore PC Engine DAC Volume",&e->song.ignorePCEDACVolume);
|
||||||
|
if (ImGui::IsItemHovered()) {
|
||||||
|
ImGui::SetTooltip("when enabled, PC Engine DAC Volume is ignored.");
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Text("Pitch linearity:");
|
ImGui::Text("Pitch linearity:");
|
||||||
if (ImGui::RadioButton("None",e->song.linearPitch==0)) {
|
if (ImGui::RadioButton("None",e->song.linearPitch==0)) {
|
||||||
|
|
Loading…
Reference in a new issue