From fe45060a33df91ac174d806a29fcf89aadb87809 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 11 Jun 2019 09:14:57 -0400 Subject: [PATCH] ymf278b: Eliminate clock macro (nw) --- src/devices/bus/msx_cart/moonsound.cpp | 2 +- src/devices/sound/ymf278b.cpp | 4 +--- src/devices/sound/ymf278b.h | 2 -- src/mame/drivers/fuukifg3.cpp | 2 +- src/mame/drivers/metro.cpp | 2 +- src/mame/drivers/psikyo.cpp | 2 +- 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/devices/bus/msx_cart/moonsound.cpp b/src/devices/bus/msx_cart/moonsound.cpp index d6b62f81347..afdb3c039eb 100644 --- a/src/devices/bus/msx_cart/moonsound.cpp +++ b/src/devices/bus/msx_cart/moonsound.cpp @@ -42,7 +42,7 @@ void msx_cart_moonsound_device::device_add_mconfig(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - YMF278B(config, m_ymf278b, YMF278B_STD_CLOCK); + YMF278B(config, m_ymf278b, 33.8688_MHz_XTAL); m_ymf278b->set_addrmap(0, &msx_cart_moonsound_device::ymf278b_map); m_ymf278b->irq_handler().set(FUNC(msx_cart_moonsound_device::irq_w)); m_ymf278b->add_route(0, "lspeaker", 0.50); diff --git a/src/devices/sound/ymf278b.cpp b/src/devices/sound/ymf278b.cpp index 2ccab0f0420..71baf70aeb9 100644 --- a/src/devices/sound/ymf278b.cpp +++ b/src/devices/sound/ymf278b.cpp @@ -511,9 +511,7 @@ void ymf278b_device::C_w(uint8_t reg, uint8_t data) // status register LD bit is on for approx 300us m_status_ld = 1; - period = attotime::from_usec(300); - if (m_clock != YMF278B_STD_CLOCK) - period = (period * m_clock) / YMF278B_STD_CLOCK; + period = clocks_to_attotime(10); m_timer_ld->adjust(period); // retrigger if key is on diff --git a/src/devices/sound/ymf278b.h b/src/devices/sound/ymf278b.h index d0f9fb1e879..e540543e6e3 100644 --- a/src/devices/sound/ymf278b.h +++ b/src/devices/sound/ymf278b.h @@ -6,8 +6,6 @@ #pragma once -#define YMF278B_STD_CLOCK (33868800) /* standard clock for OPL4 */ - class ymf278b_device : public device_t, public device_sound_interface, public device_rom_interface { public: diff --git a/src/mame/drivers/fuukifg3.cpp b/src/mame/drivers/fuukifg3.cpp index dea4db803c1..789f009a704 100644 --- a/src/mame/drivers/fuukifg3.cpp +++ b/src/mame/drivers/fuukifg3.cpp @@ -553,7 +553,7 @@ void fuuki32_state::fuuki32(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - ymf278b_device &ymf(YMF278B(config, "ymf", YMF278B_STD_CLOCK)); // 33.8688MHz + ymf278b_device &ymf(YMF278B(config, "ymf", 33.8688_MHz_XTAL)); ymf.irq_handler().set_inputline("soundcpu", 0); ymf.add_route(0, "lspeaker", 0.50); ymf.add_route(1, "rspeaker", 0.50); diff --git a/src/mame/drivers/metro.cpp b/src/mame/drivers/metro.cpp index f685668c0e8..ec73a36bacb 100644 --- a/src/mame/drivers/metro.cpp +++ b/src/mame/drivers/metro.cpp @@ -3101,7 +3101,7 @@ void metro_state::msgogo(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - ymf278b_device &ymf(YMF278B(config, "ymf", YMF278B_STD_CLOCK)); + ymf278b_device &ymf(YMF278B(config, "ymf", 33.8688_MHz_XTAL)); ymf.set_addrmap(0, &metro_state::ymf278_map); ymf.irq_handler().set_inputline("maincpu", 2); ymf.add_route(ALL_OUTPUTS, "mono", 1.0); diff --git a/src/mame/drivers/psikyo.cpp b/src/mame/drivers/psikyo.cpp index d974cab3999..d3109515660 100644 --- a/src/mame/drivers/psikyo.cpp +++ b/src/mame/drivers/psikyo.cpp @@ -1179,7 +1179,7 @@ void psikyo_state::s1945(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - ymf278b_device &ymf(YMF278B(config, "ymf", YMF278B_STD_CLOCK)); + ymf278b_device &ymf(YMF278B(config, "ymf", 33.8688_MHz_XTAL)); ymf.irq_handler().set_inputline("audiocpu", 0); ymf.add_route(ALL_OUTPUTS, "mono", 1.0);