SDLPoP
An open-source port of Prince of Persia, based on the disassembly of the DOS version.
Install / Use
/learn @NagyD/SDLPoPREADME
SDLPoP
An open-source port of Prince of Persia, based on the disassembly of the DOS version, extended with new features.
Links
- Forum board: https://forum.princed.org/viewforum.php?f=126
- GitHub: https://github.com/NagyD/SDLPoP
- Compiled versions: https://www.popot.org/get_the_games.php?game=SDLPoP
Authors
Author:
- NagyD (David from
forum.princed.org)
Contributors:
- Andrew (bug reports)
- htamas (inspiration, dungeon wall drawing algorithm, bug reports)
- Norbert (EndeavourAccuracy on GitHub) (bug reports, suggestions, improved gamepad support)
- musa (bug reports)
- Eugene (bug reports)
- StaticReturn (Mac OS X: Makefile (for older SDL1 version), bug reports)
- Poirot (ecalot on GitHub) (Mac OS X: Now compatible with Falcury SDL2 port)
- kees (bugfixes)
- Falcury
- porting to SDL2
- quicksave improvements
- replay files
- SDLPoP.ini: added basic support and constantly adding new options
- mod folders
- fake tiles
- readable sequence table
- CMake support
- pause menu
- MIDI support
- and various other bugfixes, improvements, additions
- segra (segrax on GitHub) (Joystick support, resizable window)
- DarkPrince (bug reports)
- Andrey Vasilkin / digi@os2.snc.ru (eComStation (OS/2) support)
- mfn (fixed a small bug when
USE_MIXERis undefined) - diddledani (Visual C++/NMake support)
- zaps166 (small Makefile fixes)
- usineur (faster music loading)
- yaqxsw (icon)
- SergioMartin86
- dstarosta
- Ryzee119
- berikv
- xyproto
- BarrOff
- icculus
- thrimbor
- vanfanel
- asppsa
- akien-mga
- mbeijen
- alebcay
- ckorn
- Rondom
- yuv422
- dive
Usernames on the list above refer to either GitHub users or users from forum.princed.org.
GENERAL
What is this?
This is an open-source port/conversion of the DOS game Prince of Persia. It is based on the disassembly of the original PoP1 for DOS.
Note, however, that SDLPoP has many new features not found in the original game. These are marked as such in the command-line and the keys sections below.
Where can I download that disassembly?
Here: https://forum.princed.org/viewtopic.php?f=68&t=3423
- Scroll down to the newest zip files.
- The exact version is PoP 1.0, i.e.
pop1_ida.zip(but with features added from later versions).
Sources which helped in making the disassembly:
- Modifications to
prince.exe(hex editing) topic in the PoPUW forum.- That forum is down, you can find some saved posts here: https://forum.princed.org/viewtopic.php?f=73&t=661
- HTamas posted the dungeon wall drawing algorithm in C-style pseudocode here, along with many hex-edit hacks.
- It was his work that prompted me to start the disassembly and later SDLPoP. Thank you!
- PoP1 Technical Information by Mechner: https://www.popot.org/documentation.php?doc=OldDocuments
- PoP1 Apple II source code by Mechner: https://github.com/jmechner/Prince-of-Persia-Apple-II
LICENSE
This program is open source under the GNU General Public License terms, see COPYING and src/GPLv3.h.
The following files are external libraries with their own licenses: src/opl3.c, src/opl3.h, src/stb_vorbis.c.
See their contents for license information.
USAGE
Running the game
Windows
- Double-click on the
prince.exefile. - If you want to pass command line parameters, you need to open a command line.
GNU/Linux
Arch Linux
- Use your favorite AUR helper and install the
sdlpoppackage. - Start the game with
princeor from the menu of your desktop environment.
Debian/Ubuntu
- Compile the game manually (see instructions below).
- Start the game with
./prince.
macOS
- See the compilation instructions below. Thanks to StaticReturn and Poirot.
Compiled versions
- You can find compiled versions for these three platforms here: https://www.popot.org/get_the_games.php?game=SDLPoP
- Unofficial ports for other systems can be found here: https://forum.princed.org/viewtopic.php?f=126&t=4728. These were not made by the authors of SDLPoP.
What command-line options are there?
megahit-- Enable cheats.- a number from
0to15-- Start the given level. (Works only together withmegahitorrecord.) draw-- Draw directly to the screen, skipping the offscreen buffer.demo-- Run in demo mode: only the first two levels will be playable, and quotes from magazine reviews will be displayed.stdsnd-- Use PC speaker sounds.
The following don't exist in the original game:
full-- Run in full screen mode.record-- Start recording immediately. (See the Replays section.)replayor a*.P1Rfilename -- Start replaying immediately. (See the Replays section.)validate "replays/replay.p1r"-- Print out information about a replay file and quit. (See the Replays section.)mod "Mod Name"-- Run with custom data files from the folder "mods/Mod Name/"debug-- Enable debug cheats.--version,-v-- Display SDLPoP version and quit.--help,-h,-?-- Display help and quit. (Currently it only points to this Readme...)seed=number-- Set initial random seed, for testing.--screenshot-- Must be used with megahit and a level number. When the level starts, a screenshot is saved to the screenshots folder and the game quits.--screenshot-level-- Similar to the above, except the whole level is screenshotted, thus creating a level map.--screenshot-level-extras-- Similar to the above, except lots of additional info is displayed on the picture. You can find the meaning of each symbol inMap_Symbols.txt.mute-- Start the game with sound off. (You can still enable sound with Ctrl+S.)playdemo-- Make the demo level playable. You may want to use it together with options which start the demo level immediately, such asmegahit 0 playdemoorrecord 0 playdemo.
Environment variables
SDLPOP_SAVE_PATH-- If set, all save (SAV) and hall-of-fame (HOF) files will be created in the directory it points to.- Hall-of-Fame and saved game files of mods will be placed in a subdirectory named after the mod.
Which keys can I use?
Controlling the kid
- Left: turn or run left
- Right: turn or run right
- Up: jump or climb up
- Down: crouch or climb down
- Down+Left/Right: hop
- Shift: pick up things
- Shift+Left/Right: careful step
- Home or Up+Left: jump left
- Page Up or Up+Right: jump right
- Up while running: running jump
- Shift while falling: grab onto ledge
Sword fight:
- Left/Right: walk (advance or retreat)
- Shift: strike (attack)
- Up: block (defend)
- Down: put sword away; press Shift to draw your sword again.
You can also use the numeric keypad.
The keyboard controls can be redefined in the pause menu.
Gamepad equivalents
- D-Pad: arrows
- Joystick: left/right (for all-directional joystick movement, set joystick_only_horizontal to false in SDLPoP.ini)
- A: down
- Y: up
- X or triggers: Shift
- Start or Back: Display in-game menu.
If SDLPoP does not work correctly with your gamepad, it might help if you download gamecontrollerdb.txt and configure SDLPoP to use it. See SDLPoP.ini for details.
Since version 1.23 SDLPoP now detects controllers plugged in while the game is already running. (hotplug)
Controlling the game
- Esc: Pause game.
- Space: Show how much time is left.
- Ctrl+A: Restart level.
- Ctrl+G: Save game (on levels 3..13).
- This saves only the level number, the remaining time, and the number of hit points.
- Ctrl+L: Load game (press in the intro).
- The game will continue from the beginning of the level where you saved.
- Ctrl+J: Joystick/gamepad mode.
- Ctrl+K: Keyboard mode.
- The initial mode is joystick/gamepad if such a device is detected, otherwise keyboard mode.
- Since version 1.18, SDLPoP automatically changes the input mode when there is input from either device. As a result, Ctrl+K and Ctrl+J are now redundant.
- Ctrl+R: Return to intro.
- Ctrl+S: Sound on/off.
- Ctrl+V: Show version of SDLPoP.
- Ctrl+Q: Quit game.
The following don't exist in the original game:
- Ctrl+C: Show versions of SDL:
- COMP: the SDL version SDLPoP was compiled against, i.e. the version of the SDL headers.
- LINK: the SDL version SDLPoP was linked against, i.e. the version of SDL2.dll (or its equivalent on other platforms).
- Alt+Enter: Toggle full-screen mode.
- F6: Quicksave: Save the exact state of the game.
- F9: Quickload: Load what the last quicksave saved.
- F12: Save a screenshot to the screenshots folder.
- Backspace: Display the in-game menu. (Esc will also display the menu by default, but you can turn that off.)
- `: Fast forward. (It's the key above Tab. It might have a different label depending on your keyboard layout.)
Viewing or recording replays:
Replays don't exist in the original game.
- Ctrl+Tab (in game, or on title screen): Start or stop recording.
- Tab (on title screen): View/cycle through the saved replays in the SDLPoP directory.
- F (while viewing a replay): Skip forward to the next room.
- Shift+F (while viewing a replay): Skip forward to the next level.
Cheats:
- Shift+L: Go to next level.
- C: Show numbers of current and adjacent rooms.
- Shift+C: Show numbers of diagonally adjacent rooms.
- -: Decrease remaining time by one minute.
- +: Increase remaining time by one minute.
- R: Resurrect kid.
- K: Kill guard.
- Shift+I: Flip the screen upside down.
- Shift+W: Slow falling.
- H: Look at the room to the left.
- J: Look at the room to the right.
- U: Look at the room above.
- N: Look at the room below.
- Shift+B: Toggle hiding of non-animated objects. (Also known as "blind mode".)
- Shift+S: Restore a lost hit-point. (Like a small red potion.)
- Shift+T: Give more hit-points. (Like a big red potion.)
The following don't exist in the original game:
- Ctrl+B: Go back to the room where the prince is. (Undo H,J,U,N.)
- Shift+F12: Save a screenshot of the whole level to the screenshots folder, thus creating
