From 11f9f6166b8d27c613cf88c88dca9985225aa612 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 26 Mar 2020 15:14:52 -0400 Subject: [PATCH] ym2151: Add YM2414 as alias (no attempt at emulating distinctive features at the moment) (nw) --- src/devices/sound/ym2151.cpp | 11 +++++++++++ src/devices/sound/ym2151.h | 9 +++++++++ src/mame/drivers/korgz3.cpp | 11 +++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/devices/sound/ym2151.cpp b/src/devices/sound/ym2151.cpp index 64b02822644..3a5b1076c00 100644 --- a/src/devices/sound/ym2151.cpp +++ b/src/devices/sound/ym2151.cpp @@ -6,6 +6,7 @@ DEFINE_DEVICE_TYPE(YM2151, ym2151_device, "ym2151", "Yamaha YM2151 OPM") DEFINE_DEVICE_TYPE(YM2164, ym2164_device, "ym2164", "Yamaha YM2164 OPP") +DEFINE_DEVICE_TYPE(YM2414, ym2414_device, "ym2414", "Yamaha YM2414 OPZ") #define FREQ_SH 16 /* 16.16 fixed point (frequency calculations) */ @@ -1715,6 +1716,16 @@ ym2164_device::ym2164_device(const machine_config &mconfig, const char *tag, dev } +//------------------------------------------------- +// ym2414_device - constructor +//------------------------------------------------- + +ym2414_device::ym2414_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : ym2151_device(mconfig, YM2414, tag, owner, clock) +{ +} + + //------------------------------------------------- // read - read from the device //------------------------------------------------- diff --git a/src/devices/sound/ym2151.h b/src/devices/sound/ym2151.h index ee32c6f3ed6..d5e455f3fbd 100644 --- a/src/devices/sound/ym2151.h +++ b/src/devices/sound/ym2151.h @@ -282,10 +282,19 @@ protected: virtual void write_reg(int r, int v) override; }; +// ======================> ym2414_device + +class ym2414_device : public ym2151_device +{ +public: + // construction/destruction + ym2414_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); +}; // device type definition DECLARE_DEVICE_TYPE(YM2151, ym2151_device) DECLARE_DEVICE_TYPE(YM2164, ym2164_device) +DECLARE_DEVICE_TYPE(YM2414, ym2414_device) #endif // MAME_SOUND_YM2151_H diff --git a/src/mame/drivers/korgz3.cpp b/src/mame/drivers/korgz3.cpp index 48c8d3ce530..f0ffd54d4a0 100644 --- a/src/mame/drivers/korgz3.cpp +++ b/src/mame/drivers/korgz3.cpp @@ -12,6 +12,8 @@ #include "machine/adc0808.h" #include "machine/nvram.h" #include "machine/pic8259.h" +#include "sound/ym2151.h" +#include "speaker.h" class korgz3_state : public driver_device { @@ -94,7 +96,7 @@ void korgz3_state::synth_map(address_map &map) map(0x0000, 0x0027).m(m_synthcpu, FUNC(hd6301y_cpu_device::hd6301y_io)); map(0x0040, 0x013f).ram(); map(0x2000, 0x2000).nopr(); - //map(0x3800, 0x3801).rw("ymsnd", FUNC(ym2414_device::read), FUNC(ym2414_device::write)); + map(0x3800, 0x3801).rw("ymsnd", FUNC(ym2414_device::read), FUNC(ym2414_device::write)); map(0x4000, 0x7fff).ram().share("nvram"); map(0x8000, 0xffff).rom().region("hd6303_program", 0); } @@ -125,7 +127,12 @@ void korgz3_state::korgz3(machine_config &config) M58990(config, m_adc, 1'000'000); // M58990P-1 - //YM2414(config, "ymsnd", ?'???'???); // YM2414B + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + ym2414_device &ymsnd(YM2414(config, "ymsnd", 3'579'545)); // YM2414B + ymsnd.add_route(0, "lspeaker", 0.60); + ymsnd.add_route(1, "rspeaker", 0.60); } ROM_START(korgz3)