[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.