PCE: add option to pick A/non-A revision of chip

This commit is contained in:
tildearrow 2022-08-04 23:37:28 -05:00
parent 3a18e1e6fc
commit 049ab06544
2 changed files with 18 additions and 2 deletions

View file

@ -569,6 +569,12 @@ void DivPlatformPCE::setFlags(unsigned int flags) {
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
oscBuf[i]->rate=rate; oscBuf[i]->rate=rate;
} }
if (pce!=NULL) {
delete pce;
pce=NULL;
}
pce=new PCE_PSG(tempL,tempR,(flags&4)?PCE_PSG::REVISION_HUC6280A:PCE_PSG::REVISION_HUC6280);
} }
void DivPlatformPCE::poke(unsigned int addr, unsigned short val) { void DivPlatformPCE::poke(unsigned int addr, unsigned short val) {
@ -587,8 +593,8 @@ int DivPlatformPCE::init(DivEngine* p, int channels, int sugRate, unsigned int f
isMuted[i]=false; isMuted[i]=false;
oscBuf[i]=new DivDispatchOscBuffer; oscBuf[i]=new DivDispatchOscBuffer;
} }
pce=NULL;
setFlags(flags); setFlags(flags);
pce=new PCE_PSG(tempL,tempR,PCE_PSG::REVISION_HUC6280A);
reset(); reset();
return 6; return 6;
} }
@ -597,7 +603,10 @@ void DivPlatformPCE::quit() {
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
delete oscBuf[i]; delete oscBuf[i];
} }
if (pce!=NULL) {
delete pce; delete pce;
pce=NULL;
}
} }
DivPlatformPCE::~DivPlatformPCE() { DivPlatformPCE::~DivPlatformPCE() {

View file

@ -118,6 +118,13 @@ void FurnaceGUI::drawSysConf(int chan, DivSystem type, unsigned int& flags, bool
if (ImGui::Checkbox("Disable anti-click",&antiClick)) { if (ImGui::Checkbox("Disable anti-click",&antiClick)) {
copyOfFlags=(flags&(~8))|(antiClick<<3); copyOfFlags=(flags&(~8))|(antiClick<<3);
} }
ImGui::Text("Chip revision:");
if (ImGui::RadioButton("HuC6280 (original)",(flags&4)==0)) {
copyOfFlags=(flags&(~4))|0;
}
if (ImGui::RadioButton("HuC6280A (SuperGrafx)",(flags&4)==4)) {
copyOfFlags=(flags&(~4))|4;
}
break; break;
} }
case DIV_SYSTEM_SOUND_UNIT: { case DIV_SYSTEM_SOUND_UNIT: {