summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/konin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/konin.cpp')
-rw-r--r--src/mame/drivers/konin.cpp52
1 files changed, 49 insertions, 3 deletions
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))