summaryrefslogtreecommitdiffstats
path: root/src/mame/machine/acs8600_ics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/acs8600_ics.cpp')
-rw-r--r--src/mame/machine/acs8600_ics.cpp122
1 files changed, 66 insertions, 56 deletions
diff --git a/src/mame/machine/acs8600_ics.cpp b/src/mame/machine/acs8600_ics.cpp
index 3b63cc119aa..944ea30c1f7 100644
--- a/src/mame/machine/acs8600_ics.cpp
+++ b/src/mame/machine/acs8600_ics.cpp
@@ -15,9 +15,10 @@ DEFINE_DEVICE_TYPE(ACS8600_ICS, acs8600_ics_device, "acs8600_ics", "Altos ACS860
acs8600_ics_device::acs8600_ics_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ACS8600_ICS, tag, owner, clock),
m_icscpu(*this, "icscpu"),
- m_maincpu(*this, finder_base::DUMMY_TAG),
m_out_irq1_func(*this),
- m_out_irq2_func(*this)
+ m_out_irq2_func(*this),
+ m_host_space_device(*this, finder_base::DUMMY_TAG),
+ m_host_space_index(-1)
{
}
@@ -96,35 +97,37 @@ static const z80_daisy_config ics_daisy_chain[] =
};
MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
- MCFG_DEVICE_ADD("icscpu", Z80, XTAL(4'000'000))
+ MCFG_DEVICE_ADD(m_icscpu, Z80, 4_MHz_XTAL)
MCFG_DEVICE_PROGRAM_MAP(ics_mem)
MCFG_DEVICE_IO_MAP(ics_io)
MCFG_Z80_DAISY_CHAIN(ics_daisy_chain)
- MCFG_DEVICE_ADD("stc1", AM9513, XTAL(1'843'200))
- MCFG_AM9513_OUT1_CALLBACK(WRITELINE("sio1", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio1", z80sio_device, txca_w))
- MCFG_AM9513_OUT2_CALLBACK(WRITELINE("sio1", z80sio_device, rxtxcb_w))
- MCFG_AM9513_OUT3_CALLBACK(WRITELINE("sio2", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio2", z80sio_device, txca_w))
- MCFG_AM9513_OUT4_CALLBACK(WRITELINE("sio2", z80sio_device, rxtxcb_w))
- MCFG_AM9513_OUT5_CALLBACK(WRITELINE("sio3", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio3", z80sio_device, txca_w))
- MCFG_DEVICE_ADD("stc2", AM9513, XTAL(1'843'200))
- MCFG_AM9513_OUT1_CALLBACK(WRITELINE("sio3", z80sio_device, rxtxcb_w))
- MCFG_AM9513_OUT2_CALLBACK(WRITELINE("sio4", z80sio_device, rxca_w))
- MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE("sio4", z80sio_device, txca_w))
- MCFG_AM9513_OUT3_CALLBACK(WRITELINE("sio4", z80sio_device, rxtxcb_w))
-
- MCFG_DEVICE_ADD("sio1", Z80SIO, XTAL(8'000'000)/2)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs2321a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs2321a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs2321a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs2321b", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs2321b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs2321b", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("icscpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_CPU("icscpu")
+ am9513_device &stc1(AM9513(config, "stc1", 1.8432_MHz_XTAL));
+ stc1.out1_cb().set("sio1", FUNC(z80sio_device::rxca_w));
+ stc1.out1_cb().append("sio1", FUNC(z80sio_device::txca_w));
+ stc1.out2_cb().set("sio1", FUNC(z80sio_device::rxtxcb_w));
+ stc1.out3_cb().set("sio2", FUNC(z80sio_device::rxca_w));
+ stc1.out3_cb().append("sio2", FUNC(z80sio_device::txca_w));
+ stc1.out4_cb().set("sio2", FUNC(z80sio_device::rxtxcb_w));
+ stc1.out5_cb().set("sio3", FUNC(z80sio_device::rxca_w));
+ stc1.out5_cb().append("sio3", FUNC(z80sio_device::txca_w));
+
+ am9513_device &stc2(AM9513(config, "stc2", 1.8432_MHz_XTAL));
+ stc2.out1_cb().set("sio3", FUNC(z80sio_device::rxtxcb_w));
+ stc2.out2_cb().set("sio4", FUNC(z80sio_device::rxca_w));
+ stc2.out2_cb().append("sio4", FUNC(z80sio_device::txca_w));
+ stc2.out3_cb().set("sio4", FUNC(z80sio_device::rxtxcb_w));
+
+ z80sio_device &sio1(Z80SIO(config, "sio1", 8_MHz_XTAL/2));
+ sio1.out_txda_callback().set("rs2321a", FUNC(rs232_port_device::write_txd));
+ sio1.out_dtra_callback().set("rs2321a", FUNC(rs232_port_device::write_dtr));
+ sio1.out_rtsa_callback().set("rs2321a", FUNC(rs232_port_device::write_rts));
+ sio1.out_txdb_callback().set("rs2321b", FUNC(rs232_port_device::write_txd));
+ sio1.out_dtrb_callback().set("rs2321b", FUNC(rs232_port_device::write_dtr));
+ sio1.out_rtsb_callback().set("rs2321b", FUNC(rs232_port_device::write_rts));
+ sio1.out_int_callback().set_inputline(m_icscpu, INPUT_LINE_IRQ0);
+ sio1.set_cputag(m_icscpu);
+
MCFG_DEVICE_ADD("rs2321a", RS232_PORT, default_rs232_devices, "terminal")
MCFG_RS232_RXD_HANDLER(WRITELINE("sio1", z80sio_device, rxa_w))
MCFG_RS232_DCD_HANDLER(WRITELINE("sio1", z80sio_device, dcda_w))
@@ -136,15 +139,16 @@ MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
MCFG_RS232_DCD_HANDLER(WRITELINE("sio1", z80sio_device, dcdb_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio1", z80sio_device, ctsb_w))
- MCFG_DEVICE_ADD("sio2", Z80SIO, XTAL(8'000'000)/2)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs2322a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs2322a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs2322a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs2322b", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs2322b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs2322b", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("icscpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_CPU("icscpu")
+ z80sio_device &sio2(Z80SIO(config, "sio2", 8_MHz_XTAL/2));
+ sio2.out_txda_callback().set("rs2322a", FUNC(rs232_port_device::write_txd));
+ sio2.out_dtra_callback().set("rs2322a", FUNC(rs232_port_device::write_dtr));
+ sio2.out_rtsa_callback().set("rs2322a", FUNC(rs232_port_device::write_rts));
+ sio2.out_txdb_callback().set("rs2322b", FUNC(rs232_port_device::write_txd));
+ sio2.out_dtrb_callback().set("rs2322b", FUNC(rs232_port_device::write_dtr));
+ sio2.out_rtsb_callback().set("rs2322b", FUNC(rs232_port_device::write_rts));
+ sio2.out_int_callback().set_inputline(m_icscpu, INPUT_LINE_IRQ0);
+ sio2.set_cputag(m_icscpu);
+
MCFG_DEVICE_ADD("rs2322a", RS232_PORT, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio2", z80sio_device, rxa_w))
MCFG_RS232_DCD_HANDLER(WRITELINE("sio2", z80sio_device, dcda_w))
@@ -155,15 +159,16 @@ MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
MCFG_RS232_DCD_HANDLER(WRITELINE("sio2", z80sio_device, dcdb_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio2", z80sio_device, ctsb_w))
- MCFG_DEVICE_ADD("sio3", Z80SIO, XTAL(8'000'000)/2)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs2323a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs2323a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs2323a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs2323b", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs2323b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs2323b", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("icscpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_CPU("icscpu")
+ z80sio_device &sio3(Z80SIO(config, "sio3", 8_MHz_XTAL/2));
+ sio3.out_txda_callback().set("rs2323a", FUNC(rs232_port_device::write_txd));
+ sio3.out_dtra_callback().set("rs2323a", FUNC(rs232_port_device::write_dtr));
+ sio3.out_rtsa_callback().set("rs2323a", FUNC(rs232_port_device::write_rts));
+ sio3.out_txdb_callback().set("rs2323b", FUNC(rs232_port_device::write_txd));
+ sio3.out_dtrb_callback().set("rs2323b", FUNC(rs232_port_device::write_dtr));
+ sio3.out_rtsb_callback().set("rs2323b", FUNC(rs232_port_device::write_rts));
+ sio3.out_int_callback().set_inputline(m_icscpu, INPUT_LINE_IRQ0);
+ sio3.set_cputag(m_icscpu);
+
MCFG_DEVICE_ADD("rs2323a", RS232_PORT, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio3", z80sio_device, rxa_w))
MCFG_RS232_DCD_HANDLER(WRITELINE("sio3", z80sio_device, dcda_w))
@@ -174,15 +179,16 @@ MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
MCFG_RS232_DCD_HANDLER(WRITELINE("sio3", z80sio_device, dcdb_w))
MCFG_RS232_CTS_HANDLER(WRITELINE("sio3", z80sio_device, ctsb_w))
- MCFG_DEVICE_ADD("sio4", Z80SIO, XTAL(8'000'000)/2)
- MCFG_Z80SIO_OUT_TXDA_CB(WRITELINE("rs2324a", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRA_CB(WRITELINE("rs2324a", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSA_CB(WRITELINE("rs2324a", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_TXDB_CB(WRITELINE("rs2324b", rs232_port_device, write_txd))
- MCFG_Z80SIO_OUT_DTRB_CB(WRITELINE("rs2324b", rs232_port_device, write_dtr))
- MCFG_Z80SIO_OUT_RTSB_CB(WRITELINE("rs2324b", rs232_port_device, write_rts))
- MCFG_Z80SIO_OUT_INT_CB(INPUTLINE("icscpu", INPUT_LINE_IRQ0))
- MCFG_Z80SIO_CPU("icscpu")
+ z80sio_device &sio4(Z80SIO(config, "sio4", 8_MHz_XTAL/2));
+ sio4.out_txda_callback().set("rs2324a", FUNC(rs232_port_device::write_txd));
+ sio4.out_dtra_callback().set("rs2324a", FUNC(rs232_port_device::write_dtr));
+ sio4.out_rtsa_callback().set("rs2324a", FUNC(rs232_port_device::write_rts));
+ sio4.out_txdb_callback().set("rs2324b", FUNC(rs232_port_device::write_txd));
+ sio4.out_dtrb_callback().set("rs2324b", FUNC(rs232_port_device::write_dtr));
+ sio4.out_rtsb_callback().set("rs2324b", FUNC(rs232_port_device::write_rts));
+ sio4.out_int_callback().set_inputline(m_icscpu, INPUT_LINE_IRQ0);
+ sio4.set_cputag(m_icscpu);
+
MCFG_DEVICE_ADD("rs2324a", RS232_PORT, default_rs232_devices, nullptr)
MCFG_RS232_RXD_HANDLER(WRITELINE("sio4", z80sio_device, rxa_w))
MCFG_RS232_DCD_HANDLER(WRITELINE("sio4", z80sio_device, dcda_w))
@@ -194,10 +200,14 @@ MACHINE_CONFIG_START(acs8600_ics_device::device_add_mconfig)
MCFG_RS232_CTS_HANDLER(WRITELINE("sio4", z80sio_device, ctsb_w))
MACHINE_CONFIG_END
-void acs8600_ics_device::device_start()
+void acs8600_ics_device::device_resolve_objects()
{
- m_maincpu_mem = &m_maincpu->space(AS_PROGRAM);
+ m_maincpu_mem = &m_host_space_device->space(m_host_space_index);
m_out_irq1_func.resolve_safe();
m_out_irq2_func.resolve_safe();
}
+void acs8600_ics_device::device_start()
+{
+}
+