diff options
Diffstat (limited to 'src/devices/machine/k054321.cpp')
-rw-r--r-- | src/devices/machine/k054321.cpp | 63 |
1 files changed, 11 insertions, 52 deletions
diff --git a/src/devices/machine/k054321.cpp b/src/devices/machine/k054321.cpp index be7fed6d438..ec59ae89d94 100644 --- a/src/devices/machine/k054321.cpp +++ b/src/devices/machine/k054321.cpp @@ -43,23 +43,24 @@ void k054321_device::main_map(address_map &map) map(0x2, 0x2).w(FUNC(k054321_device::volume_reset_w)); map(0x3, 0x3).w(FUNC(k054321_device::volume_up_w)); map(0x4, 0x4).w(FUNC(k054321_device::dummy_w)); - map(0x6, 0x6).w(FUNC(k054321_device::main1_w)); - map(0x7, 0x7).w(FUNC(k054321_device::main2_w)); + map(0x6, 0x6).w(m_soundlatch[0], FUNC(generic_latch_8_device::write)); + map(0x7, 0x7).w(m_soundlatch[1], FUNC(generic_latch_8_device::write)); map(0x8, 0x8).r(FUNC(k054321_device::busy_r)); - map(0xa, 0xa).r(FUNC(k054321_device::sound1_r)); + map(0xa, 0xa).r(m_soundlatch[2], FUNC(generic_latch_8_device::read)); } void k054321_device::sound_map(address_map &map) { - map(0x0, 0x0).w(FUNC(k054321_device::sound1_w)); - map(0x2, 0x2).r(FUNC(k054321_device::main1_r)); - map(0x3, 0x3).r(FUNC(k054321_device::main2_r)); + map(0x0, 0x0).w(m_soundlatch[2], FUNC(generic_latch_8_device::write)); + map(0x2, 0x2).r(m_soundlatch[0], FUNC(generic_latch_8_device::read)); + map(0x3, 0x3).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); } k054321_device::k054321_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K054321, tag, owner, clock), m_left(*this, finder_base::DUMMY_TAG), - m_right(*this, finder_base::DUMMY_TAG) + m_right(*this, finder_base::DUMMY_TAG), + m_soundlatch(*this, "soundlatch%u", 0) { } @@ -79,56 +80,14 @@ void k054321_device::device_start() m_right_gains[i] = m_right->input_gain(i); // register for savestates - save_item(NAME(m_main1)); - save_item(NAME(m_main2)); - save_item(NAME(m_sound1)); save_item(NAME(m_volume)); save_item(NAME(m_active)); } -TIMER_CALLBACK_MEMBER(k054321_device::write_main1) +void k054321_device::device_add_mconfig(machine_config &config) { - m_main1 = param; -} - -TIMER_CALLBACK_MEMBER(k054321_device::write_main2) -{ - m_main2 = param; -} - -TIMER_CALLBACK_MEMBER(k054321_device::write_sound1) -{ - m_sound1 = param; -} - -READ8_MEMBER( k054321_device::main1_r) -{ - return m_main1; -} - -WRITE8_MEMBER(k054321_device::main1_w) -{ - machine().scheduler().synchronize(timer_expired_delegate(FUNC(k054321_device::write_main1), this), data & 0xff); -} - -READ8_MEMBER( k054321_device::main2_r) -{ - return m_main2; -} - -WRITE8_MEMBER(k054321_device::main2_w) -{ - machine().scheduler().synchronize(timer_expired_delegate(FUNC(k054321_device::write_main2), this), data & 0xff); -} - -READ8_MEMBER( k054321_device::sound1_r) -{ - return m_sound1; -} - -WRITE8_MEMBER(k054321_device::sound1_w) -{ - machine().scheduler().synchronize(timer_expired_delegate(FUNC(k054321_device::write_sound1), this), data & 0xff); + for (int i = 0; i < 3; i++) + GENERIC_LATCH_8(config, m_soundlatch[i]); } WRITE8_MEMBER(k054321_device::volume_reset_w) |