From 38eec74ef70b2dd1dfd1aaf1f5045ce8a4ab556e Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 8 Apr 2018 23:46:20 +1000 Subject: clean some stuff up (nw) --- src/devices/bus/hp_dio/hp98644.cpp | 16 ++++++++++++++-- src/devices/bus/hp_dio/hp98644.h | 18 ++++++++---------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/devices/bus/hp_dio/hp98644.cpp b/src/devices/bus/hp_dio/hp98644.cpp index b47680e527e..82b814d6f90 100644 --- a/src/devices/bus/hp_dio/hp98644.cpp +++ b/src/devices/bus/hp_dio/hp98644.cpp @@ -10,6 +10,7 @@ #include "hp98644.h" #include "bus/rs232/rs232.h" + //************************************************************************** // GLOBAL VARIABLES //************************************************************************** @@ -21,6 +22,9 @@ DEFINE_DEVICE_TYPE(HPDIO_98644, dio16_98644_device, "dio98644", "HP98644A Asynch // device_add_mconfig - add device configuration //------------------------------------------------- +#define RS232_TAG "rs232" +#define INS8250_TAG "ins8250" + MACHINE_CONFIG_START( dio16_98644_device::device_add_mconfig ) MCFG_DEVICE_ADD(INS8250_TAG, INS8250, XTAL(2'457'600)) @@ -136,6 +140,7 @@ void dio16_98644_device::device_start() { // set_nubus_device makes m_slot valid set_dio_device(); + m_installed_io = false; } //------------------------------------------------- @@ -147,8 +152,15 @@ void dio16_98644_device::device_reset() uint8_t code = m_switches->read() >> REG_SWITCHES_SELECT_CODE_SHIFT; code &= REG_SWITCHES_SELECT_CODE_MASK; - m_dio->install_memory(0x600000 + (code * 0x10000), 0x6007ff + (code * 0x10000), read16_delegate(FUNC(dio16_98644_device::io_r), this), - write16_delegate(FUNC(dio16_98644_device::io_w), this)); + if (!m_installed_io) + { + m_dio->install_memory( + 0x600000 + (code * 0x10000), + 0x6007ff + (code * 0x10000), + read16_delegate(FUNC(dio16_98644_device::io_r), this), + write16_delegate(FUNC(dio16_98644_device::io_w), this)); + m_installed_io = true; + } } READ16_MEMBER(dio16_98644_device::io_r) diff --git a/src/devices/bus/hp_dio/hp98644.h b/src/devices/bus/hp_dio/hp98644.h index 8b3e13775fa..94bb4437fae 100644 --- a/src/devices/bus/hp_dio/hp98644.h +++ b/src/devices/bus/hp_dio/hp98644.h @@ -9,9 +9,6 @@ #include "hp_dio.h" #include "machine/ins8250.h" -#define RS232_TAG "rs232" -#define INS8250_TAG "ins8250" - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -26,11 +23,6 @@ public: // construction/destruction dio16_98644_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - DECLARE_READ16_MEMBER(io_r); - DECLARE_WRITE16_MEMBER(io_w); - - required_device m_uart; - protected: dio16_98644_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -43,11 +35,17 @@ protected: // optional information overrides virtual void device_add_mconfig(machine_config &config) override; + DECLARE_READ16_MEMBER(io_r); + DECLARE_WRITE16_MEMBER(io_w); + + required_device m_uart; + private: required_ioport m_switches; - uint8_t m_control; + bool m_installed_io; + uint8_t m_control; - bool m_loopback; + bool m_loopback; uint8_t m_data; }; -- cgit v1.2.3