1 diff -urN dosbox.orig/src/dosbox.cpp dosbox/src/dosbox.cpp
2 --- dosbox.orig/src/dosbox.cpp 2011-01-14 18:31:43.731310313 -0300
3 +++ dosbox/src/dosbox.cpp 2011-01-14 19:11:12.957976979 -0300
5 Pbool = secprop->Add_bool("nosound",Property::Changeable::OnlyAtStart,false);
6 Pbool->Set_help("Enable silent mode, sound is still emulated though.");
8 + Pbool = secprop->Add_bool("swapstereo",Property::Changeable::OnlyAtStart,false);
9 + Pbool->Set_help("Swaps the left and right stereo channels.");
11 Pint = secprop->Add_int("rate",Property::Changeable::OnlyAtStart,44100);
12 Pint->Set_values(rates);
13 Pint->Set_help("Mixer sample rate, setting any device's rate higher than this will probably lower their sound quality.");
14 diff -urN dosbox.orig/src/hardware/mixer.cpp dosbox/src/hardware/mixer.cpp
15 --- dosbox.orig/src/hardware/mixer.cpp 2011-01-14 18:31:43.747976978 -0300
16 +++ dosbox/src/hardware/mixer.cpp 2011-01-14 19:18:46.057976977 -0300
24 Bit8u MixTemp[MIXER_BUFSIZE];
26 Bitu mixpos=mixer.pos+done;
27 freq_index&=MIXER_REMAIN;
28 Bitu pos=0;Bitu new_pos;
30 + offset[0] = mixer.swapstereo ? 1:0;
31 + offset[1] = mixer.swapstereo ? 0:1;
36 if ( sizeof( Type) == 1) {
39 - diff[0]=(((Bit8s)(data[pos*2+0] ^ 0x80)) << 8)-last[0];
40 - diff[1]=(((Bit8s)(data[pos*2+1] ^ 0x80)) << 8)-last[1];
41 + diff[0]=(((Bit8s)(data[pos*2+offset[0]] ^ 0x80)) << 8)-last[0];
42 + diff[1]=(((Bit8s)(data[pos*2+offset[1]] ^ 0x80)) << 8)-last[1];
44 diff[0]=(((Bit8s)(data[pos] ^ 0x80)) << 8)-last[0];
48 - diff[0]=(data[pos*2+0] << 8)-last[0];
49 - diff[1]=(data[pos*2+1] << 8)-last[1];
50 + diff[0]=(data[pos*2+offset[0]] << 8)-last[0];
51 + diff[1]=(data[pos*2+offset[1]] << 8)-last[1];
53 diff[0]=(data[pos] << 8)-last[0];
59 - diff[0]=data[pos*2+0]-last[0];
60 - diff[1]=data[pos*2+1]-last[1];
61 + diff[0]=data[pos*2+offset[0]]-last[0];
62 + diff[1]=data[pos*2+offset[1]]-last[1];
64 if ( sizeof( Type) == 2) {
65 diff[0]=(Bit16s)host_readw((HostPt)&data[pos*2+0])-last[0];
70 - diff[0]=(Bits)data[pos*2+0]-32768-last[0];
71 - diff[1]=(Bits)data[pos*2+1]-32768-last[1];
72 + diff[0]=(Bits)data[pos*2+offset[0]]-32768-last[0];
73 + diff[1]=(Bits)data[pos*2+offset[1]]-32768-last[1];
75 if ( sizeof( Type) == 2) {
76 diff[0]=(Bits)host_readw((HostPt)&data[pos*2+0])-32768-last[0];
78 mixer.freq=section->Get_int("rate");
79 mixer.nosound=section->Get_bool("nosound");
80 mixer.blocksize=section->Get_int("blocksize");
81 + mixer.swapstereo=section->Get_bool("swapstereo");
83 /* Initialize the internal stuff */