mirror of https://github.com/stella-emu/stella.git
Minor refactoring of AVox/SaveKey classes (use delegating c'tor).
This commit is contained in:
parent
55a281bf34
commit
f38b40415f
|
@ -119,4 +119,4 @@ void AtariVox::reset()
|
||||||
{
|
{
|
||||||
myLastDataWriteCycle = 0;
|
myLastDataWriteCycle = 0;
|
||||||
SaveKey::reset();
|
SaveKey::reset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,8 @@ SaveKey::SaveKey(Jack jack, const Event& event, const System& system,
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SaveKey::SaveKey(Jack jack, const Event& event, const System& system,
|
SaveKey::SaveKey(Jack jack, const Event& event, const System& system,
|
||||||
const string& eepromfile)
|
const string& eepromfile)
|
||||||
: Controller(jack, event, system, Controller::SaveKey)
|
: SaveKey(jack, event, system, eepromfile, Controller::SaveKey)
|
||||||
{
|
{
|
||||||
myEEPROM = make_unique<MT24LC256>(eepromfile, system);
|
|
||||||
|
|
||||||
myDigitalPinState[One] = myDigitalPinState[Two] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -79,4 +76,4 @@ void SaveKey::write(DigitalPin pin, bool value)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,18 +33,6 @@
|
||||||
class SaveKey : public Controller
|
class SaveKey : public Controller
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
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
|
|
||||||
@param system The system using this controller
|
|
||||||
@param eepromfile The file containing the EEPROM data
|
|
||||||
@param type The type for this controller
|
|
||||||
*/
|
|
||||||
SaveKey(Jack jack, const Event& event, const System& system,
|
|
||||||
const string& eepromfile, Type type);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Create a new SaveKey controller plugged into the specified jack
|
Create a new SaveKey controller plugged into the specified jack
|
||||||
|
|
||||||
|
@ -55,9 +43,17 @@ class SaveKey : public Controller
|
||||||
*/
|
*/
|
||||||
SaveKey(Jack jack, const Event& event, const System& system,
|
SaveKey(Jack jack, const Event& event, const System& system,
|
||||||
const string& eepromfile);
|
const string& eepromfile);
|
||||||
|
|
||||||
virtual ~SaveKey() = default;
|
virtual ~SaveKey() = default;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/**
|
||||||
|
Delegating constructor currently used by both this class and classes
|
||||||
|
that inherit from SaveKey (currently, AtariVox)
|
||||||
|
*/
|
||||||
|
SaveKey(Jack jack, const Event& event, const System& system,
|
||||||
|
const string& eepromfile, Type type);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Controller::read;
|
using Controller::read;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue