mirror of https://github.com/stella-emu/stella.git
Minor refactoring in CompuMate class.
While having friends in real life is good, we should minimize them in classes :)
This commit is contained in:
parent
953761e1a1
commit
fe7c980d93
|
@ -80,7 +80,7 @@ bool CartridgeCM::poke(uInt16 address, uInt8 value)
|
|||
bank(mySWCHA & 0x3);
|
||||
if(myCompuMate)
|
||||
{
|
||||
uInt8& column = myCompuMate->myColumn;
|
||||
uInt8& column = myCompuMate->column();
|
||||
if(value & 0x20)
|
||||
column = 0;
|
||||
if(value & 0x40)
|
||||
|
@ -95,7 +95,7 @@ bool CartridgeCM::poke(uInt16 address, uInt8 value)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt8 CartridgeCM::column() const
|
||||
{
|
||||
return myCompuMate->myColumn;
|
||||
return myCompuMate->column();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -196,7 +196,7 @@ bool CartridgeCM::save(Serializer& out) const
|
|||
out.putString(name());
|
||||
out.putShort(myCurrentBank);
|
||||
out.putByte(mySWCHA);
|
||||
out.putByte(myCompuMate->myColumn);
|
||||
out.putByte(myCompuMate->column());
|
||||
out.putByteArray(myRAM, 2048);
|
||||
}
|
||||
catch(...)
|
||||
|
@ -218,7 +218,7 @@ bool CartridgeCM::load(Serializer& in)
|
|||
|
||||
myCurrentBank = in.getShort();
|
||||
mySWCHA = in.getByte();
|
||||
myCompuMate->myColumn = in.getByte();
|
||||
myCompuMate->column() = in.getByte();
|
||||
in.getByteArray(myRAM, 2048);
|
||||
}
|
||||
catch(...)
|
||||
|
|
|
@ -76,7 +76,7 @@ void CompuMate::update()
|
|||
rp.myDigitalPinState[Controller::Three] = true;
|
||||
rp.myDigitalPinState[Controller::Four] = true;
|
||||
|
||||
switch(myColumn) // This is updated outside the class
|
||||
switch(myColumn) // This is updated inside CartCM class
|
||||
{
|
||||
case 0:
|
||||
if (myKeyTable[KBDK_7]) lp.myDigitalPinState[Controller::Six] = false;
|
||||
|
|
|
@ -40,8 +40,6 @@
|
|||
*/
|
||||
class CompuMate
|
||||
{
|
||||
friend class CartridgeCM;
|
||||
|
||||
public:
|
||||
/**
|
||||
Create a new CompuMate handler for both left and right ports.
|
||||
|
@ -77,6 +75,9 @@ class CompuMate
|
|||
*/
|
||||
void enableKeyHandling(bool enable);
|
||||
|
||||
/** Needed for communication with CartCM class */
|
||||
uInt8& column() { return myColumn; }
|
||||
|
||||
private:
|
||||
/**
|
||||
Called by the controller(s) when all pins have been written
|
||||
|
|
Loading…
Reference in New Issue