]> 4ch.mooo.com Git - 16.git/blob - 16/PCGPE10/VIDEO7.TXT
modified: 16/modex16/scroll.c
[16.git] / 16 / PCGPE10 / VIDEO7.TXT
1 \r
2                  ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
3                  ³ Programming the Video7 SVGA Chip ³\r
4                  ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
5 \r
6                  Written for the PC-GPE by Mark Feldman\r
7             e-mail address : u914097@student.canberra.edu.au\r
8                              myndale@cairo.anu.edu.au\r
9 \r
10                   Please read the file SVGINTRO.TXT\r
11               (Graphics/SVGA/Intro PC-GPE menu option)\r
12 \r
13              ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
14              ³      THIS FILE MAY NOT BE DISTRIBUTED     ³\r
15              ³ SEPARATE TO THE ENTIRE PC-GPE COLLECTION. ³\r
16              ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
17 \r
18 \r
19 ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
20 ³ Disclaimer ³\r
21 ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
22 \r
23 I assume no responsibility whatsoever for any effect that this file, the\r
24 information contained therein or the use thereof has on you, your sanity,\r
25 computer, spouse, children, pets or anything else related to you or your\r
26 existance. No warranty is provided nor implied with this information.\r
27 \r
28 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
29 ³ Video7 Extensions ³\r
30 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
31 \r
32 To modify any of the Video7 extended registers you must enable the\r
33 extensions. Disable them once you are done.\r
34 \r
35 To enable extensions:\r
36 \r
37 PortW[$3C4] := $EA06;\r
38 \r
39 To disable extensions:\r
40 \r
41 PortW[$3C4] := $AE06;\r
42 \r
43 \r
44 \r
45 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
46 ³ Identifying the Video7 SVGA Chip ³\r
47 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
48 \r
49 The presence of a Video7 chip can be detected with the following procedure:\r
50 \r
51 var old_value, new_value, id : byte;\r
52 \r
53 EnableVideo7Extensions;\r
54 Port[$3D4] := $0C;\r
55 old_value := Port[$3D5];\r
56 Port[$3D5] := $55;\r
57 new_value := Port[$3D5];\r
58 Port[$3D4] := $1F;\r
59 id := Port[$3D5];\r
60 Port[$3D4] := $0C;\r
61 Port[$3D5] := old_value;\r
62 DisableVideo7Extentions;\r
63 \r
64 { Check that register value is $55 Xor $EA }\r
65 if id = $BF then\r
66   card is a video7\r
67 else\r
68   card isn't a video7\r
69 \r
70 \r
71 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
72 ³ Identifying which Video7 Chip is Present ³\r
73 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
74 \r
75 Once you know that the video card has a video7 in it you can read the Chip\r
76 Revision register to find out which chip it is:\r
77 \r
78 Port[$3C4] := $8E;\r
79 chip := Port[$3C5];\r
80 \r
81               ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
82               ³ Value in                               ³\r
83               ³ chip variable     Video7 Chip          ³\r
84               ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
85               ³ 40h-49h           1024i                ³\r
86               ³ 50h-59h           V7VGA Version 5      ³\r
87               ³ 70h-7Eh           V7VGA FASTWRITE/VRAM ³\r
88               ³ 80h-FFh           VEGA VGA             ³\r
89               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
90 \r
91 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
92 ³ Video7 Graphics Display Modes ³\r
93 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
94 \r
95                   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿\r
96                   ³ Mode     Resolution      Colors  ³\r
97                   ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´\r
98                   ³ 60h      752x410          16     ³\r
99                   ³ 61h      720x540          16     ³\r
100                   ³ 62h      800x600          16     ³\r
101                   ³ 63h      1024x768         2      ³\r
102                   ³ 64h      1024x768         4      ³\r
103                   ³ 65h      1024x768         16     ³\r
104                   ³ 66h      640x400          256    ³\r
105                   ³ 67h      640x480          256    ³\r
106                   ³ 68h      720x540          256    ³\r
107                   ³ 69h      800x600          256    ³\r
108                   ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
109 \r
110 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\r
111 ³ Video7 Display Memory ³\r
112 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ\r
113 \r
114 Remeber, the extensions must be enabled before calling any of the following\r
115 procedures.\r
116 \r
117 The Video7 version 1-3 chips use a ridiculously complex method to switch\r
118 banks (in my opinion at least), so for these chips I'll only include the code\r
119 to bank switch and leave the technical info on what it does and why it does\r
120 it till a future PC-GPE version (if ever).\r
121 \r
122 The version 1-3 chips map two banks to host memory A000:0000-FFFFh. One bank\r
123 is used for read operations, the other is used for write operations. For 256\r
124 color modes there are 16 64k banks (numbered 0 - 15 for the following\r
125 procedures). One really "stuffed in the head" thing about these chips (from\r
126 a programmers point of view anyway) is that both bank registers use a common\r
127 SVGA register to store their 2 low order bits, so if you set the Read Bank\r
128 number, the Write Bank number's 2 low order bits will be set the same as the\r
129 Read Bank number's 2 low order bits.\r
130 \r
131 The Write Bank number for 256 color modes can be set with the following\r
132 procedure:\r
133 \r
134 Port[$3C4] := $F9;\r
135 Port[$3C5] := bank_number and 1;\r
136 Port[$3C2] := (Port[$3CC] and $DF) or ((bank_number and 2) shl 4);\r
137 Port[$3C4] := $F6;\r
138 Port[$3C5] := (Port[$3C5] and $FC) or (bank_number shr 2);\r
139 \r
140 The Read Bank number for 256 color modes can be set with the following\r
141 procedure:\r
142 \r
143 Port[$3C4] := $F9;\r
144 Port[$3C5] := bank_number and 1;\r
145 Port[$3C2] := (Port[$3CC] and $DF) or ((bank_number and 2) shl 4);\r
146 Port[$3C4] := $F6;\r
147 Port[$3C5] := (Port[$3C5] and $F3) or (bank_number and $0C);\r
148 \r
149 By version 4 Headlands Technologies had gotten their act together and\r
150 adopted a more "sane" bank switching scheme. Version 4 supports both single\r
151 and duel paging schemes. There are 16 64k long banks, and a 64k granularity\r
152 with the techniques used here.\r
153 \r
154 The single paging scheme maps a bank to host memory A000:0000-FFFFh for\r
155 both read and write operations. The single paging scheme is the\r
156 default for version 4, but can also be set with the following procedure:\r
157 \r
158 Port[$3C4] := $E0;\r
159 Port[$3C5] := Port[$3C5] and $7F\r
160 \r
161 The Single/Write Bank Register is used to select which bank to map to\r
162 host memory:\r
163 \r
164           Index : E8h at port 3C4h\r
165           Read/Write at port 3C5h\r
166           ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
167           ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
168           ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
169             ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
170                  Bank\r
171 \r
172 A bank can be selected with the following procedure:\r
173 \r
174 PortW[$3C4] := (bank_number shl 12) + $E8;\r
175 \r
176 In duel paging mode one bank is mapped to A000:0000-FFFF for write operations\r
177 and another for read operations. Duel paging mode can be selected with the\r
178 following procedure:\r
179 \r
180 Port[$3C4] := $E0;\r
181 Port[$3C5] := Port[$3C5] or $80;\r
182 \r
183 The Single/Write Bank Register (see above) is used to select which bank to\r
184 map to host memory for writing operations. The Read Bank Register selects\r
185 which bank to use for read operations:\r
186 \r
187           Index : E9h at port 3C4h\r
188           Read/Write at port 3C5h\r
189           ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿\r
190           ³ 7 ³ 6 ³ 5 ³ 4 ³ 3 ³ 2 ³ 1 ³ 0 ³\r
191           ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ\r
192             ÀÄÄÄÄÄÂÄÄÄÄÄÙ\r
193                  Bank\r
194 \r
195 A read bank can be selected with the following procedure:\r
196 \r
197 PortW[$3C4] := (bank_number shl 12) + $E9;\r