Amiga: add stereo separation setting

This commit is contained in:
tildearrow 2022-02-04 17:59:55 -05:00
parent a93a9c19f3
commit acdf4d6503
5 changed files with 19 additions and 5 deletions

Binary file not shown.

View File

@ -77,11 +77,11 @@ void DivPlatformAmiga::acquire(short* bufL, short* bufR, size_t start, size_t le
} }
if (!isMuted[i]) { if (!isMuted[i]) {
if (i==0 || i==3) { if (i==0 || i==3) {
bufL[h]+=(chan[i].audDat*chan[i].outVol); bufL[h]+=((chan[i].audDat*chan[i].outVol)*sep1)>>7;
bufR[h]+=(chan[i].audDat*chan[i].outVol)>>2; bufR[h]+=((chan[i].audDat*chan[i].outVol)*sep2)>>7;
} else { } else {
bufL[h]+=(chan[i].audDat*chan[i].outVol)>>2; bufL[h]+=((chan[i].audDat*chan[i].outVol)*sep2)>>7;
bufR[h]+=(chan[i].audDat*chan[i].outVol); bufR[h]+=((chan[i].audDat*chan[i].outVol)*sep1)>>7;
} }
} }
} }
@ -315,6 +315,8 @@ void DivPlatformAmiga::setFlags(unsigned int flags) {
chipClock=COLOR_NTSC; chipClock=COLOR_NTSC;
} }
rate=chipClock/AMIGA_DIVIDER; 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) { int DivPlatformAmiga::init(DivEngine* p, int channels, int sugRate, unsigned int flags) {

View File

@ -45,6 +45,8 @@ class DivPlatformAmiga: public DivDispatch {
Channel chan[4]; Channel chan[4];
bool isMuted[4]; bool isMuted[4];
int sep1, sep2;
friend void putDispatchChan(void*,int,int); friend void putDispatchChan(void*,int,int);
public: public:

View File

@ -181,6 +181,8 @@ struct DivSong {
// - bit 1: model // - bit 1: model
// - 0: Amiga 500 // - 0: Amiga 500
// - 1: Amiga 1200 // - 1: Amiga 1200
// - bit 8-14: stereo separation
// - 0 is 0% while 127 is 100%
unsigned int systemFlags[32]; unsigned int systemFlags[32];
// song information // song information

View File

@ -5291,7 +5291,14 @@ bool FurnaceGUI::loop() {
e->setSysFlags(i,2); e->setSysFlags(i,2);
} }
break; 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 /* TODO LATER: I want 0.5 out already
if (ImGui::RadioButton("Amiga 500 (OCS)",(flags&2)==0)) { if (ImGui::RadioButton("Amiga 500 (OCS)",(flags&2)==0)) {
e->setSysFlags(i,flags&1); e->setSysFlags(i,flags&1);
@ -5304,6 +5311,7 @@ bool FurnaceGUI::loop() {
e->setSysFlags(i,(flags&2)|sysPal); e->setSysFlags(i,(flags&2)|sysPal);
} }
break; break;
}
case DIV_SYSTEM_GB: case DIV_SYSTEM_GB:
case DIV_SYSTEM_YM2610: case DIV_SYSTEM_YM2610:
case DIV_SYSTEM_YM2610_EXT: case DIV_SYSTEM_YM2610_EXT: