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

View file

@ -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) {

View file

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

View file

@ -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