Merge branch 'master' into preset1
This commit is contained in:
commit
dd93f6d18e
25 changed files with 89 additions and 104 deletions
|
|
@ -71,28 +71,6 @@ const char* DivPlatformSAA1099::getEffectName(unsigned char effect) {
|
|||
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) {
|
||||
if (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) {
|
||||
switch (core) {
|
||||
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;
|
||||
}
|
||||
acquire_saaSound(bufL,bufR,start,len);
|
||||
}
|
||||
|
||||
inline unsigned char applyPan(unsigned char vol, unsigned char pan) {
|
||||
|
|
@ -420,16 +388,7 @@ int DivPlatformSAA1099::getRegisterPoolSize() {
|
|||
void DivPlatformSAA1099::reset() {
|
||||
while (!writes.empty()) writes.pop();
|
||||
memset(regPool,0,32);
|
||||
switch (core) {
|
||||
case DIV_SAA_CORE_MAME:
|
||||
saa=saa1099_device();
|
||||
break;
|
||||
case DIV_SAA_CORE_SAASOUND:
|
||||
saa_saaSound->Clear();
|
||||
break;
|
||||
case DIV_SAA_CORE_E:
|
||||
break;
|
||||
}
|
||||
saa_saaSound->Clear();
|
||||
for (int i=0; i<6; i++) {
|
||||
chan[i]=DivPlatformSAA1099::Channel();
|
||||
chan[i].std.setEngine(parent);
|
||||
|
|
@ -500,16 +459,8 @@ void DivPlatformSAA1099::setFlags(unsigned int flags) {
|
|||
oscBuf[i]->rate=rate;
|
||||
}
|
||||
|
||||
switch (core) {
|
||||
case DIV_SAA_CORE_MAME:
|
||||
break;
|
||||
case DIV_SAA_CORE_SAASOUND:
|
||||
saa_saaSound->SetClockRate(chipClock);
|
||||
saa_saaSound->SetSampleRate(rate);
|
||||
break;
|
||||
case DIV_SAA_CORE_E:
|
||||
break;
|
||||
}
|
||||
saa_saaSound->SetClockRate(chipClock);
|
||||
saa_saaSound->SetSampleRate(rate);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void DivPlatformSAA1099::setCore(DivSAACores c) {
|
||||
core=c;
|
||||
}
|
||||
|
||||
int DivPlatformSAA1099::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {
|
||||
parent=p;
|
||||
dumpWrites=false;
|
||||
|
|
@ -533,11 +480,9 @@ int DivPlatformSAA1099::init(DivEngine* p, int channels, int sugRate, unsigned i
|
|||
isMuted[i]=false;
|
||||
oscBuf[i]=new DivDispatchOscBuffer;
|
||||
}
|
||||
if (core==DIV_SAA_CORE_SAASOUND) {
|
||||
saa_saaSound=CreateCSAASound();
|
||||
saa_saaSound->SetOversample(1);
|
||||
saa_saaSound->SetSoundParameters(SAAP_NOFILTER|SAAP_16BIT|SAAP_STEREO);
|
||||
}
|
||||
saa_saaSound=CreateCSAASound();
|
||||
saa_saaSound->SetOversample(1);
|
||||
saa_saaSound->SetSoundParameters(SAAP_NOFILTER|SAAP_16BIT|SAAP_STEREO);
|
||||
setFlags(flags);
|
||||
saaBufLen=65536;
|
||||
for (int i=0; i<2; i++) saaBuf[i]=new short[saaBufLen];
|
||||
|
|
|
|||
|
|
@ -22,15 +22,8 @@
|
|||
#include "../dispatch.h"
|
||||
#include "../macroInt.h"
|
||||
#include <queue>
|
||||
#include "sound/saa1099.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 {
|
||||
protected:
|
||||
struct Channel {
|
||||
|
|
@ -58,8 +51,6 @@ class DivPlatformSAA1099: public DivDispatch {
|
|||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v), addrOrVal(false) {}
|
||||
};
|
||||
std::queue<QueuedWrite> writes;
|
||||
DivSAACores core;
|
||||
saa1099_device saa;
|
||||
CSAASound* saa_saaSound;
|
||||
unsigned char regPool[32];
|
||||
unsigned char lastBusy;
|
||||
|
|
@ -83,9 +74,7 @@ class DivPlatformSAA1099: public DivDispatch {
|
|||
unsigned char saaNoise[2];
|
||||
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_mame(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
|
@ -99,7 +88,6 @@ class DivPlatformSAA1099: public DivDispatch {
|
|||
void forceIns();
|
||||
void tick(bool sysTick=true);
|
||||
void muteChannel(int ch, bool mute);
|
||||
void setCore(DivSAACores core);
|
||||
void setFlags(unsigned int flags);
|
||||
bool isStereo();
|
||||
int getPortaFloor(int ch);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue