summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/machine/i8214.cpp13
-rw-r--r--src/devices/machine/i8214.h5
-rw-r--r--src/mame/drivers/konin.cpp52
3 files changed, 64 insertions, 6 deletions
diff --git a/src/devices/machine/i8214.cpp b/src/devices/machine/i8214.cpp
index 47ecac623e2..454c726a99d 100644
--- a/src/devices/machine/i8214.cpp
+++ b/src/devices/machine/i8214.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Curt Coder
/**********************************************************************
- Intel 8214 Priority Interrupt Controller emulation
+ Intel 8214/3214 Priority Interrupt Control Unit
**********************************************************************/
@@ -135,6 +135,17 @@ uint8_t i8214_device::a_r()
//-------------------------------------------------
+// vector_r - read A outputs to be latched as an
+// 8080-compatible interrupt vector
+//-------------------------------------------------
+
+READ8_MEMBER(i8214_device::vector_r)
+{
+ return 0xc7 | (m_a << 3);
+}
+
+
+//-------------------------------------------------
// b_w -
//-------------------------------------------------
diff --git a/src/devices/machine/i8214.h b/src/devices/machine/i8214.h
index 4c7741aff00..be29f0e787e 100644
--- a/src/devices/machine/i8214.h
+++ b/src/devices/machine/i8214.h
@@ -2,7 +2,7 @@
// copyright-holders:Curt Coder
/**********************************************************************
- Intel 8214 Priority Interrupt Controller emulation
+ Intel 8214/3214 Priority Interrupt Control Unit
**********************************************************************
_____ _____
@@ -12,7 +12,7 @@
_SGS 4 | | 21 _R6
_INT 5 | | 20 _R5
_CLK 6 | 8214 | 19 _R4
- INTE 7 | | 18 _R3
+ INTE 7 | 3214 | 18 _R3
_A0 8 | | 17 _R2
_A1 9 | | 16 _R1
_A2 10 | | 15 _R0
@@ -60,6 +60,7 @@ public:
DECLARE_WRITE_LINE_MEMBER( inte_w );
uint8_t a_r();
+ DECLARE_READ8_MEMBER(vector_r);
void b_w(uint8_t data);
void r_w(int line, int state);
diff --git a/src/mame/drivers/konin.cpp b/src/mame/drivers/konin.cpp
index ab55a8baafd..89daace1bd1 100644
--- a/src/mame/drivers/konin.cpp
+++ b/src/mame/drivers/konin.cpp
@@ -44,7 +44,11 @@ Terminal settings: 8 data bits, 2 stop bits, no parity @ 9600
#include "emu.h"
#include "cpu/i8085/i8085.h"
+#include "machine/i8212.h"
+#include "machine/i8214.h"
#include "machine/i8251.h"
+#include "machine/pit8253.h"
+#include "machine/i8255.h"
#include "bus/rs232/rs232.h"
#include "machine/clock.h"
@@ -54,24 +58,47 @@ public:
konin_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_picu(*this, "picu")
{ }
+ DECLARE_WRITE8_MEMBER(picu_b_w);
+ DECLARE_WRITE_LINE_MEMBER(picu_r3_w);
+
private:
- virtual void machine_reset() override;
+ virtual void machine_start() override;
required_device<cpu_device> m_maincpu;
+ required_device<i8214_device> m_picu;
};
+WRITE8_MEMBER(konin_state::picu_b_w)
+{
+ m_picu->b_w(data ^ 7);
+}
+
+WRITE_LINE_MEMBER(konin_state::picu_r3_w)
+{
+ m_picu->r_w(3, !state);
+}
+
static ADDRESS_MAP_START( konin_mem, AS_PROGRAM, 8, konin_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x4fff) AM_ROM
- AM_RANGE(0x5000, 0xffff) AM_RAM
+ AM_RANGE(0x5000, 0x7fff) AM_RAM
+ AM_RANGE(0xf200, 0xf200) AM_WRITENOP // watchdog?
+ AM_RANGE(0xf400, 0xfbff) AM_RAM
+ AM_RANGE(0xfc80, 0xfc83) AM_DEVREADWRITE("mainppi", i8255_device, read, write)
+ AM_RANGE(0xfc84, 0xfc87) AM_DEVREADWRITE("mainpit", pit8253_device, read, write)
+ AM_RANGE(0xff00, 0xffff) AM_RAM
ADDRESS_MAP_END
static ADDRESS_MAP_START( konin_io, AS_IO, 8, konin_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
+ AM_RANGE(0x24, 0x24) AM_WRITE(picu_b_w)
+ AM_RANGE(0x80, 0x83) AM_DEVREADWRITE_MOD("ioppi", i8255_device, read, write, xor<3>)
AM_RANGE(0xf6, 0xf6) AM_DEVREADWRITE("uart", i8251_device, status_r, control_w)
AM_RANGE(0xf7, 0xf7) AM_DEVREADWRITE("uart", i8251_device, data_r, data_w)
+ AM_RANGE(0xf8, 0xfb) AM_DEVREADWRITE_MOD("iopit", pit8253_device, read, write, xor<3>)
ADDRESS_MAP_END
/* Input ports */
@@ -79,7 +106,7 @@ static INPUT_PORTS_START( konin )
INPUT_PORTS_END
-void konin_state::machine_reset()
+void konin_state::machine_start()
{
}
@@ -88,6 +115,24 @@ static MACHINE_CONFIG_START( konin )
MCFG_CPU_ADD("maincpu", I8080, XTAL_4MHz)
MCFG_CPU_PROGRAM_MAP(konin_mem)
MCFG_CPU_IO_MAP(konin_io)
+ MCFG_I8085A_INTE(DEVWRITELINE("picu", i8214_device, inte_w))
+ MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("intlatch", i8212_device, inta_cb)
+
+ MCFG_DEVICE_ADD("intlatch", I8212, 0)
+ MCFG_I8212_MD_CALLBACK(GND)
+ MCFG_I8212_DI_CALLBACK(DEVREAD8("picu", i8214_device, vector_r))
+ MCFG_I8212_INT_CALLBACK(INPUTLINE("maincpu", I8085_INTR_LINE))
+
+ MCFG_DEVICE_ADD("picu", I8214, XTAL_4MHz)
+ MCFG_I8214_INT_CALLBACK(DEVWRITELINE("intlatch", i8212_device, stb_w))
+
+ MCFG_DEVICE_ADD("mainpit", PIT8253, 0)
+
+ MCFG_DEVICE_ADD("mainppi", I8255, 0)
+
+ MCFG_DEVICE_ADD("iopit", PIT8253, 0)
+
+ MCFG_DEVICE_ADD("ioppi", I8255, 0)
MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
MCFG_CLOCK_SIGNAL_HANDLER(DEVWRITELINE("uart", i8251_device, write_txc))
@@ -97,6 +142,7 @@ static MACHINE_CONFIG_START( konin )
MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts))
+ MCFG_I8251_RXRDY_HANDLER(WRITELINE(konin_state, picu_r3_w))
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart", i8251_device, write_rxd))