From c5ee763de0982d9a00e19ec6ebd71ecc7def93b0 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 1 Aug 2018 21:39:09 -0400 Subject: [PATCH] prose2k: Use real serial terminal --- src/mame/drivers/tsispch.cpp | 16 +++++++++++++--- src/mame/includes/tsispch.h | 5 ----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/mame/drivers/tsispch.cpp b/src/mame/drivers/tsispch.cpp index aa0da41fb73..22e88d94a70 100644 --- a/src/mame/drivers/tsispch.cpp +++ b/src/mame/drivers/tsispch.cpp @@ -113,7 +113,9 @@ #include "emu.h" #include "includes/tsispch.h" +#include "bus/rs232/rs232.h" #include "cpu/i86/i86.h" +#include "machine/clock.h" #include "machine/i8251.h" #include "sound/dac.h" #include "sound/volt_reg.h" @@ -391,19 +393,27 @@ MACHINE_CONFIG_START(tsispch_state::prose2k) /* uarts */ MCFG_DEVICE_ADD("i8251a_u15", I8251, 0) - // (todo: proper hookup, currently using hack w/i8251_receive_character()) + MCFG_I8251_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd)) + MCFG_I8251_DTR_HANDLER(WRITELINE("rs232", rs232_port_device, write_dtr)) + MCFG_I8251_RTS_HANDLER(WRITELINE("rs232", rs232_port_device, write_rts)) MCFG_I8251_RXRDY_HANDLER(WRITELINE(*this, tsispch_state, i8251_rxrdy_int)) MCFG_I8251_TXRDY_HANDLER(WRITELINE(*this, tsispch_state, i8251_txrdy_int)) MCFG_I8251_TXEMPTY_HANDLER(WRITELINE(*this, tsispch_state, i8251_txempty_int)) + clock_device &clock(CLOCK(config, "baudclock", 153600)); + clock.signal_handler().set("i8251a_u15", FUNC(i8251_device::write_txc)); + clock.signal_handler().append("i8251a_u15", FUNC(i8251_device::write_rxc)); + /* sound hardware */ SPEAKER(config, "speaker").front_center(); MCFG_DEVICE_ADD("dac", DAC_12BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) // unknown DAC (TODO: correctly figure out how the DAC works; apparently it is connected to the serial output of the upd7720, which will be "fun" to connect up) MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) - MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0) - MCFG_GENERIC_TERMINAL_KEYBOARD_CB(DEVPUT("i8251a_u15", i8251_device, receive_character)) + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); + rs232.rxd_handler().set("i8251a_u15", FUNC(i8251_device::write_rxd)); + rs232.dsr_handler().set("i8251a_u15", FUNC(i8251_device::write_dsr)); + rs232.cts_handler().set("i8251a_u15", FUNC(i8251_device::write_cts)); MACHINE_CONFIG_END /****************************************************************************** diff --git a/src/mame/includes/tsispch.h b/src/mame/includes/tsispch.h index a5b14f86691..3128cb89c42 100644 --- a/src/mame/includes/tsispch.h +++ b/src/mame/includes/tsispch.h @@ -13,9 +13,6 @@ #include "cpu/upd7725/upd7725.h" #include "machine/pic8259.h" -#include "machine/terminal.h" - -#define TERMINAL_TAG "terminal" class tsispch_state : public driver_device { @@ -24,7 +21,6 @@ public: : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_dsp(*this, "dsp"), - m_terminal(*this, TERMINAL_TAG), m_pic(*this, "pic8259") { } @@ -55,7 +51,6 @@ private: required_device m_maincpu; required_device m_dsp; - required_device m_terminal; required_device m_pic; uint8_t m_paramReg; // status leds and resets and etc