summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-09-23 14:15:47 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-09-23 14:33:39 -0400
commite8571cf46849a94ee4acdcffedf25c8c01cd5674 (patch)
treeba76d793a9e3d87907d02f064819975c8b8a5e53
parentdf9c9fa457247cf9de00b8f59967b4aa2470b317 (diff)
seattle: Add Intel 8259 and Am9513 devices (nw)
-rw-r--r--src/devices/machine/am9513.cpp4
-rw-r--r--src/mame/drivers/seattlecmp.cpp45
2 files changed, 38 insertions, 11 deletions
diff --git a/src/devices/machine/am9513.cpp b/src/devices/machine/am9513.cpp
index 43b163a25df..14d8d3eb88c 100644
--- a/src/devices/machine/am9513.cpp
+++ b/src/devices/machine/am9513.cpp
@@ -447,6 +447,7 @@ void am9513_device::set_counter_mode(int c, u16 data)
break;
case 0x0002:
+ case 0x0003: // SCP-300F sets this up; why?
if (c < 2 && BIT(m_mmr, c + 2))
set_output(c, m_count[c] == m_alarm[c]);
else
@@ -541,7 +542,7 @@ void am9513_device::set_output(int c, bool state)
void am9513_device::set_toggle(int c, bool state)
{
m_toggle[c] = state;
- if ((m_counter_mode[c] & 0x0007) == 0x0002)
+ if ((m_counter_mode[c] & 0x0006) == 0x0002)
set_output(c, state);
}
@@ -564,6 +565,7 @@ void am9513_device::set_tc(int c, bool state)
set_output(c, state);
break;
case 0x0002:
+ case 0x0003: // SCP-300F sets this up; why?
// TC toggled output
if (!state)
set_toggle(c, !m_toggle[c]);
diff --git a/src/mame/drivers/seattlecmp.cpp b/src/mame/drivers/seattlecmp.cpp
index 9eb4a1efeb8..1acf912a050 100644
--- a/src/mame/drivers/seattlecmp.cpp
+++ b/src/mame/drivers/seattlecmp.cpp
@@ -31,8 +31,9 @@ There is a 4MHz crystal connected to the 9513.
#include "emu.h"
#include "cpu/i86/i86.h"
-#include "machine/clock.h"
+#include "machine/am9513.h"
#include "machine/i8251.h"
+#include "machine/pic8259.h"
#include "bus/rs232/rs232.h"
@@ -42,13 +43,26 @@ public:
seattle_comp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_pic(*this, "pic%u", 1)
{ }
+ DECLARE_READ8_MEMBER(pic_slave_ack);
+
private:
required_device<cpu_device> m_maincpu;
+ required_device_array<pic8259_device, 2> m_pic;
};
+READ8_MEMBER(seattle_comp_state::pic_slave_ack)
+{
+ if (offset == 1)
+ return m_pic[1]->acknowledge();
+
+ return 0;
+}
+
+
static ADDRESS_MAP_START(seattle_mem, AS_PROGRAM, 16, seattle_comp_state)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00000,0xff7ff) AM_RAM
@@ -60,10 +74,9 @@ static ADDRESS_MAP_START(seattle_io, AS_IO, 16, seattle_comp_state)
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0xf6, 0xf7) AM_DEVREADWRITE8("uart", i8251_device, data_r, data_w, 0x00ff)
AM_RANGE(0xf6, 0xf7) AM_DEVREADWRITE8("uart", i8251_device, status_r, control_w, 0xff00)
- //AM_RANGE(0xf0, 0xf1) 8259_0
- //AM_RANGE(0xf2, 0xf3) 8259_1
- //AM_RANGE(0xf4, 0xf5) AM9513
- //AM_RANGE(0xf6, 0xf7) 8251
+ AM_RANGE(0xf0, 0xf1) AM_DEVREADWRITE8("pic1", pic8259_device, read, write, 0xffff)
+ AM_RANGE(0xf2, 0xf3) AM_DEVREADWRITE8("pic2", pic8259_device, read, write, 0xffff)
+ AM_RANGE(0xf4, 0xf5) AM_DEVREADWRITE8("stc", am9513_device, read8, write8, 0xffff)
//AM_RANGE(0xfc, 0xfd) Parallel data, status, serial DCD
//AM_RANGE(0xfe, 0xff) Eprom disable bit, read sense switches (bank of 8 dipswitches)
ADDRESS_MAP_END
@@ -75,8 +88,8 @@ INPUT_PORTS_END
// bit 7 needs to be stripped off, we do this by choosing 7 bits and even parity
static DEVICE_INPUT_DEFAULTS_START( terminal )
- DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 )
- DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 )
+ DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9615 )
+ DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9615 )
DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 )
DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 )
DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN )
@@ -88,16 +101,28 @@ static MACHINE_CONFIG_START( seattle )
MCFG_CPU_ADD("maincpu", I8086, 4000000) // no idea
MCFG_CPU_PROGRAM_MAP(seattle_mem)
MCFG_CPU_IO_MAP(seattle_io)
+ MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic1", pic8259_device, inta_cb)
+
+ MCFG_DEVICE_ADD("pic1", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_INT0))
+ MCFG_PIC8259_CASCADE_ACK_CB(READ8(seattle_comp_state, pic_slave_ack))
+
+ MCFG_DEVICE_ADD("pic2", PIC8259, 0)
+ MCFG_PIC8259_OUT_INT_CB(DEVWRITELINE("pic1", pic8259_device, ir1_w))
- /* video hardware */
- MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600)
- MCFG_CLOCK_SIGNAL_HANDLER(DEVWRITELINE("uart", i8251_device, write_txc))
+ MCFG_DEVICE_ADD("stc", AM9513, XTAL_4MHz)
+ MCFG_AM9513_OUT2_CALLBACK(DEVWRITELINE("pic2", pic8259_device, ir0_w))
+ MCFG_AM9513_OUT3_CALLBACK(DEVWRITELINE("pic2", pic8259_device, ir4_w))
+ MCFG_AM9513_OUT4_CALLBACK(DEVWRITELINE("pic2", pic8259_device, ir7_w))
+ MCFG_AM9513_OUT5_CALLBACK(DEVWRITELINE("uart", i8251_device, write_txc))
MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("uart", i8251_device, write_rxc))
MCFG_DEVICE_ADD("uart", I8251, 0)
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(DEVWRITELINE("pic2", pic8259_device, ir1_w))
+ MCFG_I8251_TXRDY_HANDLER(DEVWRITELINE("pic2", pic8259_device, ir5_w))
MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart", i8251_device, write_rxd))