From 6b6ac8e5bb02989c346fcf952298c42e22888b57 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 11 Nov 2024 20:32:45 +0100 Subject: cbus/pc9801_86.cpp: implement PCM mute control --- src/devices/bus/cbus/pc9801_86.cpp | 19 ++++++++++++++++--- src/devices/bus/cbus/pc9801_86.h | 4 ++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/devices/bus/cbus/pc9801_86.cpp b/src/devices/bus/cbus/pc9801_86.cpp index e8630e77ce9..6343596aa24 100644 --- a/src/devices/bus/cbus/pc9801_86.cpp +++ b/src/devices/bus/cbus/pc9801_86.cpp @@ -224,8 +224,17 @@ void pc9801_86_device::device_start() ); m_bus->install_io(0xa460, 0xa463, read8smo_delegate(*this, FUNC(pc9801_86_device::id_r)), write8smo_delegate(*this, FUNC(pc9801_86_device::mask_w))); m_bus->install_io(0xa464, 0xa46f, read8sm_delegate(*this, FUNC(pc9801_86_device::pcm_r)), write8sm_delegate(*this, FUNC(pc9801_86_device::pcm_w))); - m_bus->install_io(0xa66c, 0xa66f, read8sm_delegate(*this, [this](offs_t o){ return o == 2 ? m_pcm_mute : 0xff; }, "pc9801_86_mute_r"), - write8sm_delegate(*this, [this](offs_t o, u8 d){ if(o == 2) m_pcm_mute = d; }, "pc9801_86_mute_w")); + m_bus->install_io(0xa66c, 0xa66f, + read8sm_delegate(*this, [this](offs_t o){ return o == 2 ? m_pcm_mute : 0xff; }, "pc9801_86_mute_r"), + write8sm_delegate(*this, [this](offs_t o, u8 d){ + if(o == 2) + { + m_pcm_mute = d; + m_ldac->set_output_gain(ALL_OUTPUTS, BIT(m_pcm_mute, 0) ? 0.0 : 1.0); + m_rdac->set_output_gain(ALL_OUTPUTS, BIT(m_pcm_mute, 0) ? 0.0 : 1.0); + } + }, "pc9801_86_mute_w") + ); m_io_base = 0; @@ -258,7 +267,11 @@ void pc9801_86_device::device_reset() m_fmirq = m_pcmirq = m_init = false; m_irq_rate = 0; m_pcm_ctrl = m_pcm_mode = 0; - m_pcm_mute = 0; + // Starts off with DACs muted (os2warp3 will burp a lot while initializing OS) + m_pcm_mute = 0x01; + m_ldac->set_output_gain(ALL_OUTPUTS, 0.0); + m_rdac->set_output_gain(ALL_OUTPUTS, 0.0); + m_pcm_clk = false; memset(&m_queue[0], 0, QUEUE_SIZE); } diff --git a/src/devices/bus/cbus/pc9801_86.h b/src/devices/bus/cbus/pc9801_86.h index 314d12cbd84..16891fd54c5 100644 --- a/src/devices/bus/cbus/pc9801_86.h +++ b/src/devices/bus/cbus/pc9801_86.h @@ -67,8 +67,8 @@ private: u8 m_pcm_mode, m_vol[7], m_pcm_ctrl, m_pcm_mute; uint16_t m_head, m_tail, m_count, m_irq_rate; bool m_pcmirq, m_fmirq, m_pcm_clk, m_init; - required_device m_ldac; - required_device m_rdac; + required_device m_ldac; + required_device m_rdac; std::vector m_queue; emu_timer *m_dac_timer; }; -- cgit v1.2.3