diff --git a/stella/src/emucore/AtariVox.cxx b/stella/src/emucore/AtariVox.cxx index f41ba4d8c..758a1bf18 100644 --- a/stella/src/emucore/AtariVox.cxx +++ b/stella/src/emucore/AtariVox.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: AtariVox.cxx,v 1.21 2009-01-01 18:13:35 stephena Exp $ +// $Id: AtariVox.cxx,v 1.22 2009-01-26 21:08:05 stephena Exp $ //============================================================================ #ifdef SPEAKJET_EMULATION @@ -30,14 +30,14 @@ AtariVox::AtariVox(Jack jack, const Event& event, const System& system, const SerialPort& port, const string& portname, const string& eepromfile) : Controller(jack, event, system, Controller::AtariVox), - mySerialPort((SerialPort*)&port), + mySerialPort((SerialPort&)port), myEEPROM(NULL), myShiftCount(0), myShiftRegister(0), myLastDataWriteCycle(0) { #ifndef SPEAKJET_EMULATION - if(mySerialPort->openPort(portname)) + if(mySerialPort.openPort(portname)) myAboutString = " (using serial port \'" + portname + "\')"; else myAboutString = " (invalid serial port \'" + portname + "\')"; @@ -58,7 +58,7 @@ AtariVox::AtariVox(Jack jack, const Event& event, const System& system, AtariVox::~AtariVox() { #ifndef SPEAKJET_EMULATION - mySerialPort->closePort(); + mySerialPort.closePort(); #else delete mySpeakJet; #endif @@ -159,7 +159,7 @@ void AtariVox::clockDataIn(bool value) { uInt8 data = ((myShiftRegister >> 1) & 0xff); #ifndef SPEAKJET_EMULATION - mySerialPort->writeByte(&data); + mySerialPort.writeByte(&data); #else mySpeakJet->write(data); #endif diff --git a/stella/src/emucore/AtariVox.hxx b/stella/src/emucore/AtariVox.hxx index b06b417e2..096a59d42 100644 --- a/stella/src/emucore/AtariVox.hxx +++ b/stella/src/emucore/AtariVox.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: AtariVox.hxx,v 1.15 2009-01-01 18:13:35 stephena Exp $ +// $Id: AtariVox.hxx,v 1.16 2009-01-26 21:08:05 stephena Exp $ //============================================================================ #ifndef ATARIVOX_HXX @@ -33,7 +33,7 @@ class MT24LC256; driver code. @author B. Watson - @version $Id: AtariVox.hxx,v 1.15 2009-01-01 18:13:35 stephena Exp $ + @version $Id: AtariVox.hxx,v 1.16 2009-01-26 21:08:05 stephena Exp $ */ class AtariVox : public Controller { @@ -100,15 +100,10 @@ class AtariVox : public Controller void shiftIn(bool value); private: - // How far off (in CPU cycles) can each write occur from when it's - // supposed to happen? Eventually, this will become a user-settable - // property... or it may turn out to be unnecessary. - enum { TIMING_SLOP = 0 }; - // Instance of an real serial port on the system // Assuming there's a real AtariVox attached, we can send SpeakJet // bytes directly to it - SerialPort* mySerialPort; + SerialPort& mySerialPort; // The EEPROM used in the AtariVox MT24LC256* myEEPROM; diff --git a/stella/src/emucore/M6532.cxx b/stella/src/emucore/M6532.cxx index 626581647..eeb164785 100644 --- a/stella/src/emucore/M6532.cxx +++ b/stella/src/emucore/M6532.cxx @@ -13,18 +13,20 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: M6532.cxx,v 1.30 2009-01-01 18:13:36 stephena Exp $ +// $Id: M6532.cxx,v 1.31 2009-01-26 21:08:05 stephena Exp $ //============================================================================ -#include +#include +#include + #include "Console.hxx" -#include "M6532.hxx" #include "Random.hxx" #include "Switches.hxx" #include "System.hxx" #include "Serializer.hxx" #include "Deserializer.hxx" -#include + +#include "M6532.hxx" // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - M6532::M6532(const Console& console) diff --git a/stella/src/emucore/MT24LC256.hxx b/stella/src/emucore/MT24LC256.hxx index 7022b8863..76d13592c 100644 --- a/stella/src/emucore/MT24LC256.hxx +++ b/stella/src/emucore/MT24LC256.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: MT24LC256.hxx,v 1.7 2009-01-01 18:13:36 stephena Exp $ +// $Id: MT24LC256.hxx,v 1.8 2009-01-26 21:08:05 stephena Exp $ //============================================================================ #ifndef MT24LC256_HXX @@ -30,7 +30,7 @@ class System; (aka Supercat) for the bulk of this code. @author Stephen Anthony & J. Payson - @version $Id: MT24LC256.hxx,v 1.7 2009-01-01 18:13:36 stephena Exp $ + @version $Id: MT24LC256.hxx,v 1.8 2009-01-26 21:08:05 stephena Exp $ */ class MT24LC256 { @@ -116,5 +116,5 @@ class MT24LC256 // Assignment operator isn't supported by this class so make it private MT24LC256& operator = (const MT24LC256&); }; -#endif +#endif diff --git a/stella/src/emucore/SaveKey.hxx b/stella/src/emucore/SaveKey.hxx index 751d7be10..9e1f5fc9b 100644 --- a/stella/src/emucore/SaveKey.hxx +++ b/stella/src/emucore/SaveKey.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: SaveKey.hxx,v 1.3 2009-01-01 18:13:37 stephena Exp $ +// $Id: SaveKey.hxx,v 1.4 2009-01-26 21:08:05 stephena Exp $ //============================================================================ #ifndef SAVEKEY_HXX @@ -31,13 +31,13 @@ class MT24LC256; driver code. @author Stephen Anthony - @version $Id: SaveKey.hxx,v 1.3 2009-01-01 18:13:37 stephena Exp $ + @version $Id: SaveKey.hxx,v 1.4 2009-01-26 21:08:05 stephena Exp $ */ class SaveKey : public Controller { public: /** - Create a new AtariVox controller plugged into the specified jack + Create a new SaveKey controller plugged into the specified jack @param jack The jack the controller is plugged into @param event The event object to use for events diff --git a/stella/src/unix/SerialPortUNIX.cxx b/stella/src/unix/SerialPortUNIX.cxx index f3ad96c56..df31c5746 100644 --- a/stella/src/unix/SerialPortUNIX.cxx +++ b/stella/src/unix/SerialPortUNIX.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: SerialPortUNIX.cxx,v 1.6 2009-01-01 18:13:39 stephena Exp $ +// $Id: SerialPortUNIX.cxx,v 1.7 2009-01-26 21:08:07 stephena Exp $ //============================================================================ #include @@ -37,6 +37,7 @@ SerialPortUNIX::SerialPortUNIX() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SerialPortUNIX::~SerialPortUNIX() { + closePort(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -62,7 +63,10 @@ bool SerialPortUNIX::openPort(const string& device) void SerialPortUNIX::closePort() { if(myHandle) + { close(myHandle); + myHandle = 0; + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/win32/SerialPortWin32.cxx b/stella/src/win32/SerialPortWin32.cxx index 19ac3781b..ae9f6a623 100644 --- a/stella/src/win32/SerialPortWin32.cxx +++ b/stella/src/win32/SerialPortWin32.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: SerialPortWin32.cxx,v 1.5 2009-01-01 18:13:39 stephena Exp $ +// $Id: SerialPortWin32.cxx,v 1.6 2009-01-26 21:08:07 stephena Exp $ //============================================================================ #include @@ -30,6 +30,7 @@ SerialPortWin32::SerialPortWin32() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SerialPortWin32::~SerialPortWin32() { + closePort(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -