Page 1 of 1

SDLPop Technical Questions

Posted: March 1st, 2017, 1:09 pm
by Nick2017
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!

Re: SDLPop Technical Questions

Posted: March 1st, 2017, 7:34 pm
by Falcury
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"

Re: SDLPop Technical Questions

Posted: March 3rd, 2017, 12:16 am
by Nick2017
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?

Re: SDLPop Technical Questions

Posted: March 4th, 2017, 1:11 pm
by David
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