seattle: Add Intel 8259 and Am9513 devices (nw)

This commit is contained in:
AJR 2017-09-23 14:15:47 -04:00
parent df9c9fa457
commit e8571cf468
2 changed files with 38 additions and 11 deletions

View File

@ -447,6 +447,7 @@ void am9513_device::set_counter_mode(int c, u16 data)
break; break;
case 0x0002: case 0x0002:
case 0x0003: // SCP-300F sets this up; why?
if (c < 2 && BIT(m_mmr, c + 2)) if (c < 2 && BIT(m_mmr, c + 2))
set_output(c, m_count[c] == m_alarm[c]); set_output(c, m_count[c] == m_alarm[c]);
else else
@ -541,7 +542,7 @@ void am9513_device::set_output(int c, bool state)
void am9513_device::set_toggle(int c, bool state) void am9513_device::set_toggle(int c, bool state)
{ {
m_toggle[c] = state; m_toggle[c] = state;
if ((m_counter_mode[c] & 0x0007) == 0x0002) if ((m_counter_mode[c] & 0x0006) == 0x0002)
set_output(c, state); set_output(c, state);
} }
@ -564,6 +565,7 @@ void am9513_device::set_tc(int c, bool state)
set_output(c, state); set_output(c, state);
break; break;
case 0x0002: case 0x0002:
case 0x0003: // SCP-300F sets this up; why?
// TC toggled output // TC toggled output
if (!state) if (!state)
set_toggle(c, !m_toggle[c]); set_toggle(c, !m_toggle[c]);

View File

@ -31,8 +31,9 @@ There is a 4MHz crystal connected to the 9513.
#include "emu.h" #include "emu.h"
#include "cpu/i86/i86.h" #include "cpu/i86/i86.h"
#include "machine/clock.h" #include "machine/am9513.h"
#include "machine/i8251.h" #include "machine/i8251.h"
#include "machine/pic8259.h"
#include "bus/rs232/rs232.h" #include "bus/rs232/rs232.h"
@ -42,13 +43,26 @@ public:
seattle_comp_state(const machine_config &mconfig, device_type type, const char *tag) seattle_comp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu") , m_maincpu(*this, "maincpu")
, m_pic(*this, "pic%u", 1)
{ } { }
DECLARE_READ8_MEMBER(pic_slave_ack);
private: private:
required_device<cpu_device> m_maincpu; 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) static ADDRESS_MAP_START(seattle_mem, AS_PROGRAM, 16, seattle_comp_state)
ADDRESS_MAP_UNMAP_HIGH ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00000,0xff7ff) AM_RAM 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) 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, data_r, data_w, 0x00ff)
AM_RANGE(0xf6, 0xf7) AM_DEVREADWRITE8("uart", i8251_device, status_r, control_w, 0xff00) AM_RANGE(0xf6, 0xf7) AM_DEVREADWRITE8("uart", i8251_device, status_r, control_w, 0xff00)
//AM_RANGE(0xf0, 0xf1) 8259_0 AM_RANGE(0xf0, 0xf1) AM_DEVREADWRITE8("pic1", pic8259_device, read, write, 0xffff)
//AM_RANGE(0xf2, 0xf3) 8259_1 AM_RANGE(0xf2, 0xf3) AM_DEVREADWRITE8("pic2", pic8259_device, read, write, 0xffff)
//AM_RANGE(0xf4, 0xf5) AM9513 AM_RANGE(0xf4, 0xf5) AM_DEVREADWRITE8("stc", am9513_device, read8, write8, 0xffff)
//AM_RANGE(0xf6, 0xf7) 8251
//AM_RANGE(0xfc, 0xfd) Parallel data, status, serial DCD //AM_RANGE(0xfc, 0xfd) Parallel data, status, serial DCD
//AM_RANGE(0xfe, 0xff) Eprom disable bit, read sense switches (bank of 8 dipswitches) //AM_RANGE(0xfe, 0xff) Eprom disable bit, read sense switches (bank of 8 dipswitches)
ADDRESS_MAP_END 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 // bit 7 needs to be stripped off, we do this by choosing 7 bits and even parity
static DEVICE_INPUT_DEFAULTS_START( terminal ) static DEVICE_INPUT_DEFAULTS_START( terminal )
DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9615 )
DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9615 )
DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 )
DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 )
DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) 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_ADD("maincpu", I8086, 4000000) // no idea
MCFG_CPU_PROGRAM_MAP(seattle_mem) MCFG_CPU_PROGRAM_MAP(seattle_mem)
MCFG_CPU_IO_MAP(seattle_io) MCFG_CPU_IO_MAP(seattle_io)
MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic1", pic8259_device, inta_cb)
/* video hardware */ MCFG_DEVICE_ADD("pic1", PIC8259, 0)
MCFG_DEVICE_ADD("uart_clock", CLOCK, 153600) MCFG_PIC8259_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_INT0))
MCFG_CLOCK_SIGNAL_HANDLER(DEVWRITELINE("uart", i8251_device, write_txc)) 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))
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_DEVCB_CHAIN_OUTPUT(DEVWRITELINE("uart", i8251_device, write_rxc))
MCFG_DEVICE_ADD("uart", I8251, 0) MCFG_DEVICE_ADD("uart", I8251, 0)
MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd))
MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr)) MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr))
MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) 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_PORT_ADD("rs232", default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart", i8251_device, write_rxd)) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart", i8251_device, write_rxd))