C64: PCM chan osc, part 2

issue #2349
This commit is contained in:
tildearrow 2025-02-05 04:10:16 -05:00
parent dbe30c0d43
commit 659a16a489
3 changed files with 14 additions and 3 deletions

View file

@ -339,6 +339,7 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
((DivPlatformC64*)dispatch)->setCoreQuality(eng->getConfInt("dsidQuality",3));
}
((DivPlatformC64*)dispatch)->setChipModel(true);
((DivPlatformC64*)dispatch)->setSoftPCM(sys==DIV_SYSTEM_C64_PCM);
break;
case DIV_SYSTEM_C64_8580:
dispatch=new DivPlatformC64;
@ -350,6 +351,7 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
((DivPlatformC64*)dispatch)->setCoreQuality(eng->getConfInt("dsidQuality",3));
}
((DivPlatformC64*)dispatch)->setChipModel(false);
((DivPlatformC64*)dispatch)->setSoftPCM(false);
break;
case DIV_SYSTEM_YM2151:
dispatch=new DivPlatformArcade;

View file

@ -69,7 +69,9 @@ short DivPlatformC64::runFakeFilter(unsigned char ch, int in) {
if (!(regPool[0x17]&(1<<ch))) {
if (regPool[0x18]&0x80 && ch==2) return 0;
float fin=in;
if (noSoftPCM) {
fin*=(float)(regPool[0x18]&15)/20.0f;
}
return CLAMP(fin,-32768,32767);
}
@ -96,7 +98,9 @@ short DivPlatformC64::runFakeFilter(unsigned char ch, int in) {
fout+=tmp;
}
if (noSoftPCM) {
fout*=(float)(regPool[0x18]&15)/20.0f;
}
return CLAMP(fout,-32768,32767);
}
@ -969,6 +973,10 @@ void DivPlatformC64::setCoreQuality(unsigned char q) {
}
}
void DivPlatformC64::setSoftPCM(bool isSoft) {
noSoftPCM=!isSoft;
}
int DivPlatformC64::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
parent=p;
dumpWrites=false;

View file

@ -91,7 +91,7 @@ class DivPlatformC64: public DivDispatch {
int pcmCycle, lineRate;
short cutoff_slide;
bool keyPriority, sidIs6581, needInitTables, no1EUpdate, multiplyRel, macroRace;
bool keyPriority, sidIs6581, needInitTables, no1EUpdate, multiplyRel, macroRace, noSoftPCM;
unsigned char chanOrder[3];
unsigned char testAD, testSR;
@ -140,6 +140,7 @@ class DivPlatformC64: public DivDispatch {
void setChipModel(bool is6581);
void setCore(unsigned char which);
void setCoreQuality(unsigned char q);
void setSoftPCM(bool isSoft);
void quit();
~DivPlatformC64();
};