mirror of https://github.com/stella-emu/stella.git
Finalize AVox CTS support. Now more testing is needed ...
This commit is contained in:
parent
c9945e48e5
commit
3fa7dadcba
|
@ -33,6 +33,10 @@
|
|||
Basically, you are now able to put many files that Stella uses inside
|
||||
one ZIP file, and distribute just that file.
|
||||
|
||||
* Extended AtariVox support to handle flow control, so that long phrases
|
||||
are no longer corrupted/cut off. Note that some USB-serial adaptors
|
||||
don't support this mode, so there may still be issues with those.
|
||||
|
||||
* Added option to select the audio device.
|
||||
|
||||
* Added option to display detected settings info when a ROM is loaded.
|
||||
|
|
|
@ -28,7 +28,13 @@ AtariVox::AtariVox(Jack jack, const Event& event, const System& system,
|
|||
{
|
||||
mySerialPort = MediaFactory::createSerialPort();
|
||||
if(mySerialPort->openPort(portname))
|
||||
myAboutString = " (using serial port \'" + portname + "\')";
|
||||
{
|
||||
myCTSFlip = !mySerialPort->isCTS();
|
||||
if(myCTSFlip)
|
||||
myAboutString = " (serial port \'" + portname + "\', inverted CTS)";
|
||||
else
|
||||
myAboutString = " (serial port \'" + portname + "\')";
|
||||
}
|
||||
else
|
||||
myAboutString = " (invalid serial port \'" + portname + "\')";
|
||||
|
||||
|
@ -50,12 +56,10 @@ bool AtariVox::read(DigitalPin pin)
|
|||
switch(pin)
|
||||
{
|
||||
// Pin 2: SpeakJet READY
|
||||
// CTS (Clear To Send) is connected inverted
|
||||
// So CTS = 0 means the buffer is full, which pulls pin 2 high
|
||||
// CTS (Clear To Send) is sent directly to pin 2
|
||||
// We also deal with the case where devices send CTS inverted
|
||||
case DigitalPin::Two:
|
||||
{
|
||||
return setPin(pin, !mySerialPort->isCTS());
|
||||
}
|
||||
return setPin(pin, mySerialPort->isCTS() ^ myCTSFlip);
|
||||
|
||||
default:
|
||||
return SaveKey::read(pin);
|
||||
|
|
|
@ -117,6 +117,11 @@ class AtariVox : public SaveKey
|
|||
// "close enough".
|
||||
uInt64 myLastDataWriteCycle{0};
|
||||
|
||||
// Some USB-Serial adaptors either don't support CTS, or send the signal
|
||||
// as inverted; we detect that when opening the port, and flip the signal
|
||||
// when necessary
|
||||
bool myCTSFlip{false};
|
||||
|
||||
// Holds information concerning serial port usage
|
||||
string myAboutString;
|
||||
|
||||
|
|
Loading…
Reference in New Issue