diff options
Diffstat (limited to 'src/devices/machine/mos6551.cpp')
-rw-r--r-- | src/devices/machine/mos6551.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/devices/machine/mos6551.cpp b/src/devices/machine/mos6551.cpp index 37bb874aaf4..f9edbd39cee 100644 --- a/src/devices/machine/mos6551.cpp +++ b/src/devices/machine/mos6551.cpp @@ -63,10 +63,11 @@ const int mos6551_device::transmitter_controls[4][3] = {0, 1, 1} }; -MACHINE_CONFIG_START(mos6551_device::device_add_mconfig) - MCFG_DEVICE_ADD("clock", CLOCK, 0) - MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(*this, mos6551_device, internal_clock)) -MACHINE_CONFIG_END +void mos6551_device::device_add_mconfig(machine_config &config) +{ + CLOCK(config, m_internal_clock, 0); + m_internal_clock->signal_handler().set(FUNC(mos6551_device::internal_clock)); +} void mos6551_device::device_start() @@ -270,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; } @@ -278,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; @@ -374,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: @@ -396,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) { |