[Contents] [index] [Help] [Retrace] [browse <] [Browse >]

In dual-playfield mode, you have two separately controllable playfields.
You specify dual-playfield mode in 1.3 by setting the dualpf bit in the
viewport.modes field.  in release 2, you specify dual-playfield by using
any ModeID that includes DPF in its name as listed in <graphics/displayinfo.h>.

In dual-playfield mode, you always define two rasinfo data structures.
Each of these structures defines one of the playfields. There are five
different ways you can configure a dual-playfield display, because there
are five different distributions of the bitplanes which the system
hardware allows.


        Table 27-6: Bitplane Assignment in Dual-playfield Mode


               Number of    Playfield 1    Playfield 2
               Bitplanes       Depth          Depth
               ---------       -----          -----
                   2             1              1
                   3             2              1
                   4             2              2
                   5             3              2
                   6             3              3


Under 1.3 if pfba is set in the viewport.modes field, or, under release 2,
if the ModeID includes DPF2 in its name, then the playfield priorities are
swapped and playfield 2 will be displayed in front of playfield 1.  In
this way, you can get more bitplanes in the background playfield than you
have in the foreground playfield. The playfield priority affects only one
viewport at a time.  if you have multiple viewports with dual-playfields,
the playfield priority is set for each one individually.

Here's a summary of the steps you need to take to create a dual-playfield
display:

  * Allocate one view structure and one viewport structure.

  * Allocate two bitmap structures.  allocate two rasinfo structures
    (linked together), each pointing to a separate BitMap. The two
    RasInfo structures are linked together as follows:

        struct RasInfo playfield1, playfield2;

        playfield1.Next = &playfield2;
        playfield2.Next = NULL;

  * Initialize each bitmap structure to describe one playfield, using one
    of the permissible bitplane distributions shown in the above table
    and allocate memory for the bitplanes themselves.  Note that BitMap 1
    and BitMap 2 need not be the same width and height.

  * Initialize the viewport structure.  in 1.3, specify dual-playfield
    mode by setting the dualpf bit (and pfba, if appropriate) in the
    viewport.modes field.  under release 2, specify dual-playfield mode
    by selecting a ModeID that includes DPF (or DPF2) in its name as
    listed in <graphics/displayinfo.h>.  set the viewport.rasinfo field
    to the address of the playfield 1 rasinfo.

  * Set up the colormap information

  * Call makevport(), mrgcop() and loadview() to display the newly
    created viewport.

For display purposes, each of the two bitmaps is assigned to a separate
viewport.  to draw separately into the bitmaps, you must also assign these
BitMaps to two separate rastports.  the section called
"initializing a rastport structure" shows you how to use a rastport data
structure to control your drawing routines.