From c171783695089ec8cd32505872a2907c8577b5f8 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Thu, 30 Jul 2020 13:33:22 -0230 Subject: [PATCH] Tie CTS signal from the serial port to the appropriate AVox pin. Still TODO is actually implement this in the platform-specific serial code. --- src/emucore/AtariVox.cxx | 5 +++-- src/emucore/SerialPort.hxx | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/emucore/AtariVox.cxx b/src/emucore/AtariVox.cxx index 9cb60012f..b80f6de4b 100644 --- a/src/emucore/AtariVox.cxx +++ b/src/emucore/AtariVox.cxx @@ -51,8 +51,9 @@ bool AtariVox::read(DigitalPin pin) { // Pin 2: SpeakJet READY case DigitalPin::Two: - // For now, we just assume the device is always ready - return setPin(pin, true); + { + return setPin(pin, mySerialPort->isCTS()); + } default: return SaveKey::read(pin); diff --git a/src/emucore/SerialPort.hxx b/src/emucore/SerialPort.hxx index aa08acbe8..f2ac5bf68 100644 --- a/src/emucore/SerialPort.hxx +++ b/src/emucore/SerialPort.hxx @@ -58,6 +58,14 @@ class SerialPort */ virtual bool writeByte(uInt8 data) { return false; } + /** + Test for 'Clear To Send' enabled. By default, assume it's always + OK to send more data. + + @return True if CTS signal enabled, else false + */ + virtual bool isCTS() { return true; } + private: // Following constructors and assignment operators not supported SerialPort(const SerialPort&) = delete;