SDLPop Technical Questions

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

Moderator: English Moderator Team

Nick2017
Sheikh
Sheikh
Posts: 30
Joined: January 7th, 2017, 10:45 pm

SDLPop Technical Questions

Postby Nick2017 » March 1st, 2017, 1:09 pm

Hi,

I would like to know the following:

1 - Where are the X and Y increments located for the sprite movements of the kid, guards, jaffar, etc? I can't find them looking at the source code.
2 - I'm guessing that every sprite must have a duration to create each animation of the characters. Is this time the same for each sprite or does it change?

Thanks!

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

Re: SDLPop Technical Questions

Postby Falcury » March 1st, 2017, 7:34 pm

Nick2017 wrote:1 - Where are the X and Y increments located for the sprite movements of the kid, guards, jaffar, etc? I can't find them looking at the source code.

Take a look at seqtbl.c, which contains the sequence table. It contains the frames and X and Y increments for the animation sequences.
A pointer into this table (Char.curr_seq) is used to store the position in the animation. Every game tick, the position in the sequence table is advanced in play_seq() in seg006.c. The sequence table also contains some scripted events, such as the footstep sounds, knocking down a tile, moving to the next level on the stairs animation, etc.

However, most of the game logic is handled outside the sequence table, of course. And character displacement is also manipulated outside the sequence table in various places.

By the way, the DOS sequence table has only minor differences compared to the one in the Apple II source code, which can be found here:
https://github.com/jmechner/Prince-of-P ... SEQTABLE.S

Nick2017 wrote:2 - I'm guessing that every sprite must have a duration to create each animation of the characters. Is this time the same for each sprite or does it change?


The sequence table defines the animations, the frames themselves are 'just' images.
In the sequence table, the same frame may appear multiple times, which slows down the animation. Example:

Code: Select all

LABEL(medland) // medium land (1.5 - 2 stories)
        act(actions_5_bumped), SEQ_KNOCK_DOWN, dy(-2), dx(1), dx(2), frame_108_fall_land_2,
        frame_109_crouch, frame_109_crouch, frame_109_crouch, frame_109_crouch,
        frame_109_crouch, frame_109_crouch, frame_109_crouch, frame_109_crouch,
        frame_109_crouch, frame_109_crouch, frame_109_crouch, frame_109_crouch,
        frame_109_crouch, frame_109_crouch, frame_109_crouch, frame_109_crouch,
        frame_109_crouch, frame_109_crouch, frame_109_crouch, frame_109_crouch,
        frame_109_crouch, frame_109_crouch, frame_109_crouch, frame_109_crouch,
        frame_109_crouch, frame_109_crouch, frame_109_crouch, frame_109_crouch,
        frame_109_crouch,
        dx(1), frame_110_stand_up_from_crouch_1,
        frame_110_stand_up_from_crouch_1, frame_110_stand_up_from_crouch_1, frame_111_stand_up_from_crouch_2,
        dx(2), frame_112_stand_up_from_crouch_3,
        frame_113_stand_up_from_crouch_4,
        dx(1), dy(1), frame_114_stand_up_from_crouch_5,
        dy(1), frame_115_stand_up_from_crouch_6,
        frame_116_stand_up_from_crouch_7,
        dx(-4), frame_117_stand_up_from_crouch_8,
        frame_118_stand_up_from_crouch_9, frame_119_stand_up_from_crouch_10,
        jmp(stand), // goto "stand"

Nick2017
Sheikh
Sheikh
Posts: 30
Joined: January 7th, 2017, 10:45 pm

Re: SDLPop Technical Questions

Postby Nick2017 » March 3rd, 2017, 12:16 am

Ok, so a sequential table is an array where actions of the game are stored, right? but what I don't understand is the timming of these events. How are they done in the DOS version, using int 8?

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

Re: SDLPop Technical Questions

Postby David » March 4th, 2017, 1:11 pm

Nick2017 wrote:but what I don't understand is the timming of these events. How are they done in the DOS version, using int 8?

Yes.
There is a long post about that here, with parts from the disassembly: viewtopic.php?f=68&t=3353


Return to “SDLPoP”

Who is online

Users browsing this forum: No registered users and 1 guest