From 3d5a7dfd54d2dacbb1fd28ef651c2d6658405999 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Wed, 17 Aug 2011 13:19:50 +0000 Subject: [PATCH] Fixed independent channel volumes in Okim6376 sound chip, used by the games from the Road Hog era of MPU4 [J. Wallace] --- src/emu/sound/okim6376.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/emu/sound/okim6376.c b/src/emu/sound/okim6376.c index a128224aa4a..e5e37a2ec4f 100644 --- a/src/emu/sound/okim6376.c +++ b/src/emu/sound/okim6376.c @@ -75,7 +75,7 @@ static const int volume_table[3] = /* divisor lookup table. When an individual word is selected, it can be assigned one of three different 'rates'. These are implemented as clock divisors, and are looked up in the ROM header. More often than not, this value is 0, - relating to a division by 8, or nominally 8KHz sampling (based on the datasheet exampleof a 64KHz clock).*/ + relating to a division by 8, or nominally 8KHz sampling (based on the datasheet example of a 64KHz clock).*/ static const int divisor_table[3] = { 8, @@ -219,8 +219,11 @@ static void oki_process(okim6376_state *info, int channel, int command) /* also reset the ADPCM parameters */ reset_adpcm(voice); - /* FIX: no attenuation for now, handle for channel 2 separately */ - voice->volume = volume_table[0]; + if (channel == 0) + { + /* We set channel 2's audio separately */ + voice->volume = volume_table[0]; + } } else { @@ -574,6 +577,7 @@ WRITE_LINE_DEVICE_HANDLER( okim6376_st_w ) { info->st_pulses ++; + MSM6376LOG(("OKIM6376:'%s' ST pulses %x\n",device->tag(),info->st_pulses)); if (info->st_pulses > 3) { info->st_pulses = 3; //undocumented behaviour beyond 3 pulses