The maximum number of colors that a viewport can display is determined by the depth of the bitmap that the viewport displays. the depth is specified when the BitMap is initialized. See the section below called "preparing the bitmap structure." Depth determines the number of bitplanes used to define the colors of the rectangular image you are trying to build (the raster image) and the number of different colors that can be displayed at the same time within a viewport. for any single pixel, the system can display any one of 4,096 possible colors. The following table shows depth values and the corresponding number of possible colors for each value. Table 27-1: Depth Values and Number of Colors in the ViewPort Colors Depth Value ------ ----------- 2 1 4 2 8 3 (Note 1) 16 4 (Notes 1,2) 32 5 (Notes 1,2,3) 16 6 (Notes 1,4) 64 6 (Notes 1,2,3,5) 4,096 6 (Notes 1,2,3,6) Notes: 1. Not available for superhires. 2. Single-playfield mode only - dualpf not one of the viewport's attributes. 3. Low-resolution mode only - neither hires nor superhires one of the viewport attributes. 4. Dual Playfield mode - dualpf is an attribute of this ViewPort. Up to eight colors (in three planes) for each playfield. 5. Extra-Half-Brite mode - extra_halfbrite is an attribute of this ViewPort. 6. Hold-And-Modify mode only - ham is an attribute of this ViewPort. The color palette used by a viewport is specified in a colormap. see the section called "preparing the colormap" for more information. Depending on whether single- or dual-playfield mode is used, the system will use different color register groupings for interpreting the on-screen colors. The table below details how the depth and the different viewport modes affect the registers the system uses. Table 27-2: Color Registers Used in Single-playfield Mode Color Depth Registers Used ----- -------------- 1 0,1 2 0-3 3 0-7 4 0-15 5 0-31 6 0-31 (if extra_halfbrite is an attribute of this viewport.) 6 0-15 (if ham is an attribute of this viewport.) The following table shows the five possible combinations when dualpf is an attribute of the viewport. Table 27-3: Color Register Used in Dual-playfield Mode Depth Color Depth Color (PF-1) Registers (PF-2) Registers ------ --------- ------ --------- 1 0,1 1 8,9 2 0-3 1 8,9 2 0-3 2 8-11 3 0-7 2 8-11 3 0-7 3 8-15