diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index f475b4750..cf52f3d29 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -115,8 +115,8 @@ void DivPlatformAY8910::acquire(short* bufL, short* bufR, size_t start, size_t l ay->sound_stream_update(ayBuf,len); if (stereo) { for (size_t i=0; i>8); + bufR[i+start]=((ayBuf[0][i]*stereoSep)>>8)+ayBuf[1][i]+ayBuf[2][i]; } } else { for (size_t i=0; idevice_reset(); stereo=(flags>>6)&1; + stereoSep=(flags>>8)&255; } int DivPlatformAY8910::init(DivEngine* p, int channels, int sugRate, unsigned int flags) { diff --git a/src/engine/platform/ay.h b/src/engine/platform/ay.h index 4b7ce1068..0537dadab 100644 --- a/src/engine/platform/ay.h +++ b/src/engine/platform/ay.h @@ -66,6 +66,7 @@ class DivPlatformAY8910: public DivDispatch { int dacPos; int dacSample; unsigned char sampleBank; + unsigned char stereoSep; int delay; diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index 123dc68ac..d5f01013d 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -99,8 +99,8 @@ void DivPlatformAY8930::acquire(short* bufL, short* bufR, size_t start, size_t l ay->sound_stream_update(ayBuf,len); if (stereo) { for (size_t i=0; i>8); + bufR[i+start]=((ayBuf[0][i]*stereoSep)>>8)+ayBuf[1][i]+ayBuf[2][i]; } } else { for (size_t i=0; i>6)&1; + stereoSep=(flags>>8)&255; } int DivPlatformAY8930::init(DivEngine* p, int channels, int sugRate, unsigned int flags) { diff --git a/src/engine/platform/ay8930.h b/src/engine/platform/ay8930.h index 81995f2de..75a5f6974 100644 --- a/src/engine/platform/ay8930.h +++ b/src/engine/platform/ay8930.h @@ -66,6 +66,7 @@ class DivPlatformAY8930: public DivDispatch { DivDispatchOscBuffer* oscBuf[3]; unsigned char regPool[32]; unsigned char ayNoiseAnd, ayNoiseOr; + unsigned char stereoSep; bool bank; int delay; diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 900845a69..98b600286 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -358,6 +358,14 @@ void FurnaceGUI::drawSysConf(int chan, DivSystem type, unsigned int& flags, bool if (ImGui::Checkbox("Stereo##_AY_STEREO",&stereo)) { copyOfFlags=(flags&(~0x40))|(stereo?0x40:0); } + if (stereo) { + int sep=256-((flags>>8)&255); + if (CWSliderInt("Separation",&sep,1,256)) { + if (sep<1) sep=1; + if (sep>256) sep=256; + copyOfFlags=(flags&(~0xff00))|((256-sep)<<8); + } + } ImGui::EndDisabled(); bool clockSel=flags&0x80; ImGui::BeginDisabled((type==DIV_SYSTEM_AY8910) && ((flags&0x30)!=16));