From 98e4d427aca80aa4b5dac44b790139be2a90a88c Mon Sep 17 00:00:00 2001 From: FateForWindows Date: Sun, 11 Dec 2022 13:10:59 -0500 Subject: tiger/gamecom.cpp: Improved audio emulation (still very innacurate). (#10664) * Use level registers for channels 1 and 2. * Halved sound_cnt maximum value - was reading twice as far, causing channel 2 to play back incorrectly. --- src/mame/tiger/gamecom.cpp | 4 ++-- src/mame/tiger/gamecom.h | 6 +++--- src/mame/tiger/gamecom_m.cpp | 10 ++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/mame/tiger/gamecom.cpp b/src/mame/tiger/gamecom.cpp index 38841881ee7..1ee22366710 100644 --- a/src/mame/tiger/gamecom.cpp +++ b/src/mame/tiger/gamecom.cpp @@ -281,8 +281,8 @@ void gamecom_state::gamecom(machine_config &config) SPEAKER(config, "speaker").front_center(); /* TODO: much more complex than this */ DAC_8BIT_R2R(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); // unknown DAC (Digital audio) - DAC_4BIT_R2R(config, m_dac0, 0).add_route(ALL_OUTPUTS, "speaker", 0.05); // unknown DAC (Frequency modulation) - DAC_4BIT_R2R(config, m_dac1, 0).add_route(ALL_OUTPUTS, "speaker", 0.05); // unknown DAC (Frequency modulation) + DAC_4BIT_R2R(config, m_dac0, 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC (Frequency modulation) + DAC_4BIT_R2R(config, m_dac1, 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC (Frequency modulation) /* cartridge */ GENERIC_CARTSLOT(config, "cartslot1", generic_linear_slot, "gamecom_cart", "bin,tgc").set_device_load(FUNC(gamecom_state::cart1_load)); diff --git a/src/mame/tiger/gamecom.h b/src/mame/tiger/gamecom.h index a01e194d6be..d34889c7708 100644 --- a/src/mame/tiger/gamecom.h +++ b/src/mame/tiger/gamecom.h @@ -286,9 +286,9 @@ private: required_shared_ptr m_p_nvram; required_device m_maincpu; required_device m_screen; - required_device m_dac; - required_device m_dac0; - required_device m_dac1; + required_device m_dac; + required_device m_dac0; + required_device m_dac1; required_device m_cart1; required_device m_cart2; required_memory_bank m_bank1; diff --git a/src/mame/tiger/gamecom_m.cpp b/src/mame/tiger/gamecom_m.cpp index cd3d6968d77..b37a7d8d0c5 100644 --- a/src/mame/tiger/gamecom_m.cpp +++ b/src/mame/tiger/gamecom_m.cpp @@ -18,7 +18,7 @@ TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_clock_timer_callback) TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_sound0_timer_callback) { - if (m_sound0_cnt > 0x3f) + if (m_sound0_cnt > 0x1f) { if (m_sound.sg0t > 0) { @@ -27,16 +27,17 @@ TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_sound0_timer_callback) m_sound0_cnt = 0; } } - if (m_sound0_cnt < 0x40) + if (m_sound0_cnt < 0x20) { m_dac0->write((m_sound.sg0w[m_sound0_cnt >> 1] >> (BIT(m_sound0_cnt, 0) * 4)) & 0xf); + m_dac0->set_output_gain(ALL_OUTPUTS, m_sound.sg0l / 31.0F); m_sound0_cnt++; } } TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_sound1_timer_callback) { - if (m_sound1_cnt > 0x3f) + if (m_sound1_cnt > 0x1f) { if (m_sound.sg1t > 0) { @@ -45,9 +46,10 @@ TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_sound1_timer_callback) m_sound1_cnt = 0; } } - if (m_sound1_cnt < 0x40) + if (m_sound1_cnt < 0x20) { m_dac1->write((m_sound.sg1w[m_sound1_cnt >> 1] >> (BIT(m_sound1_cnt, 0) * 4)) & 0xf); + m_dac1->set_output_gain(ALL_OUTPUTS, m_sound.sg1l / 31.0F); m_sound1_cnt++; } } -- cgit v1.2.3