diff options
| author | 2019-02-18 23:07:45 -0500 | |
|---|---|---|
| committer | 2019-02-18 23:07:45 -0500 | |
| commit | 42f54961d8552fed54bd53e63b0e14bcd0c9a71e (patch) | |
| tree | 0186dc40017cdc4b12f441ecfa2509f206f84c36 /src/devices | |
| parent | 58e6b1acb251c96c3e0d96242209ee5759ec5da4 (diff) | |
mc6852, mc6854, mos6551: Simplify read/write handlers (nw)
Diffstat (limited to 'src/devices')
| -rw-r--r-- | src/devices/bus/a2bus/a2ssc.cpp | 4 | ||||
| -rw-r--r-- | src/devices/bus/acorn/atom/econet.cpp | 2 | ||||
| -rw-r--r-- | src/devices/bus/acorn/cms/4080term.cpp | 2 | ||||
| -rw-r--r-- | src/devices/bus/acorn/system/econet.cpp | 2 | ||||
| -rw-r--r-- | src/devices/bus/amiga/zorro/a2232.cpp | 4 | ||||
| -rw-r--r-- | src/devices/bus/c64/swiftlink.cpp | 4 | ||||
| -rw-r--r-- | src/devices/bus/c64/tdos.cpp | 4 | ||||
| -rw-r--r-- | src/devices/bus/c64/turbo232.cpp | 6 | ||||
| -rw-r--r-- | src/devices/bus/coco/coco_dcmodem.cpp | 4 | ||||
| -rw-r--r-- | src/devices/bus/coco/coco_rs232.cpp | 4 | ||||
| -rw-r--r-- | src/devices/bus/pet/superpet.cpp | 4 | ||||
| -rw-r--r-- | src/devices/machine/mc6852.cpp | 7 | ||||
| -rw-r--r-- | src/devices/machine/mc6852.h | 4 | ||||
| -rw-r--r-- | src/devices/machine/mc6854.cpp | 4 | ||||
| -rw-r--r-- | src/devices/machine/mc6854.h | 4 | ||||
| -rw-r--r-- | src/devices/machine/mos6551.cpp | 27 | ||||
| -rw-r--r-- | src/devices/machine/mos6551.h | 4 |
17 files changed, 46 insertions, 44 deletions
diff --git a/src/devices/bus/a2bus/a2ssc.cpp b/src/devices/bus/a2bus/a2ssc.cpp index 0261835e1d7..773f4db246f 100644 --- a/src/devices/bus/a2bus/a2ssc.cpp +++ b/src/devices/bus/a2bus/a2ssc.cpp @@ -189,7 +189,7 @@ uint8_t a2bus_ssc_device::read_c0nx(uint8_t offset) case 9: case 0xa: case 0xb: - return m_acia->read(machine().dummy_space(), offset-8); + return m_acia->read(offset-8); } @@ -208,7 +208,7 @@ void a2bus_ssc_device::write_c0nx(uint8_t offset, uint8_t data) case 9: case 0xa: case 0xb: - m_acia->write(machine().dummy_space(), offset-8, data); + m_acia->write(offset-8, data); break; } } diff --git a/src/devices/bus/acorn/atom/econet.cpp b/src/devices/bus/acorn/atom/econet.cpp index 210ca895445..5051fd0e8e7 100644 --- a/src/devices/bus/acorn/atom/econet.cpp +++ b/src/devices/bus/acorn/atom/econet.cpp @@ -63,7 +63,7 @@ void atom_econet_device::device_start() { address_space &space = m_bus->memspace(); - space.install_readwrite_handler(0xb400, 0xb403, read8_delegate(FUNC(mc6854_device::read), m_adlc.target()), write8_delegate(FUNC(mc6854_device::write), m_adlc.target())); + space.install_readwrite_handler(0xb400, 0xb403, read8sm_delegate(FUNC(mc6854_device::read), m_adlc.target()), write8sm_delegate(FUNC(mc6854_device::write), m_adlc.target())); space.install_read_handler(0xb404, 0xb404, read8_delegate(FUNC(atom_econet_device::statid_r), this)); } diff --git a/src/devices/bus/acorn/cms/4080term.cpp b/src/devices/bus/acorn/cms/4080term.cpp index 24d77b1ec36..9880291b7c0 100644 --- a/src/devices/bus/acorn/cms/4080term.cpp +++ b/src/devices/bus/acorn/cms/4080term.cpp @@ -149,7 +149,7 @@ void cms_4080term_device::device_start() space.install_readwrite_handler(0xfd20, 0xfd2f, read8_delegate(FUNC(ef9345_device::data_r), m_ef9345.target()), write8_delegate(FUNC(ef9345_device::data_w), m_ef9345.target())); space.install_readwrite_handler(0xfd30, 0xfd3f, read8sm_delegate(FUNC(via6522_device::read), m_via.target()), write8sm_delegate(FUNC(via6522_device::write), m_via.target())); - space.install_readwrite_handler(0xfd40, 0xfd4f, read8_delegate(FUNC(mos6551_device::read), m_acia.target()), write8_delegate(FUNC(mos6551_device::write), m_acia.target())); + space.install_readwrite_handler(0xfd40, 0xfd4f, read8sm_delegate(FUNC(mos6551_device::read), m_acia.target()), write8sm_delegate(FUNC(mos6551_device::write), m_acia.target())); uint8_t *FNT = memregion("ef9345")->base(); uint16_t dest = 0x2000; diff --git a/src/devices/bus/acorn/system/econet.cpp b/src/devices/bus/acorn/system/econet.cpp index d6613f35bf7..f8e2c6f0ce4 100644 --- a/src/devices/bus/acorn/system/econet.cpp +++ b/src/devices/bus/acorn/system/econet.cpp @@ -72,7 +72,7 @@ void acorn_econet_device::device_reset() { address_space &space = m_bus->memspace(); - space.install_readwrite_handler(0x1940, 0x1943, read8_delegate(FUNC(mc6854_device::read), m_adlc.target()), write8_delegate(FUNC(mc6854_device::write), m_adlc.target())); + space.install_readwrite_handler(0x1940, 0x1943, read8sm_delegate(FUNC(mc6854_device::read), m_adlc.target()), write8sm_delegate(FUNC(mc6854_device::write), m_adlc.target())); space.install_read_handler(0x1944, 0x1944, read8_delegate(FUNC(acorn_econet_device::statid_r), this)); } diff --git a/src/devices/bus/amiga/zorro/a2232.cpp b/src/devices/bus/amiga/zorro/a2232.cpp index 98b3880f00a..b3dd5296f43 100644 --- a/src/devices/bus/amiga/zorro/a2232.cpp +++ b/src/devices/bus/amiga/zorro/a2232.cpp @@ -344,13 +344,13 @@ WRITE16_MEMBER( a2232_device::reset_high_w ) template<int N> READ8_MEMBER( a2232_device::acia_r ) { - return m_acia[N]->read(space, offset >> 1); + return m_acia[N]->read(offset >> 1); } template<int N> WRITE8_MEMBER( a2232_device::acia_w ) { - m_acia[N]->write(space, offset >> 1, data); + m_acia[N]->write(offset >> 1, data); } diff --git a/src/devices/bus/c64/swiftlink.cpp b/src/devices/bus/c64/swiftlink.cpp index 3f807fb13dc..5d323171a0a 100644 --- a/src/devices/bus/c64/swiftlink.cpp +++ b/src/devices/bus/c64/swiftlink.cpp @@ -131,7 +131,7 @@ uint8_t c64_swiftlink_cartridge_device::c64_cd_r(address_space &space, offs_t of if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) || ((m_cs == D700) && ((offset & 0xff00) == 0xd700))) { - data = m_acia->read(space, offset & 0x03); + data = m_acia->read(offset & 0x03); } return data; @@ -147,7 +147,7 @@ void c64_swiftlink_cartridge_device::c64_cd_w(address_space &space, offs_t offse if (((m_cs == DE00) && !io1) || ((m_cs == DF00) && !io2) || ((m_cs == D700) && ((offset & 0xff00) == 0xd700))) { - m_acia->write(space, offset & 0x03, data); + m_acia->write(offset & 0x03, data); } } diff --git a/src/devices/bus/c64/tdos.cpp b/src/devices/bus/c64/tdos.cpp index a814ccc26a8..a5ffb2e0517 100644 --- a/src/devices/bus/c64/tdos.cpp +++ b/src/devices/bus/c64/tdos.cpp @@ -244,7 +244,7 @@ uint8_t c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, switch ((offset >> 1) & 0x7f) { case 0: - data = m_ssda->read(space, offset & 0x01); + data = m_ssda->read(offset & 0x01); break; case 1: @@ -286,7 +286,7 @@ void c64_tdos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, ui switch ((offset >> 1) & 0x7f) { case 0: - m_ssda->write(space, offset & 0x01, data); + m_ssda->write(offset & 0x01, data); break; case 1: diff --git a/src/devices/bus/c64/turbo232.cpp b/src/devices/bus/c64/turbo232.cpp index 4c6e5f1ebdb..93cfcec1864 100644 --- a/src/devices/bus/c64/turbo232.cpp +++ b/src/devices/bus/c64/turbo232.cpp @@ -138,7 +138,7 @@ uint8_t c64_turbo232_cartridge_device::c64_cd_r(address_space &space, offs_t off switch (offset & 0x07) { case 0: case 1: case 2: case 3: - data = m_acia->read(space, offset & 0x03); + data = m_acia->read(offset & 0x03); break; case 7: @@ -165,11 +165,11 @@ void c64_turbo232_cartridge_device::c64_cd_w(address_space &space, offs_t offset switch (offset & 0x07) { case 0: case 1: case 2: - m_acia->write(space, offset & 0x03, data); + m_acia->write(offset & 0x03, data); break; case 3: - m_acia->write(space, offset & 0x03, data); + m_acia->write(offset & 0x03, data); if (data & 0x0f) m_es &= ~ES_M; diff --git a/src/devices/bus/coco/coco_dcmodem.cpp b/src/devices/bus/coco/coco_dcmodem.cpp index cad760775b7..693b2457e51 100644 --- a/src/devices/bus/coco/coco_dcmodem.cpp +++ b/src/devices/bus/coco/coco_dcmodem.cpp @@ -58,8 +58,8 @@ namespace virtual void device_start() override { install_readwrite_handler(0xFF6C, 0xFF6F, - read8_delegate(FUNC(mos6551_device::read), (mos6551_device *)m_uart), - write8_delegate(FUNC(mos6551_device::write), (mos6551_device *)m_uart)); + read8sm_delegate(FUNC(mos6551_device::read), (mos6551_device *)m_uart), + write8sm_delegate(FUNC(mos6551_device::write), (mos6551_device *)m_uart)); } virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/coco/coco_rs232.cpp b/src/devices/bus/coco/coco_rs232.cpp index 802d46251ad..e058a9d3f3c 100644 --- a/src/devices/bus/coco/coco_rs232.cpp +++ b/src/devices/bus/coco/coco_rs232.cpp @@ -56,8 +56,8 @@ namespace virtual void device_start() override { install_readwrite_handler(0xFF68, 0xFF6B, - read8_delegate(FUNC(mos6551_device::read), (mos6551_device *)m_uart), - write8_delegate(FUNC(mos6551_device::write), (mos6551_device *)m_uart)); + read8sm_delegate(FUNC(mos6551_device::read), (mos6551_device *)m_uart), + write8sm_delegate(FUNC(mos6551_device::write), (mos6551_device *)m_uart)); } virtual const tiny_rom_entry *device_rom_region() const override; diff --git a/src/devices/bus/pet/superpet.cpp b/src/devices/bus/pet/superpet.cpp index 1aa3ed05014..b69e7828a5a 100644 --- a/src/devices/bus/pet/superpet.cpp +++ b/src/devices/bus/pet/superpet.cpp @@ -284,7 +284,7 @@ uint8_t superpet_device::pet_bd_r(address_space &space, offs_t offset, uint8_t d case 0xeff1: case 0xeff2: case 0xeff3: - data = m_acia->read(space, offset & 0x03); + data = m_acia->read(offset & 0x03); break; } @@ -322,7 +322,7 @@ void superpet_device::pet_bd_w(address_space &space, offs_t offset, uint8_t data case 0xeff1: case 0xeff2: case 0xeff3: - m_acia->write(space, offset & 0x03, data); + m_acia->write(offset & 0x03, data); break; case 0xeff8: diff --git a/src/devices/machine/mc6852.cpp b/src/devices/machine/mc6852.cpp index d2021a450a2..6d5a9876153 100644 --- a/src/devices/machine/mc6852.cpp +++ b/src/devices/machine/mc6852.cpp @@ -147,7 +147,7 @@ void mc6852_device::rcv_complete() // read - //------------------------------------------------- -READ8_MEMBER( mc6852_device::read ) +uint8_t mc6852_device::read(offs_t offset) { uint8_t data = 0; @@ -156,7 +156,8 @@ READ8_MEMBER( mc6852_device::read ) if (m_rx_fifo.size() > 0) { data = m_rx_fifo.front(); - m_rx_fifo.pop(); + if (!machine().side_effects_disabled()) + m_rx_fifo.pop(); } } else @@ -172,7 +173,7 @@ READ8_MEMBER( mc6852_device::read ) // write - //------------------------------------------------- -WRITE8_MEMBER( mc6852_device::write ) +void mc6852_device::write(offs_t offset, uint8_t data) { if (BIT(offset, 0)) { diff --git a/src/devices/machine/mc6852.h b/src/devices/machine/mc6852.h index 624ac22657d..3f05182ed6f 100644 --- a/src/devices/machine/mc6852.h +++ b/src/devices/machine/mc6852.h @@ -52,8 +52,8 @@ public: auto sm_dtr_callback() { return m_write_sm_dtr.bind(); } auto tuf_callback() { return m_write_tuf.bind(); } - DECLARE_READ8_MEMBER( read ); - DECLARE_WRITE8_MEMBER( write ); + uint8_t read(offs_t offset); + void write(offs_t offset, uint8_t data); DECLARE_WRITE_LINE_MEMBER( rx_data_w ) { device_serial_interface::rx_w(state); } DECLARE_WRITE_LINE_MEMBER( rx_clk_w ) { rx_clock_w(state); } diff --git a/src/devices/machine/mc6854.cpp b/src/devices/machine/mc6854.cpp index 43e09eba5d2..acaa74b0cf9 100644 --- a/src/devices/machine/mc6854.cpp +++ b/src/devices/machine/mc6854.cpp @@ -809,7 +809,7 @@ void mc6854_device::update_sr1( ) -READ8_MEMBER( mc6854_device::read ) +uint8_t mc6854_device::read(offs_t offset) { switch ( offset ) { @@ -850,7 +850,7 @@ READ8_MEMBER( mc6854_device::read ) -WRITE8_MEMBER( mc6854_device::write ) +void mc6854_device::write(offs_t offset, uint8_t data) { switch ( offset ) { diff --git a/src/devices/machine/mc6854.h b/src/devices/machine/mc6854.h index 99f09f5d3a7..0f90544336b 100644 --- a/src/devices/machine/mc6854.h +++ b/src/devices/machine/mc6854.h @@ -40,8 +40,8 @@ public: } /* interface to CPU via address/data bus*/ - DECLARE_READ8_MEMBER( read ); - DECLARE_WRITE8_MEMBER( write ); + uint8_t read(offs_t offset); + void write(offs_t offset, uint8_t data); /* low-level, bit-based interface */ DECLARE_WRITE_LINE_MEMBER( set_rx ); diff --git a/src/devices/machine/mos6551.cpp b/src/devices/machine/mos6551.cpp index c6ba673d0f6..f9edbd39cee 100644 --- a/src/devices/machine/mos6551.cpp +++ b/src/devices/machine/mos6551.cpp @@ -271,7 +271,8 @@ void mos6551_device::update_divider() uint8_t mos6551_device::read_rdr() { - m_status &= ~(SR_PARITY_ERROR | SR_FRAMING_ERROR | SR_OVERRUN | SR_RDRF); + if (!machine().side_effects_disabled()) + m_status &= ~(SR_PARITY_ERROR | SR_FRAMING_ERROR | SR_OVERRUN | SR_RDRF); return m_rdr; } @@ -279,15 +280,18 @@ uint8_t mos6551_device::read_status() { uint8_t status = m_status; - if (m_cts) + if (!machine().side_effects_disabled()) { - status &= ~SR_TDRE; - } + if (m_cts) + { + status &= ~SR_TDRE; + } - if (m_irq_state != 0) - { - m_irq_state = 0; - update_irq(); + if (m_irq_state != 0) + { + m_irq_state = 0; + update_irq(); + } } return status; @@ -375,11 +379,8 @@ void mos6551_device::write_command(uint8_t data) update_divider(); } -READ8_MEMBER( mos6551_device::read ) +uint8_t mos6551_device::read(offs_t offset) { - if (machine().side_effects_disabled()) - return 0xff; - switch (offset & 0x03) { case 0: @@ -397,7 +398,7 @@ READ8_MEMBER( mos6551_device::read ) } } -WRITE8_MEMBER( mos6551_device::write ) +void mos6551_device::write(offs_t offset, uint8_t data) { switch (offset & 0x03) { diff --git a/src/devices/machine/mos6551.h b/src/devices/machine/mos6551.h index 626c17fd0b2..26332cff73c 100644 --- a/src/devices/machine/mos6551.h +++ b/src/devices/machine/mos6551.h @@ -41,8 +41,8 @@ public: auto rts_handler() { return m_rts_handler.bind(); } auto dtr_handler() { return m_dtr_handler.bind(); } - DECLARE_READ8_MEMBER(read); - DECLARE_WRITE8_MEMBER(write); + uint8_t read(offs_t offset); + void write(offs_t offset, uint8_t data); DECLARE_WRITE_LINE_MEMBER(write_xtal1); // txc DECLARE_WRITE_LINE_MEMBER(write_rxd); |
