mirror of https://github.com/stella-emu/stella.git
And now AVox output works in Linux. I can't believe the stupid mistake
I was making, shadowing an instance variable with a local one. I must be losing it :) git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1464 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
b508d668c2
commit
de5a387f47
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: AtariVox.cxx,v 1.11 2008-04-11 00:29:15 stephena Exp $
|
// $Id: AtariVox.cxx,v 1.12 2008-04-11 01:28:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifdef SPEAKJET_EMULATION
|
#ifdef SPEAKJET_EMULATION
|
||||||
|
@ -38,7 +38,6 @@ AtariVox::AtariVox(Jack jack, const Event& event, const SerialPort& port)
|
||||||
#ifdef SPEAKJET_EMULATION
|
#ifdef SPEAKJET_EMULATION
|
||||||
mySpeakJet = new SpeakJet();
|
mySpeakJet = new SpeakJet();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mySerialPort->openPort("", -1, -1, -1, -1);
|
mySerialPort->openPort("", -1, -1, -1, -1);
|
||||||
|
|
||||||
myDigitalPinState[One] = myDigitalPinState[Two] =
|
myDigitalPinState[One] = myDigitalPinState[Two] =
|
||||||
|
@ -53,7 +52,6 @@ AtariVox::~AtariVox()
|
||||||
#ifdef SPEAKJET_EMULATION
|
#ifdef SPEAKJET_EMULATION
|
||||||
delete mySpeakJet;
|
delete mySpeakJet;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mySerialPort->closePort();
|
mySerialPort->closePort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: M6502Hi.cxx,v 1.21 2008-02-06 13:45:22 stephena Exp $
|
// $Id: M6502Hi.cxx,v 1.22 2008-04-11 01:28:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "M6502Hi.hxx"
|
#include "M6502Hi.hxx"
|
||||||
|
@ -62,7 +62,6 @@ inline uInt8 M6502High::peek(uInt16 address)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
uInt8 result = mySystem->peek(address);
|
uInt8 result = mySystem->peek(address);
|
||||||
myLastAccessWasRead = true;
|
myLastAccessWasRead = true;
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -13,14 +13,23 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: SerialPortUNIX.cxx,v 1.2 2008-04-09 17:19:15 stephena Exp $
|
// $Id: SerialPortUNIX.cxx,v 1.3 2008-04-11 01:28:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/termios.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
#include "SerialPortUNIX.hxx"
|
#include "SerialPortUNIX.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SerialPortUNIX::SerialPortUNIX()
|
SerialPortUNIX::SerialPortUNIX()
|
||||||
: SerialPort()
|
: SerialPort(),
|
||||||
|
myHandle(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,17 +42,36 @@ SerialPortUNIX::~SerialPortUNIX()
|
||||||
bool SerialPortUNIX::openPort(const string& device, int baud, int data,
|
bool SerialPortUNIX::openPort(const string& device, int baud, int data,
|
||||||
int stop, int parity)
|
int stop, int parity)
|
||||||
{
|
{
|
||||||
|
myHandle = open("/dev/ttyUSB0", O_RDWR | O_NOCTTY | O_NONBLOCK);
|
||||||
|
if(myHandle <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
struct termios termios;
|
||||||
|
memset(&termios, 0, sizeof(struct termios));
|
||||||
|
|
||||||
|
termios.c_cflag = CREAD | CLOCAL;
|
||||||
|
termios.c_cflag |= B19200;
|
||||||
|
termios.c_cflag |= CS8;
|
||||||
|
tcflush(myHandle, TCIFLUSH);
|
||||||
|
tcsetattr(myHandle, TCSANOW, &termios);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void SerialPortUNIX::closePort()
|
void SerialPortUNIX::closePort()
|
||||||
{
|
{
|
||||||
|
if(myHandle)
|
||||||
|
close(myHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool SerialPortUNIX::writeByte(const uInt8 data)
|
bool SerialPortUNIX::writeByte(const uInt8* data)
|
||||||
{
|
{
|
||||||
cerr << "SerialPortUNIX::writeByte " << (int)data << endl;
|
if(myHandle)
|
||||||
|
{
|
||||||
|
// cerr << "SerialPortUNIX::writeByte " << (int)(*data) << endl;
|
||||||
|
return write(myHandle, data, 1) == 1;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: SerialPortUNIX.hxx,v 1.2 2008-04-09 17:19:16 stephena Exp $
|
// $Id: SerialPortUNIX.hxx,v 1.3 2008-04-11 01:28:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef SERIALPORT_UNIX_HXX
|
#ifndef SERIALPORT_UNIX_HXX
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
it seems to be Linux-only, and reading isn't actually supported at all.
|
it seems to be Linux-only, and reading isn't actually supported at all.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: SerialPortUNIX.hxx,v 1.2 2008-04-09 17:19:16 stephena Exp $
|
@version $Id: SerialPortUNIX.hxx,v 1.3 2008-04-11 01:28:35 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class SerialPortUNIX : public SerialPort
|
class SerialPortUNIX : public SerialPort
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,11 @@ class SerialPortUNIX : public SerialPort
|
||||||
@param data The byte to write to the port
|
@param data The byte to write to the port
|
||||||
@return True if a byte was written, else false
|
@return True if a byte was written, else false
|
||||||
*/
|
*/
|
||||||
bool writeByte(const uInt8 data);
|
bool writeByte(const uInt8* data);
|
||||||
|
|
||||||
|
private:
|
||||||
|
// File descriptor for serial connection
|
||||||
|
int myHandle;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue