mirror of https://github.com/stella-emu/stella.git
Fix crash when using CompuMate scheme but not using CM controllers.
The code now never looks at the controller type for CM ROMs, but just creates the required controllers. This means that we no longer actually need a special CompuMate controller type anywhere in the code, since selecting it has become redundant.
This commit is contained in:
parent
1fa3f0cf0d
commit
d99d3a16f5
|
@ -61,7 +61,6 @@ void CompuMate::update()
|
|||
Controller& lp = myConsole.leftController();
|
||||
Controller& rp = myConsole.rightController();
|
||||
|
||||
|
||||
lp.myAnalogPinValue[Controller::Nine] = Controller::maximumResistance;
|
||||
lp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
|
||||
lp.myDigitalPinState[Controller::Six] = true;
|
||||
|
|
|
@ -682,13 +682,9 @@ void Console::setTIAProperties()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Console::setControllers(const string& rommd5)
|
||||
{
|
||||
// Setup the controllers based on properties
|
||||
const string& left = myProperties.get(Controller_Left);
|
||||
const string& right = myProperties.get(Controller_Right);
|
||||
|
||||
// Check for CompuMate controllers; they are special in that a handler
|
||||
// creates them for us, and also that they must be used in both ports
|
||||
if(left == "COMPUMATE" || right == "COMPUMATE")
|
||||
// Check for CompuMate scheme; it is special in that a handler creates both
|
||||
// controllers for us, and associates them with the bankswitching class
|
||||
if(myCart->detectedType() == "CM")
|
||||
{
|
||||
myCMHandler = make_shared<CompuMate>(*this, myEvent, *mySystem);
|
||||
|
||||
|
@ -701,25 +697,27 @@ void Console::setControllers(const string& rommd5)
|
|||
|
||||
myLeftControl = std::move(myCMHandler->leftController());
|
||||
myRightControl = std::move(myCMHandler->rightController());
|
||||
return;
|
||||
}
|
||||
|
||||
unique_ptr<Controller> leftC = std::move(myLeftControl),
|
||||
rightC = std::move(myRightControl);
|
||||
|
||||
leftC = getControllerPort(rommd5, left, Controller::Left);
|
||||
rightC = getControllerPort(rommd5, right, Controller::Right);
|
||||
|
||||
// Swap the ports if necessary
|
||||
if(myProperties.get(Console_SwapPorts) == "NO")
|
||||
{
|
||||
myLeftControl = std::move(leftC);
|
||||
myRightControl = std::move(rightC);
|
||||
}
|
||||
else
|
||||
{
|
||||
myLeftControl = std::move(rightC);
|
||||
myRightControl = std::move(leftC);
|
||||
// Setup the controllers based on properties
|
||||
const string& left = myProperties.get(Controller_Left);
|
||||
const string& right = myProperties.get(Controller_Right);
|
||||
|
||||
unique_ptr<Controller> leftC = getControllerPort(rommd5, left, Controller::Left),
|
||||
rightC = getControllerPort(rommd5, right, Controller::Right);
|
||||
|
||||
// Swap the ports if necessary
|
||||
if(myProperties.get(Console_SwapPorts) == "NO")
|
||||
{
|
||||
myLeftControl = std::move(leftC);
|
||||
myRightControl = std::move(rightC);
|
||||
}
|
||||
else
|
||||
{
|
||||
myLeftControl = std::move(rightC);
|
||||
myRightControl = std::move(leftC);
|
||||
}
|
||||
}
|
||||
|
||||
myTIA->bindToControllers();
|
||||
|
|
Loading…
Reference in New Issue