6561 EXTRA INFORMATION Lance Ewing This text provides a few extra comments on the vert/horiz centering of the first two registers. It also provides a couple of helpful tables to show how the video ram and character table addresses are set by the related VIC registers. SCREEN ORIGIN The following diagrams show the VIC 20 screen positioned inside the monitor given by the VIC register values along side. These are approximate values. As long as you're close to these values it should be okay. Note: These measurements have been taken from a VIC 20 using the 6561 chip. Since the 6560 chip has different default values for these registers, I'm assuming the following values will be slightly off for the 6560 chip. (i) Top left corner positioned at top left corner of monitor. ____________________ | | | Address Value | | | | | | $9000 9 | | | $9001 17 |________________| | |____________________| (ii) Bottom right corner at bottom left corner of monitor. ____________________ | ________________| | | | | | | $9000 16 | | | $9001 61 | | | |___|________________| (iii) Top left corner is at the bottom right corner ____________________ | | | | | monitor | $9000 60 | | $9001 152 | | |____________________|________________ | | | vic | | screen | | | |________________| GRANULARITY Apart from the above situations, remember the general rules that increasing the value in $9000 moves the screen four pixels to the right, and increasing the value in $9001 moves the screen two pixels down. $9000: 4 pixels granularity $9001: 2 pixels granularity RESOLUTION If you combine the above information your can determine the max resolution of the TV screen as used by the VIC 20. This resolution will be somewhere between 208x264 to 208x270. Note that there are actually 312 lines and that that location $9001 reflects this by having valid values from 0 to 155 with a 2 pixel granularity. Only 264-270 lines fit on the TV screen though. The VIC screen fulls up the whole TV screen when it has 26 columns and 33/34 rows. CHARACTER TABLE/SCREEN MEMORY ADDRESSES $9002: Y------- $9005: YYYYXXXX X = chartable address Y = screen memory address The following table shows how the bottom four bits of memory location $9005 specify the character table address. X Location Contents Value HEX Decimal 0 $8000 32768 Upper case normal characters 1 $8400 33792 Upper case reversed characters 2 $8800 34816 Lower case normal character 3 $8C00 35840 Lower case reversed characters 4 $9000 36864 unavailable 5 $9400 37888 unavailable 6 $9800 38912 unavailable 7 $9C00 39936 unavailable 8 $0000 0 unavailable 9 $0400 1024 3K expansion 10 $0800 2048 3K expansion 11 $0C00 3072 3K expansion 12 $1000 4096 RAM 13 $1400 5120 RAM 14 $1800 6144 RAM 15 $1C00 7168 RAM Remember that when the character table is located at $1C00, the second half of the character table will be at $8000 because the address wraps around to the top. Likewise, when the character table is positioned at $9C00, the second half will be read from $0000 and not $A000. This second situation shouldn't ever be a problem, but the first situation is used quite often. The following table shows how the top four bits of location $9005 and the top bit of location $9002 are used to give the address of screen memory. The top bit of location $9005 will almost always be 1, so for this reason I have ignored this bit in the table below. Y1 = ($9005) AND 112 Y2 = ($9002) AND 128 Address = 4*Y2 + 64*Y1 Y1 Y2 Address 128 0 0 0 128 128 $200 512 144 0 $400 1024 144 128 $600 1536 160 0 $800 2048 160 128 $A00 2560 176 0 $C00 3072 176 128 $E00 3584 192 0 $1000 4096 192 128 $1200 4608 208 0 $1400 5120 208 128 $1600 5632 224 0 $1800 6144 224 128 $1A00 6656 240 0 $1C00 7168 240 128 $1E00 7680