diff options
author | Curt Coder <curtcoder@mail.com> | 2016-06-15 12:05:56 +0300 |
---|---|---|
committer | Curt Coder <curtcoder@mail.com> | 2016-06-15 12:06:05 +0300 |
commit | 666c5237004e7ca25ed24a528943b83d90ce354e (patch) | |
tree | fb26eb27e3a3554ad3a827962e4fde550844af6a /src/devices | |
parent | 241c32eae44675677eef6e121f66878cf5144842 (diff) |
pofo: Expansion port slot interface WIP. (nw)
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/bus/pofo/exp.cpp | 5 | ||||
-rw-r--r-- | src/devices/bus/pofo/exp.h | 19 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc101.cpp | 40 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc101.h | 4 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc102.cpp | 57 | ||||
-rw-r--r-- | src/devices/bus/pofo/hpc102.h | 8 |
6 files changed, 125 insertions, 8 deletions
diff --git a/src/devices/bus/pofo/exp.cpp b/src/devices/bus/pofo/exp.cpp index 663f1860193..98b411990bf 100644 --- a/src/devices/bus/pofo/exp.cpp +++ b/src/devices/bus/pofo/exp.cpp @@ -32,6 +32,11 @@ device_portfolio_expansion_slot_interface::device_portfolio_expansion_slot_inter m_slot = dynamic_cast<portfolio_expansion_slot_t *>(device.owner()); } +WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::iint_w ) { m_slot->iint_w(state); } +WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::eint_w ) { m_slot->eint_w(state); } +WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::nmio_w ) { m_slot->nmio_w(state); } +WRITE_LINE_MEMBER( device_portfolio_expansion_slot_interface::wake_w ) { m_slot->wake_w(state); } + //************************************************************************** diff --git a/src/devices/bus/pofo/exp.h b/src/devices/bus/pofo/exp.h index 129269ed1cb..3b1e936dca5 100644 --- a/src/devices/bus/pofo/exp.h +++ b/src/devices/bus/pofo/exp.h @@ -93,15 +93,20 @@ public: device_portfolio_expansion_slot_interface(const machine_config &mconfig, device_t &device); virtual ~device_portfolio_expansion_slot_interface() { } - bool nmd1() { return 1; } - bool pdet() { return 0; } - bool cdet() { return 1; } + virtual bool nmd1() { return 1; } + virtual bool pdet() { return 0; } + virtual bool cdet() { return 1; } - UINT8 iack_r() { return 0xff; } - UINT8 eack_r() { return 0xff; } + virtual UINT8 iack_r() { return 0xff; } + virtual UINT8 eack_r() { return 0xff; } - UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { return data; }; - void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { }; + virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { return data; }; + virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) { }; + + DECLARE_WRITE_LINE_MEMBER( iint_w ); + DECLARE_WRITE_LINE_MEMBER( eint_w ); + DECLARE_WRITE_LINE_MEMBER( nmio_w ); + DECLARE_WRITE_LINE_MEMBER( wake_w ); protected: portfolio_expansion_slot_t *m_slot; diff --git a/src/devices/bus/pofo/hpc101.cpp b/src/devices/bus/pofo/hpc101.cpp index 8ea93ac4989..b3286d2b0ef 100644 --- a/src/devices/bus/pofo/hpc101.cpp +++ b/src/devices/bus/pofo/hpc101.cpp @@ -98,4 +98,44 @@ void hpc101_t::device_start() void hpc101_t::device_reset() { + m_ppi->reset(); +} + + +//------------------------------------------------- +// nrdi_r - read +//------------------------------------------------- + +UINT8 hpc101_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +{ + if (!bcom) + { + if ((offset & 0x0f) == 0x0f) + { + data = 0x02; + } + + if ((offset & 0x0c) == 0x08) + { + data = m_ppi->read(space, offset & 0x03); + } + } + + return data; +} + + +//------------------------------------------------- +// nwri_w - write +//------------------------------------------------- + +void hpc101_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +{ + if (!bcom) + { + if ((offset & 0x0c) == 0x08) + { + m_ppi->write(space, offset & 0x03, data); + } + } } diff --git a/src/devices/bus/pofo/hpc101.h b/src/devices/bus/pofo/hpc101.h index dc578e3769b..36b4129049b 100644 --- a/src/devices/bus/pofo/hpc101.h +++ b/src/devices/bus/pofo/hpc101.h @@ -40,6 +40,10 @@ protected: virtual void device_reset() override; // device_portfolio_expansion_slot_interface overrides + bool pdet() override { return 1; } + + virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; + virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; private: required_device<i8255_device> m_ppi; diff --git a/src/devices/bus/pofo/hpc102.cpp b/src/devices/bus/pofo/hpc102.cpp index 8d40470a2eb..4ad13bd2308 100644 --- a/src/devices/bus/pofo/hpc102.cpp +++ b/src/devices/bus/pofo/hpc102.cpp @@ -37,7 +37,7 @@ static MACHINE_CONFIG_FRAGMENT( hpc102 ) MCFG_INS8250_OUT_TX_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_txd)) MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) - //MCFG_INS8250_OUT_INT_CB(WRITELINE(portfolio_state, i8250_intrpt_w)) + MCFG_INS8250_OUT_INT_CB(WRITELINE(device_portfolio_expansion_slot_interface, eint_w)) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, nullptr) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(M82C50A_TAG, ins8250_uart_device, rx_w)) @@ -90,4 +90,59 @@ void hpc102_t::device_start() void hpc102_t::device_reset() { + m_uart->reset(); +} + + +//------------------------------------------------- +// eack_r - external interrupt acknowledge +//------------------------------------------------- + +UINT8 hpc102_t::eack_r() +{ + return m_vector; +} + + +//------------------------------------------------- +// nrdi_r - read +//------------------------------------------------- + +UINT8 hpc102_t::nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +{ + if (!bcom) + { + if ((offset & 0x0f) == 0x0f) + { + data = 0x01; + } + + if (!(offset & 0x08)) + { + data = m_uart->ins8250_r(space, offset & 0x07); + } + } + + return data; +} + + +//------------------------------------------------- +// nwri_w - write +//------------------------------------------------- + +void hpc102_t::nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) +{ + if (!bcom) + { + if ((offset & 0x0f) == 0x0f) + { + m_vector = data; + } + + if (!(offset & 0x08)) + { + m_uart->ins8250_w(space, offset & 0x07, data); + } + } } diff --git a/src/devices/bus/pofo/hpc102.h b/src/devices/bus/pofo/hpc102.h index 0ef1d978e90..c1fb91305af 100644 --- a/src/devices/bus/pofo/hpc102.h +++ b/src/devices/bus/pofo/hpc102.h @@ -40,9 +40,17 @@ protected: virtual void device_reset() override; // device_portfolio_expansion_slot_interface overrides + bool pdet() override { return 1; } + + virtual UINT8 eack_r() override; + + virtual UINT8 nrdi_r(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; + virtual void nwri_w(address_space &space, offs_t offset, UINT8 data, bool iom, bool bcom, bool ncc1) override; private: required_device<ins8250_device> m_uart; + + UINT8 m_vector; }; |