From ae14b9eb7bc4f031c680b37ab567e43693a3e4d9 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Fri, 16 Aug 2019 06:54:17 +0200 Subject: [PATCH] minor refactoring --- src/emucore/Console.cxx | 14 +++++++------- src/emucore/Console.hxx | 6 +++--- src/emucore/KidVid.cxx | 6 +++--- src/emucore/KidVid.hxx | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index fdf01cb6d..ed0d56484 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -784,7 +784,7 @@ void Console::createAudioQueue() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void Console::setControllers(const string& rommd5) +void Console::setControllers(const string& romMd5) { // Check for CompuMate scheme; it is special in that a handler creates both // controllers for us, and associates them with the bankswitching class @@ -822,8 +822,8 @@ void Console::setControllers(const string& rommd5) !swappedPorts ? Controller::Jack::Right : Controller::Jack::Left, myOSystem.settings()); } - unique_ptr leftC = getControllerPort(rommd5, left, Controller::Jack::Left), - rightC = getControllerPort(rommd5, right, Controller::Jack::Right); + unique_ptr leftC = getControllerPort(left, Controller::Jack::Left, romMd5), + rightC = getControllerPort(right, Controller::Jack::Right, romMd5); // Swap the ports if necessary if(!swappedPorts) @@ -848,10 +848,10 @@ void Console::setControllers(const string& rommd5) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -unique_ptr Console::getControllerPort(const string& rommd5, - const string& controllerName, Controller::Jack port) +unique_ptr Console::getControllerPort(const string& controllerName, + Controller::Jack port, const string& romMd5) { - unique_ptr controller; // = std::move(myLeftControl); // TJ: why was this there? + unique_ptr controller; myOSystem.eventHandler().defineKeyControllerMappings(controllerName, port); myOSystem.eventHandler().defineJoyControllerMappings(controllerName, port); @@ -924,7 +924,7 @@ unique_ptr Console::getControllerPort(const string& rommd5, } else if(controllerName == "KIDVID") { - controller = make_unique(port, myEvent, *mySystem, rommd5); + controller = make_unique(port, myEvent, *mySystem, romMd5); } else if(controllerName == "MINDLINK") { diff --git a/src/emucore/Console.hxx b/src/emucore/Console.hxx index 01cca4f54..ac84a8fd0 100644 --- a/src/emucore/Console.hxx +++ b/src/emucore/Console.hxx @@ -85,7 +85,7 @@ class Console : public Serializable, public ConsoleIO /** Sets the left and right controllers for the console. */ - void setControllers(const string& rommd5); + void setControllers(const string& roMd5); /** Get the controller plugged into the specified jack @@ -339,8 +339,8 @@ class Console : public Serializable, public ConsoleIO /** Selects the left or right controller depending on ROM properties */ - unique_ptr getControllerPort(const string& rommd5, - const string& controllerName, Controller::Jack port); + unique_ptr getControllerPort(const string& controllerName, + Controller::Jack port, const string& romMd5); /** Loads a user-defined palette file (from OSystem::paletteFile), filling the diff --git a/src/emucore/KidVid.cxx b/src/emucore/KidVid.cxx index d778fb7f8..5d6f02306 100644 --- a/src/emucore/KidVid.cxx +++ b/src/emucore/KidVid.cxx @@ -22,7 +22,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - KidVid::KidVid(Jack jack, const Event& event, const System& system, - const string& rommd5) + const string& romMd5) : Controller(jack, event, system, Controller::Type::KidVid), myEnabled(myJack == Jack::Right), // mySampleFile(nullptr), @@ -41,9 +41,9 @@ KidVid::KidVid(Jack jack, const Event& event, const System& system, myBlockIdx(0) { // Right now, there are only two games that use the KidVid - if(rommd5 == "ee6665683ebdb539e89ba620981cb0f6") + if(romMd5 == "ee6665683ebdb539e89ba620981cb0f6") myGame = KVBBEARS; // Berenstain Bears - else if(rommd5 == "a204cd4fb1944c86e800120706512a64") + else if(romMd5 == "a204cd4fb1944c86e800120706512a64") myGame = KVSMURFS; // Smurfs Save the Day else myEnabled = false; diff --git a/src/emucore/KidVid.hxx b/src/emucore/KidVid.hxx index c2093bb65..d0593c42f 100644 --- a/src/emucore/KidVid.hxx +++ b/src/emucore/KidVid.hxx @@ -45,10 +45,10 @@ class KidVid : public Controller @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 md5sum The md5 of the ROM using this controller + @param romMd5 The md5 of the ROM using this controller */ KidVid(Jack jack, const Event& event, const System& system, - const string& md5sum); + const string& romMd5); virtual ~KidVid(); public: