From de5b67f430b7335f3134b660d651f48c0181abea Mon Sep 17 00:00:00 2001 From: Sebastian Griesbach <56889221+Sebastian-Griesbach@users.noreply.github.com> Date: Mon, 13 Jul 2026 16:07:28 +0200 Subject: [PATCH] Align modes of Pong and Sourround to game instructions Also update documentation accordingly --- docs/environments.md | 4 ++-- docs/environments/pong.md | 2 +- docs/environments/surround.md | 2 +- src/ale/games/supported/Pong.cpp | 10 +++------- src/ale/games/supported/Surround.cpp | 6 +++--- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/environments.md b/docs/environments.md index 34888eeeb..dcfd19849 100644 --- a/docs/environments.md +++ b/docs/environments.md @@ -313,7 +313,7 @@ the available modes and difficulty levels for different Atari games: | Phoenix | [0] | 0 | [0] | 0 | | Pitfall | [0] | 0 | [0] | 0 | | Pitfall2 | [0] | 0 | [0] | 0 | -| Pong | [0, 1] | 0 | [0, 1, 2, 3] | 0 | +| Pong | [1, 2] | 1 | [0, 1, 2, 3] | 0 | | Pooyan | [10, 30, 50, 70] | 10 | [0] | 0 | | PrivateEye | [0, 1, 2, 3, 4] | 0 | [0, 1, 2, 3] | 0 | | Qbert | [0] | 0 | [0, 1] | 0 | @@ -328,7 +328,7 @@ the available modes and difficulty levels for different Atari games: | SpaceWar | [6, ..., 17] | 6 | [0] | 0 | | StarGunner | [0, 1, 2, 3] | 0 | [0] | 0 | | Superman | [0] | 0 | [0, 1, 2, 3] | 0 | -| Surround | [0, 2] | 0 | [0, 1, 2, 3] | 0 | +| Surround | [2, 4] | 2 | [0, 1, 2, 3] | 0 | | Tennis | [0, 2] | 0 | [0, 1, 2, 3] | 0 | | Tetris | [0] | 0 | [0] | 0 | | TicTacToe3D | [0, ..., 8] | 0 | [0, 2] | 0 | diff --git a/docs/environments/pong.md b/docs/environments/pong.md index 498118d80..e5982f67c 100644 --- a/docs/environments/pong.md +++ b/docs/environments/pong.md @@ -79,7 +79,7 @@ along with the default values. | Available Modes | Default Mode | Available Difficulties | Default Difficulty | |-------------------|----------------|--------------------------|----------------------| -| `[0, 1]` | `0` | `[0, 1, 2, 3]` | `0` | +| `[1, 2]` | `1` | `[0, 1, 2, 3]` | `0` | ## Version History diff --git a/docs/environments/surround.md b/docs/environments/surround.md index 54148fd6e..953e24c9f 100644 --- a/docs/environments/surround.md +++ b/docs/environments/surround.md @@ -70,7 +70,7 @@ along with the default values. | Available Modes | Default Mode | Available Difficulties | Default Difficulty | |-------------------|----------------|--------------------------|----------------------| -| `[0, 2]` | `0` | `[0, 1, 2, 3]` | `0` | +| `[2, 4]` | `2` | `[0, 1, 2, 3]` | `0` | ## Version History diff --git a/src/ale/games/supported/Pong.cpp b/src/ale/games/supported/Pong.cpp index 9a058a380..2ba17f744 100644 --- a/src/ale/games/supported/Pong.cpp +++ b/src/ale/games/supported/Pong.cpp @@ -82,11 +82,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 @@ -94,11 +90,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/ale/games/supported/Surround.cpp b/src/ale/games/supported/Surround.cpp index bf043d42f..96207c0bb 100644 --- a/src/ale/games/supported/Surround.cpp +++ b/src/ale/games/supported/Surround.cpp @@ -106,16 +106,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) {