Listing: 1 (******************************************************************************) 2 (* GRQUERY.MOD - Procedure to Qualify "GrafixCard and "CommPort" *) 3 (* *) 4 (* Taken from GRQUERY.C by Metagraphics Software Corporation *) 5 (* Translated to TopSpeed Modula-2 v3.00. *) 6 (* *) 7 (* PSW 10/31/90 01:49am *) 8 (******************************************************************************) 9 10 IMPLEMENTATION MODULE GrQry; 11 (* 12 * Graphix 13 * Release 3.7 14 * (c) Copyright 1986-1992 PMI 15 * Green Bay, Wisconsin 16 * (414) 468-6040 17 * All rights reserved 18 * 19 *) 20 21 (******************************************************************************) 22 (* This procedure, in conjunction with QueryGrafix and QueryComm, is used to *) 23 (* dynamically determine and set the graphics hardware configuration for *) 24 (* MetaWINDOW use. *) 25 (* *) 26 (* In certain configurations it is possible to have multiple display adaptors *) 27 (* installed in one PC, or in some cases one display adaptor supports multiple*) 28 (* operating modes. For these cases the response from QueryGrafix() and *) 29 (* QueryComm() cannot be used directly for the InitGrafix() or InitMouse() *) 30 (* calls. Procedure GrQuery() qualifies the QueryGrafix() and QueryComm() *) 31 (* responses to select the initial graphics card and comm port for MetaWINDOW *) 32 (* use. *) 33 (* *) 34 (* A secondary function of this routine is to allow the operator to specify *) 35 (* overriding graphic card and mouse settings from the program startup command*) 36 (* line. This is useful to cover situations when working with "compatible" *) 37 (* graphics cards which are not fully recognized by the MetaWINDOW routines. *) 38 (* IF the hardware design of a "compatible" adaptor is not exactly the same *) 39 (* as one of the MetaWINDOW supported cards, QueryGrafix may not return the *) 40 (* proper expected results (this usually occurs if the adaptor supports *) 41 (* special "extended" features, or in multiple monitor systems). Also the *) 42 (* operator may choose to override the default mouse comm port. Selections may*) 43 (* be made from the command line, or from the environment variable called *) 44 (* METAPARM The logic is: *) 45 (* *) 46 (* Commmand line option ? *) 47 (* | | *) 48 (* yes no, check for environment var *) 49 (* | | *) 50 (* | Env var METAPARM set ? *) 51 (* | | | *) 52 (* | yes no, Do Queryfunctions *) 53 (* | | | *) 54 (* +------+--------+ *) 55 (* | *) 56 (* Parse result *) 57 (* | *) 58 (* Is a ";" present ? (ie, no wait option) *) 59 (* | | *) 60 (* yes no, Invoke Confirm screen, *) 61 (* | | *) 62 (* | D or I entered before time out ? *) 63 (* | | | *) 64 (* | no yes, Do menus *) 65 (* | | | *) 66 (* | |-----------+ *) 67 (* | | *) 68 (* Continue with application *) 69 (* | *) 70 (* v *) 71 (* *) 72 (* GrQuery should be included (or linked) within the code module of your *) 73 (* main program. Variables are passed as VAR parameters to GrQuery(). *) 74 (* *) 75 (* VAR *) 76 (* GrafixCard, CommPort: INTEGER; *) 77 (* *) 78 (* BEGIN *) 79 (* : *) 80 (* GrQuery(GrafixCard, CommPort); *) 81 (* Meta.InitGrafix(-GrafixCard); *) 82 (* Meta.InitMouse(CommPort); *) 83 (* : *) 84 (* END *) 85 (* *) 86 (******************************************************************************) 87 88 IMPORT Meta; 89 IMPORT GrConst; 90 IMPORT Lib; 91 IMPORT Str; 92 IMPORT IO; 93 94 CONST 95 (*** Set GRQtrim = TRUE to remove menu selection code ***) 96 GRQtrim = FALSE; 97 98 (*** Set DOSDISP = TRUE to use very simple text output code ***) 99 (*** Ensure that GRQtrim is TRUE if DOSDISP is TRUE. ***) 100 DOSDISP = FALSE; 101 102 (*** Set SMALLMENU = TRUE to use the smaller selection of devices available ***) 103 (*** with MetaWINDOW 3.7c, FALSE for MetaWINDOW/Plus. ***) 104 SMALLMENU = FALSE; 105 106 THORZLINE = '-'; (* ASCII Terminal box characters *) 107 TVERTLINE = '|'; 108 TLEFTTCORN = '*'; 109 TRIGHTTCORN = '*'; 110 TLEFTBCORN = '*'; 111 TRIGHTBCORN = '*'; 112 TLEFTTEE = '*'; 113 TRIGHTTEE = '*'; 114 115 HORZLINE = 205; (* Extended ansi box characters *) 116 VERTLINE = 186; 117 LEFTTCORN = 201; 118 RIGHTTCORN = 187; 119 LEFTBCORN = 200; 120 RIGHTBCORN = 188; 121 LEFTTEE = 204; 122 RIGHTTEE = 185; 123 124 (* Menu selection title string *) 125 GRQTITLE = 'Confirm Graphic Devices'; ***** ^ not supported yet 126 127 (* Terminated or exit message *) 128 GRQQUITSTR = 'MetaWINDOW terminated.'; ***** ^ not supported yet 129 130 (* The menu header. Insert your own message here. *) 131 GRQHDRSTR = 'MetaWINDOW for TopSpeed Modula-2'; ***** ^ not supported yet 132 133 GRQDELAY = 180; (* Time out delay in system clock *) 134 (* ticks (18.2 per sec), 0 = forever *) 135 136 GrQLines = 25; (* Maximum number of lines on the *) 137 (* screen, when GRQtrim TRUE *) 138 139 CNORMAL = 1700H; (* Attribute values for set_attr - *) 140 CINVERSE = 7000H; (* color display. *) 141 CHILITE = 1F00H; 142 143 MNORMAL = 0700H; (* Attribute values for set_attr - *) 144 MINVERSE = 7000H; (* mono display. *) 145 MHILITE = 0F00H; 146 147 kESC = 1BH; (* Key codes. *) 148 kCR = 0DH; 149 Home = 71; 150 End = 79; 151 PgDn = 81; 152 PgUp = 73; 153 UP_arr = 72; 154 LF_arr = 75; 155 DN_arr = 80; 156 RT_arr = 77; 157 158 TOP = -2; (* Miscellaneous. *) 159 BOT = -3; 160 SUP = 06H; 161 SDOWN = 07H; 162 GRQMAXLEN = 127; 163 GRQLINLEN = 80; 164 165 166 TYPE 167 txAttr = RECORD (* Text attribute values for text *) 168 normal: WORD; (* color vs mono screens. *) ***** ^ undeclared identifier 169 inverse: WORD; ***** ^ undeclared identifier 170 hilite: WORD; ***** ^ undeclared identifier 171 END; ***** ^ not supported yet 172 173 device = RECORD (* Device information. *) 174 devslash: ARRAY[0..3] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 175 devnum: INTEGER; 176 devdesc: ARRAY[0..34] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 177 devhres: CARDINAL; 178 devvres: CARDINAL; 179 devcolors:INTEGER; 180 END; ***** ^ not supported yet 181 182 iDevTab = ARRAY[0..6] OF device; (* Input device table. *) ***** ^ not supported yet ***** ^ not supported yet 183 184 (*%T SMALLMENU *) 185 186 TYPE 187 oDevTab = ARRAY[0..18] OF device; (* Output device table. *) ***** ^ not supported yet ***** ^ not supported yet 188 189 CONST 190 oDev = oDevTab ( 191 device("w:1", GrConst.WYS640x400, " Amdek 1280", 640, 400, 0), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 192 device("a:1", GrConst.ATT640x400, " Compaq Plasma & AT&T ", 640, 400, 0), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 193 device("g", GrConst.GEN640x480, " Genoa, SuperEGA 4880", 640, 480, 16), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 194 device("h", GrConst.HER720x348, " Hercules, Monographics", 720, 348, 0), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 195 device("c:1", GrConst.CGA640x200, " IBM, CGA", 640, 200, 2), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 196 device("c:2", GrConst.CGA320x200, " IBM, CGA", 320, 200, 4), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 197 device("e:1", GrConst.EGAMono, " IBM, EGA", 640, 350, 0), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 198 device("e:2", GrConst.EGA320x200, " IBM, EGA", 320, 200, 16), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 199 device("e:3", GrConst.EGA640x200, " IBM, EGA", 640, 200, 16), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 200 device("e:4", GrConst.EGA640x350, " IBM, EGA", 640, 350, 16), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 201 device("e:5", GrConst.MGA640x480, " IBM, MCGA", 640, 480, 2), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 202 device("e:6", GrConst.MGA640x350, " IBM, EGA", 640, 350, 2), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 203 device("e:7", GrConst.EGA640x480, " IBM, VGA", 640, 480, 16), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 204 device("l:2", GrConst.PAR640x480, " Paradise, Autoswitch EGA/480", 640, 480, 16), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 205 device("o", GrConst.TOS640x400, " Toshiba, 3100", 640, 400, 0), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 206 device("l:1", GrConst.EVA640x480, " Tseng Labs, EVA-480", 640, 480, 16), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 207 device("u:1", GrConst.VGA640x480, " Video Seven, VEGA/Deluxe", 640, 480, 16), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 208 device("w:1", GrConst.WYS640x400, " Wyse, WY-700", 640, 400, 0), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 209 device("", 0, "** No Graphics Device Located **", 0, 0, 0) ***** ^ not supported yet ***** ^ not supported yet 210 ); 211 (*%E SMALLMENU *) 212 (*%F SMALLMENU *) 213 214 TYPE 215 oDevTab = ARRAY[0..142] OF device; (* Output device table. *) 216 217 CONST 218 oDev = oDevTab ( 219 device("w:1", GrConst.WYS640x400, " Amdek 1280", 640, 400, 0), 220 device("w:2", GrConst.WYS1280x400, "+ Amdek 1280", 1280, 400, 0), 221 device("w:3", GrConst.WYS1280x800, "+ Amdek 1280", 1280, 800, 0), 222 device("a:4", GrConst.ATI800x600, "+ ATI, VGA Wonder", 800, 600, 16), 223 device("a:5", GrConst.ATI1024x768F, "+ ATI, VGA Wonder", 1024, 768, 16), 224 device("a:6", GrConst.ATI640x480X, "+ ATI, VGA Wonder", 640, 480, 256), 225 device("a:2", GrConst.DEB640x200, "+ AT&T, DEB Graphics", 640, 200, 16), 226 device("a:3", GrConst.DEB640x400, "+ AT&T, DEB Graphics", 640, 400, 16), 227 device("c:3", GrConst.CT640x480X, "+ CHIPS and Tech 82C45x", 640, 480, 256), 228 device("e:9", GrConst.VESA800x600, "+ VESA standard", 800,600, 16), 229 device("c:4", GrConst.CT1024x768, "+ CHIPS and Tech 82C45x", 1024, 768, 16), 230 device("a:1", GrConst.ATT640x400, " Compaq Plasma & AT&T ", 640, 400, 0), 231 device("b:1", GrConst.COR1600x1280V, "+ Cornerstone, Vista 1600", 1600, 1280, 0), 232 device("b:2", GrConst.COR1600x1280VA, "+ Cornerstone, Vista 1600/alt", 1600, 1280, 0), 233 device("b:3", GrConst.COR1600x1280DP, "+ Cornerstone, DualPage", 1600, 1280, 0), 234 device("b:4", GrConst.COR1600x1280DPA, "+ Cornerstone, DualPage/noJP1", 1600, 1280, 0), 235 device("b:5", GrConst.COR1600x1280MCA, "+ Cornerstone, DualPage-PS2", 1600, 1280, 0), 236 device("b:6", GrConst.SP768x1008, "+ Cornerstone, SinglePage", 768, 1008, 0), 237 device("b:7", GrConst.SP768x1008A, "+ Cornerstone, Single/noJP1", 768, 1008, 0), 238 device("b:8", GrConst.COR1280x960, "+ Cornerstone, PC1280", 1280, 960, 0), 239 device("b:9", GrConst.COR1280x960A, "+ Cornerstone, PC1280/noJP1", 1280, 960, 0), 240 device("b:10", GrConst.COR1280x1024, "+ Cornerstone, PC1280", 1280, 1024, 0), 241 device("b:11", GrConst.COR1280x1024A, "+ Cornerstone, PC1280/noJP1", 1280, 1024, 0), 242 device("z:0", GrConst.PAR800x600, "+ Eizo, MD-B07", 800, 600, 16), 243 device("z:1", GrConst.STB640x350X, "+ Eizo, MD-B10", 640, 350, 256), 244 device("z:2", GrConst.STB640x480X, "+ Eizo, MD-B10", 640, 480, 256), 245 device("z:3", GrConst.STB800x600, "+ Eizo, MD-B10", 800, 600, 16), 246 device("z:4", GrConst.STB1024x768, "+ Eizo, MD-B10", 1024, 768, 16), 247 device("v:1", GrConst.EVR640x200, "+ Everex, Graphics Edge", 640, 200, 16), 248 device("v:2", GrConst.EVR640x400, "+ Everex, Graphics Edge", 640, 400, 16), 249 device("v:3", GrConst.EVX800x600, "+ Everex, EVGA EV-673", 800,600, 16), 250 device("f:7", GrConst.FKY1120x750m, "+ Fujitsu, FMRxx, 24 dot",1120,750, 0), 251 device("f:8", GrConst.FKY1120x750, "+ Fujitsu, FMRxx, 24 dot",1120,750, 16), 252 device("f:9", GrConst.FKY640x400, "+ Fujitsu, FMRxx, 16 dot", 640,400, 16), 253 device("g", GrConst.GEN640x480, " Genoa, SuperEGA 4880", 640, 480, 16), 254 device("g:1", GrConst.GEN800x600, "+ Genoa, SuperEGA 4880", 800, 600, 16), 255 device("g:2", GrConst.GEN640x350X, "+ Genoa, SuperVGA 5000", 640, 350, 256), 256 device("g:3", GrConst.GEN640x480X, "+ Genoa, SuperVGA 5000", 640, 480, 256), 257 device("g:4", GrConst.GEN800x600, "+ Genoa, SuperVGA 5000", 800, 600, 16), 258 device("g:5", GrConst.GEN1024x768, "+ Genoa, SuperVGA 5000",1024, 768, 16), 259 device("g:7", GrConst.GEN640x480S, "+ Genoa, SuperVGA 6000", 640, 480, 256), 260 device("g:8", GrConst.GEN1024x768S, "+ Genoa, SuperVGA 6000",1024, 768, 16), 261 device("e:9", GrConst.VESA800x600, "+ Genoa, VESA standard", 800,600, 16), 262 device("h", GrConst.HER720x348, " Hercules, Monographics", 720, 348, 0), 263 device("x:4", GrConst.EXPL320x200, "+ HeadStart Explorer", 320, 200, 16), 264 device("c:1", GrConst.CGA640x200, " IBM, CGA", 640, 200, 2), 265 device("c:2", GrConst.CGA320x200, " IBM, CGA", 320, 200, 4), 266 device("e:1", GrConst.EGAMono, " IBM, EGA", 640, 350, 0), 267 device("e:2", GrConst.EGA320x200, " IBM, EGA", 320, 200, 16), 268 device("e:3", GrConst.EGA640x200, " IBM, EGA", 640, 200, 16), 269 device("e:4", GrConst.EGA640x350, " IBM, EGA", 640, 350, 16), 270 device("e:5", GrConst.MGA640x480, " IBM, MCGA", 640, 480, 2), 271 device("e:6", GrConst.MGA640x350, " IBM, EGA", 640, 350, 2), 272 device("e:7", GrConst.EGA640x480, " IBM, VGA", 640, 480, 16), 273 device("e:8", GrConst.VGA320x200, "+ IBM, VGA (analog)", 320, 200, 256), 274 device("f:4", GrConst.EGA640x350MP, "+ IBM, EGA (planar mode)", 640,350, 16), 275 device("f", GrConst.JRT320x200, "+ IBM, PCjr", 320, 200, 16), 276 device("x:1", GrConst.TTS720x350, "+ IBM, 3270", 720, 350, 2), 277 device("x:2", GrConst.TTS360x350, "+ IBM, 3270", 360, 350, 4), 278 device("m", GrConst.MDS736x1008, "+ MDS, Genius", 736, 1008, 0), 279 device("j:1", GrConst.NEC640x400, "+ NEC, PC-9800/VM", 640, 400, 16), 280 device("j:2", GrConst.MEC640x400, "+ NEC, PC-9800/VM", 640, 400, 2), 281 device("l:6", GrConst.NSI800x600, "+ NSI, Smart EGA/Plus", 800, 600, 16), 282 device("i", GrConst.NNR512x512, "+ Number 9, Revolution", 512, 485, 256), 283 device("i:1", GrConst.OAK800x600, "+ Oak, OTI-067 VGA", 800, 600, 16), 284 device("i:2", GrConst.OAK1024x768, "+ Oak, OTI-067 VGA", 1024, 768, 16), 285 device("i:3", GrConst.OAK640x480X, "+ Oak, OTI-067 VGA", 640, 480, 256), 286 device("k:1", GrConst.OCD640x350X, "+ Orchid, Designer VGA", 640, 350, 256), 287 device("k:2", GrConst.OCD640x480X, "+ Orchid, Designer VGA", 640, 480, 256), 288 device("k:3", GrConst.OCD800x600, "+ Orchid, Designer VGA", 800, 600, 16), 289 device("k:4", GrConst.OCD1024x768, "+ Orchid, Designer VGA", 1024, 768, 16), 290 device("l:2", GrConst.PAR640x480, " Paradise, Autoswitch EGA/480", 640, 480, 16), 291 device("l:3", GrConst.PAR800x600, "+ Paradise, VGA ", 800, 600, 16), 292 device("l:4", GrConst.PAR640x480x, "+ Paradise, VGA Professional", 640, 480, 256), 293 device("l:5", GrConst.PAR1024x768, "+ Paradise, VGA Professional", 1024, 768, 16), 294 device("q:1", GrConst.STB640x350X, "+ Quadram, QuadVGA Spectra", 640, 350, 256), 295 device("q:2", GrConst.STB640x480X, "+ Quadram, QuadVGA Spectra", 640, 480, 256), 296 device("q:3", GrConst.STB800x600, "+ Quadram, QuadVGA Spectra", 800, 600, 16), 297 device("q:4", GrConst.STB1024x768, "+ Quadram, QuadVGA Spectra", 1024, 768, 16), 298 device("d:1", GrConst.SIG640x400, "+ Sigma Design, Color-400", 640, 400, 16), 299 device("d:2", GrConst.SIG1664x1200, "+ Sigma Design, L*View", 1664, 1200, 0), 300 device("d:3", GrConst.SIG1664x1200A, "+ Sigma Design, L*View (A000)", 1664, 1200, 0), 301 device("d:4", GrConst.SIG1664x1200MCA, "+ Sigma Design, L*View (PS/2)", 1664, 1200, 0), 302 device("s:1", GrConst.STB640x352, "+ STB, Graphics Plus-II", 640, 352, 0), 303 device("s:2", GrConst.STB320x200, "+ STB, Graphics Plus-II", 320, 200, 16), 304 device("s:3", GrConst.STB640x200, "+ STB, Graphics Plus-II", 640, 200, 4), 305 device("s:4", GrConst.STB640x400, "+ STB, Graphics Plus-III", 640, 400, 0), 306 device("s:5", GrConst.STB640x350X, "+ STB, VGA Extra/EM", 640, 350, 256), 307 device("s:6", GrConst.STB640x480X, "+ STB, VGA Extra/EM", 640, 480, 256), 308 device("s:7", GrConst.STB800x600, "+ STB, VGA Extra/EM", 800, 600, 16), 309 device("s:8", GrConst.STB1024x768, "+ STB, VGA Extra/EM", 1024, 768, 16), 310 device("o:1", GrConst.TS4640x350x, "+ STB, VGA EM-PLUS", 640, 350, 256), 311 device("o:2", GrConst.TS4640x480x, "+ STB, VGA EM-PLUS", 640, 480, 256), 312 device("o:3", GrConst.STB800x600, "+ STB, VGA EM-PLUS", 800, 600, 16), 313 device("o:4", GrConst.TS4800x600x, "+ STB, VGA EM-PLUS", 800, 600, 256), 314 device("o:5", GrConst.TS41024x768x, "+ STB, VGA EM-PLUS", 1024, 768, 256), 315 device("f", GrConst.JRT320x200, "+ Tandy, 1000 EX", 320, 200, 16), 316 device("t:1", GrConst.TEC720x352, "+ Tecmar, Graphics Master", 720, 352, 0), 317 device("t:2", GrConst.TEC720x704, "+ Tecmar, Graphics Master", 720, 704, 0), 318 device("t:3", GrConst.TEC640x200, "+ Tecmar, Graphics Master", 640, 200, 16), 319 device("t:4", GrConst.TEC640x400, "+ Tecmar, Graphics Master", 640, 400, 16), 320 device("t:5", GrConst.TEC320x200, "+ Tecmar, Graphics Master", 320, 200, 16), 321 device("t:6", GrConst.TEC640x350X, "+ Tecmar, VGA/AD", 640, 350, 256), 322 device("t:7", GrConst.TEC640x480X, "+ Tecmar, VGA/AD", 640, 480, 256), 323 device("t:9", GrConst.TEC800x600, "+ Tecmar, VGA/AD", 800, 600, 16), 324 device("t:10", GrConst.TEC1024x768, "+ Tecmar, VGA/AD", 1024, 768, 16), 325 device("o", GrConst.TOS640x400, " Toshiba, 3100", 640, 400, 0), 326 device("r:1", GrConst.TRI800x600, "+ Trident Impact", 800, 600, 16), 327 device("r:2", GrConst.TRI1024x768, "+ Trident Impact", 1024, 768, 16), 328 device("r:3", GrConst.TRI640x480x, "+ Trident Impact", 640, 480, 256), 329 device("r:4", GrConst.TRI800x600x, "+ Trident Impact", 800, 600, 256), 330 device("r:5", GrConst.TRI1024x768x, "+ Trident Impact", 1024, 768, 256), 331 device("f:5", GrConst.TARG512x482, "+ Truevision, Targa M8", 512,482,256), 332 device("l:1", GrConst.EVA640x480, " Tseng Labs, EVA-480", 640, 480, 16), 333 device("s:5", GrConst.STB640x350X, "+ Tseng Labs 3000 chip", 640, 350, 256), 334 device("s:6", GrConst.STB640x480X, "+ Tseng Labs 3000 chip", 640, 480, 256), 335 device("s:7", GrConst.STB800x600, "+ Tseng Labs 3000 chip", 800, 600, 16), 336 device("s:8", GrConst.STB1024x768, "+ Tseng Labs 3000 chip", 1024, 768, 16), 337 device("o:1", GrConst.TS4640x350x, "+ Tseng Labs 4000 chip", 640, 350, 256), 338 device("o:2", GrConst.TS4640x480x, "+ Tseng Labs 4000 chip", 640, 480, 256), 339 device("o:3", GrConst.STB800x600, "+ Tseng Labs 4000 chip", 800, 600, 16), 340 device("o:4", GrConst.TS4800x600x, "+ Tseng Labs 4000 chip", 800, 600, 256), 341 device("o:5", GrConst.TS41024x768x, "+ Tseng Labs 4000 chip", 1024, 768, 256), 342 device("e:9", GrConst.VESA800x600, "+ VESA, VGA", 800,600, 16), 343 device("u:3", GrConst.VGA720x540, "+ Video Seven, FastWrite VGA", 720, 540, 16), 344 device("u:4", GrConst.VGA800x600, "+ Video Seven, FastWrite VGA", 800, 600, 16), 345 device("u:5", GrConst.VGA640x480X, "+ Video Seven, FastWrite VGA", 640, 480,256), 346 device("u:1", GrConst.VGA640x480, " Video Seven, VEGA/Deluxe", 640, 480, 16), 347 device("u:2", GrConst.VGA752x410, "+ Video Seven, VEGA/Deluxe", 752, 410, 16), 348 device("u:3", GrConst.VGA720x540, "+ Video Seven, VEGA VGA", 720, 540, 16), 349 device("u:4", GrConst.VGA800x600, "+ Video Seven, VEGA VGA", 800, 600, 16), 350 device("u:5", GrConst.VGA640x480X, "+ Video Seven, VGA 1024i", 640, 480, 256), 351 device("u:3", GrConst.VGA720x540, "+ Video Seven, VGA 1024i", 720, 540, 16), 352 device("u:4", GrConst.VGA800x600, "+ Video Seven, VGA 1024i", 800, 600, 16), 353 device("u:7", GrConst.VGA1024x768, "+ Video Seven, VGA 1024i", 1024, 768, 16), 354 device("u:5", GrConst.VGA640x480X, "+ Video Seven, VRAM VGA", 640, 480,256), 355 device("u:3", GrConst.VGA720x540, "+ Video Seven, VRAM VGA", 720, 540, 16), 356 device("u:4", GrConst.VGA800x600, "+ Video Seven, VRAM VGA", 800, 600, 16), 357 device("u:6", GrConst.VGA1024x768x2, "+ Video Seven, VRAM VGA", 1024, 768, 2), 358 device("w:1", GrConst.WYS640x400, " Wyse, WY-700", 640, 400, 0), 359 device("w:2", GrConst.WYS1280x400, "+ Wyse, WY-700", 1280, 400, 0), 360 device("w:3", GrConst.WYS1280x800, "+ Wyse, WY-700", 1280, 800, 0), 361 device("", 0, "** No Graphics Device Located **", 0, 0, 0) 362 ); 363 (*%E SMALLMENU *) 364 365 iDev = iDevTab ( 366 (* ("m:b", MsMouse, "Microsoft bus mouse", 0, 0, -1), *) 367 device("m:d", GrConst.MsDriver, "MS DOS mouse driver", 0, 0, -1), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 368 device("m:1", GrConst.MsCOM1, "Microsoft mouse, COM1", 0, 0, -1), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 369 device("m:2", GrConst.MsCOM2, "Microsoft mouse, COM2", 0, 0, -1), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 370 device("1", 1, "Logitech/Mouse Systems mouse, COM1", 0, 0, -1), ***** ^ not supported yet ***** ^ not supported yet 371 device("2", 2, "Logitech/Mouse Systems mouse, COM2", 0, 0, -1), ***** ^ not supported yet ***** ^ not supported yet 372 device("m:f", GrConst.FKYMsDriver, "Fujitsu DOS mouse driver", 0, 0, -1), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 373 device("", 0, "** No Input Device Located **", 0, 0, 0) ***** ^ not supported yet ***** ^ not supported yet 374 ); 375 376 VAR 377 line: ARRAY[0..GRQMAXLEN] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 378 str, buf: ARRAY[0..GRQLINLEN] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 379 txtAttrVal: txAttr; ***** ^ not supported yet 380 381 382 PROCEDURE GrQuit(Msg: ARRAY OF CHAR; Val: SHORTCARD); ***** ^ not supported yet 383 VAR 384 i: INTEGER; 385 BEGIN 386 i := Meta.QueryError(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 387 388 Meta.StopMouse(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 389 Meta.StopEvent(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 390 Meta.SetDisplay(GrConst.TextPg0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 391 Meta.ClearText(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 392 393 IF (i # 0) THEN 394 IO.WrStr('QueryError = '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 395 IO.WrInt(i DIV 128, 3); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 396 IO.WrStr('/'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 397 IO.WrInt(i MOD 128, 3); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 398 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 399 END; 400 401 IF Msg[0] = CHR(0) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 402 IO.WrStr('Normal end of program.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 403 ELSE 404 IO.WrStr(Msg); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 405 END; 406 407 Lib.SetReturnCode(Val); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 408 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 409 HALT ***** ^ undeclared identifier 410 END GrQuit; ***** ^ not supported yet 411 412 (*%F GRQtrim *) 413 414 (******************************************************************************) 415 (* PC direct BIOS calls. These routines implement the standard text *) 416 (* functions for GotoXY, setting Attributes, scrolling text, and outputing a *) 417 (* character. A typical 80x25 text screen has coordinates of 0, 0 (min) *) 418 (* to 79, 24 (max). *) 419 (******************************************************************************) 420 421 (*#save, 422 call(reg_param=>(ax, bx, cx, dx) 423 reg_saved=>(ax, bx, cx, dx, si, di, es, ds, st1, st2), 424 inline=>on) 425 *) 426 427 TYPE 428 DoScrollCODE = ARRAY[0..1] OF SHORTCARD; 429 430 PROCEDURE doScroll(ax, bx, cx, dx: CARDINAL) = 431 DoScrollCODE( 432 0CDH, 010H (* int 10H *) 433 ); 434 435 (*#restore *) 436 437 PROCEDURE txtScroll(dir, sx, sy, ex, ey, dist: CARDINAL); 438 (*** PC-BIOS scroll routine. Moves a block of text up or down. ***) 439 BEGIN 440 doScroll((dir << 8) + dist, txtAttrVal.normal, (sy << 8) + sy, (ey << 8) + ex); 441 END txtScroll; 442 443 (*#save, 444 call(reg_param=>() 445 reg_saved=>(bx, cx, dx, si, di, es, ds, st1, st2), 446 reg_return=>(ax), 447 near_call=>on) 448 *) 449 450 TYPE 451 TxtMonoCODE = ARRAY[0..12] OF SHORTCARD; 452 453 PROCEDURE txtMono(): BOOLEAN = 454 TxtMonoCODE( 455 0CDH, 011H, (* int 11H *) 456 025H, 030H, 00H, (* and ax, 30H *) 457 0A9H, 030H, 00H, (* test ax, 30H *) 458 074H, 002H, (* je true *) 459 033H, 0C0H, (* xor ax, ax *) 460 0C3H (* true: ret 0 *) 461 ); 462 463 (*#restore *) 464 465 (*#save, 466 call(reg_param=>(bx, cx, ax, dx) 467 reg_saved=>(bx, si, di, es, ds, st1, st2), 468 near_call=>on) 469 *) 470 471 TYPE 472 TxtAttrCODE = ARRAY[0..10] OF SHORTCARD; 473 474 PROCEDURE txtAttr(attrib, sx, sy, ex: CARDINAL) = 475 TxtAttrCODE( 476 08AH, 0E8H, (* mov ch, al *) 477 08AH, 0F0H, (* mov dh, al *) 478 033H, 0C0H, (* xor ax, ax *) 479 0B4H, 006H, (* mov ah, 6H *) 480 0CDH, 010H, (* int 10H *) 481 0C3H (* ret *) 482 ); 483 484 (*#restore *) 485 486 (*#save, 487 call(reg_param=>(ax), 488 reg_saved=>(cx, dx, si, di, es, ds, st1, st2), 489 near_call=>on) 490 *) 491 492 TYPE 493 TxtChoutCODE = ARRAY[0..6] OF SHORTCARD; 494 495 PROCEDURE txtChOut(ch: BYTE) = 496 TxtChoutCODE( 497 0B4H, 00EH, (* mov ah, 0EH *) 498 032H, 0FFH, (* xor bh, bh *) 499 0CDH, 010H, (* int 10H *) 500 0C3H (* ret *) 501 ); 502 503 (*#restore *) 504 505 506 (*#save, 507 call(reg_param=>(dx, ax), 508 reg_saved=>(cx, si, di, es, ds, st1, st2), 509 near_call=>on) 510 *) 511 512 TYPE TxtXYCODE = ARRAY[0..8] OF SHORTCARD; 513 514 PROCEDURE txtXY(x, y: CARDINAL) = 515 TxtXYCODE( 516 08AH, 0F0H, (* mov dh, al *) 517 0B4H, 002H, (* mov ah, 2H *) 518 032H, 0FFH, (* xor bh, bh *) 519 0CDH, 010H, (* int 10H *) 520 0C3H (* ret *) 521 ); 522 (*#restore *) 523 524 (*#save, 525 call(reg_param=>(), 526 reg_saved=>(bx, si, di, es, ds, st1, st2), 527 reg_return=>(dx), 528 near_call=>on) 529 *) 530 TYPE 531 Time55CODE = ARRAY[0..4] OF SHORTCARD; 532 533 PROCEDURE time55(): CARDINAL = 534 Time55CODE( 535 033H, 0C0H, (* xor ax, ax *) 536 0CDH, 01AH, (* int 1AH *) 537 0C3H (* ret *) 538 ); 539 (*#restore *) 540 541 542 PROCEDURE txtFrame(sx, sy, ex, ey: CARDINAL); 543 (*** Draw a text frame. ***) 544 VAR 545 i: CARDINAL; 546 BEGIN 547 (*** Draw horizontal lines. ***) 548 FOR i := sx + 1 TO ex DO 549 txtXY(i, sy); 550 txtChOut(HORZLINE); 551 txtXY(i, ey); 552 txtChOut(HORZLINE) 553 END; 554 555 (*** Draw vertical lines. ***) 556 FOR i := sy + 1 TO ey DO 557 txtXY(sx, i); 558 txtChOut(VERTLINE); 559 txtXY(ex, i); 560 txtChOut(VERTLINE) 561 END; 562 563 (*** Place corners. ***) 564 txtXY(sx, sy); 565 txtChOut(LEFTTCORN); 566 567 txtXY(ex, sy); 568 txtChOut(RIGHTTCORN); 569 570 txtXY(sx, ey); 571 txtChOut(LEFTBCORN); 572 573 txtXY(ex, ey); 574 txtChOut(RIGHTBCORN) 575 END txtFrame; 576 577 578 PROCEDURE txtBar(sx, sy, ex: CARDINAL); 579 (*** Draw a horizontal bar with T connectors on each end. ***) 580 VAR 581 i: CARDINAL; 582 BEGIN 583 584 FOR i := sx + 1 TO ex DO 585 txtXY(i, sy); 586 txtChOut(HORZLINE) 587 END; 588 589 txtXY(sx, sy); 590 txtChOut(LEFTTEE); 591 txtXY(ex, sy); 592 txtChOut(RIGHTTEE) 593 END txtBar; 594 595 596 PROCEDURE bPrint(msg: ARRAY OF CHAR); 597 (*** Print a string of text, bypassing DOS. ***) 598 VAR 599 i: CARDINAL; 600 BEGIN 601 i := 0; 602 603 WHILE (msg[i] # CHR(0)) DO 604 txtChOut(msg[i]); 605 INC(i) 606 END 607 END bPrint; 608 609 610 PROCEDURE txtTitle(msg: ARRAY OF CHAR; y: CARDINAL); 611 (*** Print msg - centered and hilite. ***) 612 VAR 613 i, x: CARDINAL; 614 BEGIN 615 i := Str.Length(msg); 616 x := (GRQLINLEN - i) DIV 2; 617 txtAttr(txtAttrVal.hilite, x, y, x + i - 1); 618 txtXY(x, y); 619 bPrint(msg) 620 END txtTitle; 621 622 623 PROCEDURE getKey(VAR s, a: CHAR); 624 (*** Get extended keys - returns scancode and ascii value in passed ***) 625 (*** parameters. Sets the first value with the scan code, the second ***) 626 (*** with the ASCII code. ***) 627 BEGIN 628 a := IO.RdKey(); 629 630 IF (a # CHR(0)) THEN 631 (*** if ASCII, null scan code ***) 632 s := CHR(0) 633 ELSE 634 (*** If first code is null, there is a scan code waiting. ***) 635 s := IO.RdKey() 636 END 637 END getKey; 638 639 640 PROCEDURE Qbeep(); 641 (*** Ring da bell. ***) 642 BEGIN 643 IO.WrChar(CHR(7H)) 644 END Qbeep; 645 646 647 PROCEDURE dispItem(devptr: ARRAY OF device; item, max_item: CARDINAL; line: ARRAY OF CHAR; dosout: BOOLEAN); 648 (*** Display device line item. dosout is a flag to use dos or bypass it ***) 649 (*** for the BIOS call. ***) 650 VAR 651 OK : BOOLEAN; 652 i, j: CARDINAL; 653 dev: device; 654 BEGIN 655 656 IF (item > max_item) OR (item < 0) THEN 657 (*** Don't go off the end of the list. ***) 658 RETURN 659 END; 660 661 dev := devptr[item]; 662 663 FOR i := 0 TO GRQLINLEN DO 664 line[i] := ' ' 665 END; 666 667 (* see if its a graphics card *) 668 IF (dev.devcolors > -1) THEN 669 Str.Insert(line, '-', 1); 670 Str.Insert(line, dev.devslash, 2); 671 Str.Insert(line, dev.devdesc, 11); 672 Str.IntToStr(LONGINT(dev.devhres), buf, 10, OK); 673 Str.Insert(line, buf, 45); 674 Str.Insert(line, ' x ', 50); 675 Str.IntToStr(LONGINT(dev.devvres), buf, 10, OK); 676 Str.Insert(line, buf, 53); 677 IF (dev.devcolors = 0) THEN 678 Str.Insert(line, 'monochrome', 60) 679 ELSE 680 Str.IntToStr(LONGINT(dev.devcolors), buf, 10, OK); 681 Str.Insert(line, buf, 60) 682 END; 683 line[71] := CHR(0) 684 ELSE 685 (*** Input device. ***) 686 Str.Insert(line, '-', 1); 687 Str.Insert(line, dev.devslash, 2); 688 Str.Insert(line, dev.devdesc, 11); 689 line[50] := CHR(0) 690 END; 691 692 IF (dosout) THEN 693 IO.WrStr(line) 694 ELSE 695 bPrint(line) 696 END; 697 698 END dispItem; 699 700 701 PROCEDURE viewList(devptr: ARRAY OF device; curDev: CARDINAL; mouse: BOOLEAN): CARDINAL; 702 (*** Menu device selection - uses cursor keys to select. ***) 703 VAR 704 choosing, refrsh: BOOLEAN; 705 x, y, 706 page_head, (* top of page *) 707 page_len, (* number of lines on page *) 708 cur_select, (* the initial selection number *) 709 tail_sel, (* how many selections are there *) 710 cy, (* the cursor position *) 711 ex: CARDINAL; (* the length of the bar (calculated) *) 712 s, a: CHAR; 713 i: CARDINAL; 714 BEGIN 715 page_head := 0; 716 page_len := GrQLines - 6; 717 718 (*** Set menu x, y position. ***) 719 720 y := 4; 721 722 IF (mouse) THEN 723 x := 10; 724 ELSE 725 x := 5; 726 END; 727 728 (*** Clear screen. ***) 729 730 txtScroll(SUP, 0, 0, 79, 24, 0); 731 732 (*** Make menu screen. ***) 733 734 txtFrame(1, 1, 78, GrQLines - 2); 735 txtBar(1, 3, 78); 736 737 txtAttr(txtAttrVal.hilite, 9, GrQLines - 1, 68); 738 txtXY(9, GrQLines - 1); 739 bPrint('Cursor keys [] -> move, [Ù] -> select, [Esc] -> Abort'); 740 741 IF (mouse) THEN 742 txtTitle('Select Input Device', 0); 743 txtXY(x - 2, y - 2); 744 bPrint('Cmd Line Pointing Device '); 745 (*** Set line length. ***) 746 ex := 54 747 ELSE 748 txtTitle('Select Display Device/Mode', 0); 749 txtXY(x - 2, y - 2); 750 bPrint('Cmd Line Graphics Device Resolution Colors '); 751 ex := 74 752 END; 753 754 (*** Find the number of entries in menu. ***) 755 756 tail_sel := HIGH(devptr); 757 758 (*** Set max page length - fewer items will simply shrink 'page'. ***) 759 760 IF tail_sel < page_len THEN 761 page_len := tail_sel + 1 762 END; 763 764 (*** Set current selection, ie default entry. ***) 765 766 IF curDev > tail_sel THEN 767 cur_select := 0 768 ELSE 769 cur_select := curDev 770 END; 771 772 (*** Set the select bar position. ***) 773 774 cy := y; 775 776 IF (cur_select # 0) THEN 777 IF (cur_select > (page_len DIV 2)) THEN 778 (*** Position cursor in the middle. ***) 779 INC(cy, (page_len DIV 2)); 780 page_head := cur_select - (page_len DIV 2) 781 ELSE 782 INC(cy, cur_select) 783 END 784 END; 785 786 choosing := TRUE; 787 refrsh := TRUE; 788 789 WHILE (choosing) DO 790 (*** Where the bar is on the page. ***) 791 792 IF (NOT refrsh) THEN 793 txtAttr(txtAttrVal.inverse, x, cy, ex) 794 END; 795 796 (*** Rewrite entire page. ***) 797 798 IF (refrsh) THEN 799 FOR i := 0 TO page_len - 1 DO 800 txtXY(x, y + i); 801 IF (y + i = cy) THEN 802 txtAttr(txtAttrVal.inverse, x, cy, ex) 803 END; 804 dispItem(devptr, page_head + i, tail_sel, str, FALSE) 805 END; 806 refrsh := FALSE; 807 ELSE 808 (*** Just moved bar. ***) 809 txtXY(x, cy); 810 dispItem(devptr, cur_select, tail_sel, str, FALSE) 811 END; 812 813 (*** Get cursor out of way. ***) 814 815 txtXY(0, GrQLines - 1); 816 getKey(s, a); 817 818 (*** Escape. ***) 819 820 IF (a = CHR(kESC)) THEN 821 GrQuit(GRQQUITSTR, 9) 822 END; 823 824 (*** Made a choice. ***) 825 826 IF (a = CHR(kCR)) THEN 827 RETURN cur_select 828 END; 829 830 txtAttr(txtAttrVal.normal, x, cy, ex); 831 txtXY(x, cy); 832 dispItem(devptr, cur_select, tail_sel, str, FALSE); 833 834 CASE s OF 835 | CHR(UP_arr), CHR(LF_arr): 836 IF (cur_select > 0) THEN 837 DEC(cur_select); 838 IF (cy > y) THEN 839 DEC(cy) 840 ELSE 841 (*** Top of page; move up one line. ***) 842 IF (page_head > 0) THEN 843 DEC(page_head); 844 txtScroll(SDOWN, x, y, ex, y + page_len - 1, 1) 845 END 846 END 847 END; 848 | CHR(DN_arr), CHR(RT_arr): 849 IF (cur_select < tail_sel) THEN 850 INC(cur_select); 851 IF (cy < (page_len + y - 1)) THEN 852 INC(cy) 853 ELSE 854 (*** Bottom of page; move down one line. ***) 855 IF (page_head < tail_sel) THEN 856 INC(page_head); 857 txtScroll(SUP, x, y, ex, y+page_len-1, 1) 858 END 859 END 860 END; 861 | CHR(Home): 862 IF (cur_select > 0) THEN 863 (*** Set page, select, to 0 and set cursor bar. ***) 864 page_head := 0; 865 cur_select := 0; 866 cy := y; 867 refrsh := TRUE 868 END; 869 | CHR(End): 870 IF (cur_select < tail_sel) THEN 871 (*** Set page, select, and set cursor bar. ***) 872 page_head := tail_sel - page_len + 1; 873 cur_select := tail_sel; 874 cy := page_len + y - 1; 875 refrsh := TRUE 876 END; 877 | CHR(PgDn): 878 IF (cur_select < tail_sel) THEN 879 INC(page_head, page_len); 880 INC(cur_select, page_len); 881 IF (page_head + page_len > tail_sel + 1) OR (cur_select > tail_sel) THEN 882 page_head := tail_sel + 1 - page_len; 883 cur_select := tail_sel; 884 cy := page_len + y - 1; 885 END; 886 refrsh := TRUE 887 END; 888 | CHR(PgUp): 889 IF (cur_select > 0) THEN 890 IF (page_head < page_len) OR (cur_select < page_len) THEN 891 page_head := 0; 892 cy := y; 893 cur_select:= 0 894 ELSE 895 DEC(page_head, page_len); 896 DEC(cur_select, page_len); 897 END; 898 refrsh := TRUE 899 END 900 ELSE 901 Qbeep() 902 END 903 END; 904 RETURN 0 905 END viewList; 906 907 908 PROCEDURE grQMenu(VAR GrafixCard, CommPort: INTEGER); 909 (*** Allow menu selection of desired devices. ***) 910 VAR 911 i, inum, onum, x, y: CARDINAL; 912 ktime: CARDINAL; 913 z, w: CHAR; 914 OK: BOOLEAN; 915 BEGIN 916 LOOP 917 918 (*** Find display adapter info. ***) 919 920 onum := 0; 921 922 WHILE (oDev[onum].devnum # 0) AND (oDev[onum].devnum # GrafixCard) DO 923 INC(onum) 924 END; 925 926 (*** Find input device info. ***) 927 928 inum := 0; 929 930 WHILE (iDev[inum].devnum # 0) AND (iDev[inum].devnum # CommPort) DO 931 INC(inum) 932 END; 933 934 (*** Clear screen. ***) 935 936 txtScroll(SUP, 0, 0, 79, 24, 0); 937 938 txtFrame(1, 1, 78, GrQLines - 2); 939 txtBar(1, 3, 78); 940 941 y := 0; 942 txtTitle(GRQHDRSTR, y); 943 944 INC(y, 2); 945 txtTitle(GRQTITLE, y); 946 947 (*** Print MetaWINDOW version. ***) 948 949 Str.Copy(line, '-[ '); 950 Meta.MetaVersion(buf); 951 Str.Append(line, buf); 952 Str.Append(line, ' ]-'); 953 txtTitle(line, GrQLines - 1); 954 955 x := 4; 956 y := 5; 957 958 txtXY(x, y); 959 960 (*** Display graphics device. ***) 961 962 FOR i := 0 TO GRQLINLEN DO 963 line[i] := ' ' 964 END; 965 966 IF (GrafixCard # 0) THEN 967 bPrint('Display Device / Mode:'); 968 Str.Copy(line, oDev[onum].devdesc); 969 Str.IntToStr(LONGINT(oDev[onum].devhres), buf, 10, OK); 970 Str.Append(line, ', '); 971 Str.Append(line, buf); 972 Str.Append(line, 'x'); 973 Str.IntToStr(LONGINT(oDev[onum].devvres), buf, 10, OK); 974 Str.Append(line, buf); 975 IF (oDev[onum].devcolors = 0) THEN 976 Str.Append(line, ' monochrome') 977 ELSE 978 Str.Append(line, ' '); 979 Str.IntToStr(LONGINT(oDev[onum].devcolors), buf, 10, OK); 980 Str.Append(line, buf); 981 Str.Append(line, ' color') 982 END; 983 984 txtAttr(txtAttrVal.hilite, x + 23, y, Str.Length(line) + x + 25); 985 txtXY(x + 23, y); 986 bPrint(line) 987 ELSE 988 txtAttr(txtAttrVal.hilite, x, y, Str.Length(oDev[onum].devdesc) + x); 989 bPrint(oDev[onum].devdesc) 990 END; 991 992 (*** Display input device. ***) 993 994 INC(y, 2); 995 txtXY(x, y); 996 bPrint('Input Device or Mouse:'); 997 998 txtAttr(txtAttrVal.hilite, x + 23, y, Str.Length(iDev[inum].devdesc) + x + 25); 999 txtXY(x + 23, y); 1000 bPrint(iDev[inum].devdesc); 1001 1002 INC(y, 3); 1003 txtXY(x, y); 1004 txtAttr(txtAttrVal.hilite, x, y, x + 3); 1005 bPrint('[D] -> choose an alternate Display.'); 1006 1007 INC(y, 2); 1008 txtXY(x, y); 1009 txtAttr(txtAttrVal.hilite, x, y, x + 3); 1010 bPrint('[I] -> choose an alternate Input device or mouse.'); 1011 1012 INC(y, 2); 1013 txtXY(x, y); 1014 txtAttr(txtAttrVal.hilite, x, y, x + 5); 1015 bPrint('[Esc] -> Escape to DOS.'); 1016 1017 INC(y, 2); 1018 txtXY(x, y); 1019 txtAttr(txtAttrVal.hilite, x, y, x + 7); 1020 bPrint('[other] -> accept defaults'); 1021 1022 INC(y, 3); 1023 txtXY(x, y); 1024 bPrint('Choice ? [ ]'); 1025 txtXY(x + 12, y); 1026 1027 (*** Wait for a key or timeout. ***) 1028 1029 ktime := time55(); 1030 1031 LOOP 1032 IF (time55() > ktime + GRQDELAY) THEN 1033 Meta.ClearText(); 1034 txtXY(0, 0); 1035 RETURN 1036 END; 1037 IF (IO.KeyPressed()) THEN 1038 EXIT 1039 END 1040 END; 1041 1042 (*** Get a key and process. ***) 1043 1044 getKey(z, w); 1045 1046 CASE w OF 1047 | CHR(kESC): 1048 (*** Escape key. ***) 1049 GrQuit(GRQQUITSTR, 9) 1050 | 'D', 'd': 1051 i := viewList(oDev, onum, FALSE); 1052 GrafixCard := oDev[i].devnum 1053 | 'I', 'i': 1054 i := viewList(iDev, inum, TRUE); 1055 CommPort := iDev[i].devnum 1056 ELSE 1057 (*** Any other key accepts choice. ***) 1058 Meta.ClearText(); 1059 txtXY(0, 0); 1060 RETURN 1061 END 1062 END 1063 END grQMenu; 1064 (*%E GRQtrim = FALSE *) 1065 1066 (*%T GRQtrim *) 1067 1068 PROCEDURE dumpList(); 1069 (*** Print the entire device list. ***) 1070 VAR 1071 i, j: CARDINAL; 1072 OK : BOOLEAN; 1073 BEGIN 1074 1075 Meta.MetaVersion(line); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1076 1077 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1078 IO.WrStr(line); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1079 1080 IO.WrLn(); IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1081 IO.WrStr(' Output Devices (Displays)'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1082 IO.WrLn(); IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1083 1084 IO.WrStr('Cmd Line Graphics Device Resolution Colors '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1085 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1086 IO.WrStr('======================================================================'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1087 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1088 1089 FOR i := 0 TO HIGH(oDev) DO ***** ^ undeclared identifier ***** ^ not supported yet 1090 FOR j := 0 TO GRQLINLEN DO 1091 line[j] := ' ' ***** ^ not supported yet ***** ^ not supported yet 1092 END; 1093 1094 Str.Insert(line, '-', 1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1095 Str.Insert(line, oDev[i].devslash, 2); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1096 Str.Insert(line, oDev[i].devdesc, 11); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1097 Str.IntToStr(LONGINT(oDev[i].devhres), buf, 10, OK); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1098 Str.Insert(line, buf, 45); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1099 Str.Insert(line, ' x ', 50); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1100 Str.IntToStr(LONGINT(oDev[i].devvres), buf, 10, OK); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1101 Str.Insert(line, buf, 53); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1102 IF (oDev[i].devcolors = 0) THEN ***** ^ not supported yet ***** ^ not supported yet 1103 Str.Insert(line, 'monochrome', 60); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1104 ELSE 1105 Str.IntToStr(LONGINT(oDev[i].devcolors), buf, 10, OK); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1106 Str.Insert(line, buf, 60); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1107 END; 1108 1109 line[70] := CHR(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1110 1111 IO.WrStr(line); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1112 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1113 END; 1114 1115 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1116 IO.WrStr(' Input Devices (Mouse)'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1117 IO.WrLn(); IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1118 IO.WrStr('Cmd Line Pointing Device '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1119 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1120 IO.WrStr('======================================================================'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1121 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1122 1123 FOR i := 0 TO HIGH(iDev) DO ***** ^ undeclared identifier ***** ^ not supported yet 1124 FOR j := 0 TO GRQLINLEN DO 1125 line[j] := ' ' ***** ^ not supported yet ***** ^ not supported yet 1126 END; 1127 1128 Str.Insert(line, '-', 1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1129 Str.Insert(line, iDev[i].devslash, 2); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1130 Str.Insert(line, iDev[i].devdesc, 11); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1131 line[50] := CHR(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1132 IO.WrStr(line); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1133 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1134 END; 1135 1136 Lib.SetReturnCode(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1137 HALT ***** ^ undeclared identifier 1138 END dumpList; ***** ^ not supported yet 1139 1140 (*%E GRQtrim = TRUE *) 1141 1142 PROCEDURE grQParse(VAR GrafixCard, CommPort: INTEGER): BOOLEAN; 1143 (*** Parse the command line or METAPARM environment variable for options. ***) 1144 (*** Sets global GrafixCard and CommPort to selection if any. ***) 1145 (*** Returns True if the /; option present, else returns False ***) 1146 VAR 1147 pass: BOOLEAN; 1148 i, dev: CARDINAL; 1149 choice: BOOLEAN; 1150 j, k: CARDINAL; 1151 BEGIN 1152 line[0] := CHR(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1153 1154 Meta.GetCmdLine(line); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1155 1156 (*** Is there a command line choice? ***) 1157 1158 choice := FALSE; 1159 1160 i := 0; 1161 1162 LOOP 1163 IF (line[i] = CHR(0)) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1164 EXIT 1165 END; 1166 IF ((line[i] = '-') OR (line[i] = '/')) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1167 choice := TRUE; 1168 EXIT 1169 END; 1170 INC(i) ***** ^ undeclared identifier ***** ^ not supported yet 1171 END; 1172 1173 (*** NULL terminate line. ***) 1174 1175 line[GRQMAXLEN] := CHR(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1176 1177 (*** If no cmd line, is there an environment var? ***) 1178 1179 IF (NOT choice) THEN 1180 Lib.EnvironmentFind("METAPARM", line) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1181 END; 1182 1183 (*** Force to upper case, remove spaces. ***) 1184 1185 Str.Lows(line); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1186 1187 (*** Process each option on the line. ***) 1188 1189 (*** Set bypass menu to FALSE. ***) 1190 1191 pass := FALSE; 1192 1193 i := 0; 1194 1195 LOOP 1196 WHILE (line[i] # CHR(0)) AND (line[i] # '/') AND (line[i] # '-') DO ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1197 INC(i) ***** ^ undeclared identifier ***** ^ not supported yet 1198 END; 1199 1200 IF (line[i] = CHR(0)) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1201 EXIT 1202 END; 1203 1204 INC(i); ***** ^ undeclared identifier ***** ^ not supported yet 1205 1206 (*%T GRQtrim *) 1207 IF line[i] = '?' THEN ***** ^ not supported yet ***** ^ not supported yet 1208 dumpList() ***** ^ not supported yet ***** ^ not supported yet 1209 END; 1210 (*%E GRQtrim = TRUE *) 1211 1212 IF line[i] = ';' THEN ***** ^ not supported yet ***** ^ not supported yet 1213 pass := TRUE 1214 END; 1215 1216 (*** Table look up for each output device. ***) 1217 1218 dev := 0; 1219 1220 WHILE (GrafixCard = 0) AND (dev <= HIGH(oDev)) DO ***** ^ undeclared identifier ***** ^ not supported yet 1221 j := 0; 1222 WITH oDev[dev] DO ***** ^ not supported yet 1223 WHILE (devslash[j] = line[i+j]) AND (devslash[j] # CHR(0)) DO ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1224 INC(j) ***** ^ undeclared identifier ***** ^ not supported yet 1225 END; 1226 1227 IF (devslash[j] = CHR(0)) AND (line[i+j] # ':') THEN ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1228 GrafixCard := devnum; ***** ^ undeclared identifier 1229 INC(i, j); ***** ^ undeclared identifier ***** ^ not supported yet 1230 END; 1231 END; ***** ^ not supported yet 1232 INC(dev) ***** ^ undeclared identifier ***** ^ undeclared identifier 1233 END; 1234 1235 (*** Table look up for each input device. ***) 1236 1237 dev := 0; ***** ^ undeclared identifier 1238 1239 WHILE (CommPort = 0) AND (dev <= HIGH(iDev)) DO ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ not supported yet 1240 j := 0; ***** ^ undeclared identifier 1241 WITH iDev[dev] DO ***** ^ undeclared identifier 1242 WHILE (devslash[j] = line[i+j]) AND (devslash[j] # CHR(0)) DO ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ not supported yet 1243 INC(j) ***** ^ undeclared identifier ***** ^ undeclared identifier 1244 END; 1245 1246 IF (devslash[j] = CHR(0)) AND (line[i+j] # ':') THEN ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ undeclared identifier 1247 CommPort := devnum; ***** ^ undeclared identifier ***** ^ undeclared identifier 1248 INC(i, j); ***** ^ undeclared identifier ***** ^ undeclared identifier ***** ^ undeclared identifier 1249 END; 1250 END; ***** ^ not supported yet 1251 INC(dev) ***** ^ undeclared identifier ***** ^ undeclared identifier 1252 END; 1253 END; 1254 RETURN pass ***** ^ undeclared identifier 1255 END grQParse; ***** ^ not supported yet 1256 1257 1258 PROCEDURE bitAnd(A1, A2: CARDINAL) : CARDINAL; 1259 (*** Return the bitwise and of the two parameters. ***) 1260 BEGIN 1261 RETURN CARDINAL(BITSET(A1) * BITSET(A2)) ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1262 END bitAnd; ***** ^ not supported yet 1263 1264 1265 PROCEDURE GrInit(VAR GrafixCard, CommPort: INTEGER); 1266 (*** Use QueryGrafix() and QueryCom() to try and determine the devices ***) 1267 (*** currently in use. As a safety measure GrafixCard and CommPort are ***) 1268 (*** initialised to 0. ***) 1269 VAR qGraf, qComm: INTEGER; 1270 BEGIN 1271 (*** Initialise GrafixCard and CommPort to 0. ***) 1272 1273 GrafixCard := 0; 1274 CommPort := 0; 1275 1276 (*** Is the driver loaded ? ***) 1277 1278 qComm := Meta.QueryComm(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1279 1280 IF (qComm < 0) THEN 1281 GrInitErr(GrafixCard, CommPort, qComm) ***** ^ undeclared identifier ***** ^ not supported yet 1282 END; 1283 1284 (*** Use QueryGrafix() to determine GrafixCard. ***) 1285 1286 qGraf := Meta.QueryGrafix(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1287 1288 CASE qGraf OF 1289 GrConst.EXPL320x200, ***** ^ not supported yet ***** ^ not supported yet 1290 GrConst.SP768x1008, ***** ^ not supported yet ***** ^ not supported yet 1291 GrConst.SP768x1008A, ***** ^ not supported yet ***** ^ not supported yet 1292 GrConst.COR1280x960, ***** ^ not supported yet ***** ^ not supported yet 1293 GrConst.COR1280x960A, ***** ^ not supported yet ***** ^ not supported yet 1294 GrConst.COR1280x1024, ***** ^ not supported yet ***** ^ not supported yet 1295 GrConst.COR1280x1024A, ***** ^ not supported yet ***** ^ not supported yet 1296 GrConst.COR1600x1280DP, ***** ^ not supported yet ***** ^ not supported yet 1297 GrConst.COR1600x1280DPA, ***** ^ not supported yet ***** ^ not supported yet 1298 GrConst.COR1600x1280MCA, ***** ^ not supported yet ***** ^ not supported yet 1299 GrConst.SIG1664x1200MCA, ***** ^ not supported yet ***** ^ not supported yet 1300 GrConst.FKY1120x750, ***** ^ not supported yet ***** ^ not supported yet 1301 GrConst.FKY640x400, ***** ^ not supported yet ***** ^ not supported yet 1302 GrConst.NDI640x480x4D, ***** ^ not supported yet ***** ^ not supported yet 1303 GrConst.HP1024x768x4, ***** ^ not supported yet ***** ^ not supported yet 1304 GrConst.GRX1024x768x4A, ***** ^ not supported yet ***** ^ not supported yet 1305 GrConst.NEC640x400: GrafixCard := qGraf ***** ^ not supported yet ***** ^ not supported yet 1306 ELSE 1307 IF (bitAnd(qGraf, GrConst.VGA640x480) = GrConst.VGA640x480) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1308 (*** Vega Deluxe. ***) 1309 IF (bitAnd(qGraf, 0030H) = 0010H) THEN ***** ^ not supported yet ***** ^ not supported yet 1310 GrafixCard := GrConst.EGAMono ***** ^ not supported yet ***** ^ not supported yet 1311 ELSE 1312 GrafixCard := GrConst.EGA640x350 ***** ^ not supported yet ***** ^ not supported yet 1313 END 1314 ELSIF (bitAnd(qGraf, GrConst.EVA640x480) = GrConst.EVA640x480) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1315 (*** Tseng Labs EVA/480. ***) 1316 IF (bitAnd(qGraf, 0030H) = 0010H) THEN ***** ^ not supported yet ***** ^ not supported yet 1317 GrafixCard := GrConst.EGAMono ***** ^ not supported yet ***** ^ not supported yet 1318 ELSE 1319 GrafixCard := GrConst.EGA640x350 ***** ^ not supported yet ***** ^ not supported yet 1320 END 1321 ELSIF bitAnd(qGraf, GrConst.EGAMono) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1322 IF bitAnd(qGraf, 0100H) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet 1323 (*** IBM PS/2 ***) 1324 IF bitAnd(qGraf, 10H) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet 1325 GrafixCard := GrConst.MGA640x480 ***** ^ not supported yet ***** ^ not supported yet 1326 ELSE 1327 GrafixCard := GrConst.EGA640x480 ***** ^ not supported yet ***** ^ not supported yet 1328 END 1329 ELSIF (bitAnd(qGraf, 0030H) = 0010H) THEN ***** ^ not supported yet ***** ^ not supported yet 1330 (*** IBM EGA ***) 1331 GrafixCard := GrConst.EGAMono ***** ^ not supported yet ***** ^ not supported yet 1332 ELSIF ((bitAnd(qGraf, 0030H) = 0030H) AND (bitAnd(qGraf, 0C0H) # 0)) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1333 GrafixCard := GrConst.EGA640x350 ***** ^ not supported yet ***** ^ not supported yet 1334 ELSE 1335 GrafixCard := GrConst.EGA640x200 ***** ^ not supported yet ***** ^ not supported yet 1336 END 1337 ELSIF bitAnd(qGraf, GrConst.ATT640x400) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1338 IF bitAnd(qGraf, 1) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet 1339 GrafixCard := GrConst.DEB640x400 ***** ^ not supported yet ***** ^ not supported yet 1340 ELSE 1341 GrafixCard := GrConst.ATT640x400 ***** ^ not supported yet ***** ^ not supported yet 1342 END 1343 ELSIF bitAnd(qGraf, GrConst.TOS640x400) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1344 GrafixCard := GrConst.TOS640x400 ***** ^ not supported yet ***** ^ not supported yet 1345 ELSIF bitAnd(qGraf, GrConst.CGA320x200) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1346 GrafixCard := GrConst.CGA640x200 ***** ^ not supported yet ***** ^ not supported yet 1347 ELSIF bitAnd(qGraf, GrConst.HER720x348) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1348 GrafixCard := GrConst.HER720x348 ***** ^ not supported yet ***** ^ not supported yet 1349 ELSIF bitAnd(qGraf, GrConst.TEC720x352) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1350 IF bitAnd(qGraf, 2) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet 1351 GrafixCard := GrConst.TEC640x200 ***** ^ not supported yet ***** ^ not supported yet 1352 ELSE 1353 GrafixCard := GrConst.TEC720x352 ***** ^ not supported yet ***** ^ not supported yet 1354 END 1355 ELSIF bitAnd(qGraf, GrConst.EVR640x200) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1356 GrafixCard := GrConst.EVR640x200 ***** ^ not supported yet ***** ^ not supported yet 1357 ELSIF bitAnd(qGraf, GrConst.STB640x352) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1358 GrafixCard := GrConst.STB640x352 ***** ^ not supported yet ***** ^ not supported yet 1359 ELSIF bitAnd(qGraf, GrConst.TTS720x350) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1360 IF bitAnd(qGraf, 1) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet 1361 GrafixCard := GrConst.TTS360x350 ***** ^ not supported yet ***** ^ not supported yet 1362 ELSE 1363 GrafixCard := GrConst.TTS720x350 ***** ^ not supported yet ***** ^ not supported yet 1364 END 1365 ELSIF bitAnd(qGraf, GrConst.SIG640x400) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1366 GrafixCard := GrConst.SIG640x400 ***** ^ not supported yet ***** ^ not supported yet 1367 ELSIF bitAnd(qGraf, GrConst.TOS640x400) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1368 GrafixCard := GrConst.TOS640x400 ***** ^ not supported yet ***** ^ not supported yet 1369 ELSIF bitAnd(qGraf, GrConst.WYS640x400) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1370 GrafixCard := GrConst.WYS640x400 ***** ^ not supported yet ***** ^ not supported yet 1371 ELSIF bitAnd(qGraf, GrConst.MDS736x1008) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1372 GrafixCard := GrConst.MDS736x1008 ***** ^ not supported yet ***** ^ not supported yet 1373 END 1374 END; 1375 1376 (*** Use the result from QueryCom() to determine CommPort. ***) 1377 1378 IF bitAnd(qComm, GrConst.FKYMsDriver) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1379 CommPort := GrConst.FKYMsDriver ***** ^ not supported yet ***** ^ not supported yet 1380 ELSIF bitAnd(qComm, GrConst.MsDriver) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1381 CommPort := GrConst.MsDriver ***** ^ not supported yet ***** ^ not supported yet 1382 (*** 1383 ELSIF bitAnd(qComm, GrConst.MsMouse) # 0 THEN 1384 CommPort := GrConst.MsMouse 1385 ***) 1386 ELSIF bitAnd(qComm, 2) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet 1387 CommPort := GrConst.MsCOM2 ***** ^ not supported yet ***** ^ not supported yet 1388 ELSIF bitAnd(qComm, 1) # 0 THEN ***** ^ not supported yet ***** ^ not supported yet 1389 CommPort := GrConst.MsCOM1 ***** ^ not supported yet ***** ^ not supported yet 1390 END 1391 END GrInit; ***** ^ not supported yet 1392 1393 1394 PROCEDURE GrInitErr(GrafixCard, CommPort, val: INTEGER); 1395 (*** Print an initialisation error message. ***) 1396 VAR i: CARDINAL; 1397 BEGIN 1398 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1399 IO.WrStr('MetaWINDOW SYSTEM ERROR: '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1400 1401 IF (val = -1) THEN 1402 IO.WrLn(); IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1403 IO.WrStr('The Metagraphics Driver (METASHEL.EXE) is not installed.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1404 IO.WrLn() ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1405 ELSIF (val = -2) THEN 1406 IO.WrStr('The InitGrafix('); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1407 IO.WrInt(GrafixCard, 6); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1408 IO.WrStr(') call is invalid.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1409 IO.WrLn(); IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1410 IO.WrStr('REASON: '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1411 1412 IF (GrafixCard = 0) THEN 1413 IO.WrStr('MetaWINDOW was unable to find a default adaptor, '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1414 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1415 IO.WrStr(' and you did not select one.') ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1416 ELSE 1417 1418 i := 0; 1419 1420 WHILE (GrafixCard # oDev[i].devnum) AND (i # HIGH(oDev)) DO ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 1421 INC(i) ***** ^ undeclared identifier ***** ^ not supported yet 1422 END; 1423 1424 IF (GrafixCard = oDev[i].devnum) THEN ***** ^ not supported yet ***** ^ not supported yet 1425 Str.Copy(buf, oDev[i].devdesc); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1426 ELSE 1427 Str.Copy(buf, '*** No graphics adaptor ***'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1428 END; 1429 1430 IF (buf[0] = '+') THEN ***** ^ not supported yet ***** ^ not supported yet 1431 (*** MetaWINDOW Plus device. ***) 1432 buf[0] := ' '; ***** ^ not supported yet ***** ^ not supported yet 1433 IO.WrStr('The'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1434 IO.WrStr(buf); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1435 IO.WrStr(' system is supported in'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1436 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1437 IO.WrStr(' MetaWINDOW/PLUS and MetaWINDOW/Premium only.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1438 IO.WrLn() ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1439 ELSIF (buf[0] = '*') THEN ***** ^ not supported yet ***** ^ not supported yet 1440 (*** MetaWINDOW Premium device. ***) 1441 buf[0] := ' '; ***** ^ not supported yet ***** ^ not supported yet 1442 IO.WrStr('The'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1443 IO.WrStr(buf); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1444 IO.WrStr(' system is supported in'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1445 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1446 IO.WrStr(' MetaWINDOW/Premium only.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1447 IO.WrLn() ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1448 ELSE 1449 buf[0] := ' '; ***** ^ not supported yet ***** ^ not supported yet 1450 IO.WrStr('Device'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1451 IO.WrStr(buf); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1452 IO.WrStr(' is not'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1453 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1454 Meta.MetaVersion(buf); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1455 IO.WrStr(' supported in '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1456 IO.WrStr(buf); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1457 IO.WrLn() ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1458 END 1459 END 1460 END; 1461 Lib.SetReturnCode(1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1462 HALT ***** ^ undeclared identifier 1463 END GrInitErr; ***** ^ not supported yet 1464 1465 1466 PROCEDURE GrQuery(VAR GrafixCard, CommPort: INTEGER); 1467 (*** Determine which devices are available. ***) 1468 VAR 1469 i: INTEGER; 1470 pass: BOOLEAN; 1471 c: CHAR; 1472 BEGIN 1473 (*** Initialise GrafixCard and CommPort from QueryGrafix() and ***) 1474 (*** QueryComm(). These settings can be changed by grQParse(). ***) 1475 1476 GrInit(GrafixCard, CommPort); ***** ^ not supported yet ***** ^ not supported yet 1477 1478 (*** Parse out the command line or environment variable, if any. ***) 1479 1480 pass := grQParse(GrafixCard, CommPort); ***** ^ not supported yet ***** ^ not supported yet 1481 1482 (*** If the /; option was present, don't do anything more. ***) 1483 1484 IF (pass) THEN 1485 RETURN 1486 END; 1487 1488 (*%F GRQtrim *) 1489 (*** Test to see if mono or color display installed and set vals into ***) 1490 (*** global structure. ***) 1491 1492 IF txtMono() THEN 1493 (* on a monochrome system *) 1494 txtAttrVal.normal := MNORMAL; 1495 txtAttrVal.inverse := MINVERSE; 1496 txtAttrVal.hilite := MHILITE 1497 ELSE (* color system *) 1498 txtAttrVal.normal := CNORMAL; 1499 txtAttrVal.inverse := CINVERSE; 1500 txtAttrVal.hilite := CHILITE 1501 END; 1502 1503 (*** Allow text screen menu selection. ***) 1504 grQMenu(GrafixCard, CommPort); 1505 (*%E GRQtrim *) 1506 1507 (*%T DOSDISP *) 1508 Meta.MetaVersion(line); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1509 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1510 IO.WrStr('-[ '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1511 IO.WrStr(line); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1512 IO.WrStr(' ]-'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1513 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1514 1515 (* find display adapter info *) 1516 1517 i := 0; 1518 1519 WHILE (oDev[i].devnum # 0) AND (oDev[i].devnum # GrafixCard) DO ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1520 INC(i) ***** ^ undeclared identifier ***** ^ not supported yet 1521 END; 1522 1523 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1524 IO.WrStr('DISPLAY: -'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1525 IO.WrStr(oDev[i].devslash); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1526 IO.WrStr(' -> '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1527 IO.WrStr(oDev[i].devdesc); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1528 IO.WrStr(', '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1529 IO.WrInt(oDev[i].devhres, 4); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1530 IO.WrStr(' x '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1531 IO.WrInt(oDev[i].devvres, 4); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1532 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1533 1534 (* find input device info *) 1535 1536 i := 0; 1537 1538 WHILE (iDev[i].devnum # 0) AND (iDev[i].devnum # CommPort) DO ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1539 INC(i) ***** ^ undeclared identifier ***** ^ not supported yet 1540 END; 1541 1542 IO.WrStr(' MOUSE: -'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1543 IO.WrStr(iDev[i].devslash); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1544 IO.WrStr(' -> '); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1545 IO.WrStr(iDev[i].devdesc); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1546 IO.WrLn(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1547 1548 c := IO.RdKey(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 1549 (*%E DOSDISP *) 1550 1551 (*** GrafixCard and CommPort are now set with valid InitGrafix and ***) 1552 (*** InitMouse values (or are equal to zero if no devices were found ***) 1553 (*** or specified). ***) 1554 END GrQuery; ***** ^ not supported yet 1555 1556 BEGIN 1557 1558 END GrQry. ***** ^ not supported yet 878 errors