SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: David's open-source port of PoP (pre-release)

Post by David »

It is written in C. (Plus it uses the SDL library.)
But since C and C++ are so similar, it might also compile as C++.
Are you asking this only out of curiosity, or do you want to recompile it?
salvadorc17
Calif
Calif
Posts: 553
Joined: August 27th, 2011, 2:04 am

Re: David's open-source port of PoP (pre-release)

Post by salvadorc17 »

Just curiosity, this port will use levels.dat and will be compatible with apoplexy???
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: David's open-source port of PoP (pre-release)

Post by David »

The next version will support levels.dat. (I added it to my version right now.)
The game will look for it in the folder of the exe (that is, not the "data" folder) for compatibility with Apoplexy.

I tried to play some mods, and I already found a bug:
On level 4 of Micro Palace, after the kid enters the exit door, the chomper bites him.
User avatar
musa
Vizier
Vizier
Posts: 112
Joined: March 27th, 2011, 2:06 pm
Location: Nairobi, Kenya

Re: David's open-source port of PoP (pre-release)

Post by musa »

Will it be compatible with the rest of the .DAT files?
-- Michael, the boy who makes Shaw's Nightmare.
Visit here to download Shaw's Nightmare: http://shawsnightmare.ucoz.com
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: David's open-source port of PoP (pre-release)

Post by David »

musa wrote:Will it be compatible with the rest of the .DAT files?
I might do that later.

Here is the new version.
Changes:
FIXED: Keys did not repeat themselves.
FIXED: Starting a new game after winning a previous one makes all texts in the game blue instead of white.
FIXED: When the screen is flashing, there may be black rectangles around the moving objects.
FIXED: Can't do level 7 trick.
DONE: Support LEVELS.DAT
FIXED: Can't interrupt fading of title screen.
FIXED: (Micro Palace, level 12) If kid is on the very left (in bottom row), then shadow is in wrong direction (looking left), and is constantly turning around.
Attachments
PORT_PoP_v1.02.zip
(888.91 KiB) Downloaded 115 times
salvadorc17
Calif
Calif
Posts: 553
Joined: August 27th, 2011, 2:04 am

Re: David's open-source port of PoP (pre-release)

Post by salvadorc17 »

Can you allow this port to use custom tileset graphics???
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: David's open-source port of PoP (pre-release)

Post by Norbert »

This is just a detail, but the sword fighting is a little bit different than what I'm used to.
Normally, when I move forward until I get attacked, I can start with a parry, then Shift, parry, Shift, and so on, and always win.
I tested this fairly thoroughly with the fat guard in level 6, and there's definitely a noticeable difference.
Again, just a detail, and not yet confirmed by others, just something I think I noticed.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: David's open-source port of PoP (pre-release)

Post by David »

You seem to be right. I already noticed this, and now I tried it with the fat guard and Jaffar.

I already have a newer version -- the biggest change is that it supports all DAT files (except those with the sounds, of course).
I don't know if I should release it before of after I fix this bug.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: David's open-source port of PoP (pre-release)

Post by David »

Here is the new version.
Changes:
FIXED: (Micro Palace, level 4) After kid enters exit door, chomper bites kid.
FIXED: shadow is partially green when he is looking to the right
FIXED: (Prince of Wateria, level 5 room 3) Empty potion has red bubbles.
DONE: Use .DAT files. (Of course the PNG files are still supported; I don't want to remove that feature.)
To use dat files, they must be in the current directory.
Now you can play mods! (And discover bugs that appear only in mods. :) )
Note that this port does not recognize if the PRINCE.EXE of the mod was changed.

About the swordfight bug: I found three mistakes in parry(), but the bug remained even after I fixed them. (They are fixed in this version.)
Attachments
PORT_PoP_v1.03.zip
(894.33 KiB) Downloaded 106 times
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: David's open-source port of PoP (pre-release)

Post by Norbert »

Nice work on fixing so many bugs over the last few releases.
I'll be checking out some mods using your conversion.
David wrote:Note that this port does not recognize if the PRINCE.EXE of the mod was changed.
Right. So, at some point, we may need to move forward with this idea, but (obviously) put it in a separate XML file (and not in one or all of the XML level files).
CusPop should have an XML export option. :lol:
Eugene
Efendi
Efendi
Posts: 14
Joined: August 7th, 2014, 2:17 pm

Re: David's open-source port of PoP (pre-release)

Post by Eugene »

Hello. David.

Strange bug...
About version 1.03 (and version 1.02 too)
My system is Windows 7 64 bit.

Strange bug...
Don't work combination keys "shift+left/right: careful step".
If use left/right key on separate cursor block - that's all right.
But.... If use left/right key on numpad - "careful step" don't work.

Thanks.

P.S.It correct if "NumLock" key is not pressed. :-)
P.P.S. Now I compiled prince (v1.03) in Centos 7 64-bit.
Combination keys "shift+left/right: careful step" working correct regardless of the "NumLock" button.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: David's open-source port of PoP (pre-release)

Post by Norbert »

David wrote:To use dat files, they must be in the current directory.
Now you can play mods! (And discover bugs that appear only in mods. :) )
I get "Can't load sprites from resource <n>." errors.
Maybe I'm not doing things right, I tried putting the DAT files in the root and in data/.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: David's open-source port of PoP (pre-release)

Post by David »

Norbert wrote:I get "Can't load sprites from resource <n>." errors.
Maybe I'm not doing things right, I tried putting the DAT files in the root and in data/.
You need to put them into the directory of the executable.
And make sure you don't delete data/font.
And that the file names are all-uppercase.
Eugene wrote:If use left/right key on numpad - "careful step" don't work.
I seems that if I hold the shift and press any numpad key, SDL sends a "shift released" message.

I couldn't find this in their buglist, but found something similar: https://bugzilla.libsdl.org/show_bug.cgi?id=1188
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: David's open-source port of PoP (pre-release)

Post by Norbert »

David wrote:You need to put them into the directory of the executable.
And make sure you don't delete data/font.
And that the file names are all-uppercase.
norbert@stimpy ~/Desktop $ ls
0000127.zip PORT_PoP_v1.03.zip
norbert@stimpy ~/Desktop $ unzip -q PORT_PoP_v1.03.zip
norbert@stimpy ~/Desktop $ unzip -q 0000127.zip
norbert@stimpy ~/Desktop $ cp -i 0000127/* PORT_PoP
norbert@stimpy ~/Desktop $ cd PORT_PoP/
norbert@stimpy ~/Desktop/PORT_PoP $ make -s 2>/dev/null
norbert@stimpy ~/Desktop/PORT_PoP $ ./prince
Segmentation fault
norbert@stimpy ~/Desktop/PORT_PoP $ ./prince
Can't load sprites from resource 700.
norbert@stimpy ~/Desktop/PORT_PoP $ ./prince
Can't load sprites from resource 700.
norbert@stimpy ~/Desktop/PORT_PoP $ ./prince
Segmentation fault
norbert@stimpy ~/Desktop/PORT_PoP $
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: David's open-source port of PoP (pre-release)

Post by David »

Hm, that's weird. Resource 700 is the sword.
I'll look into that.

EDIT: It works for me under Linux.
But... Are you using 64-bit? (The apoplexy Linux binary is 64-bit, that's why I think that.)
Perhaps the types used in DAT-related structures (short, long) have different size under 64-bit?
Post Reply