clean some stuff up (nw)

This commit is contained in:
Vas Crabb 2018-04-08 23:46:20 +10:00
parent 2469e33394
commit 38eec74ef7
2 changed files with 22 additions and 12 deletions

View File

@ -10,6 +10,7 @@
#include "hp98644.h" #include "hp98644.h"
#include "bus/rs232/rs232.h" #include "bus/rs232/rs232.h"
//************************************************************************** //**************************************************************************
// GLOBAL VARIABLES // GLOBAL VARIABLES
//************************************************************************** //**************************************************************************
@ -21,6 +22,9 @@ DEFINE_DEVICE_TYPE(HPDIO_98644, dio16_98644_device, "dio98644", "HP98644A Asynch
// device_add_mconfig - add device configuration // device_add_mconfig - add device configuration
//------------------------------------------------- //-------------------------------------------------
#define RS232_TAG "rs232"
#define INS8250_TAG "ins8250"
MACHINE_CONFIG_START( dio16_98644_device::device_add_mconfig ) MACHINE_CONFIG_START( dio16_98644_device::device_add_mconfig )
MCFG_DEVICE_ADD(INS8250_TAG, INS8250, XTAL(2'457'600)) 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_nubus_device makes m_slot valid
set_dio_device(); 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; uint8_t code = m_switches->read() >> REG_SWITCHES_SELECT_CODE_SHIFT;
code &= REG_SWITCHES_SELECT_CODE_MASK; 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), if (!m_installed_io)
write16_delegate(FUNC(dio16_98644_device::io_w), this)); {
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) READ16_MEMBER(dio16_98644_device::io_r)

View File

@ -9,9 +9,6 @@
#include "hp_dio.h" #include "hp_dio.h"
#include "machine/ins8250.h" #include "machine/ins8250.h"
#define RS232_TAG "rs232"
#define INS8250_TAG "ins8250"
//************************************************************************** //**************************************************************************
// TYPE DEFINITIONS // TYPE DEFINITIONS
//************************************************************************** //**************************************************************************
@ -26,11 +23,6 @@ public:
// construction/destruction // construction/destruction
dio16_98644_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); 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<ins8250_device> m_uart;
protected: protected:
dio16_98644_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); 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 // optional information overrides
virtual void device_add_mconfig(machine_config &config) override; virtual void device_add_mconfig(machine_config &config) override;
DECLARE_READ16_MEMBER(io_r);
DECLARE_WRITE16_MEMBER(io_w);
required_device<ins8250_device> m_uart;
private: private:
required_ioport m_switches; 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; uint8_t m_data;
}; };