List and meaning of debug commands

Second part of the best game ever made.
Post Reply
FluffyQuack
Vizier
Vizier
Posts: 86
Joined: June 6th, 2004, 7:05 pm

List and meaning of debug commands

Post by FluffyQuack »

There's a list of debug commands and cheats you can see listed on these pages:
https://popuw.com/cheats2.html
https://popuw.com/parameters.html

This isn't a complete list, though. I've going through David's POP2's disassembly to understand the code more and try to slow map more of it and I noticed there's some debug keys I've never seen be mentioned.

Here's a list of cheats/debug commands available when starting the game in cheat mode (with "yippeeyahoo" argument when starting 1.0 or 1.1):
  • K = Kill all enemies on screen
  • G = Something to do with shadow and changing health value?
  • + = Increase time left
  • - = Decrease time left
  • Shift+B = Only render animated entities
  • Shift+I = Flip screen
  • Shift+R = Display room number
  • Shift+S = Turn into shadow/flame (only works on temple and final levels)
  • Shift+K = Subtract health
  • Shift+T = Increase max health
  • Shift+W = Slow fall
  • R = Resurrect player
  • V = Sets something referred to as "buffer" to 0?
  • Alt+D = Make dump
  • F1 = Frame-by-frame mode. Also shows frame index for player as "POS=#" if F2 is toggled
  • F2 = I think this draw player's "weight" position (where feet are planted)
  • F3 = Shows "Toggle player: On/off." What does this actually do?
  • F5 = Draws blue dots below player. Right-most collision position?
  • F6 = Toggle ruler (divided into 16 segments that are 20 pixels wide each)
  • F7 = Toggle something. What does this do?
  • F8 = Toggle something. What does this do?
  • 1 = Save player X position (doesn't work for me)
  • 2 = Load player X position (doesn't work for me)
  • 3 = Save player Y position (doesn't work for me)
  • 4 = Load player Y position (doesn't work for me)
There's a few mysteries here:
  • I'm not sure what V does, but I feel it could be something trivial and not important.
  • I'm pretty sure the red lines below the player when F2 is on is the "weight" position for the player. If you have F1 and F2 enabled at the same time, you get a value showing the current frame data index for the player character (I've seen some information online claim this is the player's X position, but that's wrong).
  • I have no idea what F3 does.
  • I don't think F4 is mapped to anything.
  • F5 shows blue lines below the player, which I think correspond to the player's rightmost (relative to direction faced) collision box position. I could be wrong, though.
  • No idea what F7 and F8 do, but they toggle something in the code.
  • 1/2/3/4 are supposed to save and restore player position, but I couldn't get it working.
I'll experiment more or try to understand the code more to fully understand these debug commands.

Speaking of debug commands, this page shows there's a big debug menu in the Mac version of POP2, but unfortunately, it is apparently not functional: https://tcrf.net/Prince_of_Persia_2:_Th ... S_Classic)
David
The Prince of Persia
The Prince of Persia
Posts: 2848
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: List and meaning of debug commands

Post by David »

FluffyQuack wrote: January 7th, 2024, 11:51 pm There's a list of debug commands and cheats you can see listed on these pages:
https://popuw.com/cheats2.html
https://popuw.com/parameters.html

This isn't a complete list, though.
I thought there was a full list of PoP2 cheats somewhere, but can't find any...
FluffyQuack wrote: January 7th, 2024, 11:51 pm
  • G = Something to do with shadow and changing health value?
It increases your opponent's hit points by one.

I recall a list of cheats which labeled this as "Gain a bottle to the guard" or similar?
Did the writer of the cheats list choose "Gain" because it starts with "G"?

By the way, the "Shad" in LoadShad and SaveShad refers to any opponent, not just the shadow.
"Shad" comes from the Apple II original version of PoP1, where originally the shadow was planned to be the only opponent.
Then, when guards were added, the name stuck.
In PoP2 these names are even more outdated, since the shadow is never your opponent there.
FluffyQuack wrote: January 7th, 2024, 11:51 pm
  • 1 = Save player X position (doesn't work for me)
  • 2 = Load player X position (doesn't work for me)
  • 3 = Save player Y position (doesn't work for me)
  • 4 = Load player Y position (doesn't work for me)
  • 1/2/3/4 are supposed to save and restore player position, but I couldn't get it working.
They work only in joystick mode.
FluffyQuack wrote: January 7th, 2024, 11:51 pm
  • F3 = Shows "Toggle player: On/off." What does this actually do?
Back in the PoPUW forum, BlackChar jokingly suggested that "Maybe it started a CD player? :D".

I see some "cmp player_on, <something>" lines in the disassembly, but I don't know their purpose.
FluffyQuack
Vizier
Vizier
Posts: 86
Joined: June 6th, 2004, 7:05 pm

Re: List and meaning of debug commands

Post by FluffyQuack »

David wrote: January 13th, 2024, 11:12 amBy the way, the "Shad" in LoadShad and SaveShad refers to any opponent, not just the shadow.
"Shad" comes from the Apple II original version of PoP1, where originally the shadow was planned to be the only opponent.
Then, when guards were added, the name stuck.
In PoP2 these names are even more outdated, since the shadow is never your opponent there.
Oh, thanks for the clarification. I should have put two and two together when I saw LoadShad and SaveShad as I've looked at your SDL POP and the original POP code a lot. As I've been digging through the POP2 disassembly I am realizing how much code they kept the same from POP1. Which is pretty convenient from a reverse-engineering standpoint.
Post Reply