VDC (Video Display Controller) reference

VDC register access:
    7 6 5 4 3 2 1 0
$D600 (R)SR UR LRF VRT unused Version
$D600 (W)CR unused VDC register select
$D601 (R/W)DR VDC register data

VDC register set:
    7 6 5 4 3 2 1 0
$00 (R/W)HT Horizontal Total (Clock cycles per rasterline - 1)
$01 (R/W)HD Horizontal Displayed (Visible character columns)
$02 (R/W)HP Horizontal Sync Position
$03 (R/W)VW/HW Vertical Sync Width (rasterlines) Horizontal Sync Width (characters+1)
$04 (R/W)VT Vertical Total (Character rows per frame - 1)
$05 (R/W)VA unused ¹ Vertical Total Adjust (Rasterline count finetuning)
$06 (R/W)VD Vertical Displayed (Visible character rows)
$07 (R/W)VP Vertical Sync Position
$08 (R/W)IM unused ¹ Interlace mode
$09 (R/W)CTV unused ¹ Rasterlines per character row - 1
$0A (R/W)CM/CS unused ¹ Cursor mode Cursor start
$0B (R/W)CE unused ¹ Cursor end
$0C (R/W)DS Display Start Address (A15-A8)
$0D (R/W)DS Display Start Address (A7-A0)
$0E (R/W)CP Cursor Address (A15-A8)
$0F (R/W)CP Cursor Address (A7-A0)
$10 (R/W)LPV Vertical light pen position
$11 (R/W)LPH Horizontal light pen position
$12 (R/W)UA VDC memory update address (A15-A8)
$13 (R/W)UA VDC memory update address (A7-A0)
$14 (R/W)AA Attribute address (A15-A8)
$15 (R/W)AA Attribute address (A7-A0)
$16 (R/W)C?H Character width including gap (pixels - 1) Character width (pixels)
$17 (R/W)CDV unused ¹ Character height (rasterlines - 1)
$18 (R/W)VSS Fill/Copy Reverse Blink freq Vertical smooth scroll
$19 (R/W)HSS Bitmap Attributes Gap fill Pixel clock Horizontal smooth scroll ³
$1A (R/W)FG/BG Foreground color Background color
$1B (R/W)AI Address increment per row
$1C (R/W)CB Character base address (A15-A13) RAM-Type unused ¹
$1D (R/W)UL unused ¹ Underline scan line
$1E (R/W)WC Block copy/fill word count
$1F (R/W)DA Data register
$20 (R/W)BA Block copy source address (A15-A8)
$21 (R/W)BA Block copy source address (A7-A0)
$22 (R/W)DEB Display enable begin
$23 (R/W)DEE Display enable end
$24 (R/W)DRR unused ¹ DRAM refresh cycles per rasterline
$25 (R/W)  HSYNC ² VSYNC ² unused ¹

¹ - Unused bits read back 1
² - Only available on VDC 8568
³ - Different on VDC 8568


VDC character attributes:
Mode 7 6 5 4 3 2 1 0
Characters Alternate Reverse Underline Blink Foreground color
Bitmap Background color Foreground color


VDC color palette (RGBI):
0 2 4 6 8 A C E
VDC color palette
1 3 5 7 9 B D F


Status Register:

URUpdate ReadySet when memory update finished
LRFLightpen Register FullCleared when reading LPV or LPH
VRTVertical RetraceSet if vertical blanking or retrace area is drawn
VersionVersion1 = VDC 8563, 2 = VDC 8568


Light Pen:

SR bit 6 reset when LPV or LPH is read.


Character height:

The character height is controlled via the CTV register which can be used to set any character height from 2 to 32 rasterlines. Changing the character height however requires changes in several registers which are: VT (character rows per frame), VA (finetuning), VP (vsync position) and usually also VD (visible character rows per frame) and CDV.

char_height = 2 to 32
rlines = 312 (50 Hz) or 262 (60 Hz)
rows = Number of character rows to be displayed, should be smaller than (rlines / char_height)

VD = rows
VT = (rlines / char_height) - 1
VA = (rlines) mod (char_height)
VP = ((rlines / char_height) + rows) / 2


hcycles = 127 (15750 Hz) or 128 (15625 Hz)
columns = Number of character columns to be displayed, should be smaller than hcycles

HT = hcycles - 1
HD = columns
HP = (((hcycles+columns)/2)-2)
DEB = (((hcycles+columns)/2)+21) mod hcycles
DEE = (((hcycles+columns)/2)-4)


Cursor:

The VDC cursor is displayed on the text mode at the screen position where the character address equals the cursor pointer (CP) and only on the character rasterlines defined by the cursor start (CS) and end (CE) registers.

Cursor Start (CS) - Tells the VDC on which rasterline of a character row the cursor starts.
Cursor End (CE) - Tells the VDC on which rasterline of a character row the cursor stops.

Example: CS = 1 and CE = 5 will display a 4 rasterlines high cursor which starts at the second rasterline of the character row.

The CDV register has no effect on the cursor height.
If CS or CE contain higher values than the CTV register, they will have no effect.
If only CE contains a higher value, the cursor will never end and the cursor will be displayed for the entire character height.
If only CS contains a higher value, the cursor will never start and no cursor will be displayed.
If CS is equal to CE, a 1 rasterline high cursor will be displayed just as if CE was equal to CS+1.

Because CE ends the cursor display on a rasterline and at the same time has no effect if the value is higher than the value in the CTV register, displaying a cursor including the last rasterline of a character row can only be done by abusing the rules above.

It is possible to display an "inverted cursor" by choosing values where CS is greater than CE.


Underline:

Underlined charactes will display an $FF-byte at the character row rasterline defined by the UL register. The underline effect will behave similar to normal character pixels which means inversions and blink applies to the underline too. Unlike normal character pixels, the underline is not affected by the CDV or CDH registers.

© 2010-2012 Graham

back