From fca4d40e6df330ffb1b05260066a301e9258e798 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Sun, 27 Oct 2013 20:50:28 +0000 Subject: [PATCH] Preliminary Master volume control for Deco MLC HW [Angelo Salese] --- src/emu/sound/ymz280b.c | 4 ++-- src/mame/drivers/deco_mlc.c | 5 +++-- src/mame/includes/deco_mlc.h | 6 +++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c index e465ce8ff7a..d5fb23359f9 100644 --- a/src/emu/sound/ymz280b.c +++ b/src/emu/sound/ymz280b.c @@ -89,14 +89,14 @@ void ymz280b_device::update_irq_state() m_irq_state = 1; if (!m_irq_handler.isnull()) m_irq_handler(1); - else logerror("YMZ280B: IRQ generated, but no callback specified!"); + else logerror("YMZ280B: IRQ generated, but no callback specified!\n"); } else if (!irq_bits && m_irq_state) { m_irq_state = 0; if (!m_irq_handler.isnull()) m_irq_handler(0); - else logerror("YMZ280B: IRQ generated, but no callback specified!"); + else logerror("YMZ280B: IRQ generated, but no callback specified!\n"); } } diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c index 683607e1890..a4b668d7414 100644 --- a/src/mame/drivers/deco_mlc.c +++ b/src/mame/drivers/deco_mlc.c @@ -100,7 +100,6 @@ #include "emu.h" #include "includes/decocrpt.h" #include "machine/eepromser.h" -#include "sound/ymz280b.h" #include "cpu/arm/arm.h" #include "cpu/sh2/sh2.h" #include "includes/deco_mlc.h" @@ -179,7 +178,9 @@ WRITE32_MEMBER(deco_mlc_state::avengrs_eprom_w) // } } else if (ACCESSING_BITS_0_7) { - //volume control todo + /* Master volume control (TODO: probably logaritmic) */ + m_ymz->set_output_gain(0, (255.0 - data) / 255.0); + m_ymz->set_output_gain(1, (255.0 - data) / 255.0); } else logerror("%s: eprom_w %08x mask %08x\n",machine().describe_context(),data,mem_mask); diff --git a/src/mame/includes/deco_mlc.h b/src/mame/includes/deco_mlc.h index a3d35889136..4a213cab8b7 100644 --- a/src/mame/includes/deco_mlc.h +++ b/src/mame/includes/deco_mlc.h @@ -1,5 +1,6 @@ #include "machine/eepromser.h" #include "machine/deco146.h" +#include "sound/ymz280b.h" class deco_mlc_state : public driver_device { @@ -12,7 +13,9 @@ public: m_mlc_clip_ram(*this, "mlc_clip_ram"), m_mlc_vram(*this, "mlc_vram"), m_maincpu(*this, "maincpu"), - m_eeprom(*this, "eeprom") { } + m_eeprom(*this, "eeprom"), + m_ymz(*this, "ymz") + { } optional_device m_deco146; required_shared_ptr m_mlc_ram; @@ -63,6 +66,7 @@ public: void descramble_sound( ); required_device m_maincpu; required_device m_eeprom; + required_device m_ymz; DECLARE_READ16_MEMBER( sh96_protection_region_0_146_r ); DECLARE_WRITE16_MEMBER( sh96_protection_region_0_146_w );