SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
Post Reply
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!

My comment relates to the windows version and version of Linux.
Go to the third level,
wherein the active skeleton, and try pressing the cheat key "K"
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5786
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

Eugene wrote:wherein the active skeleton, and try pressing the cheat key "K"
Using k with skeletons gives a "Segmentation fault" under Linux, but doing so under DOS(Box) also hangs the game, so it was never meant to work properly, I think.
(I didn't take the time to test the Apple ][ version.)
StaticReturn
Efendi
Efendi
Posts: 13
Joined: September 2nd, 2014, 4:14 am

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

Post by StaticReturn »

This is amazing! Thank you for all the hard work!! (Though I am not in a position to thank you.)

I'm curious about how you did this. The programs you used, the techniques you used, some of the problems you ran into. If it's not too much trouble, please post a technical summary about how you did this. Myself (and I'm sure others) would love to get some insight about how this was accomplished! :)

Thank you,
- SR
Last edited by StaticReturn on September 2nd, 2014, 9:54 am, edited 1 time in total.
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Norbert wrote: Using k with skeletons gives a "Segmentation fault" under Linux
Same under Windows.
I might look at what is crashing the game.
Norbert wrote: (I didn't take the time to test the Apple ][ version.)
Do you know about the Apple II cheats?
There are some, but they have to be enabled in the source.
For recompiling you can use this: viewtopic.php?p=13053#p13053
In "01 POP Source/Source/SPECIALK.S" make sure it says FinalDisk = 0 and DebugKeys = 1, and delete/rename "Other/SPECIALK.PATCH".

I tried to kill the skeleton (ZAP), and it when it died, it looked like a guard. No crashing here.
(POP to enable cheats, SKIP to skip a level. I will post the list of Apple II cheats later.)
StaticReturn wrote: The programs you used, the techniques you used, some of the problems you ran into.
I used IDA (Interactive DisAssembler) to disassemble PRINCE.EXE (after unpacking it).
(The disassembly is here: viewtopic.php?f=68&t=3423)
IDA allows users to decide about many things, like giving names, adding comments, deciding if a number is actually an address(offset), or telling if a part of the EXE is code or data (and what type of data).
These make the disassembly more readable.

I converted the disassembly to C manually.
There were parts that I had to alter, for example where the hardware is accessed directly in the original.

As for the problems, look into bugs.txt.
StaticReturn wrote: If it's not too much trouble, please post a technical summary about how you did this.
Maybe.
The hardest parts about writing such a thing is: What should I include and what not? What should I assume about readers?
StaticReturn
Efendi
Efendi
Posts: 13
Joined: September 2nd, 2014, 4:14 am

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

Post by StaticReturn »

Wow, thank you for such a quick response! :)
David wrote:The hardest parts about writing such a thing is: What should I include and what not? What should I assume about readers?
Yeah, I can see how that can be a problem. Anyhow, thank you for your hard work!
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

I looked at the skeleton problem. (That pressing "K" on a skeleton crashes the game.)
The game crashes in add_midtable() (seg008.c).
A possible fix is to add this before the NULL check:

Code: Select all

	if (id > chtab_addrs[chtab_id]->n_images) {
		printf("add_midtable: Tried to use image %d of chtab %d, not in 1..%d\n", id, chtab_id, chtab_addrs[chtab_id]->n_images);
		return 0;
	}
There is another strange thing about the skeleton: If it falls two rows, after some seconds it will appear as the kid! It looks better in the original game.
I remember this was used in some mod, but I don't know which.
UPDATE: This topic about Jaffar's Revenge mentions this: http://www.popot.org/popuw_forum_archive/148a.html
But I can't find that room in the mod: http://www.popot.org/custom_levels.php?mod=0000008
EDIT: Perhaps the second half of my post belongs elsewhere?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5786
Joined: April 9th, 2009, 10:58 pm

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

Post by Norbert »

Norbert wrote:Readme.txt says "Name of program: David's open-source port of PoP".

Maybe it can also have an abbreviated name, similar to how Prince of Persia 1 is referred to as PoP1. "David's Open-Source" is DOS, as the operating system, which might be usable. "Port of PoP" is a recursive acronym, which might also be usable. The most obvious abbreviated name would be DOSPoP.

Maybe throw in another letter so it's clear it's not just PoP for DOS, like DOSNPoP (where N is Native, as in, a native port, if that's indeed what it is; I think so). Googling DOSNPoP gives 1 hit, so it would be very easy to find mentions of the conversion in the future. Makes me think of the Pinball Fantasies table Stones 'n Bones.

Or maybe PoPPED (or popped or Popped), short and snappy. Prince of Persia Port E... David/DOS, maybe "port emulation", but there must be something better, like a synonym for "by" (by David). Or maybe Poppy (or PoPPY), like the flowering plant, which also has the extra p for Port, just like Poppa. Others that I believe are free in the PoP context are popsicle (c for Conversion), lollipop and popular, but what to do with them.

Just some ideas. To me "David's open-source port of PoP" feels more like a description than a name. ;)
Anyone have any thoughts on this?
Or maybe something basic like OSPoP1 or OSSPoP1 or DOSSPoP1 or OSPoP or OSSPoP or DOSSPoP?
(OS = Open Source, OSS = Open-Source Software, DOSS = David('s) Open-Source Software)
I think people who know about the PoP abbreviation will just think about DOS PoP (PoP for DOS) when they see DOSPoP, so that one may not be a wise choice.
In theory, I could make the popot.org page get_the_games.php?game=David%27s%20open-source%20port%20of%20PoP but I prefer something more aesthetic.
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Yes, I know that the current "name" is a bit long. :)
But I don't know what/which name to choose.
Andrew
Wise Scribe
Wise Scribe
Posts: 313
Joined: July 16th, 2009, 4:39 pm

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

Post by Andrew »

David wrote:The hardest parts about writing such a thing is: What should I include and what not? What should I assume about readers?
I found mrsid's blog about his PoP C64 port to be fantastic and fascinating. That level of detail is great and those who don't understand all the technical bits can skim them. Of course it might not be possible in this instance, plus IMHO it's of lower priority than the actual porting process itself.
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

If I remember correctly, most (but not all) part of his posts are about squeezing the game into C64's limits.
The other parts are about how the game works internally.
polipo
Vizier
Vizier
Posts: 89
Joined: September 6th, 2012, 8:34 am

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

Post by polipo »

Dear,
when i compile the project under windows, the dev c show me some errors (i think missed include) :

4 PORT_PoP\types.h SDL/SDL.h: No such file or directory.

After installed the SDL package from
http://www.libsdl.org/release/SDL-devel-1.2.15-VC.zip

and inserted the corrert DEV include path the error are

5 types.h SDL/SDL_image.h: No such file or directory.

and into the devc\include\sdl\ SDL_image.h doesn't exist

After installed the SDL Image package from
http://www.libsdl.org/projects/SDL_image/

The error is
PORT_PoP\C winapifamily.h: No such file or directory.
..Dev-Cpp\include\SDL\SDL_platform.h missing binary operator before token "("


Can you help in dev c?

Thanks
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Firstly, I got the libraries from here: http://sourceforge.net/projects/devpaks/files/
You might want to try these if nothing else works.
(See doc/Readme.txt for which libraries and which versions do you need.)
polipo wrote: After installed the SDL Image package from
http://www.libsdl.org/projects/SDL_image/
Exactly which file did you download?
polipo wrote: The error is
PORT_PoP\C winapifamily.h: No such file or directory.
..Dev-Cpp\include\SDL\SDL_platform.h missing binary operator before token "("
Which file wants to include winapifamily.h?

UPDATE:
I found this about winapifamily.h: http://stackoverflow.com/questions/2244 ... codeblocks
But it's about SDL2. Are you trying to use SDL2?
For this game, you need to use SDL 1.2: http://www.libsdl.org/download-1.2.php
And you should use the Mingw version. (Your first link points to the Visual C++ version.)
polipo
Vizier
Vizier
Posts: 89
Joined: September 6th, 2012, 8:34 am

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

Post by polipo »

Dear, i have follow your link for http://sourceforge.net/projects/devpaks/files/ dev c++ package
I have installed:
libjpeg-6b_4-1spec.DevPak
libpng-1.2.7-1spec.DevPak
SDL_image-1.2.4notiff.DevPak
SDL-1.2.8-2spec.DevPak
zlib-1.2.3-1spec.DevPak

Now if i compile i have 1 error :
Compiler: Default compiler
Building Makefile: "C:\_PERSONALE\DOSPROG\PORT_PoP_v1.07\PORT_PoP\Makefile.win"
Executing make...
make.exe -f "C:\_PERSONALE\DOSPROG\PORT_PoP_v1.07\PORT_PoP\Makefile.win" all
gcc.exe main.o seg008.o seg007.o seg009.o seg000.o seg003.o seg006.o data.o seg001.o seg002.o seg004.o seg005.o -o "prince.exe" -L"lib" -l"mingw32" -l"winmm" -l"gdi32" -l"SDLmain" -l"SDL.dll" -l"SDL_Image" -s

gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.

make.exe: *** [prince.exe] Error 1

Execution terminated
Thanks
David
The Prince of Persia
The Prince of Persia
Posts: 2877
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

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

Post by David »

Internal error? That's weird.
Which version of Dev-C++ are you using?
I use Dev-C++ version 4.9.9.2 from here: http://sourceforge.net/projects/dev-cpp/files/Binaries/
But wait...
I also found this about the error: http://stackoverflow.com/questions/1281 ... rnal-error
polipo
Vizier
Vizier
Posts: 89
Joined: September 6th, 2012, 8:34 am

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

Post by polipo »

yes i think is Windows 8 the problem
Post Reply