From e4db784cd6c5b8998f4f80595b79b060dafa1d81 Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 13 Nov 2018 21:45:19 -0500 Subject: ccs300: Improve documentation; use CTC to generate baud rates; add Z80 DMA chip; add second RS232 port (nw) dmax8000, dsb46: Use set_clk for CTC channels (nw) --- src/mame/drivers/ccs300.cpp | 64 +++++++++++++++++++++++++++---------------- src/mame/drivers/dmax8000.cpp | 9 ++---- src/mame/drivers/dsb46.cpp | 10 ++----- 3 files changed, 46 insertions(+), 37 deletions(-) diff --git a/src/mame/drivers/ccs300.cpp b/src/mame/drivers/ccs300.cpp index 917d133b669..424c7e77971 100644 --- a/src/mame/drivers/ccs300.cpp +++ b/src/mame/drivers/ccs300.cpp @@ -8,13 +8,14 @@ It requires a floppy disk to boot from. -There's no info available on this system, however the bankswitching -appears to be the same as their other systems. +The bankswitching appears to be the same as CCS's other systems. Early on, it does a read from port F2. If bit 3 is low, the system becomes a Model 400. -Since IM2 is used, it is assumed there are Z80 peripherals on board. +The CPU board appears to be the 2820 System Processor, which has Z80A CTC, +Z80A PIO, Z80A SIO/0 and Z80A DMA peripherals on board. Several features, +including IEI/IEO daisy chain priority, are jumper-configurable. ****************************************************************************/ @@ -22,11 +23,11 @@ Since IM2 is used, it is assumed there are Z80 peripherals on board. #include "cpu/z80/z80.h" #include "machine/z80daisy.h" #include "machine/z80ctc.h" +#include "machine/z80dma.h" #include "machine/z80pio.h" #include "machine/z80sio.h" -#include "machine/clock.h" #include "bus/rs232/rs232.h" - +//#include "bus/s100/s100.h" class ccs300_state : public driver_device { @@ -68,7 +69,7 @@ void ccs300_state::ccs300_io(address_map &map) map(0x30, 0x33); // fdc? map(0x34, 0x34); // motor control? map(0x40, 0x40).w(FUNC(ccs300_state::port40_w)); - map(0xf0, 0xf0); // unknown, long sequence of init bytes + map(0xf0, 0xf0).rw("dma", FUNC(z80dma_device::read), FUNC(z80dma_device::write)); // long sequence of init bytes map(0xf2, 0xf2); // dip or jumper? } @@ -81,6 +82,7 @@ static const z80_daisy_config daisy_chain[] = { "ctc" }, { "sio" }, { "pio" }, + { "dma" }, { nullptr } }; @@ -121,33 +123,47 @@ DEVICE_INPUT_DEFAULTS_END void ccs300_state::ccs300(machine_config & config) { /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(4'000'000)); + Z80(config, m_maincpu, 16_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &ccs300_state::ccs300_mem); m_maincpu->set_addrmap(AS_IO, &ccs300_state::ccs300_io); m_maincpu->set_daisy_config(daisy_chain); - /* video hardware */ - clock_device &uart_clock(CLOCK(config, "uart_clock", 153'600)); - uart_clock.signal_handler().set("sio", FUNC(z80sio_device::txca_w)); - uart_clock.signal_handler().append("sio", FUNC(z80sio_device::rxca_w)); - /* Devices */ - z80sio_device& sio(Z80SIO(config, "sio", XTAL(4'000'000))); + z80sio_device &sio(Z80SIO(config, "sio", 16_MHz_XTAL / 4)); sio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); - sio.out_txda_callback().set("rs232", FUNC(rs232_port_device::write_txd)); - sio.out_dtra_callback().set("rs232", FUNC(rs232_port_device::write_dtr)); - sio.out_rtsa_callback().set("rs232", FUNC(rs232_port_device::write_rts)); - - rs232_port_device& rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); - rs232.rxd_handler().set("sio", FUNC(z80sio_device::rxa_w)); - rs232.cts_handler().set("sio", FUNC(z80sio_device::ctsa_w)); - rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be exactly here - - z80ctc_device& ctc(Z80CTC(config, "ctc", XTAL(4'000'000))); + sio.out_txda_callback().set("sioa", FUNC(rs232_port_device::write_txd)); + sio.out_dtra_callback().set("sioa", FUNC(rs232_port_device::write_dtr)); + sio.out_rtsa_callback().set("sioa", FUNC(rs232_port_device::write_rts)); + sio.out_txdb_callback().set("siob", FUNC(rs232_port_device::write_txd)); + sio.out_dtrb_callback().set("siob", FUNC(rs232_port_device::write_dtr)); + sio.out_rtsb_callback().set("siob", FUNC(rs232_port_device::write_rts)); + + rs232_port_device &sioa(RS232_PORT(config, "sioa", default_rs232_devices, "terminal")); + sioa.rxd_handler().set("sio", FUNC(z80sio_device::rxa_w)); + sioa.cts_handler().set("sio", FUNC(z80sio_device::ctsa_w)); + sioa.dcd_handler().set("sio", FUNC(z80sio_device::dcda_w)); + sioa.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be exactly here + + rs232_port_device &siob(RS232_PORT(config, "siob", default_rs232_devices, nullptr)); + siob.rxd_handler().set("sio", FUNC(z80sio_device::rxa_w)); + siob.cts_handler().set("sio", FUNC(z80sio_device::ctsa_w)); + siob.dcd_handler().set("sio", FUNC(z80sio_device::dcda_w)); + + z80ctc_device &ctc(Z80CTC(config, "ctc", 16_MHz_XTAL / 4)); + ctc.set_clk<0>(16_MHz_XTAL / 8); + ctc.set_clk<1>(16_MHz_XTAL / 8); + ctc.set_clk<2>(16_MHz_XTAL / 8); + ctc.set_clk<3>(16_MHz_XTAL / 8); + ctc.zc_callback<0>().set("sio", FUNC(z80sio_device::txca_w)); + ctc.zc_callback<0>().append("sio", FUNC(z80sio_device::rxca_w)); + ctc.zc_callback<2>().append("sio", FUNC(z80sio_device::rxtxcb_w)); ctc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); - z80pio_device& pio(Z80PIO(config, "pio", XTAL(4'000'000))); + z80pio_device &pio(Z80PIO(config, "pio", 16_MHz_XTAL / 4)); pio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + + z80dma_device &dma(Z80DMA(config, "dma", 16_MHz_XTAL / 4)); + dma.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); } /* ROM definition */ diff --git a/src/mame/drivers/dmax8000.cpp b/src/mame/drivers/dmax8000.cpp index 8ff18e22820..1c2e909f77f 100644 --- a/src/mame/drivers/dmax8000.cpp +++ b/src/mame/drivers/dmax8000.cpp @@ -32,7 +32,6 @@ What there is of the schematic shows no sign of a daisy chain or associated inte #include "machine/z80ctc.h" #include "machine/mm58274c.h" #include "bus/rs232/rs232.h" -#include "machine/clock.h" @@ -159,17 +158,15 @@ MACHINE_CONFIG_START(dmax8000_state::dmax8000) MCFG_DEVICE_IO_MAP(dmax8000_io) MCFG_MACHINE_RESET_OVERRIDE(dmax8000_state, dmax8000) - clock_device &ctc_clock(CLOCK(config, "ctc_clock", 4_MHz_XTAL / 2)); // 2MHz - ctc_clock.signal_handler().set("ctc", FUNC(z80ctc_device::trg0)); - ctc_clock.signal_handler().append("ctc", FUNC(z80ctc_device::trg1)); - ctc_clock.signal_handler().append("ctc", FUNC(z80ctc_device::trg2)); - z80ctc_device &ctc(Z80CTC(config, "ctc", 4_MHz_XTAL)); + ctc.set_clk<0>(4_MHz_XTAL / 2); // 2MHz ctc.zc_callback<0>().set("dart1", FUNC(z80dart_device::rxca_w)); ctc.zc_callback<0>().append("dart1", FUNC(z80dart_device::txca_w)); ctc.zc_callback<0>().append("dart2", FUNC(z80dart_device::rxca_w)); ctc.zc_callback<0>().append("dart2", FUNC(z80dart_device::txca_w)); + ctc.set_clk<1>(4_MHz_XTAL / 2); // 2MHz ctc.zc_callback<1>().set("dart2", FUNC(z80dart_device::rxtxcb_w)); + ctc.set_clk<2>(4_MHz_XTAL / 2); // 2MHz ctc.zc_callback<2>().set("dart1", FUNC(z80dart_device::rxtxcb_w)); z80dart_device& dart1(Z80DART(config, "dart1", 4'000'000)); // A = terminal; B = aux diff --git a/src/mame/drivers/dsb46.cpp b/src/mame/drivers/dsb46.cpp index 07713c93836..89617fd56c2 100644 --- a/src/mame/drivers/dsb46.cpp +++ b/src/mame/drivers/dsb46.cpp @@ -33,7 +33,6 @@ Both roms contain Z80 code. #include "machine/z80daisy.h" #include "machine/z80ctc.h" #include "machine/z80sio.h" -#include "machine/clock.h" #include "bus/rs232/rs232.h" @@ -113,16 +112,11 @@ static const z80_daisy_config daisy_chain[] = void dsb46_state::dsb46(machine_config &config) { // basic machine hardware - Z80(config, m_maincpu, XTAL(24'000'000) / 6); + Z80(config, m_maincpu, 24_MHz_XTAL / 6); m_maincpu->set_addrmap(AS_PROGRAM, &dsb46_state::dsb46_mem); m_maincpu->set_addrmap(AS_IO, &dsb46_state::dsb46_io); m_maincpu->set_daisy_config(daisy_chain); - /* video hardware */ - clock_device &ctc_clock(CLOCK(config, "ctc_clock", 1.8432_MHz_XTAL)); - ctc_clock.signal_handler().set("ctc1", FUNC(z80ctc_device::trg0)); - ctc_clock.signal_handler().append("ctc1", FUNC(z80ctc_device::trg2)); - /* Devices */ z80sio_device& sio(Z80SIO(config, "sio", 24_MHz_XTAL / 6)); sio.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); @@ -136,8 +130,10 @@ void dsb46_state::dsb46(machine_config &config) z80ctc_device &ctc1(Z80CTC(config, "ctc1", 24_MHz_XTAL / 6)); ctc1.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + ctc1.set_clk<0>(1.8432_MHz_XTAL); ctc1.zc_callback<0>().set("sio", FUNC(z80sio_device::rxca_w)); ctc1.zc_callback<0>().append("sio", FUNC(z80sio_device::txca_w)); + ctc1.set_clk<2>(1.8432_MHz_XTAL); ctc1.zc_callback<2>().set("sio", FUNC(z80sio_device::rxcb_w)); ctc1.zc_callback<2>().append("sio", FUNC(z80sio_device::txcb_w)); } -- cgit v1.2.3