Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | pmbaty | 1 | Name of program: SDLPoP |
| 2 | (Earlier name: David's open-source port of PoP) |
||
| 3 | |||
| 4 | Author: David from forum.princed.org (NagyD on GitHub) |
||
| 5 | Contributors: |
||
| 6 | (Usernames refer to forum.princed.org or GitHub.) |
||
| 7 | * Andrew (bug reports) |
||
| 8 | * htamas (dungeon wall drawing algorithm, bug reports) |
||
| 9 | * Norbert (EndeavourAccuracy on GitHub) (bug reports, suggestions, improved gamepad support) |
||
| 10 | * musa (bug reports) |
||
| 11 | * Eugene (bug reports) |
||
| 12 | * StaticReturn (Mac OS X: Makefile (for older SDL1 version), bug reports) |
||
| 13 | * Poirot (ecalot on GitHub) (Mac OS X: Now compatible with Falcury SDL2 port) |
||
| 14 | * kees (bugfixes) |
||
| 15 | * Falcury |
||
| 16 | * porting to SDL2 |
||
| 17 | * quicksave improvements |
||
| 18 | * replay files |
||
| 19 | * SDLPoP.ini: added basic support and constantly adding new options |
||
| 20 | * mod folders |
||
| 21 | * fake tiles |
||
| 22 | * readable sequence table |
||
| 23 | * CMake support |
||
| 24 | * and various other bugfixes, improvements, additions |
||
| 25 | * segra (segrax on GitHub) (Joystick support, resizable window) |
||
| 26 | * DarkPrince (bug reports) |
||
| 27 | * Andrey Vasilkin / digi@os2.snc.ru (eComStation (OS/2) support) |
||
| 28 | * mfn (fixed a small bug when USE_MIXER is undefined) |
||
| 29 | * diddledan (Visual C++ (NMake) support) |
||
| 30 | * zaps166 (small Makefile fixes) |
||
| 31 | * usineur (faster music loading) |
||
| 32 | * yaqxsw (icon) |
||
| 33 | |||
| 34 | Forum board: http://forum.princed.org/viewforum.php?f=126 |
||
| 35 | GitHub: https://github.com/NagyD/SDLPoP |
||
| 36 | |||
| 37 | GENERAL |
||
| 38 | ======= |
||
| 39 | |||
| 40 | Q: What is this? |
||
| 41 | A: This is an open-source port/conversion of the DOS game Prince of Persia. |
||
| 42 | It is based on the disassembly of the original PoP1 for DOS. |
||
| 43 | |||
| 44 | Q: Where can I download that disassembly? |
||
| 45 | A: Here: http://forum.princed.org/viewtopic.php?f=68&t=3423 |
||
| 46 | Scroll down to the newest zip files. |
||
| 47 | The exact version is PoP 1.0, i.e. pop1_ida.zip . |
||
| 48 | (But I also added some features from later versions.) |
||
| 49 | |||
| 50 | Sources that helped in making the disassembly: |
||
| 51 | * Modifications to prince.exe (hex editing) topic in the PoPUW forum. |
||
| 52 | - That forum is down, you can find some saved posts here: http://forum.princed.org/viewtopic.php?f=73&t=661 |
||
| 53 | - HTamas posted the dungeon wall drawing algorithm in C-style pseudocode here, along with many hex-edit hacks. |
||
| 54 | - It was his work that prompted me to start the disassembly and later SDLPoP. Thank you! |
||
| 55 | * PoP1 Technical Information by Mechner: https://www.popot.org/documentation.php?doc=OldDocuments |
||
| 56 | * PoP1 Apple II source code by Mechner: https://github.com/jmechner/Prince-of-Persia-Apple-II |
||
| 57 | |||
| 58 | LICENSE |
||
| 59 | ======= |
||
| 60 | |||
| 61 | This program is open source under the GNU General Public License terms, see gpl-3.0.txt and src/GPLv3.h. |
||
| 62 | |||
| 63 | USAGE |
||
| 64 | ===== |
||
| 65 | |||
| 66 | Q: How do I run it? |
||
| 67 | A: |
||
| 68 | Windows: |
||
| 69 | Double-click on the prince.exe file. |
||
| 70 | If you want to pass command line parameters, you need to open a command line. |
||
| 71 | |||
| 72 | GNU/Linux: |
||
| 73 | First you have to compile the game. (See the DEVELOPING section.) |
||
| 74 | Then you can start the game with the |
||
| 75 | ./prince |
||
| 76 | command. |
||
| 77 | (Or just double-click it in a file-manager.) |
||
| 78 | |||
| 79 | Mac OS X: |
||
| 80 | See the DEVELOPING section. |
||
| 81 | Thanks to StaticReturn and Poirot for this! |
||
| 82 | |||
| 83 | eComStation (OS/2): |
||
| 84 | Unofficial binaries were posted here: http://forum.princed.org/viewtopic.php?p=18431#p18431 |
||
| 85 | Alternate link: http://hobbes.nmsu.edu/h-search.php?key=sdlpop |
||
| 86 | Or you can compile for yourself using gcc, according to that post. |
||
| 87 | Thanks to digi@os2.snc.ru for the bugfixes! |
||
| 88 | |||
| 89 | Q: What command-line options are there? |
||
| 90 | A: |
||
| 91 | * megahit -- Enable cheats. |
||
| 92 | * a number from 0 to 15 -- Start the given level. (if cheats are enabled) |
||
| 93 | * draw -- Draw directly to the screen, skipping the offscreen buffer. |
||
| 94 | * full -- Run in full screen mode. |
||
| 95 | * demo -- Run in demo mode: only the first two levels will be playable, and quotes from magazine reviews will be displayed. |
||
| 96 | * record -- Start recording immediately. (See the Replays section.) |
||
| 97 | * replay or a *.P1R filename -- Start replaying immediately. (See the Replays section.) |
||
| 98 | * validate "replays/replay.p1r" -- Print out information about a replay file and quit. (See the Replays section.) |
||
| 99 | * mod "Mod Name" -- Run with custom data files from the folder "mods/Mod Name/" |
||
| 100 | * debug -- Enable debug cheats. |
||
| 101 | * --version, -v -- Display SDLPoP version and quit. |
||
| 102 | * --help, -h, -? -- Display help and quit. (Currently it only points to this Readme...) |
||
| 103 | * seed=number -- Set initial random seed, for testing. |
||
| 104 | * --screenshot -- Must be used with megahit and a level number. When the level starts, a screenshot is saved to screenshot.png and the game quits. |
||
| 105 | * --screenshot-level -- Similar to the above, except the whole level is screenshotted, thus creating a level map. |
||
| 106 | * --screenshot-level-extras -- Similar to the above, except lots of additional info is displayed on the picture. |
||
| 107 | You can find the meaning of each symbol in Map_Symbols.txt. |
||
| 108 | |||
| 109 | Q: What keys can I use? |
||
| 110 | A: |
||
| 111 | Controlling the kid: |
||
| 112 | * left: turn or run left |
||
| 113 | * right: turn or run right |
||
| 114 | * up: jump or climb up |
||
| 115 | * down: crouch or climb down |
||
| 116 | * shift: pick up things |
||
| 117 | * shift+left/right: careful step |
||
| 118 | * home or up+left: jump left |
||
| 119 | * page up or up+right: jump right |
||
| 120 | You can also use the numeric keypad. |
||
| 121 | |||
| 122 | Gamepad equivalents: |
||
| 123 | * D-Pad: arrows |
||
| 124 | * Joystick: left/right (for all-directional joystick movement, set joystick_only_horizontal to false in SDLPoP.ini) |
||
| 125 | * A: down |
||
| 126 | * Y: up |
||
| 127 | * X or triggers: shift |
||
| 128 | * Start: quit |
||
| 129 | * Back: restart level (Ctrl+A) |
||
| 130 | |||
| 131 | Controlling the game: |
||
| 132 | * Esc: pause game |
||
| 133 | * Space: show time left |
||
| 134 | * Ctrl-A: restart level |
||
| 135 | * Ctrl-G: save game (on levels 3..13) |
||
| 136 | * Ctrl-J: joystick/gamepad mode |
||
| 137 | * Ctrl-K: keyboard mode |
||
| 138 | The initial mode is joystick/gamepad if such a device is detected, otherwise keyboard mode. |
||
| 139 | The game will automatically change input mode when there is input from either device. |
||
| 140 | * Ctrl-R: return to intro |
||
| 141 | * Ctrl-S: sound on/off |
||
| 142 | * Ctrl-V: show version |
||
| 143 | * Ctrl-Q: quit game |
||
| 144 | * Ctrl-L: load game (when in the intro) |
||
| 145 | * Alt-Enter: toggle fullscreen |
||
| 146 | * F6: quicksave |
||
| 147 | * F9: quickload |
||
| 148 | * F12: Save a screenshot to screenshot.png. |
||
| 149 | |||
| 150 | Viewing or recording replays: |
||
| 151 | * Ctrl+Tab (in game, or on title screen): start or stop recording |
||
| 152 | * Tab (on title screen): view/cycle through the saved replays in the SDLPoP directory |
||
| 153 | * F (while viewing a replay): skip forward to the next room |
||
| 154 | * Shift-F (while viewing a replay): skip forward to the next level |
||
| 155 | |||
| 156 | Cheats: |
||
| 157 | * Shift-L: go to next level |
||
| 158 | * c: show numbers of current and adjacent rooms |
||
| 159 | * Shift-C: show numbers of diagonally adjacent rooms |
||
| 160 | * -: less remaining time |
||
| 161 | * +: more remaining time |
||
| 162 | * r: resurrect kid |
||
| 163 | * k: kill guard |
||
| 164 | * Shift-I: flip screen upside-down |
||
| 165 | * Shift-W: slow falling |
||
| 166 | * h: look at room to the left |
||
| 167 | * j: look at room to the right |
||
| 168 | * u: look at room above |
||
| 169 | * n: look at room below |
||
| 170 | * Shift-B: toggle hiding of non-animated objects |
||
| 171 | * Shift-S: Restore lost hit-point. (Like a small red potion.) |
||
| 172 | * Shift-T: Give more hit-points. (Like a big red potion.) |
||
| 173 | * Shift+F12: Save a screenshot of the whole level to screenshot.png, thus creating a level map. |
||
| 174 | * Ctrl+Shift+F12: Save a screenshot of the whole level with extras to screenshot.png. |
||
| 175 | You can find the meaning of each symbol in Map_Symbols.txt. |
||
| 176 | |||
| 177 | Debug cheats: |
||
| 178 | * [: shift kid 1 pixel to the left |
||
| 179 | * ]: shift kid 1 pixel to the right |
||
| 180 | * t: toggle timer |
||
| 181 | |||
| 182 | Q: Where is the music? |
||
| 183 | A: |
||
| 184 | Since version 1.13, the game supports loading music from the data/music folder. |
||
| 185 | Until 1.15, music was not included in releases because it is very big, and it does not change between SDLPoP versions. |
||
| 186 | You need to get the music from here: (38 MB) |
||
| 187 | https://www.popot.org/get_the_games/various/PoP1_DOS_music.zip |
||
| 188 | It's the last link here: https://www.popot.org/get_the_games.php?game=1 |
||
| 189 | Copy the OGG files to the data/music folder. |
||
| 190 | |||
| 191 | Since version 1.15, music is included. |
||
| 192 | |||
| 193 | MODS |
||
| 194 | ==== |
||
| 195 | |||
| 196 | Q: Can I play mods? |
||
| 197 | A: |
||
| 198 | Since version 1.02, the game supports LEVELS.DAT, and since version 1.03, the game can use all .DAT files. |
||
| 199 | You can either copy the modified .DAT files to the folder of the game, or the game to the mod's folder. |
||
| 200 | |||
| 201 | Since version 1.17, the game can also load from mod folders that have been placed in the "mods/" directory. |
||
| 202 | If you use this method, only the files different from the original V1.0 data are required in the mod's folder. |
||
| 203 | To choose which mod from the "mods/" folder to play, do one of the following: |
||
| 204 | * Open SDLPoP.ini and change the 'levelset' option to the name of the mod's folder. |
||
| 205 | * Use the command line option "mod", like so: prince.exe mod "Mod Name" |
||
| 206 | Hall-of-Fame and saved game files will also be placed in the mod's folder. |
||
| 207 | |||
| 208 | Another way to play a mod is to start the game while the current directory is the mod's directory. |
||
| 209 | You can do this from the command line, or with batch files / shell scripts. |
||
| 210 | This is useful if you want to compare the behavior of this port and the original DOS version (to find bugs). |
||
| 211 | Especially if you're editing the level and don't want to copy LEVELS.DAT from one place to the other. |
||
| 212 | /!\ Note that as of 1.03, the data/font folder and its contents must exist in the current directory! |
||
| 213 | Since 1.11, the data/font folder is no longer required. |
||
| 214 | |||
| 215 | Note that this port does not recognize if the PRINCE.EXE of the mod was changed. |
||
| 216 | Since version 1.16, you can configure some options in SDLPoP.ini: starting time, level types, etc. |
||
| 217 | In addition, since version 1.17, mods in the "mods/" folder can use a custom configuration file "mod.ini". |
||
| 218 | Options in this file can override (most of) the gameplay-related options in SDLPoP.ini. |
||
| 219 | |||
| 220 | Beware, some mods (especially the harder ones) might rely on bugs that are fixed in SDLPoP. |
||
| 221 | Since version 1.16, SDLPoP can ask you whether gameplay quirks should be fixed or not. |
||
| 222 | You can set your choice permanently in the file 'SDLPoP.ini': |
||
| 223 | - Set the option 'use_fixes_and_enhancements' to 'false' to get the exact behavior of the original game. |
||
| 224 | - Alternatively, set the option 'use_fixes_and_enhancements' to 'true'. You can then also enable or disable |
||
| 225 | individual fixes and enhancements, depending on your preference. |
||
| 226 | |||
| 227 | Furthermore, SDLPoP opens up new possibilities for mod making. |
||
| 228 | For example: |
||
| 229 | Falcury released a mod, called "Secrets of the Citadel" that "has been designed to be played using a modified version of SDLPoP". |
||
| 230 | Description and download: http://forum.princed.org/viewtopic.php?f=73&t=3664 |
||
| 231 | Alternate link: https://www.popot.org/custom_levels.php?mod=0000153 |
||
| 232 | |||
| 233 | Since version 1.16, there is support for fake tiles, for example walls that the prince can go through. |
||
| 234 | The Apoplexy level editor supports these additional tiles since v3.0: https://www.popot.org/level_editors.php?editor=apoplexy |
||
| 235 | (Just don't overuse them, please!) |
||
| 236 | |||
| 237 | REPLAYS |
||
| 238 | ======= |
||
| 239 | |||
| 240 | Q: How do replays work? |
||
| 241 | A: |
||
| 242 | Starting from version 1.16, you can capture or view replays in SDLPoP. |
||
| 243 | To start recording, press Ctrl+Tab on the title screen or while in game. To stop recording, press Ctrl+Tab again. |
||
| 244 | Your replays get saved in the "replays/" directory as files with a .P1R extension. |
||
| 245 | You can change the location where replays are kept using the setting 'replays_folder' in SDLPoP.ini. |
||
| 246 | |||
| 247 | If you want to start recording on a specific level, you can use the command "prince.exe record <lvl_number>", |
||
| 248 | where <lvl_number> is the level on which you want to start. |
||
| 249 | |||
| 250 | To view a replay, you can press Tab while on the title screen. |
||
| 251 | To cycle to the next replay (in reverse creation order), press Tab again. |
||
| 252 | You can also double-click on a replay file (and tell the OS that the file needs to be opened with the SDLPoP executable). |
||
| 253 | SDLPoP will then immediately play that replay. Dragging and dropping onto the executable also works. |
||
| 254 | While viewing a replay, you can press F to skip forward to the next room, or Shift+F to skip to the next level. |
||
| 255 | |||
| 256 | Your settings specified in SDLPoP.ini (including whether you are playing with bugfixes on or off) are remembered in the replay. |
||
| 257 | It shouldn't matter how SDLPoP.ini is set up when you are viewing the replay later. |
||
| 258 | Note that any cheats you use do not get saved as part of the replay. |
||
| 259 | |||
| 260 | To print out information about the replay from the command-line, you can use the 'validate' command-line parameter. |
||
| 261 | Example usage: prince validate "replays/replay.p1r" |
||
| 262 | |||
| 263 | DEVELOPING |
||
| 264 | ========== |
||
| 265 | |||
| 266 | Q: How do I (re)compile it? |
||
| 267 | A: |
||
| 268 | Prerequisites for all platforms: |
||
| 269 | Make sure that you have the development versions of the "SDL2", "SDL2_image" and "SDL2_mixer" (since SDLPoP 1.13) libraries installed. |
||
| 270 | |||
| 271 | Windows: |
||
| 272 | If you are using Dev-C++: |
||
| 273 | I originally used Dev-C++ version 4.9.9.2 from here: https://sourceforge.net/projects/dev-cpp/files/Binaries/ |
||
| 274 | More recently, I'm using this version: https://sourceforge.net/projects/orwelldevcpp/ |
||
| 275 | For Dev-C++ you need the MinGW Development Libraries of SDL2: |
||
| 276 | https://libsdl.org/download-2.0.php |
||
| 277 | https://libsdl.org/projects/SDL_image/ |
||
| 278 | https://libsdl.org/projects/SDL_mixer/ |
||
| 279 | To install these, just extract the contents of the i686-w64-mingw32 folder from each archive to the Dev-Cpp folder. |
||
| 280 | To compile, open one of the .dev files and click the compile icon. |
||
| 281 | |||
| 282 | Building with Visual Studio: |
||
| 283 | Run build.bat in the src/ directory. |
||
| 284 | For this to work, you first need to do two other things: |
||
| 285 | a) Run vsvarsall.bat from the command line, with either 'x86' or 'x64' as a parameter. |
||
| 286 | This batch file is included with all installations of MS Visual Studio, but its exact location may vary. |
||
| 287 | For VS2017, the command you should run might look like this: |
||
| 288 | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 |
||
| 289 | This step sets up various environment variables, to enable running the compiler from the command line. |
||
| 290 | b) Set up the environment variable 'SDL2' to point to the SDL2 development library files. |
||
| 291 | To do this, you can use a command like so: |
||
| 292 | set "SDL2=C:\libraries\SDL2-2.0.5" |
||
| 293 | You can get the SDL2 library files from here: (download the Visual C++ 32/64-bit development package) |
||
| 294 | https://www.libsdl.org/download-2.0.php |
||
| 295 | (You could create a small batch file to automate the above steps on your system.) |
||
| 296 | Alternatively, you can also build SDLPoP using MSVC with NMake (use the makefile src/NMakefile). |
||
| 297 | |||
| 298 | You can also use CMake, in conjunction with the MinGW-w64 toolchain. |
||
| 299 | You could either invoke CMake from the command line yourself, or use an IDE that uses CMake internally. |
||
| 300 | As an example, CLion uses CMake as its project model. |
||
| 301 | If you are using CLion as your IDE, you can simply load the src/ directory as a project. |
||
| 302 | |||
| 303 | GNU/Linux: |
||
| 304 | You can install the libraries with apt-get or a package manager. |
||
| 305 | sudo apt-get install libsdl2-image-dev libsdl2-mixer-dev |
||
| 306 | |||
| 307 | Alternatively, you can compile SDL2 and the other libraries from source. |
||
| 308 | https://libsdl.org/download-2.0.php |
||
| 309 | https://libsdl.org/projects/SDL_image/ |
||
| 310 | https://libsdl.org/projects/SDL_mixer/ |
||
| 311 | I recommend this if your distro does not have the newest SDL version, because older SDL versions have some known bugs. |
||
| 312 | Namely, sound becomes garbled in SDL versions older than 2.0.4 if the sound output is not 8-bit. |
||
| 313 | |||
| 314 | When you have the libraries, just type the command: |
||
| 315 | make all |
||
| 316 | and the game should compile. |
||
| 317 | |||
| 318 | You can create a desktop/menu icon with: |
||
| 319 | sudo make install |
||
| 320 | and remove it with: |
||
| 321 | sudo make uninstall |
||
| 322 | |||
| 323 | macOS: |
||
| 324 | Get SDL2 and dependencies |
||
| 325 | a) Install "port" from https://www.macports.org/ |
||
| 326 | b) sudo port install libsdl2 libsdl2_image libsdl2_mixer |
||
| 327 | or |
||
| 328 | a) Install "homebrew" |
||
| 329 | b) brew install sdl2 sdl2_image |
||
| 330 | c) brew install sdl2_mixer --with-libvorbis |
||
| 331 | |||
| 332 | Get development tools: |
||
| 333 | a) Install Xcode. |
||
| 334 | b) Install the "command line developer tools" by typing 'xcode-select --install' at the prompt. |
||
| 335 | c) Using terminal, in the '/src' directory of SDLPoP, type: make |
||
| 336 | |||
| 337 | PLAY! |
||
| 338 | a) Type './prince' or './prince full'. |
||
| 339 | b) Hit Control-Q to quit. |
||
| 340 | |||
| 341 | Tested on OSX 10.9.5, OSX 10.11.2 and macOS 10.13. |