File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
8383ModeVect 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
9389void 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 }
Original file line number Diff line number Diff 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.
107107ModeVect SurroundSettings::getAvailableModes () {
108- return {0 , 2 };
108+ return {2 , 4 };
109109}
110110
111111void 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) {
You can’t perform that action at this time.
0 commit comments