Various corrections and fixes
Fix SN PSG pitch corrections Revive YM2612 from dead Add Game Gear stereo function finally Add OPN/A prescaler config
This commit is contained in:
parent
0c1a8bc001
commit
25af023dc6
15 changed files with 147 additions and 99 deletions
|
|
@ -981,6 +981,10 @@ void DivPlatformYM2203::reset() {
|
|||
|
||||
extMode=false;
|
||||
|
||||
// set prescaler
|
||||
immWrite(0x2d,0xff);
|
||||
immWrite(prescale,0xff);
|
||||
|
||||
ay->reset();
|
||||
ay->getRegisterWrites().clear();
|
||||
ay->flushWrites();
|
||||
|
|
@ -1013,7 +1017,8 @@ void DivPlatformYM2203::setSkipRegisterWrites(bool value) {
|
|||
}
|
||||
|
||||
void DivPlatformYM2203::setFlags(unsigned int flags) {
|
||||
switch (flags&0x3f) {
|
||||
// Clock flags
|
||||
switch (flags&0x1f) {
|
||||
default:
|
||||
case 0x00:
|
||||
chipClock=COLOR_NTSC;
|
||||
|
|
@ -1034,10 +1039,36 @@ void DivPlatformYM2203::setFlags(unsigned int flags) {
|
|||
chipClock=3000000.0/2.0;
|
||||
break;
|
||||
}
|
||||
// Prescaler flags
|
||||
switch ((flags>>5)&0x3) {
|
||||
default:
|
||||
case 0x00: // /6
|
||||
prescale=0x2d;
|
||||
fmFreqBase=4720270.0,
|
||||
fmDivBase=36,
|
||||
ayDiv=16;
|
||||
break;
|
||||
case 0x01: // /3
|
||||
prescale=0x2e;
|
||||
fmFreqBase=4720270.0/2.0,
|
||||
fmDivBase=18,
|
||||
ayDiv=8;
|
||||
break;
|
||||
case 0x02: // /2
|
||||
prescale=0x2f;
|
||||
fmFreqBase=4720270.0/3.0,
|
||||
fmDivBase=12,
|
||||
ayDiv=4;
|
||||
break;
|
||||
}
|
||||
rate=fm->sample_rate(chipClock);
|
||||
for (int i=0; i<6; i++) {
|
||||
oscBuf[i]->rate=rate;
|
||||
}
|
||||
immWrite(0x2d,0xff);
|
||||
immWrite(prescale,0xff);
|
||||
ay->setExtClockDiv(chipClock,ayDiv);
|
||||
ay->setFlags(16);
|
||||
}
|
||||
|
||||
int DivPlatformYM2203::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
||||
|
|
@ -1050,11 +1081,11 @@ int DivPlatformYM2203::init(DivEngine* p, int channels, int sugRate, unsigned in
|
|||
}
|
||||
fm=new ymfm::ym2203(iface);
|
||||
fm->set_fidelity(ymfm::OPN_FIDELITY_MIN);
|
||||
setFlags(flags);
|
||||
// YM2149, 2MHz
|
||||
ay=new DivPlatformAY8910(true,chipClock,ayDiv);
|
||||
ay->init(p,3,sugRate,16);
|
||||
ay->toggleRegisterDump(true);
|
||||
setFlags(flags);
|
||||
|
||||
reset();
|
||||
return 6;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue