SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.

Moderator: English Moderator Team

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

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

Post by David » June 17th, 2015, 10:00 pm

Falcury wrote: Now that I look at it, there seems to be a minor difference with flashes in the original game: in SDLPoP, the lower part of the screen does not participate in the flash, but it does when I play the original game using DOSBox.
The original game does flashes by changing a hardware palette register.
SDLPoP does it differently: It fills the onscreen surface with the color of the flash, and then copies the offscreen surface with black changed to transparent (using color key).
The offscreen surface does not contain the bottom status area, so that part is not filled with the color.
Falcury wrote: Fix level doors in the starting room displaying a blue area when they slide open: https://github.com/Falcury/SDLPoP/commi ... 5f77d794fb
If I understood your changes correctly, those level doors will appear without stairs.

Falcury
Wise Scribe
Wise Scribe
Posts: 341
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury » June 17th, 2015, 11:35 pm

David wrote:If I understood your changes correctly, those level doors will appear without stairs.
Yes. This is of course the normal behaviour for level start doors (they display the "top of the stairs" I suppose?), but normally we only see the start door crashing down - I think this is why the game never bothered to add a black background.
Simply using a black rectangle would be better, but there did not seem to be an easy way to day this using add_backtable(); hence the ugliness...

Edit:
I was stupid and only checked whether it worked properly in palace levels... Turns out that I have now caused a graphical glitch with start doors in dungeon levels, because the stairs image (res344.png) in VDUNGEON.DAT is two pixels wider than it needs to be...
A possible fix for this: https://github.com/Falcury/SDLPoP/commi ... 7a927e93d6
Last edited by Falcury on June 20th, 2015, 12:42 pm, edited 1 time in total.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3202
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Post by Norbert » June 20th, 2015, 12:09 am

David, will there still be versioned releases of SDLPoP in the future?
Do you have any plans regarding those?

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3202
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Post by Norbert » June 23rd, 2015, 2:35 am

(Double posting, because David could miss an edit.)
Norbert wrote:David, will there still be versioned releases of SDLPoP in the future?
Do you have any plans regarding those?
By the way, I'm not asking because I prefer not to add new versions to popot.org or anything. ;)
It's just that I noticed the effect that GitHub appears to have on versioning.
SDLPoP basically changed to a rolling release of sorts. Maybe that's a good thing, maybe not, maybe it doesn't matter?
The ChangeLog.txt is also on GitHub, but so far hasn't been touched.

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

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

Post by David » June 23rd, 2015, 9:41 pm

Norbert wrote:SDLPoP basically changed to a rolling release of sorts. Maybe that's a good thing, maybe not, maybe it doesn't matter?
The only downside I can think of is for people who can't compile for themselves. (The zip files had exes, the GitHub repository doesn't.)
Norbert wrote:The ChangeLog.txt is also on GitHub, but so far hasn't been touched.
The changes can be seen here: https://github.com/NagyD/SDLPoP/commits/master

By the way: https://github.com/NagyD/SDLPoP/issues/6

Falcury
Wise Scribe
Wise Scribe
Posts: 341
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury » June 23rd, 2015, 11:57 pm

David wrote:The only downside I can think of is for people who can't compile for themselves. (The zip files had exes, the GitHub repository doesn't.)
I suppose a zipped "stable" binary version can still be released periodically? This way, it will be easier for people to try it out. It may be good anyway to have a somewhat "official" version as a point of reference so it will be easier to deal with issues that people may run into.
Hm, I think my vote would go to something permissive like the MIT license (at least as far as my own contributions are concerned). But it's your decision of course, it's your project :)

Regarding the recent changes I added to my fork:
Would you like me to create new pull requests, or do you prefer to manually merge things so you can more easily cherrypick what you approve of?
I've tried to organise the "experimental" stuff into separate branches (shadow potion, level scripting) so they can be merged or ignored independently from the small patches.
In their current state, both features do not break any existing functionality as far as I know, although they may be a bit unpolished (I still need to make them cooperate with quicksaving nicely).

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3202
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Post by Norbert » June 24th, 2015, 12:44 am

Falcury wrote:
Hm, I think my vote would go to something permissive like the MIT license (at least as far as my own contributions are concerned). But it's your decision of course, it's your project :)
Hm, yeah, I brought up the (lack of a) license in July 2014.
Especially now that there are some contributors in addition to the main author, I wouldn't wait too much longer with picking a license.
Permissive, non-copyleft, makes sense, like a MIT/BSD or the zlib License. Nowadays, SDL itself also uses the zlib License, by the way.
I always thought BSD is a bit confusing, because of the various clause-versions it has.

Falcury
Wise Scribe
Wise Scribe
Posts: 341
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury » June 24th, 2015, 10:57 am

Norbert wrote:The ChangeLog.txt is also on GitHub, but so far hasn't been touched.
OK, I made an update to ChangeLog.txt with a proposed list of changes for the next version and created a new pull request (which also includes some bug fixes and quickloading displaying a black screen briefly).

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

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

Post by David » June 26th, 2015, 10:44 pm

I merged the updates.
Falcury wrote:Simply using a black rectangle would be better, but there did not seem to be an easy way to day this using add_backtable(); hence the ugliness...
1. There is add_wipetable(), but it requires x-coordinates to be multiples of 8. (Leftover from DOS, and there it's a leftover from Apple II.)
This restriction could be lifted. It's used only in draw_tile_wipe() and wall_pattern() (for palace walls).
2. Or you could use set_clip_rect() before add_backtable().

About the license:
When I created the repository, GitHub asked me to select a license.
Is there any way to change that selection for an existing repository, or do I just need to upload the license text manually?

As for the choice:
The GPL, MIT, BSD, zlib licenses were mentioned.
What reasons are there to choose one over the other (in general and for SDLPoP)?

By the way, I noticed that IE8 can't open the GitHub site. Wireshark shows some "Handshake Failure"s with TLSv1 and SSLv3.
(IE itself shows a generic error message listing many possible causes.)
Also, GitHub shows this icon in the top-left corner when I'm logged in. I wonder why...

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3202
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Post by Norbert » June 27th, 2015, 12:08 am

David wrote:Also, GitHub shows this icon in the top-left corner when I'm logged in. I wonder why...
That's most likely because of this combined with this.
David wrote:Is there any way to change that selection for an existing repository, or do I just need to upload the license text manually?
https://help.github.com/articles/open-s ... m-licenses
David wrote:The GPL, MIT, BSD, zlib licenses were mentioned. What reasons are there to choose one over the other (in general and for SDLPoP)?
For GPL, you can read the lead of this. For the others, you can first read the lead of this, and then just read the entire licenses themselves - they are small enough to just read:

- (zlib License) https://en.wikipedia.org/wiki/Zlib_License#Text

- (MIT License) https://en.wikipedia.org/wiki/MIT_License#License_terms

- (the three BSD licenses) https://en.wikipedia.org/wiki/BSD_licenses
Roughly, those three BSD licenses are:
1. the 4-clause BSD License,
2. the 3-clause BSD License (which removed the advertising clause; point 3.), and
3. the 2-clause BSD License (which also removed the non-endorsement clause; point 4.)

Of course, you can also multi-license software.
(The permissive licenses are compatible with the GPL, so if you pick one of those there's no need to multi-license with GPL.)

Falcury
Wise Scribe
Wise Scribe
Posts: 341
Joined: June 25th, 2009, 10:01 pm

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

Post by Falcury » June 27th, 2015, 3:28 pm

Here is a snapshot binary version of the current state of SDLPoP (compiled for Windows). It includes the music files (with reduced file size: I used Audacity's OGG export quality setting 4 and mono channel).

David, are there things you want to be changed or is there stuff that you wish to add? Or, will it be okay to simply call this "version 1.15" so people have a new stable release to play with?
Attachments
SDLPoP_v1.15RC.zip
(4.79 MiB) Downloaded 14 times

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3202
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Post by Norbert » June 27th, 2015, 5:49 pm

I get the warning that, at line 2130 of seg009.c, the (void*) cast doesn't work properly on my 64-bit system (different size integers).

By the way, I noticed that the Makefile uses gnu99. I think that's the GNU variant of c99. Maybe -std=c99 should be used for portability?
When you use this...
-----
CFLAGS += $(INCS) -Wall -Wno-unused-result -Wextra -Wshadow -Wpointer-arith -Wcast-qual -std=c99 -O2 -g -pedantic
-----
...you'll find some unused parameters and declarations that shadow global declarations. If you really want to polish it, maybe even add -Wmissing-prototypes and -Wstrict-prototypes, although that'll give you lots of warnings. May not be necessary.
With...
-----
$ make 2> makeoutput.txt
-----
...you can more easily look through all the warnings.

It's great that, with SDL2, fullscreen now also works perfectly on Linux.
I noticed that someone even added Alt+Enter to toggle fullscreen.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3202
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Post by Norbert » June 27th, 2015, 6:38 pm

Some suggestions for the doc/ directory.

- Maybe remove X-error.txt? (Unless it has some kind of historical value?)

- In bugs.txt it's quite difficult to at a glance find where "not fixed yet:" starts. This is because that text isn't in a header format. Therefore I suggest changing the five(?) headers "fixed bugs:", "not fixed yet:", "leaks:", "formerly not implemented:" and "Not (yet) implemented:" in such a way that it's immediately clear where the new sections start. Example: instead of "not fixed yet:" use

Code: Select all

===============================================================================
NOT FIXED YET
===============================================================================
- The headers of Readme.txt are better, but could also be clearer. Also, it would be best if they are consistent across files.

- In ChangeLog.txt, maybe move the text "For recent changes, look at GitHub: https://github.com/NagyD/SDLPoP/commits/master" that is now at the bottom to the top of the file, under the text "Change log and history.".

- Also in ChangeLog.txt, make clear headers for the dates. The information about 2015 June 24 is more than 40 lines, including empty lines. If you want to make it easier for readers to find where in the file the different dates/versions start, change, for example, "2015 June 24" to

Code: Select all

2015 June 24
-------------------------------------------------------------------------------
or

Code: Select all

2015 June 24
===============================================================================
or

Code: Select all

===============================================================================
2015 June 24
===============================================================================
Or something similar. It's easy to find the dates at the top of the file, but at the bottom there are more lines and also paragraphs.

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

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

Post by David » June 27th, 2015, 7:43 pm

Added GPLv3 license.
Also Updated Windows build instructions for SDL2.
Norbert wrote: I get the warning that, at line 2130 of seg009.c, the (void*) cast doesn't work properly on my 64-bit system (different size integers).

Code: Select all

printf("timer_handles[%d] = %p\n", timer_index, (void*) timer_handles[timer_index]);
That's just a debug printout. I added the cast in v1.10, maybe to fix a warning?
SDL_TimerID was a pointer in SDL 1.x, but it's an integer in SDL 2.
Norbert wrote: I noticed that someone even added Alt+Enter to toggle fullscreen.
That was here: viewtopic.php?p=16124#p16124
Norbert wrote: In bugs.txt it's quite difficult to at a glance find where "not fixed yet:" starts.
In addition, some of them were fixed since.
Norbert wrote: Maybe -std=c99 should be used for portability?
But then I get "warning: ISO C forbids zero-size array `images'".
And the unnamed union in sound_buffer_type does not work. (Under Windows at least.)

I made some changes: https://github.com/NagyD/SDLPoP/commit/ ... 8178798221

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3202
Joined: April 9th, 2009, 10:58 pm
Contact:

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

Post by Norbert » June 27th, 2015, 8:05 pm

I didn't expect you to pick a copyleft license, so I didn't go into the differences between the GPL versions. Note that you picked GPLv3+, because you included "or (at your option) any later version". This means that if the Free Software Foundation comes up with a GPLv4, SDLPoP can also be distributed under that license - whatever its text would be. GPLv3 and GPLv2 are different in some ways. Linus Torvalds, for example, uses GPLv2 for Linux but dislikes GPLv3. Stallman talks about GPLv3 here. GPLv3+ means you picked the same thing as I did in 2008 for apoplexy.

Thanks for updating the doc/ files.

Post Reply