From 3e0dcbb0ae7db50bd60e31950cc05fb2ef3ee392 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 2 Jan 2023 04:53:37 -0500 Subject: [PATCH] aaaaaaaa --- src/engine/platform/amiga.cpp | 8 ++++---- src/engine/platform/amiga.h | 2 +- src/engine/platform/arcade.cpp | 14 +++++++------- src/engine/platform/arcade.h | 2 +- src/engine/platform/ay.cpp | 14 +++++++------- src/engine/platform/ay.h | 2 +- src/engine/platform/ay8930.cpp | 10 +++++----- src/engine/platform/ay8930.h | 2 +- src/engine/platform/bubsyswsg.cpp | 6 +++--- src/engine/platform/bubsyswsg.h | 2 +- src/engine/platform/c64.cpp | 8 ++++---- src/engine/platform/c64.h | 2 +- src/engine/platform/dummy.cpp | 6 +++--- src/engine/platform/dummy.h | 2 +- src/engine/platform/fds.cpp | 6 +++--- src/engine/platform/fds.h | 2 +- src/engine/platform/ga20.cpp | 4 ++-- src/engine/platform/ga20.h | 2 +- src/engine/platform/gb.cpp | 6 +++--- src/engine/platform/gb.h | 2 +- src/engine/platform/genesis.cpp | 10 +++++----- src/engine/platform/genesis.h | 2 +- src/engine/platform/k007232.cpp | 8 ++++---- src/engine/platform/k007232.h | 2 +- src/engine/platform/lynx.cpp | 2 +- src/engine/platform/lynx.h | 2 +- src/engine/platform/mmc5.cpp | 4 ++-- src/engine/platform/mmc5.h | 2 +- src/engine/platform/msm5232.cpp | 6 +++--- src/engine/platform/msm5232.h | 2 +- src/engine/platform/msm6258.cpp | 10 +++++----- src/engine/platform/msm6258.h | 2 +- src/engine/platform/msm6295.cpp | 4 ++-- src/engine/platform/msm6295.h | 2 +- src/engine/platform/n163.cpp | 4 ++-- src/engine/platform/n163.h | 2 +- src/engine/platform/namcowsg.cpp | 2 +- src/engine/platform/namcowsg.h | 2 +- src/engine/platform/nes.cpp | 6 +++--- src/engine/platform/nes.h | 2 +- src/engine/platform/opl.cpp | 6 +++--- src/engine/platform/opl.h | 2 +- src/engine/platform/opll.cpp | 4 ++-- src/engine/platform/opll.h | 2 +- src/engine/platform/pce.cpp | 6 +++--- src/engine/platform/pce.h | 2 +- src/engine/platform/pcmdac.cpp | 14 +++++++------- src/engine/platform/pcmdac.h | 2 +- src/engine/platform/pcspkr.cpp | 16 ++++++++-------- src/engine/platform/pcspkr.h | 2 +- src/engine/platform/pet.cpp | 10 +++++----- src/engine/platform/pet.h | 2 +- src/engine/platform/pokemini.cpp | 6 +++--- src/engine/platform/pokemini.h | 2 +- src/engine/platform/pokey.cpp | 2 +- src/engine/platform/pokey.h | 2 +- src/engine/platform/pong.cpp | 6 +++--- src/engine/platform/pong.h | 2 +- src/engine/platform/qsound.cpp | 6 +++--- src/engine/platform/qsound.h | 2 +- src/engine/platform/rf5c68.cpp | 4 ++-- src/engine/platform/rf5c68.h | 2 +- src/engine/platform/saa.cpp | 10 +++++----- src/engine/platform/saa.h | 2 +- src/engine/platform/scc.cpp | 4 ++-- src/engine/platform/scc.h | 2 +- src/engine/platform/segapcm.cpp | 6 +++--- src/engine/platform/segapcm.h | 2 +- src/engine/platform/sms.cpp | 10 +++++----- src/engine/platform/sms.h | 2 +- src/engine/platform/snes.cpp | 6 +++--- src/engine/platform/snes.h | 2 +- src/engine/platform/su.cpp | 4 ++-- src/engine/platform/su.h | 2 +- src/engine/platform/swan.cpp | 6 +++--- src/engine/platform/swan.h | 2 +- src/engine/platform/t6w28.cpp | 6 +++--- src/engine/platform/t6w28.h | 2 +- src/engine/platform/tia.cpp | 10 +++++----- src/engine/platform/tia.h | 2 +- src/engine/platform/tx81z.cpp | 6 +++--- src/engine/platform/tx81z.h | 2 +- src/engine/platform/vb.cpp | 6 +++--- src/engine/platform/vb.h | 2 +- src/engine/platform/vera.cpp | 6 +++--- src/engine/platform/vera.h | 2 +- src/engine/platform/vic20.cpp | 6 +++--- src/engine/platform/vic20.h | 2 +- src/engine/platform/vrc6.cpp | 4 ++-- src/engine/platform/vrc6.h | 2 +- src/engine/platform/x1_010.cpp | 6 +++--- src/engine/platform/x1_010.h | 2 +- src/engine/platform/ym2203.cpp | 6 +++--- src/engine/platform/ym2203.h | 2 +- src/engine/platform/ym2608.cpp | 10 +++++----- src/engine/platform/ym2608.h | 2 +- src/engine/platform/ym2610.cpp | 10 +++++----- src/engine/platform/ym2610.h | 2 +- src/engine/platform/ym2610b.cpp | 10 +++++----- src/engine/platform/ym2610b.h | 2 +- src/engine/platform/ymz280b.cpp | 6 +++--- src/engine/platform/ymz280b.h | 2 +- src/engine/platform/zxbeeper.cpp | 6 +++--- src/engine/platform/zxbeeper.h | 2 +- 104 files changed, 233 insertions(+), 233 deletions(-) diff --git a/src/engine/platform/amiga.cpp b/src/engine/platform/amiga.cpp index 4e588e7d..6f70a310 100644 --- a/src/engine/platform/amiga.cpp +++ b/src/engine/platform/amiga.cpp @@ -75,9 +75,9 @@ const char** DivPlatformAmiga::getRegisterSheet() { if (chan[i+1].freq>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]; } } diff --git a/src/engine/platform/amiga.h b/src/engine/platform/amiga.h index c22ca1af..494b5da7 100644 --- a/src/engine/platform/amiga.h +++ b/src/engine/platform/amiga.h @@ -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); diff --git a/src/engine/platform/arcade.cpp b/src/engine/platform/arcade.cpp index 22f5c293..3912921c 100644 --- a/src/engine/platform/arcade.cpp +++ b/src/engine/platform/arcade.cpp @@ -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); } } diff --git a/src/engine/platform/arcade.h b/src/engine/platform/arcade.h index 2eb26cb7..f2ec0faf 100644 --- a/src/engine/platform/arcade.h +++ b/src/engine/platform/arcade.h @@ -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); diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index b90e0f2a..4a2a4b59 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -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 (ayBufLensound_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; diff --git a/src/engine/platform/ay.h b/src/engine/platform/ay.h index a546baa8..ad8b4625 100644 --- a/src/engine/platform/ay.h +++ b/src/engine/platform/ay.h @@ -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); diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index 032fd69e..85eca751 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -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 (ayBufLensound_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; diff --git a/src/engine/platform/ay8930.h b/src/engine/platform/ay8930.h index b89ee6f5..0e60c350 100644 --- a/src/engine/platform/ay8930.h +++ b/src/engine/platform/ay8930.h @@ -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); diff --git a/src/engine/platform/bubsyswsg.cpp b/src/engine/platform/bubsyswsg.cpp index 73fd967b..31869722 100644 --- a/src/engine/platform/bubsyswsg.cpp +++ b/src/engine/platform/bubsyswsg.cpp @@ -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; h32767) out=32767; //printf("out: %d\n",out); - bufL[h]=bufR[h]=out; + buf[0][h]=buf[1][h]=out; } } diff --git a/src/engine/platform/bubsyswsg.h b/src/engine/platform/bubsyswsg.h index 900a391a..d544c2ec 100644 --- a/src/engine/platform/bubsyswsg.h +++ b/src/engine/platform/bubsyswsg.h @@ -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); diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index 8091e179..4d1caf9a 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -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=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; diff --git a/src/engine/platform/c64.h b/src/engine/platform/c64.h index 9bdabbe4..28cf5b29 100644 --- a/src/engine/platform/c64.h +++ b/src/engine/platform/c64.h @@ -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); diff --git a/src/engine/platform/dummy.cpp b/src/engine/platform/dummy.cpp index 898809cc..28cb5d40 100644 --- a/src/engine/platform/dummy.cpp +++ b/src/engine/platform/dummy.cpp @@ -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; i32767) out=32767; - bufL[i]=out; + buf[0][i]=out; } } diff --git a/src/engine/platform/dummy.h b/src/engine/platform/dummy.h index d3a1b91e..c12d494b 100644 --- a/src/engine/platform/dummy.h +++ b/src/engine/platform/dummy.h @@ -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); diff --git a/src/engine/platform/fds.cpp b/src/engine/platform/fds.cpp index e0047ace..bdae0c19 100644 --- a/src/engine/platform/fds.cpp +++ b/src/engine/platform/fds.cpp @@ -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 { diff --git a/src/engine/platform/fds.h b/src/engine/platform/fds.h index beabb641..a6e7862e 100644 --- a/src/engine/platform/fds.h +++ b/src/engine/platform/fds.h @@ -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); diff --git a/src/engine/platform/ga20.cpp b/src/engine/platform/ga20.cpp index bb29154a..990531b3 100644 --- a/src/engine/platform/ga20.cpp +++ b/src/engine/platform/ga20.cpp @@ -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>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]; } diff --git a/src/engine/platform/ga20.h b/src/engine/platform/ga20.h index 5e64db77..9c67a9fd 100644 --- a/src/engine/platform/ga20.h +++ b/src/engine/platform/ga20.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; diff --git a/src/engine/platform/gb.cpp b/src/engine/platform/gb.cpp index 2cb64f4a..c2f301e2 100644 --- a/src/engine/platform/gb.cpp +++ b/src/engine/platform/gb.cpp @@ -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; iapu_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; diff --git a/src/engine/platform/gb.h b/src/engine/platform/gb.h index ce657fd1..8f70fecb 100644 --- a/src/engine/platform/gb.h +++ b/src/engine/platform/gb.h @@ -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); diff --git a/src/engine/platform/genesis.cpp b/src/engine/platform/genesis.cpp index 5bc33950..ca88598a 100644 --- a/src/engine/platform/genesis.cpp +++ b/src/engine/platform/genesis.cpp @@ -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 { diff --git a/src/engine/platform/genesis.h b/src/engine/platform/genesis.h index 9bde5aa3..d384111b 100644 --- a/src/engine/platform/genesis.h +++ b/src/engine/platform/genesis.h @@ -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& stream, int sRate, size_t len); int dispatch(DivCommand c); void* getChanState(int chan); diff --git a/src/engine/platform/k007232.cpp b/src/engine/platform/k007232.cpp index e4007cfd..007ed796 100644 --- a/src/engine/platform/k007232.cpp +++ b/src/engine/platform/k007232.cpp @@ -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>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; } diff --git a/src/engine/platform/k007232.h b/src/engine/platform/k007232.h index 78d0522b..8d9aeb28 100644 --- a/src/engine/platform/k007232.h +++ b/src/engine/platform/k007232.h @@ -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); diff --git a/src/engine/platform/lynx.cpp b/src/engine/platform/lynx.cpp index 978e2600..8311739c 100644 --- a/src/engine/platform/lynx.cpp +++ b/src/engine/platform/lynx.cpp @@ -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=0 && chan[i].samplesong.sampleLen) { diff --git a/src/engine/platform/lynx.h b/src/engine/platform/lynx.h index dfd89108..ec2208d3 100644 --- a/src/engine/platform/lynx.h +++ b/src/engine/platform/lynx.h @@ -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); diff --git a/src/engine/platform/mmc5.cpp b/src/engine/platform/mmc5.cpp index a00dd771..3e992068 100644 --- a/src/engine/platform/mmc5.cpp +++ b/src/engine/platform/mmc5.cpp @@ -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; i32767) sample=32767; if (sample<-32768) sample=-32768; - bufL[i]=sample; + buf[0][i]=sample; if (++writeOscBuf>=32) { writeOscBuf=0; diff --git a/src/engine/platform/mmc5.h b/src/engine/platform/mmc5.h index a3ab9053..3e83ff06 100644 --- a/src/engine/platform/mmc5.h +++ b/src/engine/platform/mmc5.h @@ -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); diff --git a/src/engine/platform/msm5232.cpp b/src/engine/platform/msm5232.cpp index 8a4e369c..1ed6e5a2 100644 --- a/src/engine/platform/msm5232.cpp +++ b/src/engine/platform/msm5232.cpp @@ -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>8; + buf[0][h]+=(temp[i]*partVolume[i])>>8; } } } diff --git a/src/engine/platform/msm5232.h b/src/engine/platform/msm5232.h index e6bfb9ff..26d2a34b 100644 --- a/src/engine/platform/msm5232.h +++ b/src/engine/platform/msm5232.h @@ -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); diff --git a/src/engine/platform/msm6258.cpp b/src/engine/platform/msm6258.cpp index c9b6b910..4824af90 100644 --- a/src/engine/platform/msm6258.cpp +++ b/src/engine/platform/msm6258.cpp @@ -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; } } diff --git a/src/engine/platform/msm6258.h b/src/engine/platform/msm6258.h index b981fd28..47d079ca 100644 --- a/src/engine/platform/msm6258.h +++ b/src/engine/platform/msm6258.h @@ -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); diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index 2423167f..3247d9ca 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -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=22) { updateOsc=0; diff --git a/src/engine/platform/msm6295.h b/src/engine/platform/msm6295.h index e3339df3..77a82f58 100644 --- a/src/engine/platform/msm6295.h +++ b/src/engine/platform/msm6295.h @@ -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; diff --git a/src/engine/platform/n163.cpp b/src/engine/platform/n163.cpp index c3efd5ac..49c1569a 100644 --- a/src/engine/platform/n163.cpp +++ b/src/engine/platform/n163.cpp @@ -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; i32767) 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; diff --git a/src/engine/platform/n163.h b/src/engine/platform/n163.h index 872c622b..30eb222c 100644 --- a/src/engine/platform/n163.h +++ b/src/engine/platform/n163.h @@ -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); diff --git a/src/engine/platform/namcowsg.cpp b/src/engine/platform/namcowsg.cpp index 122693d2..58270c0e 100644 --- a/src/engine/platform/namcowsg.cpp +++ b/src/engine/platform/namcowsg.cpp @@ -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) { diff --git a/src/engine/platform/namcowsg.h b/src/engine/platform/namcowsg.h index 639b54c4..87a2517e 100644 --- a/src/engine/platform/namcowsg.h +++ b/src/engine/platform/namcowsg.h @@ -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); diff --git a/src/engine/platform/nes.cpp b/src/engine/platform/nes.cpp index d0cae5ec..a60eeee4 100644 --- a/src/engine/platform/nes.cpp +++ b/src/engine/platform/nes.cpp @@ -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 { diff --git a/src/engine/platform/nes.h b/src/engine/platform/nes.h index d9f43e91..42758f56 100644 --- a/src/engine/platform/nes.h +++ b/src/engine/platform/nes.h @@ -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); diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index aefefcaa..4c993d54 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -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 { diff --git a/src/engine/platform/opl.h b/src/engine/platform/opl.h index db8bc475..5a113d4d 100644 --- a/src/engine/platform/opl.h +++ b/src/engine/platform/opl.h @@ -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); diff --git a/src/engine/platform/opll.cpp b/src/engine/platform/opll.cpp index 8ffd6501..0bc99dab 100644 --- a/src/engine/platform/opll.cpp +++ b/src/engine/platform/opll.cpp @@ -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); } diff --git a/src/engine/platform/opll.h b/src/engine/platform/opll.h index a1eb7004..32970e50 100644 --- a/src/engine/platform/opll.h +++ b/src/engine/platform/opll.h @@ -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); diff --git a/src/engine/platform/pce.cpp b/src/engine/platform/pce.cpp index cc6f67f3..c83594fe 100644 --- a/src/engine/platform/pce.cpp +++ b/src/engine/platform/pce.cpp @@ -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; h32767) 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]; } } diff --git a/src/engine/platform/pce.h b/src/engine/platform/pce.h index 02aea9b3..6493840c 100644 --- a/src/engine/platform/pce.h +++ b/src/engine/platform/pce.h @@ -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); diff --git a/src/engine/platform/pcmdac.cpp b/src/engine/platform/pcmdac.cpp index 8d9bb954..32ae9c5b 100644 --- a/src/engine/platform/pcmdac.cpp +++ b/src/engine/platform/pcmdac.cpp @@ -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; hdata[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+8))<>(depthScale+8))<>(depthScale+8))<>depthScale)<(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); diff --git a/src/engine/platform/pcspkr.h b/src/engine/platform/pcspkr.h index b3028d78..953a93b8 100644 --- a/src/engine/platform/pcspkr.h +++ b/src/engine/platform/pcspkr.h @@ -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); diff --git a/src/engine/platform/pet.cpp b/src/engine/platform/pet.cpp index 1e98257e..7474558e 100644 --- a/src/engine/platform/pet.cpp +++ b/src/engine/platform/pet.cpp @@ -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; hdata[oscBuf->needle++]=0; } } diff --git a/src/engine/platform/pet.h b/src/engine/platform/pet.h index 69bf9dde..5942817c 100644 --- a/src/engine/platform/pet.h +++ b/src/engine/platform/pet.h @@ -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); diff --git a/src/engine/platform/pokemini.cpp b/src/engine/platform/pokemini.cpp index 7625f1ed..1099e63f 100644 --- a/src/engine/platform/pokemini.cpp +++ b/src/engine/platform/pokemini.cpp @@ -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=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; } } diff --git a/src/engine/platform/pokemini.h b/src/engine/platform/pokemini.h index 7fc17ddf..80233eb4 100644 --- a/src/engine/platform/pokemini.h +++ b/src/engine/platform/pokemini.h @@ -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); diff --git a/src/engine/platform/pokey.cpp b/src/engine/platform/pokey.cpp index a79ec453..f740c1af 100644 --- a/src/engine/platform/pokey.cpp +++ b/src/engine/platform/pokey.cpp @@ -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 { diff --git a/src/engine/platform/pokey.h b/src/engine/platform/pokey.h index e68178a2..2418ade2 100644 --- a/src/engine/platform/pokey.h +++ b/src/engine/platform/pokey.h @@ -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); diff --git a/src/engine/platform/pong.cpp b/src/engine/platform/pong.cpp index 0c97391c..fe34b398 100644 --- a/src/engine/platform/pong.cpp +++ b/src/engine/platform/pong.cpp @@ -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; idata[oscBuf->needle++]=out; } else { - bufL[i]=0; + buf[0][i]=0; oscBuf->data[oscBuf->needle++]=0; flip=false; } diff --git a/src/engine/platform/pong.h b/src/engine/platform/pong.h index 835809f5..8259b14c 100644 --- a/src/engine/platform/pong.h +++ b/src/engine/platform/pong.h @@ -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); diff --git a/src/engine/platform/qsound.cpp b/src/engine/platform/qsound.cpp index a307912a..3c9f3689 100644 --- a/src/engine/platform/qsound.cpp +++ b/src/engine/platform/qsound.cpp @@ -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 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; jGenerateMany((unsigned char*)saaBuf[0],len,oscBuf); #ifdef TA_BIG_ENDIAN for (size_t i=0; i>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; itick(); } 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; diff --git a/src/engine/platform/scc.h b/src/engine/platform/scc.h index 55d82ca8..1c736472 100644 --- a/src/engine/platform/scc.h +++ b/src/engine/platform/scc.h @@ -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); diff --git a/src/engine/platform/segapcm.cpp b/src/engine/platform/segapcm.cpp index edc05d47..dd212c3f 100644 --- a/src/engine/platform/segapcm.cpp +++ b/src/engine/platform/segapcm.cpp @@ -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; h32767) os[1]=32767; - bufL[h]=os[0]; - bufR[h]=os[1]; + buf[0][h]=os[0]; + buf[1][h]=os[1]; } } diff --git a/src/engine/platform/segapcm.h b/src/engine/platform/segapcm.h index 8e02d4a8..3164e1b9 100644 --- a/src/engine/platform/segapcm.h +++ b/src/engine/platform/segapcm.h @@ -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); diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index e4a0bedc..2a25dd8c 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -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; hsound_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 { diff --git a/src/engine/platform/sms.h b/src/engine/platform/sms.h index 90000308..7358ce91 100644 --- a/src/engine/platform/sms.h +++ b/src/engine/platform/sms.h @@ -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); diff --git a/src/engine/platform/snes.cpp b/src/engine/platform/snes.cpp index fec8139e..38512d13 100644 --- a/src/engine/platform/snes.cpp +++ b/src/engine/platform/snes.cpp @@ -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>2; if (next<-32768) next=-32768; diff --git a/src/engine/platform/snes.h b/src/engine/platform/snes.h index 094fe03a..884c7d80 100644 --- a/src/engine/platform/snes.h +++ b/src/engine/platform/snes.h @@ -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); diff --git a/src/engine/platform/su.cpp b/src/engine/platform/su.cpp index 52fcafb0..53937aaf 100644 --- a/src/engine/platform/su.cpp +++ b/src/engine/platform/su.cpp @@ -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; hWrite(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); } diff --git a/src/engine/platform/su.h b/src/engine/platform/su.h index d6ca5aee..518edafa 100644 --- a/src/engine/platform/su.h +++ b/src/engine/platform/su.h @@ -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); diff --git a/src/engine/platform/swan.cpp b/src/engine/platform/swan.cpp index 92dbe940..b5d860ae 100644 --- a/src/engine/platform/swan.cpp +++ b/src/engine/platform/swan.cpp @@ -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; hSoundUpdate(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; } diff --git a/src/engine/platform/swan.h b/src/engine/platform/swan.h index 167a1180..6f129e6d 100644 --- a/src/engine/platform/swan.h +++ b/src/engine/platform/swan.h @@ -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); diff --git a/src/engine/platform/t6w28.cpp b/src/engine/platform/t6w28.cpp index 5830b428..34cdb126 100644 --- a/src/engine/platform/t6w28.cpp +++ b/src/engine/platform/t6w28.cpp @@ -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; h32767) tempR=32767; - bufL[h]=tempL; - bufR[h]=tempR; + buf[0][h]=tempL; + buf[1][h]=tempR; } } diff --git a/src/engine/platform/t6w28.h b/src/engine/platform/t6w28.h index e3aa2fcf..dd49d1b8 100644 --- a/src/engine/platform/t6w28.h +++ b/src/engine/platform/t6w28.h @@ -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); diff --git a/src/engine/platform/tia.cpp b/src/engine/platform/tia.cpp index 5f0467a5..a2472b21 100644 --- a/src/engine/platform/tia.cpp +++ b/src/engine/platform/tia.cpp @@ -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>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; diff --git a/src/engine/platform/tia.h b/src/engine/platform/tia.h index 3317955b..b4b867dc 100644 --- a/src/engine/platform/tia.h +++ b/src/engine/platform/tia.h @@ -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); diff --git a/src/engine/platform/tx81z.cpp b/src/engine/platform/tx81z.cpp index e76f4337..5e762910 100644 --- a/src/engine/platform/tx81z.cpp +++ b/src/engine/platform/tx81z.cpp @@ -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]; } } diff --git a/src/engine/platform/tx81z.h b/src/engine/platform/tx81z.h index 3107f805..4dea61e7 100644 --- a/src/engine/platform/tx81z.h +++ b/src/engine/platform/tx81z.h @@ -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); diff --git a/src/engine/platform/vb.cpp b/src/engine/platform/vb.cpp index c1257144..ea798073 100644 --- a/src/engine/platform/vb.cpp +++ b/src/engine/platform/vb.cpp @@ -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; h32767) tempR=32767; - bufL[h]=tempL; - bufR[h]=tempR; + buf[0][h]=tempL; + buf[1][h]=tempR; } } diff --git a/src/engine/platform/vb.h b/src/engine/platform/vb.h index b09e33af..7475c745 100644 --- a/src/engine/platform/vb.h +++ b/src/engine/platform/vb.h @@ -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); diff --git a/src/engine/platform/vera.cpp b/src/engine/platform/vera.cpp index c5de2721..82b7705a 100644 --- a/src/engine/platform/vera.cpp +++ b/src/engine/platform/vera.cpp @@ -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; idata[oscBuf[i]->needle++]=vic->ch[i].out?(vic->volume<<11):0; } diff --git a/src/engine/platform/vic20.h b/src/engine/platform/vic20.h index fd650b55..3fc9fade 100644 --- a/src/engine/platform/vic20.h +++ b/src/engine/platform/vic20.h @@ -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); diff --git a/src/engine/platform/vrc6.cpp b/src/engine/platform/vrc6.cpp index bb1a7a42..fa5cd0d3 100644 --- a/src/engine/platform/vrc6.cpp +++ b/src/engine/platform/vrc6.cpp @@ -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; i32767) 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) { diff --git a/src/engine/platform/vrc6.h b/src/engine/platform/vrc6.h index 3cb02c41..5facd13a 100644 --- a/src/engine/platform/vrc6.h +++ b/src/engine/platform/vrc6.h @@ -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); diff --git a/src/engine/platform/x1_010.cpp b/src/engine/platform/x1_010.cpp index 0a751097..27e55e59 100644 --- a/src/engine/platform/x1_010.cpp +++ b/src/engine/platform/x1_010.cpp @@ -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; h32767) 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; diff --git a/src/engine/platform/x1_010.h b/src/engine/platform/x1_010.h index 5c106eed..eaa4258a 100644 --- a/src/engine/platform/x1_010.h +++ b/src/engine/platform/x1_010.h @@ -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); diff --git a/src/engine/platform/ym2203.cpp b/src/engine/platform/ym2203.cpp index 453fa905..66e3d098 100644 --- a/src/engine/platform/ym2203.cpp +++ b/src/engine/platform/ym2203.cpp @@ -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++) { diff --git a/src/engine/platform/ym2203.h b/src/engine/platform/ym2203.h index 2076aa25..f7163ab6 100644 --- a/src/engine/platform/ym2203.h +++ b/src/engine/platform/ym2203.h @@ -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); diff --git a/src/engine/platform/ym2608.cpp b/src/engine/platform/ym2608.cpp index fd73fd2c..b706426d 100644 --- a/src/engine/platform/ym2608.cpp +++ b/src/engine/platform/ym2608.cpp @@ -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; i32767) 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)); diff --git a/src/engine/platform/ym2608.h b/src/engine/platform/ym2608.h index 9dfa2e8d..d4b3b9ba 100644 --- a/src/engine/platform/ym2608.h +++ b/src/engine/platform/ym2608.h @@ -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); diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index b6f23154..1f8d88c7 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -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; i32767) 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; idata[oscBuf[i]->needle++]=(fmChan[i]->debug_output(0)+fmChan[i]->debug_output(1)); diff --git a/src/engine/platform/ym2610.h b/src/engine/platform/ym2610.h index 82cce7b5..40d013e1 100644 --- a/src/engine/platform/ym2610.h +++ b/src/engine/platform/ym2610.h @@ -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); diff --git a/src/engine/platform/ym2610b.cpp b/src/engine/platform/ym2610b.cpp index f78d62d7..82ebd38f 100644 --- a/src/engine/platform/ym2610b.cpp +++ b/src/engine/platform/ym2610b.cpp @@ -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; i32767) 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; idata[oscBuf[j]->needle++]=(short)(((int)buf[j*2][i]+buf[j*2+1][i])/2); } - bufL[pos]=(short)(dataL/8); - bufR[pos]=(short)(dataR/8); + buf[0][pos]=(short)(dataL/8); + buf[1][pos]=(short)(dataR/8); pos++; } len-=blockLen; diff --git a/src/engine/platform/ymz280b.h b/src/engine/platform/ymz280b.h index 37e06cf3..78ea544b 100644 --- a/src/engine/platform/ymz280b.h +++ b/src/engine/platform/ymz280b.h @@ -56,7 +56,7 @@ class DivPlatformYMZ280B: 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); diff --git a/src/engine/platform/zxbeeper.cpp b/src/engine/platform/zxbeeper.cpp index 90ddfe2c..cf563f27 100644 --- a/src/engine/platform/zxbeeper.cpp +++ b/src/engine/platform/zxbeeper.cpp @@ -27,7 +27,7 @@ const char** DivPlatformZXBeeper::getRegisterSheet() { return NULL; } -void DivPlatformZXBeeper::acquire(short* bufL, short* bufR, size_t start, size_t len) { +void DivPlatformZXBeeper::acquire(short** buf, size_t len) { bool o=false; for (size_t h=start; hdata[oscBuf[0]->needle++]=o?16384:-16384; continue; } @@ -64,7 +64,7 @@ void DivPlatformZXBeeper::acquire(short* bufL, short* bufR, size_t start, size_t } if (++curChan>=6) curChan=0; - bufL[h]=o?16384:0; + buf[0][h]=o?16384:0; oscBuf[0]->data[oscBuf[0]->needle++]=o?16384:-16384; } } diff --git a/src/engine/platform/zxbeeper.h b/src/engine/platform/zxbeeper.h index 19c3e6ed..a9b3594c 100644 --- a/src/engine/platform/zxbeeper.h +++ b/src/engine/platform/zxbeeper.h @@ -52,7 +52,7 @@ class DivPlatformZXBeeper: 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);