Skip to content

Commit

Permalink
Added a debug cheat to quickload but keep the currently loaded level.…
Browse files Browse the repository at this point in the history
… (Shift+F9)
  • Loading branch information
NagyD committed Mar 20, 2021
1 parent c244c73 commit 79332ff
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doc/ChangeLog.txt
Expand Up @@ -613,3 +613,5 @@ FIXED: Make it possible to go through a certain closed gate on level 11 of Demo
Testcase: replays-testcases/Demo by Suave Prince level 11.p1r
FIXED: When the prince jumps up at the bottom of a big pillar split between two rooms, a part near the top of the screen disappears.
Example: The top row in the first room of the original level 5.
DONE: Added a debug cheat to quickload but keep the currently loaded level. (Shift+F9)
Motivation: https://forum.princed.org/viewtopic.php?p=32556#p32556
6 changes: 6 additions & 0 deletions doc/Readme.txt
Expand Up @@ -218,6 +218,12 @@ See SDLPoP.ini for details.
* [: shift kid 1 pixel to the left
* ]: shift kid 1 pixel to the right
* T: Toggle timer (remaining minutes:seconds:ticks). Also shows the total elapsed ticks during playback.
* Shift+F9: Quickload but keep the currently loaded level.
* Intended use: Suppose you made a quicksave after you got the prince or a guard into a specific position needed for a trick.
Then you try to do the trick, but you realize that you need to change the level slightly to make the trick work. So you edit the level.
But you can't use a (regular) quickload to get back to the saved position, because that would load the previous version of the level from the quicksave file.
In this situation, press Ctrl+A to load the new version of the level, then press Shift+F9 to load the quicksave onto this new level.
* Motivation: https://forum.princed.org/viewtopic.php?p=32556#p32556

Where is the music?
----------------------
Expand Down
10 changes: 9 additions & 1 deletion src/seg000.c
Expand Up @@ -254,7 +254,15 @@ int quick_process(process_func_type process_func) {
int ok = 1;
#define process(x) ok = ok && process_func(&(x), sizeof(x))
// level
process(level);
#ifdef USE_DEBUG_CHEATS
// Don't load the level if the user holds either Shift key while pressing F9.
if (debug_cheats_enabled && (key_states[SDL_SCANCODE_LSHIFT] || key_states[SDL_SCANCODE_RSHIFT])) {
fseek(quick_fp, sizeof(level), SEEK_CUR);
} else
#endif
{
process(level);
}
process(checkpoint);
process(upside_down);
process(drawn_room);
Expand Down

0 comments on commit 79332ff

Please sign in to comment.