SAA1099: remove MAME core
closes #529 the MAME core is inaccurate. it doesn't emulate envelope too well.
This commit is contained in:
parent
ed9cd1ebe0
commit
6dc408d99c
|
|
@ -312,10 +312,7 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
|
||||||
dispatch=new DivPlatformTX81Z;
|
dispatch=new DivPlatformTX81Z;
|
||||||
break;
|
break;
|
||||||
case DIV_SYSTEM_SAA1099: {
|
case DIV_SYSTEM_SAA1099: {
|
||||||
int saaCore=eng->getConfInt("saaCore",1);
|
|
||||||
if (saaCore<0 || saaCore>2) saaCore=0;
|
|
||||||
dispatch=new DivPlatformSAA1099;
|
dispatch=new DivPlatformSAA1099;
|
||||||
((DivPlatformSAA1099*)dispatch)->setCore((DivSAACores)saaCore);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIV_SYSTEM_PCSPKR:
|
case DIV_SYSTEM_PCSPKR:
|
||||||
|
|
|
||||||
|
|
@ -71,28 +71,6 @@ const char* DivPlatformSAA1099::getEffectName(unsigned char effect) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSAA1099::acquire_mame(short* bufL, short* bufR, size_t start, size_t len) {
|
|
||||||
if (saaBufLen<len) {
|
|
||||||
saaBufLen=len;
|
|
||||||
for (int i=0; i<2; i++) {
|
|
||||||
delete[] saaBuf[i];
|
|
||||||
saaBuf[i]=new short[saaBufLen];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while (!writes.empty()) {
|
|
||||||
QueuedWrite w=writes.front();
|
|
||||||
saa.control_w(w.addr);
|
|
||||||
saa.data_w(w.val);
|
|
||||||
regPool[w.addr&0x1f]=w.val;
|
|
||||||
writes.pop();
|
|
||||||
}
|
|
||||||
saa.sound_stream_update(saaBuf,len,oscBuf);
|
|
||||||
for (size_t i=0; i<len; i++) {
|
|
||||||
bufL[i+start]=saaBuf[0][i];
|
|
||||||
bufR[i+start]=saaBuf[1][i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DivPlatformSAA1099::acquire_saaSound(short* bufL, short* bufR, size_t start, size_t len) {
|
void DivPlatformSAA1099::acquire_saaSound(short* bufL, short* bufR, size_t start, size_t len) {
|
||||||
if (saaBufLen<len*2) {
|
if (saaBufLen<len*2) {
|
||||||
saaBufLen=len*2;
|
saaBufLen=len*2;
|
||||||
|
|
@ -115,17 +93,7 @@ void DivPlatformSAA1099::acquire_saaSound(short* bufL, short* bufR, size_t start
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSAA1099::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
void DivPlatformSAA1099::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||||
switch (core) {
|
acquire_saaSound(bufL,bufR,start,len);
|
||||||
case DIV_SAA_CORE_MAME:
|
|
||||||
acquire_mame(bufL,bufR,start,len);
|
|
||||||
break;
|
|
||||||
case DIV_SAA_CORE_SAASOUND:
|
|
||||||
acquire_saaSound(bufL,bufR,start,len);
|
|
||||||
break;
|
|
||||||
case DIV_SAA_CORE_E:
|
|
||||||
//acquire_e(bufL,bufR,start,len);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline unsigned char applyPan(unsigned char vol, unsigned char pan) {
|
inline unsigned char applyPan(unsigned char vol, unsigned char pan) {
|
||||||
|
|
@ -420,16 +388,7 @@ int DivPlatformSAA1099::getRegisterPoolSize() {
|
||||||
void DivPlatformSAA1099::reset() {
|
void DivPlatformSAA1099::reset() {
|
||||||
while (!writes.empty()) writes.pop();
|
while (!writes.empty()) writes.pop();
|
||||||
memset(regPool,0,32);
|
memset(regPool,0,32);
|
||||||
switch (core) {
|
saa_saaSound->Clear();
|
||||||
case DIV_SAA_CORE_MAME:
|
|
||||||
saa=saa1099_device();
|
|
||||||
break;
|
|
||||||
case DIV_SAA_CORE_SAASOUND:
|
|
||||||
saa_saaSound->Clear();
|
|
||||||
break;
|
|
||||||
case DIV_SAA_CORE_E:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for (int i=0; i<6; i++) {
|
for (int i=0; i<6; i++) {
|
||||||
chan[i]=DivPlatformSAA1099::Channel();
|
chan[i]=DivPlatformSAA1099::Channel();
|
||||||
chan[i].std.setEngine(parent);
|
chan[i].std.setEngine(parent);
|
||||||
|
|
@ -500,16 +459,8 @@ void DivPlatformSAA1099::setFlags(unsigned int flags) {
|
||||||
oscBuf[i]->rate=rate;
|
oscBuf[i]->rate=rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (core) {
|
saa_saaSound->SetClockRate(chipClock);
|
||||||
case DIV_SAA_CORE_MAME:
|
saa_saaSound->SetSampleRate(rate);
|
||||||
break;
|
|
||||||
case DIV_SAA_CORE_SAASOUND:
|
|
||||||
saa_saaSound->SetClockRate(chipClock);
|
|
||||||
saa_saaSound->SetSampleRate(rate);
|
|
||||||
break;
|
|
||||||
case DIV_SAA_CORE_E:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSAA1099::poke(unsigned int addr, unsigned short val) {
|
void DivPlatformSAA1099::poke(unsigned int addr, unsigned short val) {
|
||||||
|
|
@ -520,10 +471,6 @@ void DivPlatformSAA1099::poke(std::vector<DivRegWrite>& wlist) {
|
||||||
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
for (DivRegWrite& i: wlist) rWrite(i.addr,i.val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSAA1099::setCore(DivSAACores c) {
|
|
||||||
core=c;
|
|
||||||
}
|
|
||||||
|
|
||||||
int DivPlatformSAA1099::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
int DivPlatformSAA1099::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
||||||
parent=p;
|
parent=p;
|
||||||
dumpWrites=false;
|
dumpWrites=false;
|
||||||
|
|
@ -533,11 +480,9 @@ int DivPlatformSAA1099::init(DivEngine* p, int channels, int sugRate, unsigned i
|
||||||
isMuted[i]=false;
|
isMuted[i]=false;
|
||||||
oscBuf[i]=new DivDispatchOscBuffer;
|
oscBuf[i]=new DivDispatchOscBuffer;
|
||||||
}
|
}
|
||||||
if (core==DIV_SAA_CORE_SAASOUND) {
|
saa_saaSound=CreateCSAASound();
|
||||||
saa_saaSound=CreateCSAASound();
|
saa_saaSound->SetOversample(1);
|
||||||
saa_saaSound->SetOversample(1);
|
saa_saaSound->SetSoundParameters(SAAP_NOFILTER|SAAP_16BIT|SAAP_STEREO);
|
||||||
saa_saaSound->SetSoundParameters(SAAP_NOFILTER|SAAP_16BIT|SAAP_STEREO);
|
|
||||||
}
|
|
||||||
setFlags(flags);
|
setFlags(flags);
|
||||||
saaBufLen=65536;
|
saaBufLen=65536;
|
||||||
for (int i=0; i<2; i++) saaBuf[i]=new short[saaBufLen];
|
for (int i=0; i<2; i++) saaBuf[i]=new short[saaBufLen];
|
||||||
|
|
|
||||||
|
|
@ -22,15 +22,8 @@
|
||||||
#include "../dispatch.h"
|
#include "../dispatch.h"
|
||||||
#include "../macroInt.h"
|
#include "../macroInt.h"
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include "sound/saa1099.h"
|
|
||||||
#include "../../../extern/SAASound/src/SAASound.h"
|
#include "../../../extern/SAASound/src/SAASound.h"
|
||||||
|
|
||||||
enum DivSAACores {
|
|
||||||
DIV_SAA_CORE_MAME=0,
|
|
||||||
DIV_SAA_CORE_SAASOUND,
|
|
||||||
DIV_SAA_CORE_E
|
|
||||||
};
|
|
||||||
|
|
||||||
class DivPlatformSAA1099: public DivDispatch {
|
class DivPlatformSAA1099: public DivDispatch {
|
||||||
protected:
|
protected:
|
||||||
struct Channel {
|
struct Channel {
|
||||||
|
|
@ -58,8 +51,6 @@ class DivPlatformSAA1099: public DivDispatch {
|
||||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||||
};
|
};
|
||||||
std::queue<QueuedWrite> writes;
|
std::queue<QueuedWrite> writes;
|
||||||
DivSAACores core;
|
|
||||||
saa1099_device saa;
|
|
||||||
CSAASound* saa_saaSound;
|
CSAASound* saa_saaSound;
|
||||||
unsigned char regPool[32];
|
unsigned char regPool[32];
|
||||||
unsigned char lastBusy;
|
unsigned char lastBusy;
|
||||||
|
|
@ -83,9 +74,7 @@ class DivPlatformSAA1099: public DivDispatch {
|
||||||
unsigned char saaNoise[2];
|
unsigned char saaNoise[2];
|
||||||
friend void putDispatchChan(void*,int,int);
|
friend void putDispatchChan(void*,int,int);
|
||||||
|
|
||||||
void acquire_e(short* bufL, short* bufR, size_t start, size_t len);
|
|
||||||
void acquire_saaSound(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire_saaSound(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
void acquire_mame(short* bufL, short* bufR, size_t start, size_t len);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||||
|
|
@ -99,7 +88,6 @@ class DivPlatformSAA1099: public DivDispatch {
|
||||||
void forceIns();
|
void forceIns();
|
||||||
void tick(bool sysTick=true);
|
void tick(bool sysTick=true);
|
||||||
void muteChannel(int ch, bool mute);
|
void muteChannel(int ch, bool mute);
|
||||||
void setCore(DivSAACores core);
|
|
||||||
void setFlags(unsigned int flags);
|
void setFlags(unsigned int flags);
|
||||||
bool isStereo();
|
bool isStereo();
|
||||||
int getPortaFloor(int ch);
|
int getPortaFloor(int ch);
|
||||||
|
|
|
||||||
|
|
@ -873,7 +873,6 @@ class FurnaceGUI {
|
||||||
int arcadeCore;
|
int arcadeCore;
|
||||||
int ym2612Core;
|
int ym2612Core;
|
||||||
int snCore;
|
int snCore;
|
||||||
int saaCore;
|
|
||||||
int nesCore;
|
int nesCore;
|
||||||
int fdsCore;
|
int fdsCore;
|
||||||
int pcSpeakerOutMethod;
|
int pcSpeakerOutMethod;
|
||||||
|
|
@ -974,7 +973,6 @@ class FurnaceGUI {
|
||||||
arcadeCore(0),
|
arcadeCore(0),
|
||||||
ym2612Core(0),
|
ym2612Core(0),
|
||||||
snCore(0),
|
snCore(0),
|
||||||
saaCore(1),
|
|
||||||
nesCore(0),
|
nesCore(0),
|
||||||
fdsCore(0),
|
fdsCore(0),
|
||||||
pcSpeakerOutMethod(0),
|
pcSpeakerOutMethod(0),
|
||||||
|
|
|
||||||
|
|
@ -84,11 +84,6 @@ const char* snCores[]={
|
||||||
"Nuked-PSG Mod"
|
"Nuked-PSG Mod"
|
||||||
};
|
};
|
||||||
|
|
||||||
const char* saaCores[]={
|
|
||||||
"MAME",
|
|
||||||
"SAASound"
|
|
||||||
};
|
|
||||||
|
|
||||||
const char* nesCores[]={
|
const char* nesCores[]={
|
||||||
"puNES",
|
"puNES",
|
||||||
"NSFplay"
|
"NSFplay"
|
||||||
|
|
@ -899,10 +894,6 @@ void FurnaceGUI::drawSettings() {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Combo("##SNCore",&settings.snCore,snCores,2);
|
ImGui::Combo("##SNCore",&settings.snCore,snCores,2);
|
||||||
|
|
||||||
ImGui::Text("SAA1099 core");
|
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::Combo("##SAACore",&settings.saaCore,saaCores,2);
|
|
||||||
|
|
||||||
ImGui::Text("NES core");
|
ImGui::Text("NES core");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Combo("##NESCore",&settings.nesCore,nesCores,2);
|
ImGui::Combo("##NESCore",&settings.nesCore,nesCores,2);
|
||||||
|
|
@ -1954,7 +1945,6 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.arcadeCore=e->getConfInt("arcadeCore",0);
|
settings.arcadeCore=e->getConfInt("arcadeCore",0);
|
||||||
settings.ym2612Core=e->getConfInt("ym2612Core",0);
|
settings.ym2612Core=e->getConfInt("ym2612Core",0);
|
||||||
settings.snCore=e->getConfInt("snCore",0);
|
settings.snCore=e->getConfInt("snCore",0);
|
||||||
settings.saaCore=e->getConfInt("saaCore",1);
|
|
||||||
settings.nesCore=e->getConfInt("nesCore",0);
|
settings.nesCore=e->getConfInt("nesCore",0);
|
||||||
settings.fdsCore=e->getConfInt("fdsCore",0);
|
settings.fdsCore=e->getConfInt("fdsCore",0);
|
||||||
settings.pcSpeakerOutMethod=e->getConfInt("pcSpeakerOutMethod",0);
|
settings.pcSpeakerOutMethod=e->getConfInt("pcSpeakerOutMethod",0);
|
||||||
|
|
@ -2048,7 +2038,6 @@ void FurnaceGUI::syncSettings() {
|
||||||
clampSetting(settings.arcadeCore,0,1);
|
clampSetting(settings.arcadeCore,0,1);
|
||||||
clampSetting(settings.ym2612Core,0,1);
|
clampSetting(settings.ym2612Core,0,1);
|
||||||
clampSetting(settings.snCore,0,1);
|
clampSetting(settings.snCore,0,1);
|
||||||
clampSetting(settings.saaCore,0,1);
|
|
||||||
clampSetting(settings.nesCore,0,1);
|
clampSetting(settings.nesCore,0,1);
|
||||||
clampSetting(settings.fdsCore,0,1);
|
clampSetting(settings.fdsCore,0,1);
|
||||||
clampSetting(settings.pcSpeakerOutMethod,0,4);
|
clampSetting(settings.pcSpeakerOutMethod,0,4);
|
||||||
|
|
@ -2171,7 +2160,6 @@ void FurnaceGUI::commitSettings() {
|
||||||
e->setConf("arcadeCore",settings.arcadeCore);
|
e->setConf("arcadeCore",settings.arcadeCore);
|
||||||
e->setConf("ym2612Core",settings.ym2612Core);
|
e->setConf("ym2612Core",settings.ym2612Core);
|
||||||
e->setConf("snCore",settings.snCore);
|
e->setConf("snCore",settings.snCore);
|
||||||
e->setConf("saaCore",settings.saaCore);
|
|
||||||
e->setConf("nesCore",settings.nesCore);
|
e->setConf("nesCore",settings.nesCore);
|
||||||
e->setConf("fdsCore",settings.fdsCore);
|
e->setConf("fdsCore",settings.fdsCore);
|
||||||
e->setConf("pcSpeakerOutMethod",settings.pcSpeakerOutMethod);
|
e->setConf("pcSpeakerOutMethod",settings.pcSpeakerOutMethod);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue