	nAn explanation of 1280 Horizontal Pixel modeF.Bowen



The C4567R6 supports ultra-high resolution graphics by permitting the
programmer to use 1280 pixel lines.  1280 mode is enabled by setting the H1280
and H640 bits in VIC control register "B" to a "1".



The 1280 "pixels" are acheived by time-multiplexing bitplane bits.
This means that for the first half of each pixel, the VIC will fetch the color
from the normal palette index.  For the second half of the same pixel, the VIC
will fetch the color from the palette index+128.  To utilize this feature, you
must set up the color palette appropriately.  Here's an example.



Lets draw a 1280 mode picture that looks roughly like this:
(0[1 K


lqqqqqqqqqqqqqqq
x
x 
x  
x   
x    
x     
x      
(B[0 K


This picture is one "cell" 8 pixels high and 8 pixels wide, but in 1280 mode
it will appear to be 16 'narrow' pixels wide if we program things properly.
To make it simpler, let's use only two colors- black for the background and
white for the lines.  In 320 or 640 wide pictures, this could be accomplished
with a single bitplane, but in 1280 mode you need two bitplanes because you
need to use four palette indices: one for the background, one for a dot to
appear in the "early" half of a pixel, one for a dot to appear in the "late"
half of a pixel, and one for dots in both halves of a pixel.

An explanation of 1280 Horizontal Pixel mode, continuedF.Bowen



The "early" bits will come from the first eight bytes of bitplane '0':

(0[1 K
 1  1  1  1  1  1  1  1   $FF
 1  0  0  0  0  0  0  0   $80
 1  1  0  0  0  0  0  0   $C0
 1  0  0  0  0  0  0  0   $80
 1  0  1  0  0  0  0  0   $A0
 1  0  0  0  0  0  0  0   $80
 1  0  0  1  0  0  0  0   $90
 1  0  0  0  0  0  0  0   $80
(B[0 K

and the "late" bits will come from the first eight bytes of bitplane '1':

(0[1 K
1  1  1  1  1  1  1  1    $FF
1  0  0  0  0  0  0  0    $80
0  0  0  0  0  0  0  0    $00
0  1  0  0  0  0  0  0    $40
0  0  0  0  0  0  0  0    $00
0  0  1  0  0  0  0  0    $20
0  0  0  0  0  0  0  0    $00
0  0  0  1  0  0  0  0    $10
(B[0 K

Together, these early and late bits form the color palette index:

(0[1 K
11 11 11 11 11 11 11 11
11 00 00 00 00 00 00 00
01 01 00 00 00 00 00 00
01 10 00 00 00 00 00 00
01 00 01 00 00 00 00 00
01 00 10 00 00 00 00 00
01 00 00 01 00 00 00 00
01 00 00 10 00 00 00 00
(> }  }  }  }  }  }  }  }(B[0 K   Early bits come from Bitplane '0'(0[1 K 
(>}  }  }  }  }  }  }  } (B[0 K   Late  bits come from Bitplane '1'(0[1 K 
(B[0 K

That's how the bitplanes need to be programmed.  Here's how the palette must
be programmed to provide the four pixel types:


bits    index     index+128
(0[1 Kqqqq  qqqqqqqqqqq    qqqqqqqqqqq
 00  $00   BLACK    $80   BLACK
 01  $01   WHITE    $81   BLACK
 10  $02   BLACK    $82   WHITE
 11  $03   WHITE    $83   WHITE
      qqqqqqqqqqq    qqqqqqqqqqq
(B[0 K    early       late

An explanation of 1280 Horizontal Pixel mode, continuedF.Bowen



So let's set up the VIC for 1280x200x2 (but one-color) bitplane mode with
bitplanes at $00C000 and $018000...


Clear the screen:
F 00C000 00FFFF 00:bitplane 0, 16K bytes
F 018000 01BFFF 00:bitplane 1, 16K bytes


Setup the palette:
>FFD100  00 0F 00 0F:red   index
>FFD200  00 0F 00 0F:green index
>FFD300  00 0F 00 0F:blue  index
>FFD080  00 00 0F 0F:red   index+128
>FFD081  00 00 0F 0F:green index+128
>FFD082  00 00 0F 0F:blue  index+128


Render the picture:
>00C000  FF 80 C0 80 A0 80 90 80
>018000  FF 80 00 40 00 20 00 10


And finally turn it on:

>FFD031  D4 03 0C 08


To get the text screen back, type:


>FFD031  E0





Notes:

1. The pixel clock is substituted for Bitplane 7 by the VIC in 1280 mode and
   cannot be used for display.  This is how the VIC "adds 128" to the palette
   index for the "late" half of the pixel.

2. On most monitors, horizontal lines will appear "brighter" than vertical or
   diagonal lines due principally to its pitch (resolution).
