aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMax Horn2003-09-18 16:01:33 +0000
committerMax Horn2003-09-18 16:01:33 +0000
commit9470c9f66131d16ca19d111d21948ba57a1a8eb3 (patch)
tree79aa7b664c9dcab922649ad552ef03fe6ba58e21 /backends
parentdcf77f7a1008e4a6b98c9face6cc7461c6347e1d (diff)
downloadscummvm-rg350-9470c9f66131d16ca19d111d21948ba57a1a8eb3.tar.gz
scummvm-rg350-9470c9f66131d16ca19d111d21948ba57a1a8eb3.tar.bz2
scummvm-rg350-9470c9f66131d16ca19d111d21948ba57a1a8eb3.zip
changed & documented the premixer semantics
svn-id: r10294
Diffstat (limited to 'backends')
-rw-r--r--backends/midi/adlib.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/backends/midi/adlib.cpp b/backends/midi/adlib.cpp
index 2205c56589..efd412235e 100644
--- a/backends/midi/adlib.cpp
+++ b/backends/midi/adlib.cpp
@@ -866,7 +866,7 @@ int MidiDriver_ADLIB::open() {
_samples_per_tick = (_mixer->getOutputRate() << FIXP_SHIFT) / BASE_FREQ;
- _mixer->setupPremix(this, premix_proc);
+ _mixer->setupPremix(premix_proc, this);
return 0;
}
@@ -1014,6 +1014,9 @@ void MidiDriver_ADLIB::adlib_write(byte port, byte value) {
void MidiDriver_ADLIB::generate_samples(int16 *data, int len) {
int step;
+ int16 *origData = data;
+ uint origLen = len;
+
do {
step = len;
if (step > (_next_tick >> FIXP_SHIFT))
@@ -1030,6 +1033,11 @@ void MidiDriver_ADLIB::generate_samples(int16 *data, int len) {
data += step;
len -= step;
} while (len);
+
+ // Convert mono data to stereo
+ for (int i = (origLen - 1); i >= 0; i--) {
+ origData[2 * i] = origData[2 * i + 1] = origData[i];
+ }
}
void MidiDriver_ADLIB::reset_tick() {