summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/pofo/exp.cpp5
-rw-r--r--src/devices/bus/pofo/exp.h19
-rw-r--r--src/devices/bus/pofo/hpc101.cpp40
-rw-r--r--src/devices/bus/pofo/hpc101.h4
-rw-r--r--src/devices/bus/pofo/hpc102.cpp57
-rw-r--r--src/devices/bus/pofo/hpc102.h8
-rw-r--r--src/mame/drivers/pofo.cpp7
7 files changed, 127 insertions, 13 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;
};
diff --git a/src/mame/drivers/pofo.cpp b/src/mame/drivers/pofo.cpp
index 4b55589d01e..5476eb3e4af 100644
--- a/src/mame/drivers/pofo.cpp
+++ b/src/mame/drivers/pofo.cpp
@@ -117,7 +117,6 @@ public:
/* interrupt state */
UINT8 m_ip; /* interrupt pending */
UINT8 m_ie; /* interrupt enable */
- UINT8 m_sivr; /* serial interrupt vector register */
/* counter state */
UINT16 m_counter;
@@ -207,7 +206,7 @@ WRITE8_MEMBER( portfolio_state::irq_mask_w )
IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack)
{
- UINT8 vector = m_sivr;
+ UINT8 vector = 0;
for (int i = 0; i < 4; i++)
{
@@ -217,7 +216,7 @@ IRQ_CALLBACK_MEMBER(portfolio_state::portfolio_int_ack)
m_ip &= ~(1 << i);
if (i == 3)
- vector = m_sivr;
+ vector = m_exp->eack_r();
else
vector = INTERRUPT_VECTOR[i];
@@ -716,12 +715,10 @@ void portfolio_state::machine_start()
/* set initial values */
m_keylatch = 0xff;
- m_sivr = 0x2a;
/* register for state saving */
save_item(NAME(m_ip));
save_item(NAME(m_ie));
- save_item(NAME(m_sivr));
save_item(NAME(m_counter));
save_item(NAME(m_keylatch));
save_pointer(NAME(m_contrast.target()), m_contrast.bytes());