SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: SDLPoP; David's open-source port of PoP

Post by Falcury »

Here is some code for reading options from modded DOS executables:
https://github.com/Falcury/SDLPoP/commi ... 6e101a590d

Limitation: the executable will not be found if the filename is not PRINCE.EXE.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: SDLPoP; David's open-source port of PoP

Post by Falcury »

David wrote: March 24th, 2018, 7:54 pm I fixed the removed loose floor on level 3, and also replaced a few numbers with (existing!) custom options.
https://github.com/NagyD/SDLPoP/commit/ ... 9ea9f8b577
https://github.com/NagyD/SDLPoP/commit/ ... fc0a53b2ac -- Note the TODOs.
I guess a lesson for me could be that I should test much more exhaustively than I thought I did? :|
Interestingly (or disparagingly), apparently I have 'blind spots'. For example, I remember staring at this line and finding it mildly curious that the column and row were the same. Not realizing the mistake of course...

Code: Select all

-	if (current_level == /*3*/ custom->checkpoint_level && Char.room == 7) {
+	if (current_level == /*3*/ custom->checkpoint_level && Char.room == 7 /* TODO: add a custom option */) {
I think the only reason I did not add an option for that one, is because CusPop also doesn't have it.

Code: Select all

-		Char.room == /*11*/ custom->mirror_room
+		Char.room == 11 /* TODO: add a custom option */
But, custom->mirror_room already exists?
David wrote: March 24th, 2018, 7:54 pm A question: Do you think that this should use custom->mirror_level?
I guess you're right, that would make sense.
Unless you would prefer to make it a separate option?
David
The Prince of Persia
The Prince of Persia
Posts: 2852
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

Falcury wrote: March 31st, 2018, 2:58 pm

Code: Select all

-		Char.room == /*11*/ custom->mirror_room
+		Char.room == 11 /* TODO: add a custom option */
But, custom->mirror_room already exists?
Yes, but custom->mirror_room is room 4, where the mirror appears, but this check uses room 11.
This check is about the music that is played when the player exits room 11 to the left.
Falcury wrote: March 31st, 2018, 2:58 pm For example, I remember staring at this line and finding it mildly curious that the column and row were the same. Not realizing the mistake of course...
Interestingly, there is a similar but correct coincidence just below that line: the mirror appears on level 4, room 4, column 4... (but row 0)
In fact, in CusPop, the column and the room are handled together, because that's what the EXE does.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: SDLPoP; David's open-source port of PoP

Post by Falcury »

Here is a new mac disk image for version 1.18.1.
Turns out the older disk image could only run on macOS 10.12 or higher (which is the OS version I compiled on). Hopefully that is fixed now.
David wrote: March 31st, 2018, 3:49 pm Yes, but custom->mirror_room is room 4, where the mirror appears, but this check uses room 11.
This check is about the music that is played when the player exits room 11 to the left.
Right. I'm glad that you caught the error.
Attachments
SDLPoP-1.18.1.dmg
(1.37 MiB) Downloaded 92 times
David
The Prince of Persia
The Prince of Persia
Posts: 2852
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

Falcury wrote: April 1st, 2018, 1:40 pm
David wrote: March 31st, 2018, 3:49 pm Yes, but custom->mirror_room is room 4, where the mirror appears, but this check uses room 11.
This check is about the music that is played when the player exits room 11 to the left.
Right. I'm glad that you caught the error.
Actually it was my own mistake in the previous commit: https://github.com/NagyD/SDLPoP/commit/ ... ab21daR524
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5749
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

Hey, you know what's nice...
That apoplexy (3.3+) can now start level 0 (the demo level) using SDLPoP.
This makes it a lot easier to modify that level and test how the prince's auto-movement reacts to it.
I know there are other ways to test it, but this makes the edit/test-loop really quick.
(Same goes for the potions level, of course.)
Even useful for mods whose authors eventually opt to using DOSBox.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: SDLPoP; David's open-source port of PoP

Post by Falcury »

Falcury wrote: April 1st, 2018, 1:40 pm Here is a new mac disk image for version 1.18.1.
I was finally able to verify that this disk image works properly.
The only caveat is that newer Mac OS versions complain that the app is not digitally signed, but I cannot solve that easily.
I guess it's OK now to add the disk image to popot.org.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5749
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

Falcury wrote: April 14th, 2018, 5:38 pmI guess it's OK now to add the disk image to popot.org.
Added it.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5749
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

It appears that debug option "t" is also available with "megahit", while "[" and "]" are not.
This seems inconsistent.
David
The Prince of Persia
The Prince of Persia
Posts: 2852
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

Norbert wrote: April 15th, 2018, 12:06 am It appears that debug option "t" is also available with "megahit", while "[" and "]" are not.
This seems inconsistent.
"t" is checked here: https://github.com/NagyD/SDLPoP/blob/ma ... 000.c#L757 -- The only check is that debug cheats must be enabled at compile-time.
"[" and "]" is checked here: https://github.com/NagyD/SDLPoP/blob/ma ... 00.c#L1532 -- For this, debug cheats must be activated at runtime.
To enable the latter, you need to start SDLPoP with the "debug" command line option: https://github.com/NagyD/SDLPoP/blob/ma ... 000.c#L102
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: SDLPoP; David's open-source port of PoP

Post by Falcury »

Norbert wrote: April 15th, 2018, 12:06 am It appears that debug option "t" is also available with "megahit", while "[" and "]" are not.
This seems inconsistent.
That is a bug, I suppose.
Come to think of it, maybe people would want to use the timer without also enabling cheat mode (for speed runs maybe?). So, we could also decide to make it a separate thing, if we want.

Somewhat related:
Interestingly, the timer jumps from 59:00:01 to 58:59:11, skipping 59:00:00 (and similarly, every minute after that), which shows that all minutes are 719 ticks long, not 720. Therefore, '60 minutes' of in-game time is actually 5 seconds shorter than you would expect (1/12 * 60 = 5).
David
The Prince of Persia
The Prince of Persia
Posts: 2852
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

Falcury wrote: April 15th, 2018, 11:43 am Interestingly, the timer jumps from 59:00:01 to 58:59:11, skipping 59:00:00 (and similarly, every minute after that), which shows that all minutes are 719 ticks long, not 720. Therefore, '60 minutes' of in-game time is actually 5 seconds shorter than you would expect (1/12 * 60 = 5).
The ticks are wrapped around here: https://github.com/NagyD/SDLPoP/blob/ma ... 08.c#L1714

The relevant part of the disassembly:

Code: Select all

seg008:24D3 FF 0E 82 4F                          dec     rem_tick        ; time passes
seg008:24D7 75 28                                jnz     loc_C121
seg008:24D9 C7 06 82 4F CF 02                    mov     rem_tick, 719   ; 720=12*60 ticks = 1 minute
seg008:24DF FF 0E 7E 4F                          dec     rem_min
seg008:24E3 74 3D                                jz      loc_C142
This seems to be a bug in the original.
It should either set ticks to 720 (not just here but also where it sets the starting time, and in Shift+L), or check if the ticks are *less than* zero.

As a side note, the blinking single HP appears in the frames when rem_tick is odd, so it will skip a blink every minute.
Although in the original PoP, you don't know when to look (when will the timer reach the minute boundary).
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5749
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

Maybe the 'saved screenshot'-message could be visible in-game instead of on the console.
Similar to how the quicksave-message is briefly shown in-game.
Maybe the same goes for similar messages? Although I can't think of any others, of the top of my head.
To give the end-user more 'accessible' feedback in response to a request/action.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5749
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

Norbert wrote: March 18th, 2018, 1:10 am I don't think integer (pixel perfect) scaling works under Linux, not at 4:3 nor at the default 16:9.
At least, I don't see any changes. Does it work under Windows?
Quoting/bumping this only because it may be related to this issue.
At the time, I didn't receive a reply, and recently mbunkin did, but isn't the issue the same?
(I don't know a lot about it, maybe they are different issues...)
David
The Prince of Persia
The Prince of Persia
Posts: 2852
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

Norbert wrote: April 29th, 2018, 4:04 pm
Norbert wrote: March 18th, 2018, 1:10 am I don't think integer (pixel perfect) scaling works under Linux, not at 4:3 nor at the default 16:9.
At least, I don't see any changes. Does it work under Windows?
Quoting/bumping this only because it may be related to this issue.
At the time, I didn't receive a reply, and recently mbunkin did, but isn't the issue the same?
(I don't know a lot about it, maybe they are different issues...)
Integer scaling works for me on Windows, but only if 4:3 aspect ratio is turned off.
Which SDL version are you using?
Remember, this feature requires SDL 2.0.5 or newer.
Post Reply