Genesis VDP Plane Priority Question

Discussion in 'Sega Discussion' started by vext01, Sep 2, 2012.

  1. vext01

    vext01 Active Member

    Joined:
    Jan 26, 2012
    Messages:
    39
    Likes Received:
    0
    Hi Assembler,

    I am investigating a bug in the dgen-sdl emulator.

    Look at the attached screenshot. Notice the player sprite is partially over the scores.

    The plane priority on the emulator is as follows:

    ---8<---
    // Draw, from the bottom up
    // Low priority
    draw_plane_back1(line);
    draw_plane_back0(line);
    draw_window(line, 0);
    draw_sprites(line, 0);
    // High priority
    draw_plane_front1(line);
    draw_plane_front0(line);
    draw_window(line, 1);
    draw_sprites(line, 1);
    ---8<---

    I think plane 0 is plane A here and 1 = B.

    What we are seeing here is a low priority sprite rendering over the low priority window plane. It looks wrong and is (this doesn't happen on the real thing).

    By drawing the window planes last, ie:

    ---8<---
    // Draw, from the bottom up
    // Low priority
    draw_plane_back1(line);
    draw_plane_back0(line);
    draw_sprites(line, 0);
    draw_window(line, 0);
    // High priority
    draw_plane_front1(line);
    draw_plane_front0(line);
    draw_sprites(line, 1);
    draw_window(line, 1);
    ---8<---

    then the game *appears* correctly.

    Yet if we consult some docs (http://emu-docs.org/Genesis/Graphics/genvdp.txt):

    ---8<---
    (back) (front)
    A > B > C > D > E' > F' > G'

    ' = Denotes high priority
    A = Backdrop color
    B = Low priority plane B
    C = Low priority plane A
    D = Low priority sprites
    E = High priority plane B
    F = High priority plane A
    G = High priority sprites
    ---8<---

    And we are given some info about the interaction of window too:

    ---8<---
    The window plane operates differently from plane A or B. It can be thought
    of a 'replacement' for plane A which is used under certain conditions.
    That said, plane A cannot be displayed in any area where plane W is
    located, it is impossible for them to overlap.
    ---8<---

    This implies the following plane ordering to me:

    ---8<---
    Backdrop color
    Low priority plane B
    Low priority plane A
    Low priority window
    Low priority sprites
    High priority plane B
    High priority plane A
    High priority window
    High priority sprites
    ---8<---

    This is exactly the ordering that causes the issue in the first place?!

    Can someone clarify this. Should the window always be on top?
     

    Attached Files:

    Last edited: Sep 2, 2012
  2. vext01

    vext01 Active Member

    Joined:
    Jan 26, 2012
    Messages:
    39
    Likes Received:
    0
    PS.

    I have just been told that moving the "window" plane to the top breaks the cd player in lotus turbo challenge.
     
  3. vext01

    vext01 Active Member

    Joined:
    Jan 26, 2012
    Messages:
    39
    Likes Received:
    0
    I'm quite suprised that no-one here has any ideas. Perhaps I posted to the wrong forum?
     
  4. Druidic teacher

    Druidic teacher Officer at Arms

    Joined:
    Jun 6, 2006
    Messages:
    3,643
    Likes Received:
    129
    x
     
    Last edited: Jun 22, 2017
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page