mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-03 09:47:26 +00:00
OPN: fix possible crash when CSM is off
This commit is contained in:
parent
45c6a1cbfb
commit
8c2b3ba438
4 changed files with 5 additions and 3 deletions
|
@ -94,7 +94,7 @@ class DivPlatformYM2203: public DivPlatformOPN {
|
||||||
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformYM2203():
|
DivPlatformYM2203():
|
||||||
DivPlatformOPN(2, 3, 6, 6, 6, 4720270.0, 36, 16),
|
DivPlatformOPN(2, 3, 6, 6, 6, 4720270.0, 36, 16, false, 6),
|
||||||
prescale(0x2d),
|
prescale(0x2d),
|
||||||
isCSM(0) {}
|
isCSM(0) {}
|
||||||
~DivPlatformYM2203();
|
~DivPlatformYM2203();
|
||||||
|
|
|
@ -787,6 +787,8 @@ void DivPlatformYM2203Ext::setCSM(bool isCSM) {
|
||||||
this->isCSM=isCSM?1:0;
|
this->isCSM=isCSM?1:0;
|
||||||
if (isCSM) {
|
if (isCSM) {
|
||||||
csmChan=3;
|
csmChan=3;
|
||||||
|
} else {
|
||||||
|
csmChan=6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -125,7 +125,7 @@ class DivPlatformYM2608: public DivPlatformOPN {
|
||||||
void setCSM(bool isCSM);
|
void setCSM(bool isCSM);
|
||||||
void quit();
|
void quit();
|
||||||
DivPlatformYM2608():
|
DivPlatformYM2608():
|
||||||
DivPlatformOPN(2, 6, 9, 15, 16, 9440540.0, 72, 32),
|
DivPlatformOPN(2, 6, 9, 15, 16, 9440540.0, 72, 32, false, 16),
|
||||||
prescale(0x2d),
|
prescale(0x2d),
|
||||||
isCSM(0) {}
|
isCSM(0) {}
|
||||||
~DivPlatformYM2608();
|
~DivPlatformYM2608();
|
||||||
|
|
|
@ -364,7 +364,7 @@ class DivPlatformYM2610Base: public DivPlatformOPN {
|
||||||
}
|
}
|
||||||
|
|
||||||
DivPlatformYM2610Base(int ext, int psg, int adpcmA, int adpcmB, int chanCount):
|
DivPlatformYM2610Base(int ext, int psg, int adpcmA, int adpcmB, int chanCount):
|
||||||
DivPlatformOPN(ext,psg,adpcmA,adpcmB,chanCount,9440540.0, 72, 32) {}
|
DivPlatformOPN(ext,psg,adpcmA,adpcmB,chanCount,9440540.0, 72, 32, false, 16) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue