From fff79cfb49a0aad85eecde987de9ec114294f855 Mon Sep 17 00:00:00 2001 From: Ben Black Date: Wed, 23 Dec 2020 12:24:40 -0700 Subject: [PATCH] changed mode numbers for pong and surround --- src/games/supported/Pong.cpp | 10 +++------- src/games/supported/Surround.cpp | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/games/supported/Pong.cpp b/src/games/supported/Pong.cpp index d4ae83680..a9148ca34 100644 --- a/src/games/supported/Pong.cpp +++ b/src/games/supported/Pong.cpp @@ -81,11 +81,7 @@ void PongSettings::loadState(Deserializer& ser) { // returns a list of mode that the game can be played in ModeVect PongSettings::getAvailableModes() { - ModeVect modes(getNumModes()); - for (unsigned int i = 0; i < modes.size(); i++) { - modes[i] = i; - } - return modes; + return {1, 2}; } // set the mode of the game @@ -93,11 +89,11 @@ ModeVect PongSettings::getAvailableModes() { void PongSettings::setMode( game_mode_t m, System& system, std::unique_ptr environment) { - if (m < getNumModes()) { + if (isModeSupported(m)) { // read the mode we are currently in unsigned char mode = readRam(&system, 0x96); // press select until the correct mode is reached - while (mode != m) { + while (mode != m - 1) { environment->pressSelect(2); mode = readRam(&system, 0x96); } diff --git a/src/games/supported/Surround.cpp b/src/games/supported/Surround.cpp index 818d55f47..898f4d7b2 100644 --- a/src/games/supported/Surround.cpp +++ b/src/games/supported/Surround.cpp @@ -105,16 +105,16 @@ DifficultyVect SurroundSettings::getAvailableDifficulties() { // https://atariage.com/manual_html_page.php?SoftwareLabelID=535 // There are only two single player modes, the second is faster than the first. ModeVect SurroundSettings::getAvailableModes() { - return {0, 2}; + return {2, 4}; } void SurroundSettings::setMode( game_mode_t m, System& system, std::unique_ptr environment) { - if (m == 0 || m == 2) { + if (isModeSupported(m)) { // Read the game mode from RAM address 0xf9. unsigned char mode = readRam(&system, 0xf9); - int desired_mode = m + 1; + int desired_mode = m - 1; // Press select until the correct mode is reached for single player only. while (mode != desired_mode) {