An open-source port of Prince of Persia, based on the disassembly of the DOS version, extended with new features.
Author:
forum.princed.org
)Contributors:
USE_MIXER
is undefined)Usernames on the list above refer to either GitHub users or users from forum.princed.org
.
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.
Here: https://forum.princed.org/viewtopic.php?f=68&t=3423
pop1_ida.zip
(but with features added from later versions).Sources which helped in making the disassembly:
prince.exe
(hex editing) topic in the PoPUW forum.
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.
prince.exe
file.sdlpop
package.prince
or from the menu of your desktop environment../prince
.megahit
-- Enable cheats.0
to 15
-- Start the given level. (Works only together with megahit
or record
.)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.)replay
or a *.P1R
filename -- 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 in Map_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 as megahit 0 playdemo
or record 0 playdemo
.SDLPOP_SAVE_PATH
-- If set, all save (SAV) and hall-of-fame (HOF) files will be created in the directory it points to.
Sword fight:
You can also use the numeric keypad.
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)
The following don't exist in the original game:
Replays don't exist in the original game.
The following don't exist in the original game:
These don't exist in the original game.
Intended use of Shift+F9:
Since version 1.13, the game supports loading music from the data/music folder.
Until 1.15, music was not included in releases because it is very big, and it does not change between SDLPoP versions. You need to get the music from here: (38 MB) https://www.popot.org/get_the_games/various/PoP1_DOS_music.zip It's the last link here: https://www.popot.org/get_the_games.php?game=1 Copy the OGG files to the data/music folder.
Since version 1.15, music is included.
Since version 1.18, SDLPoP can play music from the MIDISND*.DAT files and OGG files are not included.
You can still copy OGG files to data/music
or mods/<modname>/music
to override music for the original game or a mod, respectively.
To use the music in data/music
for all mods as well, enable the always_use_original_music
option in SDLPoP.ini
.
The possible file names can be found in data/music/names.txt
.
The file name has to be the part after the equals sign, followed by .ogg
.
You can find an example alternate music set in the ZIP mentioned above, in the ogg_MT-32
folder.
Since version 1.02, the game supports LEVELS.DAT
, and since version 1.03, the game can use all .DAT files.
You can either copy the modified .DAT files to the folder of the game, or the game to the mod's folder.
Since version 1.17, the game can also load from mod folders that have been placed in the "mods/" directory. If you use this method, only the files different from the original V1.0 data are required in the mod's folder.
To choose which mod to play from the mods/
folder, do one of the following:
prince mod "Mod Name"
Hall-of-Fame and saved game files will also be placed in the mod's folder.
Another way to play a mod is to start the game while the current directory is the mod's directory. You can do this from the command line, or with batch files / shell scripts. This is useful if you want to compare the behavior of this port and the original DOS version (to find bugs). Especially if you're editing the level and don't want to copy LEVELS.DAT from one place to the other.
Since version 1.19, SDLPoP can recognize most changes made with CusPoP in a DOS mod's PRINCE.EXE. Since version 1.16, you can configure some options in SDLPoP.ini: starting time, level types, etc. In addition, since version 1.17, mods in the "mods/" folder can use a custom configuration file "mod.ini". Options in this file can override (most of) the gameplay-related options in SDLPoP.ini.
Beware, some mods (especially the harder ones) might rely on bugs that are fixed in SDLPoP.
Furthermore, SDLPoP opens up new possibilities for mod making. For example:
See doc/tiles.md for documentation on tiles added by SDLPoP.
Since version 1.16, SDLPoP supports fake tiles, for example walls that the prince can go through. The Apoplexy level editor supports these additional tiles since v3.0.
Since version 1.19, SDLPoP supports colored torches. (Supported in Apoplexy since v3.5.)
Since version 1.23, SDLPoP supports teleports. (Supported in Apoplexy since v3.16.)
Replays don't exist in the original game.
Starting from version 1.16, you can capture or view replays in SDLPoP. To start recording, press Ctrl+Tab on the title screen or while in game. To stop recording, press Ctrl+Tab again. Your replays get saved in the "replays/" directory as files with a .P1R extension. You can change the location where replays are kept using the setting 'replays_folder' in SDLPoP.ini.
If you want to start recording on a specific level, you can use the command prince record <lvl_number>
,
where
To view a replay, you can press Tab while on the title screen. To cycle to the next replay (in reverse creation order), press Tab again. You can also double-click on a replay file (and tell the OS that the file needs to be opened with the SDLPoP executable). SDLPoP will then immediately play that replay. Dragging and dropping onto the executable also works.
While viewing a replay, you can press F to skip forward to the next room, or Shift+F to skip to the next level.
Your settings specified in SDLPoP.ini (including whether you are playing with bugfixes on or off) are remembered in the replay. It shouldn't matter how SDLPoP.ini is set up when you are viewing the replay later. Note that any cheats you use do not get saved as part of the replay.
To print out information about the replay from the command-line, you can use the 'validate' command-line parameter.
Example usage: prince validate "replays/replay.p1r"
Since version 1.21 you can re-record if you make a mistake: While recording, make a quicksave to mark your place, and press quickload to return to that place.
SDL2
and SDL2_image
libraries installed.You need the MinGW Development Libraries of SDL2:
*-mingw.tar.gz
files.To install these, just extract the contents of the i686-w64-mingw32
folder from each archive to:
c:\Program Files (x86)\Dev-Cpp\MinGW64\
c:\Program Files\Dev-Cpp\MinGW64\
You need to "merge" the contents of the bin
, include
, etc. folders in the archives into the existing folders with the same name in the MinGW64
folder.
To compile, open one of the .dev files and click the compile icon.
build.bat
in the src/
directory.call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
This step sets up various environment variables, to enable running the compiler from the command line.
set "SDL2=C:\libraries\SDL2-2.0.8"
You can get the SDL2 library files from here:
*-VC.zip
files.SDL2
environmental variable for the compiler.
Add SDL2
and SDL2_image
dll folder to PATH
for built executable to find them.pacman -S sdl2_image
apt-get install libsdl2-image-dev
I recommend this if your distro does not have the newest SDL version, because sound may be garbled in SDL versions older than 2.0.4 if the sound output is not 8-bit.
Download the SDL2 and SDL2 image sources:
Build and install these libraries according to their documentation.
Then build the game:
make all
Create a desktop/menu icon with:
sudo make install
Remove it with:
sudo make uninstall
brew install sdl2 sdl2_image pkg-config
Install "port" from https://www.macports.org/, then:
sudo port install libsdl2 libsdl2_image pkgconfig
xcode-select --install
at the prompt.make
Tested on OSX 10.9.5, OSX 10.11.2, macOS 10.13 and 10.14.
./prince
or ./prince full
.