NagyD / SDLPoP

An open-source port of Prince of Persia, based on the disassembly of the DOS version.
GNU General Public License v3.0
1.1k stars 141 forks source link

Exit room timer save #245

Open SergioMartin86 opened 3 years ago

SergioMartin86 commented 3 years ago

The overflow glitch that allows for skips on level 10 and 12 requires that the exit room timer is conserved through savestates.

Currently in SDLpop, if you quicksave just before grabbing the ledge and quickload, then the overflow glitch won't happen. This pull request solves the problem and allows our bot to find the trick.

mooskagh commented 3 years ago

Note that it will likely break forward and backward compatibility between savegame versions.

If so, I'd suggest to wait a bit more to gather other possible changes to break it once instead of several times. (and in any case it would be great that even after the change, new SDLPoP could open old savegames)

SergioMartin86 commented 3 years ago

(and in any case it would be great that even after the change, new SDLPoP could open old savegames)

I purposefully appended this value at the end, so that if you load an old savestate (2908 bytes instead of 2910) you can set these missing 2 bytes to zero.