From 2cce7ba6926a48b9aa0a40944ac1c1d30038f0f5 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 1 May 2019 17:36:50 +0900 Subject: adc1213x.cpp : Simplify handlers --- src/devices/machine/adc1213x.cpp | 12 ++++++------ src/devices/machine/adc1213x.h | 12 ++++++------ src/mame/drivers/hornet.cpp | 10 +++++----- src/mame/drivers/nwk-tr.cpp | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/devices/machine/adc1213x.cpp b/src/devices/machine/adc1213x.cpp index 889162bcd3a..1931498f58c 100644 --- a/src/devices/machine/adc1213x.cpp +++ b/src/devices/machine/adc1213x.cpp @@ -113,7 +113,7 @@ void adc12138_device::device_reset() di_w -------------------------------------------------*/ -WRITE8_MEMBER( adc12138_device::di_w ) +void adc12138_device::di_w(u8 data) { m_data_in = data & 1; } @@ -211,7 +211,7 @@ void adc12138_device::convert(int channel, int bits16, int lsbfirst) cs_w -------------------------------------------------*/ -WRITE8_MEMBER( adc12138_device::cs_w ) +void adc12138_device::cs_w(u8 data) { if (data) { @@ -292,7 +292,7 @@ WRITE8_MEMBER( adc12138_device::cs_w ) sclk_w -------------------------------------------------*/ -WRITE8_MEMBER( adc12138_device::sclk_w ) +void adc12138_device::sclk_w(u8 data) { if (data) { @@ -312,7 +312,7 @@ WRITE8_MEMBER( adc12138_device::sclk_w ) conv_w -------------------------------------------------*/ -WRITE8_MEMBER( adc12138_device::conv_w ) +void adc12138_device::conv_w(u8 data) { m_end_conv = 1; } @@ -321,7 +321,7 @@ WRITE8_MEMBER( adc12138_device::conv_w ) do_r -------------------------------------------------*/ -READ8_MEMBER( adc12138_device::do_r ) +u8 adc12138_device::do_r() { //printf("ADC: DO\n"); return m_data_out; @@ -331,7 +331,7 @@ READ8_MEMBER( adc12138_device::do_r ) eoc_r -------------------------------------------------*/ -READ8_MEMBER( adc12138_device::eoc_r ) +u8 adc12138_device::eoc_r() { return m_end_conv; } diff --git a/src/devices/machine/adc1213x.h b/src/devices/machine/adc1213x.h index f8dc4f9dd4c..985659be2e3 100644 --- a/src/devices/machine/adc1213x.h +++ b/src/devices/machine/adc1213x.h @@ -36,12 +36,12 @@ public: set_ipt_convert_callback(ipt_convert_delegate(callback, name, nullptr, static_cast(nullptr))); } - DECLARE_WRITE8_MEMBER( di_w ); - DECLARE_WRITE8_MEMBER( cs_w ); - DECLARE_WRITE8_MEMBER( sclk_w ); - DECLARE_WRITE8_MEMBER( conv_w ); - DECLARE_READ8_MEMBER( do_r ); - DECLARE_READ8_MEMBER( eoc_r ); + void di_w(u8 data); + void cs_w(u8 data); + void sclk_w(u8 data); + void conv_w(u8 data = 0); + u8 do_r(); + u8 eoc_r(); protected: adc12138_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/mame/drivers/hornet.cpp b/src/mame/drivers/hornet.cpp index 9416abc126b..205becc7026 100644 --- a/src/mame/drivers/hornet.cpp +++ b/src/mame/drivers/hornet.cpp @@ -556,7 +556,7 @@ READ8_MEMBER(hornet_state::sysreg_r) 0x01 = ADDO (ADC DO) */ r = 0xf0; - r |= m_adc12138->do_r(space, 0) | (m_adc12138->eoc_r(space, 0) << 2); + r |= m_adc12138->do_r() | (m_adc12138->eoc_r() << 2); break; case 4: /* I/O port 4 - DIP switches */ @@ -607,10 +607,10 @@ WRITE8_MEMBER(hornet_state::sysreg_w) 0x02 = ADDI (ADC DI) 0x01 = ADDSCLK (ADC SCLK) */ - m_adc12138->cs_w(space, 0, (data >> 3) & 0x1); - m_adc12138->conv_w(space, 0, (data >> 2) & 0x1); - m_adc12138->di_w(space, 0, (data >> 1) & 0x1); - m_adc12138->sclk_w(space, 0, data & 0x1); + m_adc12138->cs_w((data >> 3) & 0x1); + m_adc12138->conv_w((data >> 2) & 0x1); + m_adc12138->di_w((data >> 1) & 0x1); + m_adc12138->sclk_w(data & 0x1); m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE); osd_printf_debug("System register 1 = %02X\n", data); diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp index c057ba4466b..d21b63e5063 100644 --- a/src/mame/drivers/nwk-tr.cpp +++ b/src/mame/drivers/nwk-tr.cpp @@ -426,7 +426,7 @@ READ32_MEMBER(nwktr_state::sysreg_r) } if (ACCESSING_BITS_0_7) { - r |= m_adc12138->do_r(space, 0) | (m_adc12138->eoc_r(space, 0) << 2); + r |= m_adc12138->do_r() | (m_adc12138->eoc_r() << 2); } } else if (offset == 1) @@ -462,10 +462,10 @@ WRITE32_MEMBER(nwktr_state::sysreg_w) int di = (data >> 25) & 0x1; int sclk = (data >> 24) & 0x1; - m_adc12138->cs_w(space, 0, cs); - m_adc12138->conv_w(space, 0, conv); - m_adc12138->di_w(space, 0, di); - m_adc12138->sclk_w(space, 0, sclk); + m_adc12138->cs_w(cs); + m_adc12138->conv_w(conv); + m_adc12138->di_w(di); + m_adc12138->sclk_w(sclk); } if (ACCESSING_BITS_0_7) { -- cgit v1.2.3