2828#include " ale/games/supported/Pitfall.hpp"
2929
3030#include " ale/games/RomUtils.hpp"
31- #include " ale/environment/stella_environment_wrapper.hpp"
3231
3332namespace ale {
3433using namespace stella ;
@@ -56,8 +55,7 @@ void PitfallSettings::step(const System& system) {
5655 int timer_minutes = readRam (&system, 0xD8 );
5756 int timer_seconds = readRam (&system, 0xD9 );
5857 // Game terminates when: (1) all lives lost and logo screen shown, OR (2) timer runs out (00:00)
59- // In legacy mode (mode 1), timer expiration is not checked for backwards compatibility
60- bool timer_expired = m_terminateOnTimeout && (timer_minutes == 0 && timer_seconds == 0 );
58+ bool timer_expired = (timer_minutes == 0 && timer_seconds == 0 );
6159 m_terminal = (lives_byte == 0 && logo_timer != 0 ) || timer_expired;
6260
6361 m_lives = (lives_byte == 0xA ) ? 3 : ((lives_byte == 0x8 ) ? 2 : 1 );
@@ -102,7 +100,6 @@ void PitfallSettings::reset() {
102100 m_score = 2000 ;
103101 m_terminal = false ;
104102 m_lives = 3 ;
105- m_terminateOnTimeout = true ;
106103}
107104
108105/* saves the state of the rom settings */
@@ -111,7 +108,6 @@ void PitfallSettings::saveState(Serializer& ser) {
111108 ser.putInt (m_score);
112109 ser.putBool (m_terminal);
113110 ser.putInt (m_lives);
114- ser.putBool (m_terminateOnTimeout);
115111}
116112
117113// loads the state of the rom settings
@@ -120,33 +116,10 @@ void PitfallSettings::loadState(Deserializer& ser) {
120116 m_score = ser.getInt ();
121117 m_terminal = ser.getBool ();
122118 m_lives = ser.getInt ();
123- m_terminateOnTimeout = ser.getBool ();
124119}
125120
126121ActionVect PitfallSettings::getStartingActions () {
127122 return {PLAYER_A_UP };
128123}
129124
130- // Returns a list of modes that the game can be played in.
131- // Mode 0: Default mode with timer-based termination (terminates when 20-minute timer expires)
132- // Mode 1: Legacy mode without timer-based termination (for backwards compatibility)
133- ModeVect PitfallSettings::getAvailableModes () {
134- return {0 , 1 };
135- }
136-
137- // Set the mode of the game.
138- void PitfallSettings::setMode (
139- game_mode_t m, System& system,
140- std::unique_ptr<StellaEnvironmentWrapper> environment) {
141- if (m == 0 ) {
142- // Default mode: terminate when 20-minute timer expires
143- m_terminateOnTimeout = true ;
144- } else if (m == 1 ) {
145- // Legacy mode: do not terminate on timer expiration (original buggy behavior)
146- m_terminateOnTimeout = false ;
147- } else {
148- throw std::runtime_error (" This mode is not supported for Pitfall." );
149- }
150- }
151-
152125} // namespace ale
0 commit comments