diff --git a/src/emucore/CompuMate.cxx b/src/emucore/CompuMate.cxx index a6667eeea..2bfa53044 100644 --- a/src/emucore/CompuMate.cxx +++ b/src/emucore/CompuMate.cxx @@ -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; diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index 246358f40..4e97c8034 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -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(*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 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 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();