Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed mode numbers for pong and surround #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/games/supported/Pong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,19 @@ 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
// the given mode must be one returned by the previous function
void PongSettings::setMode(
game_mode_t m, System& system,
std::unique_ptr<StellaEnvironmentWrapper> 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);
}
Expand Down
6 changes: 3 additions & 3 deletions src/games/supported/Surround.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<StellaEnvironmentWrapper> 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) {
Expand Down