]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
FINISH_DATA() with bits=16 (mono audio) skipped paula volume adjustment.
authorToni Wilen <twilen@winuae.net>
Sat, 16 Jun 2018 19:18:54 +0000 (22:18 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 16 Jun 2018 19:18:54 +0000 (22:18 +0300)
audio.cpp

index f950e5f792524eb119e4d47bc5547590fd3470fa..a670a60e31ebc1d6a353cc52594296384761e7f1 100644 (file)
--- a/audio.cpp
+++ b/audio.cpp
@@ -336,13 +336,12 @@ typedef uae_s8 sample8_t;
 
 STATIC_INLINE int FINISH_DATA (int data, int bits, int ch)
 {
-       if (bits == 16) {
-               return data;
-       } else if (bits - 16 > 0) {
-               data >>=  bits - 16;
-       } else {
+       if (bits < 16) {
                int shift = 16 - bits;
                data <<= shift;
+       } else {
+               int shift = bits - 16;
+               data >>= shift;
        }
        data = data * sound_paula_volume[ch] / 32768;
        return data;