emu2413, part 1
missing: - patches - chan osc
This commit is contained in:
parent
129237fb2c
commit
dc2daccf05
|
|
@ -94,6 +94,20 @@ void DivPlatformOPLL::acquire_ymfm(short** buf, size_t len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformOPLL::acquire_emu(short** buf, size_t len) {
|
void DivPlatformOPLL::acquire_emu(short** buf, size_t len) {
|
||||||
|
thread_local int os;
|
||||||
|
|
||||||
|
for (size_t h=0; h<len; h++) {
|
||||||
|
if (!writes.empty()) {
|
||||||
|
QueuedWrite& w=writes.front();
|
||||||
|
OPLL_writeReg(fm_emu,w.addr,w.val);
|
||||||
|
writes.pop();
|
||||||
|
}
|
||||||
|
os=OPLL_calc(fm_emu)<<1;
|
||||||
|
if (os<-32768) os=-32768;
|
||||||
|
if (os>32767) os=32767;
|
||||||
|
|
||||||
|
buf[0][h]=os;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformOPLL::acquire(short** buf, size_t len) {
|
void DivPlatformOPLL::acquire(short** buf, size_t len) {
|
||||||
|
|
@ -1103,11 +1117,19 @@ void DivPlatformOPLL::setFlags(const DivConfig& flags) {
|
||||||
chipClock=COLOR_NTSC;
|
chipClock=COLOR_NTSC;
|
||||||
}
|
}
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/36;
|
|
||||||
patchSet=flags.getInt("patchSet",0);
|
patchSet=flags.getInt("patchSet",0);
|
||||||
|
if (selCore==1) {
|
||||||
|
rate=chipClock/72;
|
||||||
|
} else {
|
||||||
|
rate=chipClock/36;
|
||||||
|
}
|
||||||
for (int i=0; i<11; i++) {
|
for (int i=0; i<11; i++) {
|
||||||
|
if (selCore==1) {
|
||||||
|
oscBuf[i]->rate=rate;
|
||||||
|
} else {
|
||||||
oscBuf[i]->rate=rate/2;
|
oscBuf[i]->rate=rate/2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
noTopHatFreq=flags.getBool("noTopHatFreq",false);
|
noTopHatFreq=flags.getBool("noTopHatFreq",false);
|
||||||
fixedAll=flags.getBool("fixedAll",true);
|
fixedAll=flags.getBool("fixedAll",true);
|
||||||
}
|
}
|
||||||
|
|
@ -1117,6 +1139,12 @@ int DivPlatformOPLL::init(DivEngine* p, int channels, int sugRate, const DivConf
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
skipRegisterWrites=false;
|
skipRegisterWrites=false;
|
||||||
patchSet=0;
|
patchSet=0;
|
||||||
|
fm_emu=NULL;
|
||||||
|
if (selCore==1) {
|
||||||
|
fm_emu=OPLL_new(72,1);
|
||||||
|
OPLL_setChipType(fm_emu,vrc7?1:0);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<11; i++) {
|
for (int i=0; i<11; i++) {
|
||||||
isMuted[i]=false;
|
isMuted[i]=false;
|
||||||
oscBuf[i]=new DivDispatchOscBuffer;
|
oscBuf[i]=new DivDispatchOscBuffer;
|
||||||
|
|
@ -1131,6 +1159,10 @@ void DivPlatformOPLL::quit() {
|
||||||
for (int i=0; i<11; i++) {
|
for (int i=0; i<11; i++) {
|
||||||
delete oscBuf[i];
|
delete oscBuf[i];
|
||||||
}
|
}
|
||||||
|
if (fm_emu!=NULL) {
|
||||||
|
OPLL_delete(fm_emu);
|
||||||
|
fm_emu=NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DivPlatformOPLL::~DivPlatformOPLL() {
|
DivPlatformOPLL::~DivPlatformOPLL() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue