diff options
author | 2019-07-18 21:25:00 -0400 | |
---|---|---|
committer | 2019-07-18 21:26:15 -0400 | |
commit | a0ca0e8e7d2ba3f9c86436bb025a2db7f35cc5e6 (patch) | |
tree | e9ab7eec19b44bc672b80685fa0bcf2e39ef66f8 | |
parent | 8a2b84d598f9e22aaa1ed588553dfe0a9c360e67 (diff) |
i8212: Simplify read/write handlers (nw)
supstarf.cpp: Code cleanup (nw)
-rw-r--r-- | src/devices/bus/s100/polyvti.cpp | 4 | ||||
-rw-r--r-- | src/devices/machine/i8212.cpp | 6 | ||||
-rw-r--r-- | src/devices/machine/i8212.h | 6 | ||||
-rw-r--r-- | src/mame/drivers/supstarf.cpp | 54 |
4 files changed, 35 insertions, 35 deletions
diff --git a/src/devices/bus/s100/polyvti.cpp b/src/devices/bus/s100/polyvti.cpp index 03ba6a39413..21bc4365b31 100644 --- a/src/devices/bus/s100/polyvti.cpp +++ b/src/devices/bus/s100/polyvti.cpp @@ -179,7 +179,7 @@ void poly_vti_device::s100_mwrt_w(offs_t offset, u8 data) u8 poly_vti_device::s100_sinp_r(offs_t offset) { if ((offset & 0xfc00) >> 10 == m_address->read()) - return m_kbdlatch->read(machine().dummy_space(), 0); + return m_kbdlatch->read(); return 0xff; } @@ -190,7 +190,7 @@ void poly_vti_device::kbd_put(u8 data) { if (data==8) data=127; // fix backspace - m_kbdlatch->strobe(machine().dummy_space(), 0, data); + m_kbdlatch->strobe(data); } } diff --git a/src/devices/machine/i8212.cpp b/src/devices/machine/i8212.cpp index c6428fe7c13..c6cf46eafe5 100644 --- a/src/devices/machine/i8212.cpp +++ b/src/devices/machine/i8212.cpp @@ -120,7 +120,7 @@ void i8212_device::device_reset() // read - data latch read //------------------------------------------------- -READ8_MEMBER(i8212_device::read) +uint8_t i8212_device::read() { if (!machine().side_effects_disabled()) { @@ -150,7 +150,7 @@ IRQ_CALLBACK_MEMBER(i8212_device::inta_cb) // write - data latch write //------------------------------------------------- -WRITE8_MEMBER(i8212_device::write) +void i8212_device::write(uint8_t data) { // clear interrupt line m_write_int(CLEAR_LINE); @@ -171,7 +171,7 @@ WRITE8_MEMBER(i8212_device::write) // strobe - data input strobe //------------------------------------------------- -WRITE8_MEMBER(i8212_device::strobe) +void i8212_device::strobe(uint8_t data) { if (get_mode() == mode::INPUT) { diff --git a/src/devices/machine/i8212.h b/src/devices/machine/i8212.h index 5168d98c714..efd84d11813 100644 --- a/src/devices/machine/i8212.h +++ b/src/devices/machine/i8212.h @@ -44,12 +44,12 @@ public: auto md_rd_callback() { return m_read_md.bind(); } // data read handlers - DECLARE_READ8_MEMBER(read); + uint8_t read(); IRQ_CALLBACK_MEMBER(inta_cb); // data write handlers - DECLARE_WRITE8_MEMBER(write); - DECLARE_WRITE8_MEMBER(strobe); + void write(uint8_t data); + void strobe(uint8_t data); // line write handlers DECLARE_WRITE_LINE_MEMBER(stb_w); diff --git a/src/mame/drivers/supstarf.cpp b/src/mame/drivers/supstarf.cpp index 2cf19fe2b3a..597d940addf 100644 --- a/src/mame/drivers/supstarf.cpp +++ b/src/mame/drivers/supstarf.cpp @@ -19,27 +19,27 @@ class supstarf_state : public driver_device { public: supstarf_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_soundcpu(*this, "soundcpu"), - m_psg(*this, {"psg1", "psg2"}), - m_soundlatch(*this, {"soundlatch1", "soundlatch2"}) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_soundcpu(*this, "soundcpu") + , m_psg(*this, "psg%u", 1U) + , m_soundlatch(*this, "soundlatch%u", 1U) { } void supstarf(machine_config &config); private: - DECLARE_READ8_MEMBER(psg_latch_r); - DECLARE_WRITE8_MEMBER(psg_latch_w); - DECLARE_WRITE8_MEMBER(port1_w); - DECLARE_WRITE8_MEMBER(port2_w); + u8 psg_latch_r(offs_t offset); + void psg_latch_w(offs_t offset, u8 data); + void port1_w(u8 data); + void port2_w(u8 data); DECLARE_READ_LINE_MEMBER(contacts_r); DECLARE_WRITE_LINE_MEMBER(displays_w); - DECLARE_WRITE8_MEMBER(driver_clk_w); + void driver_clk_w(offs_t offset, u8 data); DECLARE_READ_LINE_MEMBER(phase_detect_r); - DECLARE_WRITE8_MEMBER(lights_a_w); - DECLARE_WRITE8_MEMBER(lights_b_w); + void lights_a_w(u8 data); + void lights_b_w(u8 data); void main_io_map(address_map &map); void main_map(address_map &map); @@ -81,7 +81,7 @@ void supstarf_state::sound_io_map(address_map &map) map(0x00, 0xff).rw(FUNC(supstarf_state::psg_latch_r), FUNC(supstarf_state::psg_latch_w)); } -READ8_MEMBER(supstarf_state::psg_latch_r) +u8 supstarf_state::psg_latch_r(offs_t offset) { u8 result = 0xff; // AR3 +5v pullup @@ -95,12 +95,12 @@ READ8_MEMBER(supstarf_state::psg_latch_r) } if (m_latch_select) - result &= m_soundlatch[1]->read(space, 0); + result &= m_soundlatch[1]->read(); return result; } -WRITE8_MEMBER(supstarf_state::psg_latch_w) +void supstarf_state::psg_latch_w(offs_t offset, u8 data) { for (int d = 0; d < 2; d++) { @@ -112,15 +112,15 @@ WRITE8_MEMBER(supstarf_state::psg_latch_w) } if (m_latch_select) - m_soundlatch[0]->strobe(space, 0, data); + m_soundlatch[0]->strobe(data); } -WRITE8_MEMBER(supstarf_state::port1_w) +void supstarf_state::port1_w(u8 data) { m_port1_data = data; } -WRITE8_MEMBER(supstarf_state::port2_w) +void supstarf_state::port2_w(u8 data) { m_maincpu->set_input_line(INPUT_LINE_RESET, BIT(data, 4) ? CLEAR_LINE : ASSERT_LINE); if (!BIT(data, 4)) @@ -145,7 +145,7 @@ WRITE_LINE_MEMBER(supstarf_state::displays_w) { } -WRITE8_MEMBER(supstarf_state::driver_clk_w) +void supstarf_state::driver_clk_w(offs_t offset, u8 data) { } @@ -154,11 +154,11 @@ READ_LINE_MEMBER(supstarf_state::phase_detect_r) return 0; } -WRITE8_MEMBER(supstarf_state::lights_a_w) +void supstarf_state::lights_a_w(u8 data) { } -WRITE8_MEMBER(supstarf_state::lights_b_w) +void supstarf_state::lights_b_w(u8 data) { } @@ -175,36 +175,36 @@ void supstarf_state::machine_start() void supstarf_state::supstarf(machine_config &config) { - I8085A(config, m_maincpu, XTAL(5'068'800)); + I8085A(config, m_maincpu, 5.0688_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &supstarf_state::main_map); m_maincpu->set_addrmap(AS_IO, &supstarf_state::main_io_map); m_maincpu->in_sid_func().set(FUNC(supstarf_state::contacts_r)); m_maincpu->out_sod_func().set(FUNC(supstarf_state::displays_w)); - I8035(config, m_soundcpu, XTAL(5'068'800) / 2); // from 8085 pin 37 (CLK OUT) + I8035(config, m_soundcpu, 5.0688_MHz_XTAL / 2); // from 8085 pin 37 (CLK OUT) m_soundcpu->set_addrmap(AS_PROGRAM, &supstarf_state::sound_map); m_soundcpu->set_addrmap(AS_IO, &supstarf_state::sound_io_map); m_soundcpu->p1_out_cb().set(FUNC(supstarf_state::port1_w)); m_soundcpu->p2_out_cb().set(FUNC(supstarf_state::port2_w)); m_soundcpu->t1_in_cb().set(FUNC(supstarf_state::phase_detect_r)); - I8212(config, m_soundlatch[0], 0); + I8212(config, m_soundlatch[0]); m_soundlatch[0]->md_rd_callback().set_constant(0); m_soundlatch[0]->int_wr_callback().set_inputline("maincpu", I8085_RST55_LINE); - I8212(config, m_soundlatch[1], 0); + I8212(config, m_soundlatch[1]); m_soundlatch[1]->md_rd_callback().set_constant(0); m_soundlatch[1]->int_wr_callback().set_inputline("soundcpu", MCS48_INPUT_IRQ); //MCFG_DEVCB_CHAIN_OUTPUT(INPUTLINE("maincpu", I8085_READY_LINE)) SPEAKER(config, "mono").front_center(); - AY8910(config, m_psg[0], XTAL(5'068'800) / 6); // from 8035 pin 1 (T0) + AY8910(config, m_psg[0], 5.0688_MHz_XTAL / 6); // from 8035 pin 1 (T0) m_psg[0]->port_a_write_callback().set(FUNC(supstarf_state::lights_a_w)); m_psg[0]->port_b_write_callback().set(FUNC(supstarf_state::lights_b_w)); m_psg[0]->add_route(ALL_OUTPUTS, "mono", 0.50); - AY8910(config, m_psg[1], XTAL(5'068'800) / 6); // from 8035 pin 1 (T0) + AY8910(config, m_psg[1], 5.0688_MHz_XTAL / 6); // from 8035 pin 1 (T0) m_psg[1]->port_a_read_callback().set_ioport("JO"); m_psg[1]->port_b_read_callback().set_ioport("I1"); m_psg[1]->add_route(ALL_OUTPUTS, "mono", 0.50); |