2008-04-29 15:49:34 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
2011-01-01 16:04:32 +00:00
|
|
|
// Copyright (c) 1995-2011 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2008-04-29 15:49:34 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2008-04-29 15:49:34 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2009-05-13 13:55:40 +00:00
|
|
|
// $Id$
|
2008-04-29 15:49:34 +00:00
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#ifndef SAVEKEY_HXX
|
|
|
|
#define SAVEKEY_HXX
|
|
|
|
|
|
|
|
class MT24LC256;
|
|
|
|
|
|
|
|
#include "Control.hxx"
|
|
|
|
|
|
|
|
/**
|
|
|
|
Richard Hutchinson's SaveKey "controller", consisting of a 32KB EEPROM
|
|
|
|
accessible using the I2C protocol.
|
|
|
|
|
|
|
|
This code owes a great debt to Alex Herbert's AtariVox documentation and
|
|
|
|
driver code.
|
|
|
|
|
|
|
|
@author Stephen Anthony
|
2009-05-13 13:55:40 +00:00
|
|
|
@version $Id$
|
2008-04-29 15:49:34 +00:00
|
|
|
*/
|
|
|
|
class SaveKey : public Controller
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
2009-01-26 21:08:07 +00:00
|
|
|
Create a new SaveKey controller plugged into the specified jack
|
2008-04-29 15:49:34 +00:00
|
|
|
|
|
|
|
@param jack The jack the controller is plugged into
|
|
|
|
@param event The event object to use for events
|
|
|
|
@param system The system using this controller
|
|
|
|
@param eepromfile The file containing the EEPROM data
|
|
|
|
*/
|
|
|
|
SaveKey(Jack jack, const Event& event, const System& system,
|
|
|
|
const string& eepromfile);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor
|
|
|
|
*/
|
|
|
|
virtual ~SaveKey();
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Read the value of the specified digital pin for this controller.
|
|
|
|
|
|
|
|
@param pin The pin of the controller jack to read
|
|
|
|
@return The state of the pin
|
|
|
|
*/
|
2011-05-24 16:04:48 +00:00
|
|
|
bool read(DigitalPin pin);
|
2008-04-29 15:49:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Write the given value to the specified digital pin for this
|
|
|
|
controller. Writing is only allowed to the pins associated
|
|
|
|
with the PIA. Therefore you cannot write to pin six.
|
|
|
|
|
|
|
|
@param pin The pin of the controller jack to write to
|
|
|
|
@param value The value to write to the pin
|
|
|
|
*/
|
2011-05-24 16:04:48 +00:00
|
|
|
void write(DigitalPin pin, bool value);
|
2008-04-29 15:49:34 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Update the entire digital and analog pin state according to the
|
|
|
|
events currently set.
|
|
|
|
*/
|
2011-05-24 16:04:48 +00:00
|
|
|
void update() { }
|
2008-04-29 15:49:34 +00:00
|
|
|
|
2008-05-19 02:53:58 +00:00
|
|
|
/**
|
|
|
|
Notification method invoked by the system right before the
|
|
|
|
system resets its cycle counter to zero. It may be necessary
|
|
|
|
to override this method for devices that remember cycle counts.
|
|
|
|
*/
|
2011-05-24 16:04:48 +00:00
|
|
|
void systemCyclesReset();
|
2008-05-19 02:53:58 +00:00
|
|
|
|
2008-04-29 15:49:34 +00:00
|
|
|
private:
|
|
|
|
// The EEPROM used in the SaveKey
|
|
|
|
MT24LC256* myEEPROM;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|