diff --git a/demos/bruno_time.fur b/demos/bruno_time.fur index 351a6e1f..6d5756d7 100644 Binary files a/demos/bruno_time.fur and b/demos/bruno_time.fur differ diff --git a/src/engine/platform/amiga.cpp b/src/engine/platform/amiga.cpp index fe63d081..6eaa10d4 100644 --- a/src/engine/platform/amiga.cpp +++ b/src/engine/platform/amiga.cpp @@ -77,11 +77,11 @@ void DivPlatformAmiga::acquire(short* bufL, short* bufR, size_t start, size_t le } if (!isMuted[i]) { if (i==0 || i==3) { - bufL[h]+=(chan[i].audDat*chan[i].outVol); - bufR[h]+=(chan[i].audDat*chan[i].outVol)>>2; + bufL[h]+=((chan[i].audDat*chan[i].outVol)*sep1)>>7; + bufR[h]+=((chan[i].audDat*chan[i].outVol)*sep2)>>7; } else { - bufL[h]+=(chan[i].audDat*chan[i].outVol)>>2; - bufR[h]+=(chan[i].audDat*chan[i].outVol); + bufL[h]+=((chan[i].audDat*chan[i].outVol)*sep2)>>7; + bufR[h]+=((chan[i].audDat*chan[i].outVol)*sep1)>>7; } } } @@ -315,6 +315,8 @@ void DivPlatformAmiga::setFlags(unsigned int flags) { chipClock=COLOR_NTSC; } rate=chipClock/AMIGA_DIVIDER; + sep1=((flags>>8)&127)+127; + sep2=127-((flags>>8)&127); } int DivPlatformAmiga::init(DivEngine* p, int channels, int sugRate, unsigned int flags) { diff --git a/src/engine/platform/amiga.h b/src/engine/platform/amiga.h index 475c4523..7dba475e 100644 --- a/src/engine/platform/amiga.h +++ b/src/engine/platform/amiga.h @@ -45,6 +45,8 @@ class DivPlatformAmiga: public DivDispatch { Channel chan[4]; bool isMuted[4]; + int sep1, sep2; + friend void putDispatchChan(void*,int,int); public: diff --git a/src/engine/song.h b/src/engine/song.h index fdd18973..a0406018 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -181,6 +181,8 @@ struct DivSong { // - bit 1: model // - 0: Amiga 500 // - 1: Amiga 1200 + // - bit 8-14: stereo separation + // - 0 is 0% while 127 is 100% unsigned int systemFlags[32]; // song information diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 56e8e8a1..ee2d4f95 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5291,7 +5291,14 @@ bool FurnaceGUI::loop() { e->setSysFlags(i,2); } break; - case DIV_SYSTEM_AMIGA: + case DIV_SYSTEM_AMIGA: { + ImGui::Text("Stereo separation:"); + int stereoSep=(flags>>8)&127; + if (ImGui::SliderInt("##StereoSep",&stereoSep,0,127)) { + if (stereoSep<0) stereoSep=0; + if (stereoSep>127) stereoSep=127; + e->setSysFlags(i,(flags&1)|((stereoSep&127)<<8)); + } /* TODO LATER: I want 0.5 out already if (ImGui::RadioButton("Amiga 500 (OCS)",(flags&2)==0)) { e->setSysFlags(i,flags&1); @@ -5304,6 +5311,7 @@ bool FurnaceGUI::loop() { e->setSysFlags(i,(flags&2)|sysPal); } break; + } case DIV_SYSTEM_GB: case DIV_SYSTEM_YM2610: case DIV_SYSTEM_YM2610_EXT: