Skip to content

Commit fff79cf

Browse files
committed
changed mode numbers for pong and surround
1 parent e6adf39 commit fff79cf

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

src/games/supported/Pong.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,19 @@ void PongSettings::loadState(Deserializer& ser) {
8181

8282
// returns a list of mode that the game can be played in
8383
ModeVect PongSettings::getAvailableModes() {
84-
ModeVect modes(getNumModes());
85-
for (unsigned int i = 0; i < modes.size(); i++) {
86-
modes[i] = i;
87-
}
88-
return modes;
84+
return {1, 2};
8985
}
9086

9187
// set the mode of the game
9288
// the given mode must be one returned by the previous function
9389
void PongSettings::setMode(
9490
game_mode_t m, System& system,
9591
std::unique_ptr<StellaEnvironmentWrapper> environment) {
96-
if (m < getNumModes()) {
92+
if (isModeSupported(m)) {
9793
// read the mode we are currently in
9894
unsigned char mode = readRam(&system, 0x96);
9995
// press select until the correct mode is reached
100-
while (mode != m) {
96+
while (mode != m - 1) {
10197
environment->pressSelect(2);
10298
mode = readRam(&system, 0x96);
10399
}

src/games/supported/Surround.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ DifficultyVect SurroundSettings::getAvailableDifficulties() {
105105
// https://atariage.com/manual_html_page.php?SoftwareLabelID=535
106106
// There are only two single player modes, the second is faster than the first.
107107
ModeVect SurroundSettings::getAvailableModes() {
108-
return {0, 2};
108+
return {2, 4};
109109
}
110110

111111
void SurroundSettings::setMode(
112112
game_mode_t m, System& system,
113113
std::unique_ptr<StellaEnvironmentWrapper> environment) {
114-
if (m == 0 || m == 2) {
114+
if (isModeSupported(m)) {
115115
// Read the game mode from RAM address 0xf9.
116116
unsigned char mode = readRam(&system, 0xf9);
117-
int desired_mode = m + 1;
117+
int desired_mode = m - 1;
118118

119119
// Press select until the correct mode is reached for single player only.
120120
while (mode != desired_mode) {

0 commit comments

Comments
 (0)