Created
July 4, 2016 19:00
-
-
Save shattered/d48d429a20f7062473331eaff7377a51 to your computer and use it in GitHub Desktop.
null modem hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/devices/bus/rs232/null_modem.cpp b/src/devices/bus/rs232/null_modem.cpp | |
index 4c5d741..a859577 100644 | |
--- a/src/devices/bus/rs232/null_modem.cpp | |
+++ b/src/devices/bus/rs232/null_modem.cpp | |
@@ -15,7 +15,8 @@ null_modem_device::null_modem_device(const machine_config &mconfig, const char * | |
m_rs232_stopbits(*this, "RS232_STOPBITS"), | |
m_input_count(0), | |
m_input_index(0), | |
- m_timer_poll(nullptr) | |
+ m_timer_poll(nullptr), | |
+ m_rts(ASSERT_LINE) | |
{ | |
} | |
@@ -68,6 +69,8 @@ WRITE_LINE_MEMBER(null_modem_device::update_serial) | |
output_dcd(0); | |
output_dsr(0); | |
output_cts(0); | |
+ | |
+ m_rts = ASSERT_LINE; | |
} | |
void null_modem_device::device_reset() | |
@@ -91,6 +94,7 @@ void null_modem_device::device_timer(emu_timer &timer, device_timer_id id, int p | |
void null_modem_device::queue() | |
{ | |
+ logerror("null: queue: empty %d rts %d\n", is_transmit_register_empty(), m_rts); | |
if (is_transmit_register_empty()) | |
{ | |
if (m_input_index == m_input_count) | |
@@ -99,7 +103,7 @@ void null_modem_device::queue() | |
m_input_count = m_stream->input(m_input_buffer, sizeof(m_input_buffer)); | |
} | |
- if (m_input_count != 0) | |
+ if (m_input_count != 0 && m_rts == ASSERT_LINE) | |
{ | |
transmit_register_setup(m_input_buffer[m_input_index++]); | |
diff --git a/src/devices/bus/rs232/null_modem.h b/src/devices/bus/rs232/null_modem.h | |
index aed62fb..2015968 100644 | |
--- a/src/devices/bus/rs232/null_modem.h | |
+++ b/src/devices/bus/rs232/null_modem.h | |
@@ -15,6 +15,8 @@ public: | |
virtual machine_config_constructor device_mconfig_additions() const override; | |
virtual WRITE_LINE_MEMBER( input_txd ) override { device_serial_interface::rx_w(state); } | |
+ virtual WRITE_LINE_MEMBER( input_rts ) override { logerror("null: rts %d <- %d\n", m_rts, state); m_rts = (line_state) state; } | |
+// virtual WRITE_LINE_MEMBER( input_dtr ) override; | |
DECLARE_WRITE_LINE_MEMBER(update_serial); | |
@@ -46,6 +48,7 @@ private: | |
UINT32 m_input_count; | |
UINT32 m_input_index; | |
emu_timer *m_timer_poll; | |
+ line_state m_rts; | |
}; | |
extern const device_type NULL_MODEM; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment