From 1975a129cceb70de5ffc479a1166d93e2202ca3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Tue, 28 Apr 2009 21:45:43 +0000 Subject: [PATCH] ignore adlib 0xc0 high bits (seemingly unused on real cards), reduce volume Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3376 --- src/hardware/adlib.h | 3 +-- src/hardware/opl.cpp | 10 +++++----- src/hardware/ymf262.c | 6 ++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/hardware/adlib.h b/src/hardware/adlib.h index baa3b586..f82953df 100644 --- a/src/hardware/adlib.h +++ b/src/hardware/adlib.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: adlib.h,v 1.4 2009-04-26 10:33:53 harekiet Exp $ */ +/* $Id: adlib.h,v 1.5 2009-04-28 21:45:43 c2woody Exp $ */ #ifndef DOSBOX_ADLIB_H #define DOSBOX_ADLIB_H @@ -24,7 +24,6 @@ #include "dosbox.h" #include "mixer.h" #include "inout.h" -#include "mixer.h" #include "setup.h" #include "pic.h" #include "hardware.h" diff --git a/src/hardware/opl.cpp b/src/hardware/opl.cpp index 27d0ae44..2d8d6b1d 100644 --- a/src/hardware/opl.cpp +++ b/src/hardware/opl.cpp @@ -499,8 +499,8 @@ void adlib_init(Bit32u samplerate) { #if defined(OPLTYPE_IS_OPL3) op[i].is_4op = false; op[i].is_4op_attached = false; - op[i].left_pan = 2; - op[i].right_pan = 2; + op[i].left_pan = 1; + op[i].right_pan = 1; #endif } @@ -848,8 +848,8 @@ void adlib_write(Bitu idx, Bit8u val) { change_feedback(chanbase,&op[opbase]); #if defined(OPLTYPE_IS_OPL3) // OPL3 panning - op[opbase].left_pan = ((val&0x10)>>4)+((val&0x40)>>6); - op[opbase].right_pan = ((val&0x20)>>5)+((val&0x80)>>7); + op[opbase].left_pan = ((val&0x10)>>4); + op[opbase].right_pan = ((val&0x20)>>5); #endif } } @@ -933,7 +933,7 @@ static void INLINE clipit16(Bit32s ival, Bit16s* outval) { outbufl[i] += chanval*cptr[0].left_pan; \ outbufr[i] += chanval*cptr[0].right_pan; \ } else { \ - outbufl[i] += chanval*2; \ + outbufl[i] += chanval; \ } #else #define CHANVAL_OUT \ diff --git a/src/hardware/ymf262.c b/src/hardware/ymf262.c index 25b5c3f0..fe630135 100644 --- a/src/hardware/ymf262.c +++ b/src/hardware/ymf262.c @@ -2073,16 +2073,14 @@ static void OPL3WriteReg(OPL3 *chip, int r, int v) /* OPL3 mode */ chip->pan[ base ] = (v & 0x10) ? 1 : 0; /* ch.A */ chip->pan[ base +1 ] = (v & 0x20) ? 1 : 0; /* ch.B */ - if (v & 0x40) chip->pan[ base ] += 1; /* ch.C->ch.A */ - if (v & 0x80) chip->pan[ base +1 ] += 1; /* ch.D->ch.B */ } else { int base = ((r&0xf) + ch_offset) * 2; /* OPL2 mode - always enabled */ - chip->pan[ base ] = 2; /* ch.A */ - chip->pan[ base +1 ] = 2; /* ch.B */ + chip->pan[ base ] = 1; /* ch.A */ + chip->pan[ base +1 ] = 1; /* ch.B */ } CH->SLOT[SLOT1].FB = (v>>1)&7 ? ((v>>1)&7) + 7 : 0;