mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-30 08:23:01 +00:00
aaaaaaaa
This commit is contained in:
parent
e06b2f6952
commit
3e0dcbb0ae
104 changed files with 233 additions and 233 deletions
|
@ -75,9 +75,9 @@ const char** DivPlatformAmiga::getRegisterSheet() {
|
|||
if (chan[i+1].freq<AMIGA_DIVIDER) chan[i+1].freq=AMIGA_DIVIDER; \
|
||||
}
|
||||
|
||||
void DivPlatformAmiga::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformAmiga::acquire(short** buf, size_t len) {
|
||||
static int outL, outR, output;
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
for (size_t h=0; h<len; h++) {
|
||||
outL=0;
|
||||
outR=0;
|
||||
for (int i=0; i<4; i++) {
|
||||
|
@ -142,8 +142,8 @@ void DivPlatformAmiga::acquire(short* bufL, short* bufR, size_t start, size_t le
|
|||
filter[0][1]+=(filtConst*(filter[0][0]-filter[0][1]))>>12;
|
||||
filter[1][0]+=(filtConst*(outR-filter[1][0]))>>12;
|
||||
filter[1][1]+=(filtConst*(filter[1][0]-filter[1][1]))>>12;
|
||||
bufL[h]=filter[0][1];
|
||||
bufR[h]=filter[1][1];
|
||||
buf[0][h]=filter[0][1];
|
||||
buf[1][h]=filter[1][1];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ class DivPlatformAmiga: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
@ -84,8 +84,8 @@ void DivPlatformArcade::acquire_nuked(short* bufL, short* bufR, size_t start, si
|
|||
if (o[1]<-32768) o[1]=-32768;
|
||||
if (o[1]>32767) o[1]=32767;
|
||||
|
||||
bufL[h]=o[0];
|
||||
bufR[h]=o[1];
|
||||
buf[0][h]=o[0];
|
||||
buf[1][h]=o[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,16 +121,16 @@ void DivPlatformArcade::acquire_ymfm(short* bufL, short* bufR, size_t start, siz
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformArcade::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformArcade::acquire(short** buf, size_t len) {
|
||||
if (useYMFM) {
|
||||
acquire_ymfm(bufL,bufR,start,len);
|
||||
acquire_ymfm(buf[0],buf[1],0,len);
|
||||
} else {
|
||||
acquire_nuked(bufL,bufR,start,len);
|
||||
acquire_nuked(buf[0],buf[1],0,len);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class DivPlatformArcade: public DivPlatformOPM {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
friend void putDispatchChip(void*,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
@ -169,7 +169,7 @@ void DivPlatformAY8910::checkWrites() {
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformAY8910::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformAY8910::acquire(short** buf, size_t len) {
|
||||
if (ayBufLen<len) {
|
||||
ayBufLen=len;
|
||||
for (int i=0; i<3; i++) {
|
||||
|
@ -184,8 +184,8 @@ void DivPlatformAY8910::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
checkWrites();
|
||||
|
||||
ay->sound_stream_update(ayBuf,1);
|
||||
bufL[i+start]=ayBuf[0][0];
|
||||
bufR[i+start]=bufL[i+start];
|
||||
buf[0][i]=ayBuf[0][0];
|
||||
buf[1][i]=buf[0][i];
|
||||
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=sunsoftVolTable[31-(ay->lastIndx&31)]>>3;
|
||||
oscBuf[1]->data[oscBuf[1]->needle++]=sunsoftVolTable[31-((ay->lastIndx>>5)&31)]>>3;
|
||||
|
@ -198,11 +198,11 @@ void DivPlatformAY8910::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
|
||||
ay->sound_stream_update(ayBuf,1);
|
||||
if (stereo) {
|
||||
bufL[i+start]=ayBuf[0][0]+ayBuf[1][0]+((ayBuf[2][0]*stereoSep)>>8);
|
||||
bufR[i+start]=((ayBuf[0][0]*stereoSep)>>8)+ayBuf[1][0]+ayBuf[2][0];
|
||||
buf[0][i]=ayBuf[0][0]+ayBuf[1][0]+((ayBuf[2][0]*stereoSep)>>8);
|
||||
buf[1][i]=((ayBuf[0][0]*stereoSep)>>8)+ayBuf[1][0]+ayBuf[2][0];
|
||||
} else {
|
||||
bufL[i+start]=ayBuf[0][0]+ayBuf[1][0]+ayBuf[2][0];
|
||||
bufR[i+start]=bufL[i+start];
|
||||
buf[0][i]=ayBuf[0][0]+ayBuf[1][0]+ayBuf[2][0];
|
||||
buf[1][i]=buf[0][i];
|
||||
}
|
||||
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=ayBuf[0][0]<<2;
|
||||
|
|
|
@ -128,7 +128,7 @@ class DivPlatformAY8910: public DivDispatch {
|
|||
|
||||
public:
|
||||
void setExtClockDiv(unsigned int eclk=COLOR_NTSC, unsigned char ediv=8);
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
@ -164,7 +164,7 @@ void DivPlatformAY8930::checkWrites() {
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformAY8930::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformAY8930::acquire(short** buf, size_t len) {
|
||||
if (ayBufLen<len) {
|
||||
ayBufLen=len;
|
||||
for (int i=0; i<3; i++) {
|
||||
|
@ -179,11 +179,11 @@ void DivPlatformAY8930::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
|
||||
ay->sound_stream_update(ayBuf,1);
|
||||
if (stereo) {
|
||||
bufL[i+start]=ayBuf[0][0]+ayBuf[1][0]+((ayBuf[2][0]*stereoSep)>>8);
|
||||
bufR[i+start]=((ayBuf[0][0]*stereoSep)>>8)+ayBuf[1][0]+ayBuf[2][0];
|
||||
buf[0][i]=ayBuf[0][0]+ayBuf[1][0]+((ayBuf[2][0]*stereoSep)>>8);
|
||||
buf[1][i]=((ayBuf[0][0]*stereoSep)>>8)+ayBuf[1][0]+ayBuf[2][0];
|
||||
} else {
|
||||
bufL[i+start]=ayBuf[0][0]+ayBuf[1][0]+ayBuf[2][0];
|
||||
bufR[i+start]=bufL[i+start];
|
||||
buf[0][i]=ayBuf[0][0]+ayBuf[1][0]+ayBuf[2][0];
|
||||
buf[1][i]=buf[0][i];
|
||||
}
|
||||
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=ayBuf[0][0]<<2;
|
||||
|
|
|
@ -131,7 +131,7 @@ class DivPlatformAY8930: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
@ -39,9 +39,9 @@ const char** DivPlatformBubSysWSG::getRegisterSheet() {
|
|||
return regCheatSheetBubSysWSG;
|
||||
}
|
||||
|
||||
void DivPlatformBubSysWSG::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformBubSysWSG::acquire(short** buf, size_t len) {
|
||||
int chanOut=0;
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
for (size_t h=0; h<len; h++) {
|
||||
signed int out=0;
|
||||
// K005289 part
|
||||
k005289.tick();
|
||||
|
@ -68,7 +68,7 @@ void DivPlatformBubSysWSG::acquire(short* bufL, short* bufR, size_t start, size_
|
|||
if (out>32767) out=32767;
|
||||
|
||||
//printf("out: %d\n",out);
|
||||
bufL[h]=bufR[h]=out;
|
||||
buf[0][h]=buf[1][h]=out;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ class DivPlatformBubSysWSG: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
@ -63,9 +63,9 @@ const char** DivPlatformC64::getRegisterSheet() {
|
|||
return regCheatSheetSID;
|
||||
}
|
||||
|
||||
void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformC64::acquire(short** buf, size_t len) {
|
||||
int dcOff=isFP?0:sid.get_dc(0);
|
||||
for (size_t i=start; i<start+len; i++) {
|
||||
for (size_t i=0; i<len; i++) {
|
||||
if (!writes.empty()) {
|
||||
QueuedWrite w=writes.front();
|
||||
if (isFP) {
|
||||
|
@ -77,7 +77,7 @@ void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
writes.pop();
|
||||
}
|
||||
if (isFP) {
|
||||
sid_fp.clock(4,&bufL[i]);
|
||||
sid_fp.clock(4,&buf[0][i]);
|
||||
if (++writeOscBuf>=4) {
|
||||
writeOscBuf=0;
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=(sid_fp.lastChanOut[0]-dcOff)>>5;
|
||||
|
@ -86,7 +86,7 @@ void DivPlatformC64::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
}
|
||||
} else {
|
||||
sid.clock();
|
||||
bufL[i]=sid.output();
|
||||
buf[0][i]=sid.output();
|
||||
if (++writeOscBuf>=16) {
|
||||
writeOscBuf=0;
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=(sid.last_chan_out[0]-dcOff)>>5;
|
||||
|
|
|
@ -79,7 +79,7 @@ class DivPlatformC64: public DivDispatch {
|
|||
|
||||
void updateFilter();
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
|
||||
#define CHIP_FREQBASE 2048
|
||||
|
||||
void DivPlatformDummy::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformDummy::acquire(short** buf, size_t len) {
|
||||
int chanOut;
|
||||
for (size_t i=start; i<start+len; i++) {
|
||||
for (size_t i=0; i<len; i++) {
|
||||
int out=0;
|
||||
for (unsigned char j=0; j<chans; j++) {
|
||||
if (chan[j].active) {
|
||||
|
@ -44,7 +44,7 @@ void DivPlatformDummy::acquire(short* bufL, short* bufR, size_t start, size_t le
|
|||
}
|
||||
if (out<-32768) out=-32768;
|
||||
if (out>32767) out=32767;
|
||||
bufL[i]=out;
|
||||
buf[0][i]=out;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class DivPlatformDummy: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
void muteChannel(int ch, bool mute);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
|
|
|
@ -61,7 +61,7 @@ void DivPlatformFDS::acquire_puNES(short* bufL, short* bufR, size_t start, size_
|
|||
int sample=isMuted[0]?0:fds->snd.main.output;
|
||||
if (sample>32767) sample=32767;
|
||||
if (sample<-32768) sample=-32768;
|
||||
bufL[i]=sample;
|
||||
buf[0][i]=sample;
|
||||
if (++writeOscBuf>=32) {
|
||||
writeOscBuf=0;
|
||||
oscBuf->data[oscBuf->needle++]=sample<<1;
|
||||
|
@ -77,7 +77,7 @@ void DivPlatformFDS::acquire_NSFPlay(short* bufL, short* bufR, size_t start, siz
|
|||
int sample=isMuted[0]?0:(out[0]<<1);
|
||||
if (sample>32767) sample=32767;
|
||||
if (sample<-32768) sample=-32768;
|
||||
bufL[i]=sample;
|
||||
buf[0][i]=sample;
|
||||
if (++writeOscBuf>=32) {
|
||||
writeOscBuf=0;
|
||||
oscBuf->data[oscBuf->needle++]=sample<<1;
|
||||
|
@ -93,7 +93,7 @@ void DivPlatformFDS::doWrite(unsigned short addr, unsigned char data) {
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformFDS::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformFDS::acquire(short** buf, size_t len) {
|
||||
if (useNP) {
|
||||
acquire_NSFPlay(bufL,bufR,start,len);
|
||||
} else {
|
||||
|
|
|
@ -66,7 +66,7 @@ class DivPlatformFDS: public DivDispatch {
|
|||
void acquire_NSFPlay(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -51,7 +51,7 @@ inline void DivPlatformGA20::chWrite(unsigned char ch, unsigned int addr, unsign
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformGA20::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformGA20::acquire(short** buf, size_t len) {
|
||||
if (ga20BufLen<len) {
|
||||
ga20BufLen=len;
|
||||
for (int i=0; i<4; i++) {
|
||||
|
@ -73,7 +73,7 @@ void DivPlatformGA20::acquire(short* bufL, short* bufR, size_t start, size_t len
|
|||
}
|
||||
short *buffer[4] = {&ga20Buf[0][h],&ga20Buf[1][h],&ga20Buf[2][h],&ga20Buf[3][h]};
|
||||
ga20.sound_stream_update(buffer, 1);
|
||||
bufL[h]=(signed int)(ga20Buf[0][h]+ga20Buf[1][h]+ga20Buf[2][h]+ga20Buf[3][h])>>2;
|
||||
buf[0][h]=(signed int)(ga20Buf[0][h]+ga20Buf[1][h]+ga20Buf[2][h]+ga20Buf[3][h])>>2;
|
||||
for (int i=0; i<4; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=ga20Buf[i][h];
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ class DivPlatformGA20: public DivDispatch, public iremga20_intf {
|
|||
void chWrite(unsigned char ch, unsigned int addr, unsigned char val);
|
||||
public:
|
||||
virtual u8 read_byte(u32 address) override;
|
||||
virtual void acquire(short* bufL, short* bufR, size_t start, size_t len) override;
|
||||
virtual void acquire(short** buf, size_t len) override;
|
||||
virtual int dispatch(DivCommand c) override;
|
||||
virtual void* getChanState(int chan) override;
|
||||
virtual DivMacroInt* getChanMacroInt(int ch) override;
|
||||
|
|
|
@ -61,7 +61,7 @@ const char** DivPlatformGB::getRegisterSheet() {
|
|||
return regCheatSheetGB;
|
||||
}
|
||||
|
||||
void DivPlatformGB::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformGB::acquire(short** buf, size_t len) {
|
||||
for (size_t i=start; i<start+len; i++) {
|
||||
if (!writes.empty()) {
|
||||
QueuedWrite& w=writes.front();
|
||||
|
@ -70,8 +70,8 @@ void DivPlatformGB::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
}
|
||||
|
||||
GB_advance_cycles(gb,16);
|
||||
bufL[i]=gb->apu_output.final_sample.left;
|
||||
bufR[i]=gb->apu_output.final_sample.right;
|
||||
buf[0][i]=gb->apu_output.final_sample.left;
|
||||
buf[1][i]=gb->apu_output.final_sample.right;
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(gb->apu_output.current_sample[i].left+gb->apu_output.current_sample[i].right)<<6;
|
||||
|
|
|
@ -78,7 +78,7 @@ class DivPlatformGB: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -186,8 +186,8 @@ void DivPlatformGenesis::acquire_nuked(short* bufL, short* bufR, size_t start, s
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,12 +242,12 @@ void DivPlatformGenesis::acquire_ymfm(short* bufL, short* bufR, size_t start, si
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformGenesis::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformGenesis::acquire(short** buf, size_t len) {
|
||||
if (useYMFM) {
|
||||
acquire_ymfm(bufL,bufR,start,len);
|
||||
} else {
|
||||
|
|
|
@ -98,7 +98,7 @@ class DivPlatformGenesis: public DivPlatformOPN {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
void fillStream(std::vector<DivDelayedWrite>& stream, int sRate, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
|
|
|
@ -54,7 +54,7 @@ inline void DivPlatformK007232::chWrite(unsigned char ch, unsigned int addr, uns
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformK007232::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformK007232::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
if ((--delay)<=0) {
|
||||
delay=MAX(0,delay);
|
||||
|
@ -76,15 +76,15 @@ void DivPlatformK007232::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
const unsigned char vol1=regPool[0x10],vol2=regPool[0x11];
|
||||
const signed int lout[2]={(k007232.output(0)*(vol1&0xf)),(k007232.output(1)*(vol2&0xf))};
|
||||
const signed int rout[2]={(k007232.output(0)*((vol1>>4)&0xf)),(k007232.output(1)*((vol2>>4)&0xf))};
|
||||
bufL[h]=(lout[0]+lout[1])<<4;
|
||||
bufR[h]=(rout[0]+rout[1])<<4;
|
||||
buf[0][h]=(lout[0]+lout[1])<<4;
|
||||
buf[1][h]=(rout[0]+rout[1])<<4;
|
||||
for (int i=0; i<2; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(lout[i]+rout[i])<<4;
|
||||
}
|
||||
} else {
|
||||
const unsigned char vol=regPool[0xc];
|
||||
const signed int out[2]={(k007232.output(0)*(vol&0xf)),(k007232.output(1)*((vol>>4)&0xf))};
|
||||
bufL[h]=bufR[h]=(out[0]+out[1])<<4;
|
||||
buf[0][h]=buf[1][h]=(out[0]+out[1])<<4;
|
||||
for (int i=0; i<2; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=out[i]<<5;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class DivPlatformK007232: public DivDispatch, public k007232_intf {
|
|||
void chWrite(unsigned char ch, unsigned int addr, unsigned char val);
|
||||
public:
|
||||
u8 read_sample(u8 ne, u32 address);
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -130,7 +130,7 @@ const char** DivPlatformLynx::getRegisterSheet() {
|
|||
return regCheatSheetLynx;
|
||||
}
|
||||
|
||||
void DivPlatformLynx::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformLynx::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
for (int i=0; i<4; i++) {
|
||||
if (chan[i].pcm && chan[i].sample>=0 && chan[i].sample<parent->song.sampleLen) {
|
||||
|
|
|
@ -68,7 +68,7 @@ class DivPlatformLynx: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -43,7 +43,7 @@ const char** DivPlatformMMC5::getRegisterSheet() {
|
|||
return regCheatSheetMMC5;
|
||||
}
|
||||
|
||||
void DivPlatformMMC5::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformMMC5::acquire(short** buf, size_t len) {
|
||||
for (size_t i=start; i<start+len; i++) {
|
||||
if (dacSample!=-1) {
|
||||
dacPeriod+=dacRate;
|
||||
|
@ -81,7 +81,7 @@ void DivPlatformMMC5::acquire(short* bufL, short* bufR, size_t start, size_t len
|
|||
}
|
||||
if (sample>32767) sample=32767;
|
||||
if (sample<-32768) sample=-32768;
|
||||
bufL[i]=sample;
|
||||
buf[0][i]=sample;
|
||||
|
||||
if (++writeOscBuf>=32) {
|
||||
writeOscBuf=0;
|
||||
|
|
|
@ -50,7 +50,7 @@ class DivPlatformMMC5: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -45,7 +45,7 @@ const char** DivPlatformMSM5232::getRegisterSheet() {
|
|||
return regCheatSheetMSM5232;
|
||||
}
|
||||
|
||||
void DivPlatformMSM5232::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformMSM5232::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
while (!writes.empty()) {
|
||||
QueuedWrite w=writes.front();
|
||||
|
@ -75,9 +75,9 @@ void DivPlatformMSM5232::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
}
|
||||
|
||||
//printf("tempL: %d tempR: %d\n",tempL,tempR);
|
||||
bufL[h]=0;
|
||||
buf[0][h]=0;
|
||||
for (int i=0; i<8; i++) {
|
||||
bufL[h]+=(temp[i]*partVolume[i])>>8;
|
||||
buf[0][h]+=(temp[i]*partVolume[i])>>8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class DivPlatformMSM5232: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -30,7 +30,7 @@ const char** DivPlatformMSM6258::getRegisterSheet() {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void DivPlatformMSM6258::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformMSM6258::acquire(short** buf, size_t len) {
|
||||
short* outs[2]={
|
||||
&msmOut,
|
||||
NULL
|
||||
|
@ -78,12 +78,12 @@ void DivPlatformMSM6258::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
}
|
||||
|
||||
if (isMuted[0]) {
|
||||
bufL[h]=0;
|
||||
bufR[h]=0;
|
||||
buf[0][h]=0;
|
||||
buf[1][h]=0;
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=0;
|
||||
} else {
|
||||
bufL[h]=(msmPan&2)?msmOut:0;
|
||||
bufR[h]=(msmPan&1)?msmOut:0;
|
||||
buf[0][h]=(msmPan&2)?msmOut:0;
|
||||
buf[1][h]=(msmPan&1)?msmOut:0;
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=msmPan?msmOut:0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ class DivPlatformMSM6258: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -37,7 +37,7 @@ u8 DivPlatformMSM6295::read_byte(u32 address) {
|
|||
return adpcmMem[address&0x3ffff];
|
||||
}
|
||||
|
||||
void DivPlatformMSM6295::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformMSM6295::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
if (delay<=0) {
|
||||
if (!writes.empty()) {
|
||||
|
@ -75,7 +75,7 @@ void DivPlatformMSM6295::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
msm.tick();
|
||||
msm.tick();
|
||||
|
||||
bufL[h]=msm.out()<<4;
|
||||
buf[0][h]=msm.out()<<4;
|
||||
|
||||
if (++updateOsc>=22) {
|
||||
updateOsc=0;
|
||||
|
|
|
@ -64,7 +64,7 @@ class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf {
|
|||
|
||||
public:
|
||||
virtual u8 read_byte(u32 address) override;
|
||||
virtual void acquire(short* bufL, short* bufR, size_t start, size_t len) override;
|
||||
virtual void acquire(short** buf, size_t len) override;
|
||||
virtual int dispatch(DivCommand c) override;
|
||||
virtual void* getChanState(int chan) override;
|
||||
virtual DivMacroInt* getChanMacroInt(int ch) override;
|
||||
|
|
|
@ -108,13 +108,13 @@ const char** DivPlatformN163::getRegisterSheet() {
|
|||
return regCheatSheetN163;
|
||||
}
|
||||
|
||||
void DivPlatformN163::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformN163::acquire(short** buf, size_t len) {
|
||||
for (size_t i=start; i<start+len; i++) {
|
||||
n163.tick();
|
||||
int out=(n163.out()<<6)*2; // scale to 16 bit
|
||||
if (out>32767) out=32767;
|
||||
if (out<-32768) out=-32768;
|
||||
bufL[i]=bufR[i]=out;
|
||||
buf[0][i]=buf[1][i]=out;
|
||||
|
||||
if (n163.voice_cycle()==0x78) for (int i=0; i<8; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=n163.voice_out(i)<<7;
|
||||
|
|
|
@ -74,7 +74,7 @@ class DivPlatformN163: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -151,7 +151,7 @@ const char** DivPlatformNamcoWSG::getRegisterSheet() {
|
|||
return regCheatSheetNamcoWSG;
|
||||
}
|
||||
|
||||
void DivPlatformNamcoWSG::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformNamcoWSG::acquire(short** buf, size_t len) {
|
||||
while (!writes.empty()) {
|
||||
QueuedWrite w=writes.front();
|
||||
switch (devType) {
|
||||
|
|
|
@ -54,7 +54,7 @@ class DivPlatformNamcoWSG: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -112,7 +112,7 @@ void DivPlatformNES::acquire_puNES(short* bufL, short* bufR, size_t start, size_
|
|||
int sample=(pulse_output(nes)+tnd_output(nes))<<6;
|
||||
if (sample>32767) sample=32767;
|
||||
if (sample<-32768) sample=-32768;
|
||||
bufL[i]=sample;
|
||||
buf[0][i]=sample;
|
||||
if (++writeOscBuf>=32) {
|
||||
writeOscBuf=0;
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=isMuted[0]?0:(nes->S1.output<<11);
|
||||
|
@ -139,7 +139,7 @@ void DivPlatformNES::acquire_NSFPlay(short* bufL, short* bufR, size_t start, siz
|
|||
int sample=(out1[0]+out1[1]+out2[0]+out2[1])<<1;
|
||||
if (sample>32767) sample=32767;
|
||||
if (sample<-32768) sample=-32768;
|
||||
bufL[i]=sample;
|
||||
buf[0][i]=sample;
|
||||
if (++writeOscBuf>=32) {
|
||||
writeOscBuf=0;
|
||||
oscBuf[0]->data[oscBuf[0]->needle++]=nes1_NP->out[0]<<11;
|
||||
|
@ -151,7 +151,7 @@ void DivPlatformNES::acquire_NSFPlay(short* bufL, short* bufR, size_t start, siz
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformNES::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformNES::acquire(short** buf, size_t len) {
|
||||
if (useNP) {
|
||||
acquire_NSFPlay(bufL,bufR,start,len);
|
||||
} else {
|
||||
|
|
|
@ -72,7 +72,7 @@ class DivPlatformNES: public DivDispatch {
|
|||
void acquire_NSFPlay(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -255,14 +255,14 @@ void DivPlatformOPL::acquire_nuked(short* bufL, short* bufR, size_t start, size_
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
buf[0][h]=os[0];
|
||||
if (oplType==3 || oplType==759) {
|
||||
bufR[h]=os[1];
|
||||
buf[1][h]=os[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformOPL::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformOPL::acquire(short** buf, size_t len) {
|
||||
//if (useYMFM) {
|
||||
// acquire_ymfm(bufL,bufR,start,len);
|
||||
//} else {
|
||||
|
|
|
@ -108,7 +108,7 @@ class DivPlatformOPL: public DivDispatch {
|
|||
//void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -83,14 +83,14 @@ void DivPlatformOPLL::acquire_nuked(short* bufL, short* bufR, size_t start, size
|
|||
os*=50;
|
||||
if (os<-32768) os=-32768;
|
||||
if (os>32767) os=32767;
|
||||
bufL[h]=os;
|
||||
buf[0][h]=os;
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformOPLL::acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
}
|
||||
|
||||
void DivPlatformOPLL::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformOPLL::acquire(short** buf, size_t len) {
|
||||
acquire_nuked(bufL,bufR,start,len);
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ class DivPlatformOPLL: public DivDispatch {
|
|||
void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -53,7 +53,7 @@ const char** DivPlatformPCE::getRegisterSheet() {
|
|||
return regCheatSheetPCE;
|
||||
}
|
||||
|
||||
void DivPlatformPCE::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformPCE::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
// PCM part
|
||||
for (int i=0; i<6; i++) {
|
||||
|
@ -113,8 +113,8 @@ void DivPlatformPCE::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
if (tempR[0]>32767) tempR[0]=32767;
|
||||
|
||||
//printf("tempL: %d tempR: %d\n",tempL,tempR);
|
||||
bufL[h]=tempL[0];
|
||||
bufR[h]=tempR[0];
|
||||
buf[0][h]=tempL[0];
|
||||
buf[1][h]=tempR[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ class DivPlatformPCE: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
// to ease the driver, freqency register is a 8.16 counter relative to output sample rate
|
||||
#define CHIP_FREQBASE 65536
|
||||
|
||||
void DivPlatformPCMDAC::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformPCMDAC::acquire(short** buf, size_t len) {
|
||||
const int depthScale=(15-outDepth);
|
||||
int output=0;
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
if (!chan[0].active || isMuted) {
|
||||
bufL[h]=0;
|
||||
bufR[h]=0;
|
||||
buf[0][h]=0;
|
||||
buf[1][h]=0;
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
continue;
|
||||
}
|
||||
|
@ -157,12 +157,12 @@ void DivPlatformPCMDAC::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
output=output*chan[0].vol*chan[0].envVol/16384;
|
||||
oscBuf->data[oscBuf->needle++]=output;
|
||||
if (outStereo) {
|
||||
bufL[h]=((output*chan[0].panL)>>(depthScale+8))<<depthScale;
|
||||
bufR[h]=((output*chan[0].panR)>>(depthScale+8))<<depthScale;
|
||||
buf[0][h]=((output*chan[0].panL)>>(depthScale+8))<<depthScale;
|
||||
buf[1][h]=((output*chan[0].panR)>>(depthScale+8))<<depthScale;
|
||||
} else {
|
||||
output=(output>>depthScale)<<depthScale;
|
||||
bufL[h]=output;
|
||||
bufR[h]=output;
|
||||
buf[0][h]=output;
|
||||
buf[1][h]=output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ class DivPlatformPCMDAC: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
@ -207,10 +207,10 @@ void DivPlatformPCSpeaker::acquire_unfilt(short* bufL, short* bufR, size_t start
|
|||
}
|
||||
}
|
||||
out=(pos>(freq>>1) && !isMuted[0])?32767:0;
|
||||
bufL[i]=out;
|
||||
buf[0][i]=out;
|
||||
oscBuf->data[oscBuf->needle++]=out;
|
||||
} else {
|
||||
bufL[i]=0;
|
||||
buf[0][i]=0;
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
}
|
||||
}
|
||||
|
@ -234,10 +234,10 @@ void DivPlatformPCSpeaker::acquire_cone(short* bufL, short* bufR, size_t start,
|
|||
float out=(low+band)*0.75;
|
||||
if (out>1.0) out=1.0;
|
||||
if (out<-1.0) out=-1.0;
|
||||
bufL[i]=out*32767;
|
||||
buf[0][i]=out*32767;
|
||||
oscBuf->data[oscBuf->needle++]=out*32767;
|
||||
} else {
|
||||
bufL[i]=0;
|
||||
buf[0][i]=0;
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
}
|
||||
}
|
||||
|
@ -261,10 +261,10 @@ void DivPlatformPCSpeaker::acquire_piezo(short* bufL, short* bufR, size_t start,
|
|||
float out=band*0.15-(next-low)*0.06;
|
||||
if (out>1.0) out=1.0;
|
||||
if (out<-1.0) out=-1.0;
|
||||
bufL[i]=out*32767;
|
||||
buf[0][i]=out*32767;
|
||||
oscBuf->data[oscBuf->needle++]=out*32767;
|
||||
} else {
|
||||
bufL[i]=0;
|
||||
buf[0][i]=0;
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
}
|
||||
}
|
||||
|
@ -317,11 +317,11 @@ void DivPlatformPCSpeaker::acquire_real(short* bufL, short* bufR, size_t start,
|
|||
} else {
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
}
|
||||
bufL[i]=0;
|
||||
buf[0][i]=0;
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformPCSpeaker::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformPCSpeaker::acquire(short** buf, size_t len) {
|
||||
switch (speakerType) {
|
||||
case 0:
|
||||
acquire_unfilt(bufL,bufR,start,len);
|
||||
|
|
|
@ -68,7 +68,7 @@ class DivPlatformPCSpeaker: public DivDispatch {
|
|||
|
||||
public:
|
||||
void pcSpeakerThread();
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -55,7 +55,7 @@ void DivPlatformPET::rWrite(unsigned int addr, unsigned char val) {
|
|||
regPool[addr]=val;
|
||||
}
|
||||
|
||||
void DivPlatformPET::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformPET::acquire(short** buf, size_t len) {
|
||||
bool hwSROutput=((regPool[11]>>2)&7)==4;
|
||||
if (chan[0].enable) {
|
||||
int reload=regPool[8]*2+4;
|
||||
|
@ -70,8 +70,8 @@ void DivPlatformPET::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
} else {
|
||||
chan[0].cnt-=SAMP_DIVIDER;
|
||||
}
|
||||
bufL[h]=chan[0].out;
|
||||
bufR[h]=chan[0].out;
|
||||
buf[0][h]=chan[0].out;
|
||||
buf[1][h]=chan[0].out;
|
||||
oscBuf->data[oscBuf->needle++]=chan[0].out;
|
||||
}
|
||||
// emulate driver writes to PCR
|
||||
|
@ -79,8 +79,8 @@ void DivPlatformPET::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
} else {
|
||||
chan[0].out=0;
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
bufL[h]=0;
|
||||
bufR[h]=0;
|
||||
buf[0][h]=0;
|
||||
buf[1][h]=0;
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class DivPlatformPET: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -86,7 +86,7 @@ void DivPlatformPokeMini::rWrite(unsigned char addr, unsigned char val) {
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformPokeMini::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformPokeMini::acquire(short** buf, size_t len) {
|
||||
int out=0;
|
||||
for (size_t i=start; i<start+len; i++) {
|
||||
for (int j=0; j<PCSPKR_DIVIDER; j++) {
|
||||
|
@ -102,10 +102,10 @@ void DivPlatformPokeMini::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
}
|
||||
if (on) {
|
||||
out=(pos>=pivot && !isMuted[0])?volTable[vol&3]:0;
|
||||
bufL[i]=out;
|
||||
buf[0][i]=out;
|
||||
oscBuf->data[oscBuf->needle++]=out;
|
||||
} else {
|
||||
bufL[i]=0;
|
||||
buf[0][i]=0;
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class DivPlatformPokeMini: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -64,7 +64,7 @@ const char** DivPlatformPOKEY::getRegisterSheet() {
|
|||
return regCheatSheetPOKEY;
|
||||
}
|
||||
|
||||
void DivPlatformPOKEY::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformPOKEY::acquire(short** buf, size_t len) {
|
||||
if (useAltASAP) {
|
||||
acquireASAP(bufL, start, len);
|
||||
} else {
|
||||
|
|
|
@ -58,7 +58,7 @@ class DivPlatformPOKEY: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
void acquireMZ(short* buf, size_t start, size_t len);
|
||||
void acquireASAP(short* buf, size_t start, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#define CHIP_DIVIDER 1024
|
||||
|
||||
void DivPlatformPong::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformPong::acquire(short** buf, size_t len) {
|
||||
int out=0;
|
||||
for (size_t i=start; i<start+len; i++) {
|
||||
if (on) {
|
||||
|
@ -32,10 +32,10 @@ void DivPlatformPong::acquire(short* bufL, short* bufR, size_t start, size_t len
|
|||
flip=!flip;
|
||||
}
|
||||
out=(flip && !isMuted[0])?32767:0;
|
||||
bufL[i]=out;
|
||||
buf[0][i]=out;
|
||||
oscBuf->data[oscBuf->needle++]=out;
|
||||
} else {
|
||||
bufL[i]=0;
|
||||
buf[0][i]=0;
|
||||
oscBuf->data[oscBuf->needle++]=0;
|
||||
flip=false;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class DivPlatformPong: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -265,11 +265,11 @@ const char** DivPlatformQSound::getRegisterSheet() {
|
|||
return regCheatSheetQSound;
|
||||
}
|
||||
|
||||
void DivPlatformQSound::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformQSound::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
qsound_update(&chip);
|
||||
bufL[h]=chip.out[0];
|
||||
bufR[h]=chip.out[1];
|
||||
buf[0][h]=chip.out[0];
|
||||
buf[1][h]=chip.out[1];
|
||||
|
||||
for (int i=0; i<19; i++) {
|
||||
int data=chip.voice_output[i]<<2;
|
||||
|
|
|
@ -62,7 +62,7 @@ class DivPlatformQSound: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -54,7 +54,7 @@ void DivPlatformRF5C68::chWrite(unsigned char ch, unsigned int addr, unsigned ch
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformRF5C68::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformRF5C68::acquire(short** buf, size_t len) {
|
||||
short buf[16][256];
|
||||
short* chBufPtrs[16]={
|
||||
buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6],buf[7],
|
||||
|
@ -68,7 +68,7 @@ void DivPlatformRF5C68::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
|
||||
while (len > 0) {
|
||||
size_t blockLen=MIN(len,256);
|
||||
short* bufPtrs[2]={&bufL[pos],&bufR[pos]};
|
||||
short* bufPtrs[2]={&buf[0][pos],&buf[1][pos]};
|
||||
rf5c68.sound_stream_update(bufPtrs,chBufPtrs,blockLen);
|
||||
for (int i=0; i<8; i++) {
|
||||
for (size_t j=0; j<blockLen; j++) {
|
||||
|
|
|
@ -56,7 +56,7 @@ class DivPlatformRF5C68: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -73,18 +73,18 @@ void DivPlatformSAA1099::acquire_saaSound(short* bufL, short* bufR, size_t start
|
|||
saa_saaSound->GenerateMany((unsigned char*)saaBuf[0],len,oscBuf);
|
||||
#ifdef TA_BIG_ENDIAN
|
||||
for (size_t i=0; i<len; i++) {
|
||||
bufL[i+start]=(short)((((unsigned short)saaBuf[0][1+(i<<1)])<<8)|(((unsigned short)saaBuf[0][1+(i<<1)])>>8));
|
||||
bufR[i+start]=(short)((((unsigned short)saaBuf[0][i<<1])<<8)|(((unsigned short)saaBuf[0][i<<1])>>8));
|
||||
buf[0][i+start]=(short)((((unsigned short)saaBuf[0][1+(i<<1)])<<8)|(((unsigned short)saaBuf[0][1+(i<<1)])>>8));
|
||||
buf[1][i+start]=(short)((((unsigned short)saaBuf[0][i<<1])<<8)|(((unsigned short)saaBuf[0][i<<1])>>8));
|
||||
}
|
||||
#else
|
||||
for (size_t i=0; i<len; i++) {
|
||||
bufL[i+start]=saaBuf[0][i<<1];
|
||||
bufR[i+start]=saaBuf[0][1+(i<<1)];
|
||||
buf[0][i+start]=saaBuf[0][i<<1];
|
||||
buf[1][i+start]=saaBuf[0][1+(i<<1)];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void DivPlatformSAA1099::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformSAA1099::acquire(short** buf, size_t len) {
|
||||
acquire_saaSound(bufL,bufR,start,len);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ class DivPlatformSAA1099: public DivDispatch {
|
|||
void acquire_saaSound(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -80,13 +80,13 @@ const char** DivPlatformSCC::getRegisterSheet() {
|
|||
return isPlus ? regCheatSheetSCCPlus : regCheatSheetSCC;
|
||||
}
|
||||
|
||||
void DivPlatformSCC::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformSCC::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
for (int i=0; i<16; i++) {
|
||||
scc->tick();
|
||||
}
|
||||
short out=(short)scc->out()<<5;
|
||||
bufL[h]=bufR[h]=out;
|
||||
buf[0][h]=buf[1][h]=out;
|
||||
|
||||
for (int i=0; i<5; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=scc->voice_out(i)<<7;
|
||||
|
|
|
@ -50,7 +50,7 @@ class DivPlatformSCC: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
//#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
||||
//#define immWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
||||
|
||||
void DivPlatformSegaPCM::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformSegaPCM::acquire(short** buf, size_t len) {
|
||||
static int os[2];
|
||||
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
|
@ -67,8 +67,8 @@ void DivPlatformSegaPCM::acquire(short* bufL, short* bufR, size_t start, size_t
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class DivPlatformSegaPCM: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -73,8 +73,8 @@ void DivPlatformSMS::acquire_nuked(short* bufL, short* bufR, size_t start, size_
|
|||
if (oL>32767) oL=32767;
|
||||
if (oR<-32768) oR=-32768;
|
||||
if (oR>32767) oR=32767;
|
||||
bufL[h]=oL;
|
||||
bufR[h]=oR;
|
||||
buf[0][h]=oL;
|
||||
buf[1][h]=oR;
|
||||
for (int i=0; i<4; i++) {
|
||||
if (isMuted[i]) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=0;
|
||||
|
@ -97,8 +97,8 @@ void DivPlatformSMS::acquire_mame(short* bufL, short* bufR, size_t start, size_t
|
|||
}
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
short* outs[2]={
|
||||
&bufL[h],
|
||||
&bufR[h]
|
||||
&buf[0][h],
|
||||
&buf[1][h]
|
||||
};
|
||||
sn->sound_stream_update(outs,1);
|
||||
for (int i=0; i<4; i++) {
|
||||
|
@ -111,7 +111,7 @@ void DivPlatformSMS::acquire_mame(short* bufL, short* bufR, size_t start, size_t
|
|||
}
|
||||
}
|
||||
|
||||
void DivPlatformSMS::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformSMS::acquire(short** buf, size_t len) {
|
||||
if (nuked) {
|
||||
acquire_nuked(bufL,bufR,start,len);
|
||||
} else {
|
||||
|
|
|
@ -69,7 +69,7 @@ class DivPlatformSMS: public DivDispatch {
|
|||
void acquire_nuked(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);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -65,7 +65,7 @@ const char** DivPlatformSNES::getRegisterSheet() {
|
|||
return regCheatSheetSNESDSP;
|
||||
}
|
||||
|
||||
void DivPlatformSNES::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformSNES::acquire(short** buf, size_t len) {
|
||||
short out[2];
|
||||
short chOut[16];
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
|
@ -82,8 +82,8 @@ void DivPlatformSNES::acquire(short* bufL, short* bufR, size_t start, size_t len
|
|||
dsp.set_output(out,1);
|
||||
dsp.run(32);
|
||||
dsp.get_voice_outputs(chOut);
|
||||
bufL[h]=out[0];
|
||||
bufR[h]=out[1];
|
||||
buf[0][h]=out[0];
|
||||
buf[1][h]=out[1];
|
||||
for (int i=0; i<8; i++) {
|
||||
int next=(3*(chOut[i*2]+chOut[i*2+1]))>>2;
|
||||
if (next<-32768) next=-32768;
|
||||
|
|
|
@ -93,7 +93,7 @@ class DivPlatformSNES: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -40,14 +40,14 @@ double DivPlatformSoundUnit::NOTE_SU(int ch, int note) {
|
|||
return NOTE_FREQUENCY(note);
|
||||
}
|
||||
|
||||
void DivPlatformSoundUnit::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformSoundUnit::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
while (!writes.empty()) {
|
||||
QueuedWrite w=writes.front();
|
||||
su->Write(w.addr,w.val);
|
||||
writes.pop();
|
||||
}
|
||||
su->NextSample(&bufL[h],&bufR[h]);
|
||||
su->NextSample(&buf[0][h],&buf[1][h]);
|
||||
for (int i=0; i<8; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=su->GetSample(i);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class DivPlatformSoundUnit: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -50,7 +50,7 @@ const char** DivPlatformSwan::getRegisterSheet() {
|
|||
return regCheatSheetWS;
|
||||
}
|
||||
|
||||
void DivPlatformSwan::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformSwan::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
// PCM part
|
||||
if (pcm && dacSample!=-1) {
|
||||
|
@ -83,8 +83,8 @@ void DivPlatformSwan::acquire(short* bufL, short* bufR, size_t start, size_t len
|
|||
int16_t samp[2]{0, 0};
|
||||
ws->SoundUpdate(16);
|
||||
ws->SoundFlush(samp, 1);
|
||||
bufL[h]=samp[0];
|
||||
bufR[h]=samp[1];
|
||||
buf[0][h]=samp[0];
|
||||
buf[1][h]=samp[1];
|
||||
for (int i=0; i<4; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(ws->sample_cache[i][0]+ws->sample_cache[i][1])<<6;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ class DivPlatformSwan: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -35,7 +35,7 @@ const char** DivPlatformT6W28::getRegisterSheet() {
|
|||
return regCheatSheetT6W28;
|
||||
}
|
||||
|
||||
void DivPlatformT6W28::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformT6W28::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
cycles=0;
|
||||
while (!writes.empty() && cycles<16) {
|
||||
|
@ -64,8 +64,8 @@ void DivPlatformT6W28::acquire(short* bufL, short* bufR, size_t start, size_t le
|
|||
if (tempR<-32768) tempR=-32768;
|
||||
if (tempR>32767) tempR=32767;
|
||||
|
||||
bufL[h]=tempL;
|
||||
bufR[h]=tempR;
|
||||
buf[0][h]=tempL;
|
||||
buf[1][h]=tempR;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ class DivPlatformT6W28: public DivDispatch {
|
|||
|
||||
void writeOutVol(int ch);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -38,16 +38,16 @@ const char** DivPlatformTIA::getRegisterSheet() {
|
|||
return regCheatSheetTIA;
|
||||
}
|
||||
|
||||
void DivPlatformTIA::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformTIA::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
tia.tick();
|
||||
if (mixingType==2) {
|
||||
bufL[h]=tia.myCurrentSample[0];
|
||||
bufR[h]=tia.myCurrentSample[1];
|
||||
buf[0][h]=tia.myCurrentSample[0];
|
||||
buf[1][h]=tia.myCurrentSample[1];
|
||||
} else if (mixingType==1) {
|
||||
bufL[h]=(tia.myCurrentSample[0]+tia.myCurrentSample[1])>>1;
|
||||
buf[0][h]=(tia.myCurrentSample[0]+tia.myCurrentSample[1])>>1;
|
||||
} else {
|
||||
bufL[h]=tia.myCurrentSample[0];
|
||||
buf[0][h]=tia.myCurrentSample[0];
|
||||
}
|
||||
if (++chanOscCounter>=114) {
|
||||
chanOscCounter=0;
|
||||
|
|
|
@ -45,7 +45,7 @@ class DivPlatformTIA: public DivDispatch {
|
|||
unsigned char dealWithFreq(unsigned char shape, int base, int pitch);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -55,7 +55,7 @@ const char** DivPlatformTX81Z::getRegisterSheet() {
|
|||
return regCheatSheetOPZ;
|
||||
}
|
||||
|
||||
void DivPlatformTX81Z::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformTX81Z::acquire(short** buf, size_t len) {
|
||||
static int os[2];
|
||||
|
||||
ymfm::ym2414::fm_engine* fme=fm_ymfm->debug_engine();
|
||||
|
@ -87,8 +87,8 @@ void DivPlatformTX81Z::acquire(short* bufL, short* bufR, size_t start, size_t le
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class DivPlatformTX81Z: public DivPlatformOPM {
|
|||
|
||||
friend void putDispatchChip(void*,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -93,7 +93,7 @@ const char** DivPlatformVB::getRegisterSheet() {
|
|||
return regCheatSheetVB;
|
||||
}
|
||||
|
||||
void DivPlatformVB::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformVB::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
cycles=0;
|
||||
while (!writes.empty()) {
|
||||
|
@ -117,8 +117,8 @@ void DivPlatformVB::acquire(short* bufL, short* bufR, size_t start, size_t len)
|
|||
if (tempR<-32768) tempR=-32768;
|
||||
if (tempR>32767) tempR=32767;
|
||||
|
||||
bufL[h]=tempL;
|
||||
bufR[h]=tempR;
|
||||
buf[0][h]=tempL;
|
||||
buf[1][h]=tempR;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class DivPlatformVB: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -53,7 +53,7 @@ const char** DivPlatformVERA::getRegisterSheet() {
|
|||
return regCheatSheetVERA;
|
||||
}
|
||||
|
||||
void DivPlatformVERA::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformVERA::acquire(short** buf, size_t len) {
|
||||
// both PSG part and PCM part output a full 16-bit range, putting bufL/R
|
||||
// argument right into both could cause an overflow
|
||||
short buf[4][128];
|
||||
|
@ -102,8 +102,8 @@ void DivPlatformVERA::acquire(short* bufL, short* bufR, size_t start, size_t len
|
|||
pcm_render(pcm,buf[2],buf[3],curLen);
|
||||
for (int i=0; i<curLen; i++) {
|
||||
psg_render(psg,&buf[0][i],&buf[1][i],1);
|
||||
bufL[pos]=(short)(((int)buf[0][i]+buf[2][i])/2);
|
||||
bufR[pos]=(short)(((int)buf[1][i]+buf[3][i])/2);
|
||||
buf[0][pos]=(short)(((int)buf[0][i]+buf[2][i])/2);
|
||||
buf[1][pos]=(short)(((int)buf[1][i]+buf[3][i])/2);
|
||||
pos++;
|
||||
|
||||
for (int i=0; i<16; i++) {
|
||||
|
|
|
@ -60,7 +60,7 @@ class DivPlatformVERA: public DivDispatch {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -39,7 +39,7 @@ const char** DivPlatformVIC20::getRegisterSheet() {
|
|||
return regCheatSheetVIC;
|
||||
}
|
||||
|
||||
void DivPlatformVIC20::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformVIC20::acquire(short** buf, size_t len) {
|
||||
const unsigned char loadFreq[3] = {0x7e, 0x7d, 0x7b};
|
||||
const unsigned char wavePatterns[16] = {
|
||||
0b0, 0b10, 0b100, 0b110, 0b1000, 0b1010, 0b1011, 0b1110,
|
||||
|
@ -66,8 +66,8 @@ void DivPlatformVIC20::acquire(short* bufL, short* bufR, size_t start, size_t le
|
|||
}
|
||||
short samp;
|
||||
vic_sound_machine_calculate_samples(vic,&samp,1,1,0,SAMP_DIVIDER);
|
||||
bufL[h]=samp;
|
||||
bufR[h]=samp;
|
||||
buf[0][h]=samp;
|
||||
buf[1][h]=samp;
|
||||
for (int i=0; i<4; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=vic->ch[i].out?(vic->volume<<11):0;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class DivPlatformVIC20: public DivDispatch {
|
|||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -46,7 +46,7 @@ const char** DivPlatformVRC6::getRegisterSheet() {
|
|||
return regCheatSheetVRC6;
|
||||
}
|
||||
|
||||
void DivPlatformVRC6::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformVRC6::acquire(short** buf, size_t len) {
|
||||
for (size_t i=start; i<start+len; i++) {
|
||||
// PCM part
|
||||
for (int i=0; i<2; i++) {
|
||||
|
@ -81,7 +81,7 @@ void DivPlatformVRC6::acquire(short* bufL, short* bufR, size_t start, size_t len
|
|||
int sample=vrc6.out()<<9; // scale to 16 bit
|
||||
if (sample>32767) sample=32767;
|
||||
if (sample<-32768) sample=-32768;
|
||||
bufL[i]=bufR[i]=sample;
|
||||
buf[0][i]=buf[1][i]=sample;
|
||||
|
||||
// Oscilloscope buffer part
|
||||
if (++writeOscBuf>=32) {
|
||||
|
|
|
@ -61,7 +61,7 @@ class DivPlatformVRC6: public DivDispatch, public vrcvi_intf {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -205,7 +205,7 @@ const char** DivPlatformX1_010::getRegisterSheet() {
|
|||
return regCheatSheetX1_010;
|
||||
}
|
||||
|
||||
void DivPlatformX1_010::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformX1_010::acquire(short** buf, size_t len) {
|
||||
for (size_t h=start; h<start+len; h++) {
|
||||
x1_010.tick();
|
||||
|
||||
|
@ -218,8 +218,8 @@ void DivPlatformX1_010::acquire(short* bufL, short* bufR, size_t start, size_t l
|
|||
if (tempR>32767) tempR=32767;
|
||||
|
||||
//printf("tempL: %d tempR: %d\n",tempL,tempR);
|
||||
bufL[h]=stereo?tempL:((tempL+tempR)>>1);
|
||||
bufR[h]=stereo?tempR:bufL[h];
|
||||
buf[0][h]=stereo?tempL:((tempL+tempR)>>1);
|
||||
buf[1][h]=stereo?tempR:buf[0][h];
|
||||
|
||||
for (int i=0; i<16; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(x1_010.voice_out(i,0)+x1_010.voice_out(i,1))>>1;
|
||||
|
|
|
@ -127,7 +127,7 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf {
|
|||
friend void putDispatchChan(void*,int,int);
|
||||
public:
|
||||
u8 read_byte(u32 address);
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -156,7 +156,7 @@ const char** DivPlatformYM2203::getRegisterSheet() {
|
|||
return regCheatSheetYM2203;
|
||||
}
|
||||
|
||||
void DivPlatformYM2203::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformYM2203::acquire(short** buf, size_t len) {
|
||||
if (useCombo) {
|
||||
acquire_combo(bufL,bufR,start,len);
|
||||
} else {
|
||||
|
@ -218,7 +218,7 @@ void DivPlatformYM2203::acquire_combo(short* bufL, short* bufR, size_t start, si
|
|||
if (os<-32768) os=-32768;
|
||||
if (os>32767) os=32767;
|
||||
|
||||
bufL[h]=os;
|
||||
buf[0][h]=os;
|
||||
|
||||
for (int i=0; i<3; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=fm_nuked.ch_out[i];
|
||||
|
@ -259,7 +259,7 @@ void DivPlatformYM2203::acquire_ymfm(short* bufL, short* bufR, size_t start, siz
|
|||
if (os<-32768) os=-32768;
|
||||
if (os>32767) os=32767;
|
||||
|
||||
bufL[h]=os;
|
||||
buf[0][h]=os;
|
||||
|
||||
|
||||
for (int i=0; i<3; i++) {
|
||||
|
|
|
@ -59,7 +59,7 @@ class DivPlatformYM2203: public DivPlatformOPN {
|
|||
void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -297,7 +297,7 @@ double DivPlatformYM2608::NOTE_ADPCMB(int note) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void DivPlatformYM2608::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformYM2608::acquire(short** buf, size_t len) {
|
||||
if (useCombo) {
|
||||
acquire_combo(bufL,bufR,start,len);
|
||||
} else {
|
||||
|
@ -386,8 +386,8 @@ void DivPlatformYM2608::acquire_combo(short* bufL, short* bufR, size_t start, si
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
|
@ -447,8 +447,8 @@ void DivPlatformYM2608::acquire_ymfm(short* bufL, short* bufR, size_t start, siz
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
|
||||
for (int i=0; i<6; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1));
|
||||
|
|
|
@ -74,7 +74,7 @@ class DivPlatformYM2608: public DivPlatformOPN {
|
|||
void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -232,7 +232,7 @@ const char** DivPlatformYM2610::getRegisterSheet() {
|
|||
return regCheatSheetYM2610;
|
||||
}
|
||||
|
||||
void DivPlatformYM2610::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformYM2610::acquire(short** buf, size_t len) {
|
||||
if (useCombo) {
|
||||
acquire_combo(bufL,bufR,start,len);
|
||||
} else {
|
||||
|
@ -317,8 +317,8 @@ void DivPlatformYM2610::acquire_combo(short* bufL, short* bufR, size_t start, si
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
|
@ -380,8 +380,8 @@ void DivPlatformYM2610::acquire_ymfm(short* bufL, short* bufR, size_t start, siz
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1));
|
||||
|
|
|
@ -42,7 +42,7 @@ class DivPlatformYM2610: public DivPlatformYM2610Base {
|
|||
void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
|
@ -296,7 +296,7 @@ const char** DivPlatformYM2610B::getRegisterSheet() {
|
|||
return regCheatSheetYM2610B;
|
||||
}
|
||||
|
||||
void DivPlatformYM2610B::acquire(short* bufL, short* bufR, size_t start, size_t len) {
|
||||
void DivPlatformYM2610B::acquire(short** buf, size_t len) {
|
||||
if (useCombo) {
|
||||
acquire_combo(bufL,bufR,start,len);
|
||||
} else {
|
||||
|
@ -385,8 +385,8 @@ void DivPlatformYM2610B::acquire_combo(short* bufL, short* bufR, size_t start, s
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
|
@ -446,8 +446,8 @@ void DivPlatformYM2610B::acquire_ymfm(short* bufL, short* bufR, size_t start, si
|
|||
if (os[1]<-32768) os[1]=-32768;
|
||||
if (os[1]>32767) os[1]=32767;
|
||||
|
||||
bufL[h]=os[0];
|
||||
bufR[h]=os[1];
|
||||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
|
||||
|
||||
for (int i=0; i<psgChanOffs; i++) {
|
||||
|
|
|
@ -38,7 +38,7 @@ class DivPlatformYM2610B: public DivPlatformYM2610Base {
|
|||
void acquire_ymfm(short* bufL, short* bufR, size_t start, size_t len);
|
||||
|
||||
public:
|
||||
void acquire(short* bufL, short* bufR, size_t start, size_t len);
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue