1{ 2 This file is part of the Free Pascal run time library. 3 (c) 2000-2003 by Marco van de Voort 4 member of the Free Pascal development team. 5 6 See the file COPYING.FPC, included in this distribution, 7 for details about the copyright. 8 9 Header conversions (with FpIoctl macro expansion) for FreeBSD 4.2's 10 sys/fbio.h sys/consio.h sys/kbdio.h (together these three form 11 machine/console.h) and 12 machine/mouse.h 13 14 Converted to use in a future FreeBSD API to get the IDE running on 15 the physical console with mousesupport. 16 17 As soon as cross unit inlining is ready, all functions should be made 18 inline. (so the FpIoctl and the other very small macro's) 19 20 This program is distributed in the hope that it will be useful, 21 but WITHOUT ANY WARRANTY;without even the implied warranty of 22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 23} 24 25UNIT Console; 26 27{$packrecords C} 28 29interface 30 31{I tried to keep original types as much as possible, only "int" is converted 32to longint because INT is a standard function in TP/FPC} 33 34TYPE 35 uchar = char; 36 uint = dword; 37 u_int = uint; 38 ushort= word; 39 short = integer; 40 long = dword; {?} 41 size_t= longint; {Dunno sure, but it is 32-bit} 42 caddr_t= longint; {idem} 43 vm_offset_t=dword; {idem} 44 45{----------------------------- sys/fbio.h ----------------------------------} 46 47{ 48 * Copyright (c) 1992, 1993 49 * The Regents of the University of California. All rights reserved. 50 * 51 * This code is derived from software developed by the Computer Systems 52 * Engineering group at Lawrence Berkeley Laboratory under DARPA 53 * contract BG 91-66 and contributed to Berkeley. 54 * 55 * Redistribution and use in source and binary forms, with or without 56 * modification, are permitted provided that the following conditions 57 * are met: 58 * 1. Redistributions of source code must retain the above copyright 59 * notice, this list of conditions and the following disclaimer. 60 * 2. Redistributions in binary form must reproduce the above copyright 61 * notice, this list of conditions and the following disclaimer in the 62 * documentation and/or other materials provided with the distribution. 63 * 3. All advertising materials mentioning features or use of this software 64 * must display the following acknowledgement: 65 * This product includes software developed by the University of 66 * California, Berkeley and its contributors. 67 * 4. Neither the name of the University nor the names of its contributors 68 * may be used to endorse or promote products derived from this software 69 * without specific prior written permission. 70 * 71 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 72 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 73 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 74 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 75 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 76 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 77 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 78 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 79 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 80 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 81 * SUCH DAMAGE. 82 * 83 * @(#)fbio.h 8.2 (Berkeley) 10/30/93 84 * 85 * $FreeBSD: src/sys/sys/fbio.h,v 1.9.2.1 2000/05/05 09:16:16 nyan Exp $ 86 } 87 88{ 89 * Frame buffer FpIoctls (from Sprite, trimmed to essentials for X11). 90 } 91 92{ 93 * Frame buffer type codes. 94 } 95 96CONST 97 98 FBTYPE_SUN1BW =0; { multibus mono } 99 FBTYPE_SUN1COLOR =1; { multibus color } 100 FBTYPE_SUN2BW =2; { memory mono } 101 FBTYPE_SUN2COLOR =3; { color w/rasterop chips } 102 FBTYPE_SUN2GP =4; { GP1/GP2 } 103 FBTYPE_SUN5COLOR =5; { RoadRunner accelerator } 104 FBTYPE_SUN3COLOR =6; { memory color } 105 FBTYPE_MEMCOLOR =7; { memory 24-bit } 106 FBTYPE_SUN4COLOR =8; { memory color w/overlay } 107 108 FBTYPE_NOTSUN1 =9; { reserved for customer } 109 FBTYPE_NOTSUN2 =10; { reserved for customer } 110 FBTYPE_NOTSUN3 =11; { reserved for customer } 111 112 FBTYPE_SUNFAST_COLOR =12; { accelerated 8bit } 113 FBTYPE_SUNROP_COLOR =13; { MEMCOLOR with rop h/w } 114 FBTYPE_SUNFB_VIDEO =14; { Simple video mixing } 115 FBTYPE_RESERVED5 =15; { reserved, do not use } 116 FBTYPE_RESERVED4 =16; { reserved, do not use } 117 FBTYPE_RESERVED3 =17; { reserved, do not use } 118 FBTYPE_RESERVED2 =18; { reserved, do not use } 119 FBTYPE_RESERVED1 =19; { reserved, do not use } 120 121 FBTYPE_MDA =20; 122 FBTYPE_HERCULES =21; 123 FBTYPE_CGA =22; 124 FBTYPE_EGA =23; 125 FBTYPE_VGA =24; 126 FBTYPE_PC98 =25; 127 FBTYPE_TGA =26; 128 129 FBTYPE_LASTPLUSONE =27; { max number of fbs (change as add) } 130 131{ 132 * Frame buffer descriptor as returned by FBIOGTYPE. 133 } 134 135type fbtype = record 136 fb_type : longint; { as defined above } 137 fb_height : longint; { in pixels } 138 fb_width : longint; { in pixels } 139 fb_depth : longint; { bits per pixel } 140 fb_cmsize : longint; { size of color map (entries) } 141 fb_size : longint; { total size in bytes } 142 end; 143 144Function FBIOGTYPE(fd:longint;var param1 : fbtype):boolean; 145 146{ 147 * General purpose structure for passing info in and out of frame buffers 148 * (used for gp1) -- unsupported. 149 } 150type fbinfo = record 151 fb_physaddr : longint; { physical frame buffer address } 152 fb_hwwidth : longint; { fb board width } 153 fb_hwheight : longint; { fb board height } 154 fb_addrdelta : longint; { phys addr diff between boards } 155 fb_ropaddr : ^uchar; { fb virtual addr } 156 fb_unit : longint; { minor devnum of fb } 157 end; 158 159Function FBIOGINFO(fd:longint;var param1 : fbinfo):boolean; 160 161type 162{ 163 * Color map I/O. 164 } 165 fbcmap = record 166 index : longint; { first element (0 origin) } 167 count : longint; { number of elements } 168 red : ^uchar; { red color map elements } 169 green : ^uchar; { green color map elements } 170 blue : ^uchar; { blue color map elements } 171 end; 172 173Function FBIOPUTCMAP(fd:longint;var param1 : fbcmap):boolean; 174Function FBIOGETCMAP(fd:longint;var param1 : fbcmap):boolean; 175 176{ 177 * Set/get attributes. 178 } 179const 180 FB_ATTR_NDEVSPECIFIC =8; { no. of device specific values } 181 FB_ATTR_NEMUTYPES =4; { no. of emulation types } 182 183type fbsattr = record 184 flags:longint; { flags; see below } 185 emu_type : longint; { emulation type (-1 if unused) } 186 dev_specific : array[0..FB_ATTR_NDEVSPECIFIC-1] of longint; { catchall } 187 end; 188const 189 FB_ATTR_AUTOINIT =1; { emulation auto init flag } 190 FB_ATTR_DEVSPECIFIC =2; { dev. specific stuff valid flag } 191 192type fbgattr = record 193 real_type : longint; { real device type } 194 owner : longint; { PID of owner, 0 if myself } 195 _fbtype : fbtype; { fbtype info for real device } 196 sattr : fbsattr; { see above } 197 emu_types : array [0..FB_ATTR_NEMUTYPES-1] OF Longint; { possible emulations } 198 { (-1 if unused) } 199 end; 200 201{ FBIOSATTR _IOW('F', 5, struct fbsattr) -- unsupported } 202 203Function FBIOGATTR(fd:longint;var param1 : fbgattr):boolean; 204 205{ 206 * Video control. 207 } 208 209const 210 FBVIDEO_OFF =0; 211 FBVIDEO_ON =1; 212 213Function FBIOSVIDEO(fd:longint;var param1 : longint):boolean; 214Function FBIOGVIDEO(fd:longint;var param1 : longint):boolean; 215 216{ 217 * Hardware cursor control (for, e.g., CG6). A rather complex and icky 218 * interface that smells like VMS, but there it is.... 219 } 220type fbcurpos = record 221 x : short; 222 y : short; 223 end; 224 225 226 227 fbcursor = record 228 _set : short; { flags; see below } 229 enable : short; { nonzero => cursor on, 0 => cursor off } 230 _pos : fbcurpos; { position on display } 231 hot : fbcurpos; { hot-spot within cursor } 232 cmap : fbcmap; { cursor color map } 233 _size : fbcurpos; { number of valid bits in image & mask } 234 image : caddr_t; { cursor image bits } 235 mask : caddr_t; { cursor mask bits } 236 end; 237 238const 239 FB_CUR_SETCUR =$01; { set on/off (i.e., obey fbcursor.enable) } 240 FB_CUR_SETPOS =$02; { set position } 241 FB_CUR_SETHOT =$04; { set hot-spot } 242 FB_CUR_SETCMAP =$08; { set cursor color map } 243 FB_CUR_SETSHAPE =$10; { set size & bits } 244 FB_CUR_SETALL =(FB_CUR_SETCUR OR FB_CUR_SETPOS OR FB_CUR_SETHOT OR 245 FB_CUR_SETCMAP OR FB_CUR_SETSHAPE); 246 247{ controls for cursor attributes & shape (including position) } 248Function FBIOSCURSOR(fd:longint;var param1 : fbcursor):boolean; 249Function FBIOGCURSOR(fd:longint;var param1 : fbcursor):boolean; 250 251{ controls for cursor position only } 252Function FBIOSCURPOS(fd:longint;var param1 : fbcurpos):boolean; 253Function FBIOGCURPOS(fd:longint;var param1 : fbcurpos):boolean; 254 255{ get maximum cursor size } 256Function FBIOGCURMAX(fd:longint;var param1 : fbcurpos):boolean; 257 258{ The new style frame buffer FpIoctls. } 259 260CONST 261 V_INFO_COLOR =(1 SHL 0); 262 V_INFO_GRAPHICS =(1 SHL 1); 263 V_INFO_LINEAR =(1 SHL 2); 264 V_INFO_VESA =(1 SHL 3); 265 V_INFO_MM_OTHER =(-1); 266 V_INFO_MM_TEXT =0; 267 V_INFO_MM_PLANAR =1; 268 V_INFO_MM_PACKED =2; 269 V_INFO_MM_DIRECT =3; 270 V_INFO_MM_CGA =100; 271 V_INFO_MM_HGC =101; 272 V_INFO_MM_VGAX =102; 273 274TYPE 275{ video mode information block } 276 video_info = record 277 vi_mode : longint; { mode number, see below } 278 vi_flags : longint; 279 vi_width : longint; 280 vi_height : longint; 281 vi_cwidth : longint; 282 vi_cheight : longint; 283 vi_depth : longint; 284 vi_planes : longint; 285 vi_window : uint; { physical address } 286 vi_window_size : size_t; 287 vi_window_gran : size_t; 288 vi_buffer : uint; { physical address } 289 vi_buffer_size : size_t; 290 vi_mem_model : longint; 291 { for MM_PACKED and MM_DIRECT only } 292 vi_pixel_size : longint; { in bytes } 293 { for MM_DIRECT only } 294 vi_pixel_fields : array[0..3] of longint; { RGB and reserved fields } 295 vi_pixel_fsizes : array[0..3] of longint; 296 { reserved } 297 vi_reserved : array[0..63] of uchar; 298 end; 299 300 video_info_t = video_info; 301const 302 KD_OTHER =0; { unknown } 303 KD_MONO =1; { monochrome adapter } 304 KD_HERCULES =2; { hercules adapter } 305 KD_CGA =3; { color graphics adapter } 306 KD_EGA =4; { enhanced graphics adapter } 307 KD_VGA =5; { video graphics adapter } 308 KD_PC98 =6; { PC-98 display } 309 KD_TGA =7; { TGA } 310 V_ADP_COLOR =(1 SHL 0); 311 V_ADP_MODECHANGE=(1 SHL 1); 312 V_ADP_STATESAVE =(1 SHL 2); 313 V_ADP_STATELOAD =(1 SHL 3); 314 V_ADP_FONT =(1 SHL 4); 315 V_ADP_PALETTE =(1 SHL 5); 316 V_ADP_BORDER =(1 SHL 6); 317 V_ADP_VESA =(1 SHL 7); 318 V_ADP_PROBED =(1 SHL 16); 319 V_ADP_INITIALIZED=(1 SHL 17); 320 V_ADP_REGISTERED =(1 SHL 18); 321 322{ adapter infromation block } 323type video_adapter = record 324 va_index : longint; 325 va_type : longint; 326 va_name : pchar; 327 va_unit : longint; 328 va_minor : longint; 329 va_flags : longint; 330 va_io_base : longint; 331 va_io_size : longint; 332 va_crtc_addr : longint; 333 va_mem_base : longint; 334 va_mem_size : longint; 335 va_window : vm_offset_t; { virtual address } 336 va_window_size : size_t; 337 va_window_gran : size_t; 338 va_window_orig : uint; 339 va_buffer : vm_offset_t; { virtual address } 340 va_buffer_size : size_t; 341 va_initial_mode : longint; 342 va_initial_bios_mode : longint; 343 va_mode : longint; 344 va_info : video_info; 345 va_line_width : longint; 346 va_disp_start : record 347 x : longint; 348 y : longint; 349 end; 350 va_token : pointer; 351 end; 352 353 video_adapter_t = video_adapter; 354 355 video_adapter_info = record 356 va_index : longint; 357 va_type : longint; 358 va_name : array[0..15] of char; 359 va_unit : longint; 360 va_flags : longint; 361 va_io_base : longint; 362 va_io_size : longint; 363 va_crtc_addr : longint; 364 va_mem_base : longint; 365 va_mem_size : longint; 366 va_window : uint; { virtual address } 367 va_window_size : size_t; 368 va_window_gran : size_t; 369 va_unused0 : uint; 370 va_buffer_size : size_t; 371 va_initial_mode : longint; 372 va_initial_bios_mode : longint; 373 va_mode : longint; 374 va_line_width : longint; 375 va_disp_start : record 376 x : longint; 377 y : longint; 378 end; 379 va_window_orig : uint; 380 { reserved } 381 va_reserved : array[0..63] OF uchar; 382 end; 383 video_adapter_info_t = video_adapter_info; 384 385CONST 386{ some useful video adapter index } 387 V_ADP_PRIMARY =0; 388 V_ADP_SECONDARY =1; 389 390{ video mode numbers } 391 392 M_B40x25 =0; { black & white 40 columns } 393 M_C40x25 =1; { color 40 columns } 394 M_B80x25 =2; { black & white 80 columns } 395 M_C80x25 =3; { color 80 columns } 396 M_BG320 =4; { black & white graphics 320x200 } 397 M_CG320 =5; { color graphics 320x200 } 398 M_BG640 =6; { black & white graphics 640x200 hi-res } 399 M_EGAMONO80x25 =7; { ega-mono 80x25 } 400 M_CG320_D =13; { ega mode D } 401 M_CG640_E =14; { ega mode E } 402 M_EGAMONOAPA =15; { ega mode F } 403 M_CG640x350 =16; { ega mode 10 } 404 M_ENHMONOAPA2 =17; { ega mode F with extended memory } 405 M_ENH_CG640 =18; { ega mode 10* } 406 M_ENH_B40x25 =19; { ega enhanced black & white 40 columns } 407 M_ENH_C40x25 =20; { ega enhanced color 40 columns } 408 M_ENH_B80x25 =21; { ega enhanced black & white 80 columns } 409 M_ENH_C80x25 =22; { ega enhanced color 80 columns } 410 M_VGA_C40x25 =23; { vga 8x16 font on color } 411 M_VGA_C80x25 =24; { vga 8x16 font on color } 412 M_VGA_M80x25 =25; { vga 8x16 font on mono } 413 414 M_VGA11 =26; { vga 640x480 2 colors } 415 M_BG640x480 =26; 416 M_VGA12 =27; { vga 640x480 16 colors } 417 M_CG640x480 =27; 418 M_VGA13 =28; { vga 320x200 256 colors } 419 M_VGA_CG320 =28; 420 421 M_VGA_C80x50 =30; { vga 8x8 font on color } 422 M_VGA_M80x50 =31; { vga 8x8 font on color } 423 M_VGA_C80x30 =32; { vga 8x16 font on color } 424 M_VGA_M80x30 =33; { vga 8x16 font on color } 425 M_VGA_C80x60 =34; { vga 8x8 font on color } 426 M_VGA_M80x60 =35; { vga 8x8 font on color } 427 M_VGA_CG640 =36; { vga 640x400 256 color } 428 M_VGA_MODEX =37; { vga 320x240 256 color } 429 430 M_VGA_C90x25 =40; { vga 8x16 font on color } 431 M_VGA_M90x25 =41; { vga 8x16 font on mono } 432 M_VGA_C90x30 =42; { vga 8x16 font on color } 433 M_VGA_M90x30 =43; { vga 8x16 font on mono } 434 M_VGA_C90x43 =44; { vga 8x8 font on color } 435 M_VGA_M90x43 =45; { vga 8x8 font on mono } 436 M_VGA_C90x50 =46; { vga 8x8 font on color } 437 M_VGA_M90x50 =47; { vga 8x8 font on mono } 438 M_VGA_C90x60 =48; { vga 8x8 font on color } 439 M_VGA_M90x60 =49; { vga 8x8 font on mono } 440 441 M_ENH_B80x43 =$70; { ega black & white 80x43 } 442 M_ENH_C80x43 =$71; { ega color 80x43 } 443 444 M_PC98_80x25 =98; { PC98 text 80x25 } 445 M_PC98_80x30 =99; { PC98 text 80x30 } 446 M_PC98_EGC640x400 =100; { PC98 graphic 640x400 16 colors } 447 M_PC98_PEGC640x400 =101; { PC98 graphic 640x400 256 colors } 448 M_PC98_PEGC640x480 =102; { PC98 graphic 640x480 256 colors } 449 450 M_HGC_P0 =$e0; { hercules graphics - page 0 @ B0000 } 451 M_HGC_P1 =$e1; { hercules graphics - page 1 @ B8000 } 452 M_MCA_MODE =$ff; { monochrome adapter mode } 453 454 M_TEXT_80x25 =200; { generic text modes } 455 M_TEXT_80x30 =201; 456 M_TEXT_80x43 =202; 457 M_TEXT_80x50 =203; 458 M_TEXT_80x60 =204; 459 M_TEXT_132x25 =205; 460 M_TEXT_132x30 =206; 461 M_TEXT_132x43 =207; 462 M_TEXT_132x50 =208; 463 M_TEXT_132x60 =209; 464 465 M_VESA_BASE =$100; { VESA mode number base } 466 M_VESA_CG640x400 =$100; { 640x400, 256 color } 467 M_VESA_CG640x480 =$101; { 640x480, 256 color } 468 M_VESA_800x600 =$102; { 800x600, 16 color } 469 M_VESA_CG800x600 =$103; { 800x600, 256 color } 470 M_VESA_1024x768 =$104; { 1024x768, 16 color } 471 M_VESA_CG1024x768 =$105; { 1024x768, 256 color } 472 M_VESA_1280x1024 =$106; { 1280x1024, 16 color } 473 M_VESA_CG1280x1024 =$107; { 1280x1024, 256 color } 474 M_VESA_C80x60 =$108; { 8x8 font } 475 M_VESA_C132x25 =$109; { 8x16 font } 476 M_VESA_C132x43 =$10a; { 8x14 font } 477 M_VESA_C132x50 =$10b; { 8x8 font } 478 M_VESA_C132x60 =$10c; { 8x8 font } 479 M_VESA_32K_320 =$10d; { 320x200, 5:5:5 } 480 M_VESA_64K_320 =$10e; { 320x200, 5:6:5 } 481 M_VESA_FULL_320 =$10f; { 320x200, 8:8:8 } 482 M_VESA_32K_640 =$110; { 640x480, 5:5:5 } 483 M_VESA_64K_640 =$111; { 640x480, 5:6:5 } 484 M_VESA_FULL_640 =$112; { 640x480, 8:8:8 } 485 M_VESA_32K_800 =$113; { 800x600, 5:5:5 } 486 M_VESA_64K_800 =$114; { 800x600, 5:6:5 } 487 M_VESA_FULL_800 =$115; { 800x600, 8:8:8 } 488 M_VESA_32K_1024 =$116; { 1024x768, 5:5:5 } 489 M_VESA_64K_1024 =$117; { 1024x768, 5:6:5 } 490 M_VESA_FULL_1024 =$118; { 1024x768, 8:8:8 } 491 M_VESA_32K_1280 =$119; { 1280x1024, 5:5:5 } 492 M_VESA_64K_1280 =$11a; { 1280x1024, 5:6:5 } 493 M_VESA_FULL_1280 =$11b; { 1280x1024, 8:8:8 } 494 M_VESA_MODE_MAX =$1ff; 495 496type 497 video_display_start = record 498 x :longint; 499 y : longint; 500 end; 501 502 video_display_start_t= video_display_start; 503 504 video_color_palette = record 505 index : longint; { first element (zero-based) } 506 count : longint; { number of elements } 507 red : ^uchar; { red } 508 green : ^uchar; { green } 509 blue : ^uchar; { blue } 510 transparent : ^uchar; { may be NULL } 511 end; 512 513 video_color_palette_t = video_color_palette; 514 515{ adapter info. } 516Function FBIO_ADAPTER(fd:longint;var param1 : longint):boolean; 517Function FBIO_ADPTYPE(fd:longint;var param1 : longint):boolean; 518Function FBIO_ADPINFO(fd:longint;var param1 : video_adapter_info):boolean; 519 520{ video mode control } 521Function FBIO_MODEINFO(fd:longint;var param1 : video_info):boolean; 522Function FBIO_FINDMODE(fd:longint;var param1 : video_info):boolean; 523Function FBIO_GETMODE(fd:longint;var param1 : longint):boolean; 524Function FBIO_SETMODE(fd:longint;var param1 : longint):boolean; 525 526{ get/set frame buffer window origin } 527Function FBIO_GETWINORG(fd:longint;var param1 : u_int):boolean; 528Function FBIO_SETWINORG(fd:longint;var param1 : u_int):boolean; 529 530{ get/set display start address } 531Function FBIO_GETDISPSTART(fd:longint;var param1 : video_display_start_t):boolean; 532Function FBIO_SETDISPSTART(fd:longint;var param1 : video_display_start_t):boolean; 533 534{ get/set scan line width } 535Function FBIO_GETLINEWIDTH(fd:longint;var param1 : u_int):boolean; 536Function FBIO_SETLINEWIDTH(fd:longint;var param1 : u_int):boolean; 537 538{ color palette control } 539Function FBIO_GETPALETTE(fd:longint;var param1 : video_color_palette_t):boolean; 540Function FBIO_SETPALETTE(fd:longint;var param1 : video_color_palette_t):boolean; 541 542{----------------------------- sys/consio.h ----------------------------------} 543 544{ version packaged with FreeBSD 4.2-RELEASE 545Translation to FreePascal by Marco van de Voort. (2000-2001), original 546copyright follows: 547 548 * Copyright (c) 1991-1996 S�ren Schmidt 549 * All rights reserved. 550 * 551 * Redistribution and use in source and binary forms, with or without 552 * modification, are permitted provided that the following conditions 553 * are met: 554 * 1. Redistributions of source code must retain the above copyright 555 * notice, this list of conditions and the following disclaimer 556 * in this position and unchanged. 557 * 2. Redistributions in binary form must reproduce the above copyright 558 * notice, this list of conditions and the following disclaimer in the 559 * documentation and/or other materials provided with the distribution. 560 * 3. The name of the author may not be used to endorse or promote products 561 * derived from this software without specific prior written permission 562 * 563 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 564 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 565 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 566 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 567 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 568 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 569 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 570 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 571 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 572 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 573 * 574 * $FreeBSD: src/sys/sys/consio.h,v 1.5.2.1 2000/05/05 09:16:15 nyan Exp $ 575 576} 577 578{$define definconsole} 579 580{ 581 * Console FpIoctl commands. Some commands are named as KDXXXX, GIO_XXX, and 582 * PIO_XXX, rather than CONS_XXX, for historical and compatibility reasons. 583 * Some other CONS_XXX commands are works as wrapper around frame buffer 584 * FpIoctl commands FBIO_XXX. Do not try to change all these commands, 585 * otherwise we shall have compatibility problems. 586 } 587 588const 589 590{ get/set video mode } 591 KD_TEXT =0; { set text mode restore fonts } 592 KD_TEXT0 =0; { ditto } 593 KD_GRAPHICS =1; { set graphics mode } 594 KD_TEXT1 =2; { set text mode !restore fonts } 595 KD_PIXEL =3; { set pixel mode } 596 597Function KDGETMODE(fd:longint;var param1 : longint):boolean; 598Function KDSETMODE(fd:longint;param1 : longint):boolean; 599 600{ set border color } 601Function KDSBORDER(fd:longint;param1 : longint):boolean; 602 603{ set up raster(pixel) text mode } 604type 605 scr_size = record 606 _scrsize : array[0..2] of longint; 607 end; 608 scr_size_t = scr_size; 609 610Function KDRASTER(fd:longint;var param1 : scr_size_t):boolean; 611 612type 613 614{ get/set screen char map } 615 616 scrmap = record 617 _scrmap : array[0..255] of char; 618 end; 619 scrmap_t = scrmap; 620 621Function GIO_SCRNMAP(fd:longint;var param1 : scrmap_t):boolean; 622Function PIO_SCRNMAP(fd:longint;var param1 : scrmap_t):boolean; 623 624{ get the current text attribute } 625Function GIO_ATTR(fd:longint;var param1 : longint):boolean; 626 627{ get the current text color } 628Function GIO_COLOR(fd:longint;var param1 : longint):boolean; 629 630{ get the adapter type (equivalent to FBIO_ADPTYPE) } 631Function CONS_CURRENT(fd:longint;var param1 : longint):boolean; 632 633{ get the current video mode (equivalent to FBIO_GETMODE) } 634Function CONS_GET(fd:longint;var param1 : longint):boolean; 635 636{ not supported? } 637Function CONS_IO(fd:longint):boolean; 638 639{ set blank time interval } 640Function CONS_BLANKTIME(fd:longint;var param1 : longint):boolean; 641 642{ set/get the screen saver (these FpIoctls are current noop) } 643CONST maxsaver=16; 644 645type ssaver =record 646 name : array[0..maxsaver-1] of char; 647 num : Longint; 648 time : Long; 649 end; 650 ssaver_t = ssaver; 651 652Function CONS_SSAVER(fd:longint;var param1 : ssaver_t):boolean; 653Function CONS_GSAVER(fd:longint;var param1 : ssaver_t):boolean; 654 655{ set the text cursor shape } 656 657CONST 658 CONS_BLINK_CURSOR = (1 shl 0); 659 CONS_CHAR_CURSOR = (1 shl 1); 660 661Function CONS_CURSORTYPE(fd:longint;var param1 : longint):boolean; 662 663{ set the bell type to audible or visual } 664CONST 665 CONS_VISUAL_BELL =(1 shl 0); 666 CONS_QUIET_BELL =(1 shl 1); 667 668Function CONS_BELLTYPE(fd:longint;var param1 : longint):boolean; 669 670{ set the history (scroll back) buffer size (in lines) } 671Function CONS_HISTORY(fd:longint;var param1 : longint):boolean; 672 673{ mouse cursor FpIoctl } 674type 675 mouse_data = record 676 x : longint; 677 y : Longint; 678 z : longint; 679 buttons : longint; 680 end; 681 682 mouse_data_t = mouse_data; 683 684 mouse_mode = record 685 mode : longint; 686 signal : longint; 687 end; 688 689 mouse_mode_t = mouse_mode; 690 691 mouse_event = record 692 id : Longint; { one based } 693 value : longint; 694 end; 695 696 mouse_event_t = mouse_event; 697 698CONST 699 MOUSE_SHOW =$01; 700 MOUSE_HIDE =$02; 701 MOUSE_MOVEABS =$03; 702 MOUSE_MOVEREL =$04; 703 MOUSE_GETINFO =$05; 704 _MOUSE_MODE =$06; 705 MOUSE_ACTION =$07; 706 MOUSE_MOTION_EVENT =$08; 707 MOUSE_BUTTON_EVENT =$09; 708 MOUSE_MOUSECHAR =$0a; 709 710TYPE 711 mouse_info = record 712 operation : longint; 713 u : record 714 case integer of 715 0: (data : mouse_data_t); 716 1: (mode : mouse_mode_t); 717 2: (event: mouse_event_t); 718 3: (mouse_char : longint); 719 end; 720 end; 721 mouse_info_t = mouse_info; 722 723Function CONS_MOUSECTL(fd:longint;var param1 : mouse_info_t):boolean; 724 725{ see if the vty has been idle } 726Function CONS_IDLE(fd:longint;var param1 : longint):boolean; 727 728{ set the screen saver mode } 729CONST 730 CONS_LKM_SAVER = 0; 731 CONS_USR_SAVER = 1; 732 733Function CONS_SAVERMODE(fd:longint;var param1 : longint):boolean; 734 735{ start the screen saver } 736Function CONS_SAVERSTART(fd:longint;var param1 : longint):boolean; 737 738TYPE 739{ set/get font data } 740 fnt8 = record 741 fnt8x8 : array[0..8*256-1] of char; 742 end; 743 744 fnt8_t = fnt8; 745 746 fnt14 = record 747 fnt8x14: array[0..14*256-1] of char; 748 end; 749 750 fnt14_t = fnt14; 751 752 fnt16 = record 753 fnt8x16: array[0..16*256-1] of char; 754 end; 755 fnt16_t = fnt16; 756 757Function PIO_FONT8x8(fd:longint;var param1 : fnt8_t):boolean; 758Function GIO_FONT8x8(fd:longint;var param1 : fnt8_t):boolean; 759Function PIO_FONT8x14(fd:longint;var param1 : fnt14_t):boolean; 760Function GIO_FONT8x14(fd:longint;var param1 : fnt14_t):boolean; 761Function PIO_FONT8x16(fd:longint;var param1 : fnt16_t):boolean; 762Function GIO_FONT8x16(fd:longint;var param1 : fnt16_t):boolean; 763 764 765{ get video mode information } 766type colors = record 767 fore : char; 768 back : char; 769 end; 770 771 vid_info = record 772 _size : short; 773 m_num : short; 774 mv_row, 775 mv_col : ushort; 776 mv_rsz, 777 mv_csz : ushort; 778 mv_norm, 779 mv_rev, 780 mv_grfc : colors; 781 mv_ovscan : uchar; 782 mk_keylock : uchar; 783 end; 784 vid_info_t = vid_info; 785 786Function CONS_GETINFO(fd:longint;var param1 : vid_info_t):boolean; 787 788{ get version } 789 790Function CONS_GETVERS(fd:longint;var param1 : longint):boolean; 791 792{ get the video adapter index (equivalent to FBIO_ADAPTER) } 793Function CONS_CURRENTADP(fd:longint;var param1 : longint):boolean; 794 795{ get the video adapter information (equivalent to FBIO_ADPINFO) } 796Function CONS_ADPINFO(fd:longint;var param1 : video_adapter_info_t):boolean; 797 798{ get the video mode information (equivalent to FBIO_MODEINFO) } 799Function CONS_MODEINFO(fd:longint;var param1 : video_info_t):boolean; 800 801{ find a video mode (equivalent to FBIO_FINDMODE) } 802Function CONS_FINDMODE(fd:longint;var param1 : video_info_t):boolean; 803 804{ set the frame buffer window origin (equivalent to FBIO_SETWINORG) } 805Function CONS_SETWINORG(fd:longint;param1 : longint):boolean; 806 807{ use the specified keyboard } 808Function CONS_SETKBD(fd:longint;param1 : longint):boolean; 809 810{ release the current keyboard } 811Function CONS_RELKBD(fd:longint):boolean; 812 813{ get/set the current terminal emulator info. } 814CONST 815 TI_NAME_LEN = 32; 816 TI_DESC_LEN = 64; 817 818TYPE 819 term_info = record 820 ti_index : Longint; 821 ti_flags : longint; 822 ti_name : array[0..TI_NAME_LEN-1] of uchar; 823 ti_desc : array[0..TI_DESC_LEN-1] of uchar; 824 end; 825 term_info_t = term_info; 826 827Function CONS_GETTERM(fd:longint;var param1 : term_info_t):boolean; 828Function CONS_SETTERM(fd:longint;var param1 : term_info_t):boolean; 829 830{$ifdef PC98} 831Function ADJUST_CLOCK(fd:longint):boolean; 832{$endif} 833 834{ 835* Vty switching FpIoctl commands. 836} 837 838{ get the next available vty } 839Function VT_OPENQRY(fd:longint;var param1 : longint):boolean; 840 841{ set/get vty switching mode } 842const 843 VT_AUTO =0; { switching is automatic } 844 VT_PROCESS =1; { switching controlled by prog } 845 VT_KERNEL =255; { switching controlled in kernel } 846 847TYPE 848 vt_mode = record 849 mode : Char; 850 waitv : char; { not implemented yet SOS } 851 relsig : short; 852 acqsig : short; 853 frsig : short; { not implemented yet SOS } 854 end; 855 856 vtmode_t = vt_mode; 857 858 859Function VT_SETMODE(fd:longint;var param1 : vtmode_t):boolean; 860Function VT_GETMODE(fd:longint;var param1 : vtmode_t):boolean; 861 862 863{ acknowledge release or acquisition of a vty } 864const 865 VT_FALSE = 0; 866 VT_TRUE = 1; 867 VT_ACKACQ = 2; 868 869Function VT_RELDISP(fd:longint;param1 : longint):boolean; 870 871{ activate the specified vty } 872Function VT_ACTIVATE(fd:longint;param1 : longint):boolean; 873 874{ wait until the specified vty is activate } 875Function VT_WAITACTIVE(fd:longint;param1 : longint):boolean; 876 877{ get the currently active vty } 878Function VT_GETACTIVE(fd:longint;var param1 : longint):boolean; 879 880{ get the index of the vty } 881Function VT_GETINDEX(fd:longint;var param1 : longint):boolean; 882 883{ 884* Video mode switching FpIoctl. See sys/fbio.h for mode numbers. 885} 886 887Function SW_B40x25(fd:longint):boolean; 888Function SW_C40x25(fd:longint):boolean; 889Function SW_B80x25(fd:longint):boolean; 890Function SW_C80x25(fd:longint):boolean; 891Function SW_BG320(fd:longint):boolean; 892Function SW_CG320(fd:longint):boolean; 893Function SW_BG640(fd:longint):boolean; 894Function SW_EGAMONO80x25(fd:longint):boolean; 895Function SW_CG320_D(fd:longint):boolean; 896Function SW_CG640_E(fd:longint):boolean; 897Function SW_EGAMONOAPA(fd:longint):boolean; 898Function SW_CG640x350(fd:longint):boolean; 899Function SW_ENH_MONOAPA2(fd:longint):boolean; 900Function SW_ENH_CG640(fd:longint):boolean; 901Function SW_ENH_B40x25(fd:longint):boolean; 902Function SW_ENH_C40x25(fd:longint):boolean; 903Function SW_ENH_B80x25(fd:longint):boolean; 904Function SW_ENH_C80x25(fd:longint):boolean; 905Function SW_ENH_B80x43(fd:longint):boolean; 906Function SW_ENH_C80x43(fd:longint):boolean; 907Function SW_MCAMODE(fd:longint):boolean; 908Function SW_VGA_C40x25(fd:longint):boolean; 909Function SW_VGA_C80x25(fd:longint):boolean; 910Function SW_VGA_C80x30(fd:longint):boolean; 911Function SW_VGA_C80x50(fd:longint):boolean; 912Function SW_VGA_C80x60(fd:longint):boolean; 913Function SW_VGA_M80x25(fd:longint):boolean; 914Function SW_VGA_M80x30(fd:longint):boolean; 915Function SW_VGA_M80x50(fd:longint):boolean; 916Function SW_VGA_M80x60(fd:longint):boolean; 917Function SW_VGA11(fd:longint):boolean; 918Function SW_BG640x480(fd:longint):boolean; 919Function SW_VGA12(fd:longint):boolean; 920Function SW_CG640x480(fd:longint):boolean; 921Function SW_VGA13(fd:longint):boolean; 922Function SW_VGA_CG320(fd:longint):boolean; 923Function SW_VGA_CG640(fd:longint):boolean; 924Function SW_VGA_MODEX(fd:longint):boolean; 925Function SW_PC98_80x25(fd:longint):boolean; 926Function SW_PC98_80x30(fd:longint):boolean; 927Function SW_PC98_EGC640x400(fd:longint):boolean; 928Function SW_PC98_PEGC640x400(fd:longint):boolean; 929Function SW_PC98_PEGC640x480(fd:longint):boolean; 930Function SW_VGA_C90x25(fd:longint):boolean; 931Function SW_VGA_M90x25(fd:longint):boolean; 932Function SW_VGA_C90x30(fd:longint):boolean; 933Function SW_VGA_M90x30(fd:longint):boolean; 934Function SW_VGA_C90x43(fd:longint):boolean; 935Function SW_VGA_M90x43(fd:longint):boolean; 936Function SW_VGA_C90x50(fd:longint):boolean; 937Function SW_VGA_M90x50(fd:longint):boolean; 938Function SW_VGA_C90x60(fd:longint):boolean; 939Function SW_VGA_M90x60(fd:longint):boolean; 940Function SW_TEXT_80x25(fd:longint):boolean; 941Function SW_TEXT_80x30(fd:longint):boolean; 942Function SW_TEXT_80x43(fd:longint):boolean; 943Function SW_TEXT_80x50(fd:longint):boolean; 944Function SW_TEXT_80x60(fd:longint):boolean; 945Function SW_TEXT_132x25(fd:longint):boolean; 946Function SW_TEXT_132x30(fd:longint):boolean; 947Function SW_TEXT_132x43(fd:longint):boolean; 948Function SW_TEXT_132x50(fd:longint):boolean; 949Function SW_TEXT_132x60(fd:longint):boolean; 950Function SW_VESA_CG640x400(fd:longint):boolean; 951Function SW_VESA_CG640x480(fd:longint):boolean; 952Function SW_VESA_800x600(fd:longint):boolean; 953Function SW_VESA_CG800x600(fd:longint):boolean; 954Function SW_VESA_1024x768(fd:longint):boolean; 955Function SW_VESA_CG1024x768(fd:longint):boolean; 956Function SW_VESA_1280x1024(fd:longint):boolean; 957Function SW_VESA_CG1280x1024(fd:longint):boolean; 958Function SW_VESA_C80x60(fd:longint):boolean; 959Function SW_VESA_C132x25(fd:longint):boolean; 960Function SW_VESA_C132x43(fd:longint):boolean; 961Function SW_VESA_C132x50(fd:longint):boolean; 962Function SW_VESA_C132x60(fd:longint):boolean; 963Function SW_VESA_32K_320(fd:longint):boolean; 964Function SW_VESA_64K_320(fd:longint):boolean; 965Function SW_VESA_FULL_320(fd:longint):boolean; 966Function SW_VESA_32K_640(fd:longint):boolean; 967Function SW_VESA_64K_640(fd:longint):boolean; 968Function SW_VESA_FULL_640(fd:longint):boolean; 969Function SW_VESA_32K_800(fd:longint):boolean; 970Function SW_VESA_64K_800(fd:longint):boolean; 971Function SW_VESA_FULL_800(fd:longint):boolean; 972Function SW_VESA_32K_1024(fd:longint):boolean; 973Function SW_VESA_64K_1024(fd:longint):boolean; 974Function SW_VESA_FULL_1024(fd:longint):boolean; 975Function SW_VESA_32K_1280(fd:longint):boolean; 976Function SW_VESA_64K_1280(fd:longint):boolean; 977Function SW_VESA_FULL_1280(fd:longint):boolean; 978 979{----------------------------- sys/kbio.h ----------------------------------} 980 981{ version packaged with FreeBSD 4.2-RELEASE 982Translation to FreePascal by Marco van de Voort. (2000-2001), original 983copyright follows: ( I assume BSD licensed) 984 985Based on 986 * $FreeBSD: src/sys/sys/kbio.h,v 1.5.2.1 2000/10/29 16:59:32 dwmalone Exp $ 987} 988 989{ get/set keyboard I/O mode} 990const K_RAW =0; { keyboard returns scancodes} 991 K_XLATE =1; { keyboard returns ascii} 992 K_CODE =2; { keyboard returns keycodes} 993 994{After each FpIoctl value, I've put the type of the parameters to be passed: 995 @int -> pass a pointer to an int. 996 int -> pass pointer(int) 997 - -> nothing 998@keymap_t -> pass a pointer to a keymap_t 999 etc. 1000} 1001 1002Function KDGKBMODE(fd:longint;var param1 : longint):boolean; 1003Function KDSKBMODE(fd:longint;param1 : longint):boolean; 1004 1005 1006{ make tone} 1007Function KDMKTONE(fd:longint;param1 : longint):boolean; 1008 1009{ see console.h for the definitions of the following FpIoctls} 1010{$ifndef definconsole} 1011Function KDGETMODE(fd:longint;var param1 : longint):boolean; 1012Function KDSETMODE(fd:longint;param1 : longint):boolean; 1013Function KDSBORDER(fd:longint;param1 : longint):boolean; 1014 1015{$endif} 1016const 1017{ get/set keyboard lock state} 1018 CLKED =1; { Caps locked} 1019 NLKED =2; { Num locked} 1020 SLKED =4; { Scroll locked} 1021 ALKED =8; { AltGr locked} 1022 LOCK_MASK =CLKED or NLKED or SLKED or ALKED; 1023 1024Function KDGKBSTATE(fd:longint;var param1 : longint):boolean; 1025Function KDSKBSTATE(fd:longint;param1 : longint):boolean; 1026 1027{ enable/disable I/O access} 1028Function KDENABIO(fd:longint):boolean; 1029Function KDDISABIO(fd:longint):boolean; 1030 1031{ make sound} 1032Function KIOCSOUND(fd:longint;param1 : longint):boolean; 1033 1034Const 1035{ get keyboard model} 1036 KB_OTHER =0; { keyboard not known} 1037 KB_84 =1; { 'old' 84 key AT-keyboard} 1038 KB_101 =2; { MF-101 or MF-102 keyboard} 1039Function KDGKBTYPE(fd:longint;var param1 : longint):boolean; 1040 1041const 1042{ get/set keyboard LED state} 1043 LED_CAP =1; { Caps lock LED} 1044 LED_NUM =2; { Num lock LED} 1045 LED_SCR =4; { Scroll lock LED} 1046 LED_MASK =LED_CAP or LED_NUM or LED_SCR; 1047Function KDGETLED(fd:longint;var param1 : longint):boolean; 1048Function KDSETLED(fd:longint;param1 : longint):boolean; 1049 1050{ set keyboard repeat rate (obsolete, use KDSETREPEAT below)} 1051Function KDSETRAD(fd:longint;param1 : longint):boolean; 1052 1053{ see console.h for the definition of the following FpIoctl} 1054{$ifndef definconsole} 1055Function KDRASTER(fd:longint;var param1 : scr_size_t):boolean; 1056 1057{$endif} 1058 1059TYPE 1060{ get keyboard information} 1061 keyboard_info = Record 1062 kb_index : longint; { kbdio index#} 1063 kb_name : array[0..15] of char; { driver name} 1064 kb_unit : longint; { unit#} 1065 kb_type : longint; { KB_84, KB_101, KB_OTHER,...} 1066 kb_config: longint; { device configuration flags} 1067 kb_flags : longint; { internal flags} 1068 end; 1069 keyboard_info_t=keyboard_info; 1070 1071Function KDGKBINFO(fd:longint;var param1 : keyboard_info_t):boolean; 1072 1073Type 1074{ set/get keyboard repeat rate (new interface)} 1075 keyboard_repeat = record 1076 kb_repeat: array[0..1] of longint; 1077 end; 1078 1079keyboard_repeat_t = keyboard_repeat; 1080 1081Function KDSETREPEAT(fd:longint;var param1 : keyboard_repeat_t):boolean; 1082Function KDGETREPEAT(fd:longint;var param1 : keyboard_repeat_t):boolean; 1083 1084{ get/set key map/accent map/function key strings} 1085 1086const 1087 NUM_KEYS =256; { number of keys in table} 1088 NUM_STATES =8; { states per key} 1089 ALTGR_OFFSET =128; { offset for altlock keys} 1090 1091 NUM_DEADKEYS =15; { number of accent keys} 1092 NUM_ACCENTCHARS =52; { max number of accent chars} 1093 1094 NUM_FKEYS =96; { max number of function keys} 1095 MAXFK =16; { max length of a function key str} 1096 1097type 1098 keyent_t = record 1099 map : array[0..NUM_STATES-1] of uchar; 1100 spcl : uchar; 1101 flgs : uchar; 1102 end; 1103 1104const 1105 FLAG_LOCK_O =0; 1106 FLAG_LOCK_C =1; 1107 FLAG_LOCK_N =2; 1108 1109type keymap = record 1110 n_keys : ushort; 1111 key : array[0..NUM_KEYS-1] OF keyent_t; 1112 end; 1113 1114 keymap_t= keymap; 1115 1116CONST 1117{ defines for "special" keys (spcl bit set in keymap)} 1118 NOP =$00; { nothing (dead key)} 1119 LSH =$02; { left shift key} 1120 RSH =$03; { right shift key} 1121 CLK =$04; { caps lock key} 1122 NLK =$05; { num lock key} 1123 SLK =$06; { scroll lock key} 1124 LALT =$07; { left alt key} 1125 BTAB =$08; { backwards tab} 1126 LCTR =$09; { left control key} 1127 NEXT =$0a; { switch to next screen} 1128 F_SCR =$0b; { switch to first screen} 1129 L_SCR =$1a; { switch to last screen} 1130 F_FN =$1b; { first function key} 1131 L_FN =$7a; { last function key} 1132{ $7b-$7f reserved do not use !} 1133 RCTR =$80; { right control key} 1134 RALT =$81; { right alt (altgr) key} 1135 ALK =$82; { alt lock key} 1136 ASH =$83; { alt shift key} 1137 META =$84; { meta key} 1138 RBT =$85; { boot machine} 1139 DBG =$86; { call debugger} 1140 SUSP =$87; { suspend power (APM)} 1141 SPSC =$88; { toggle splash/text screen} 1142 1143 DGRA =$89; { grave} 1144 F_ACC =DGRA; { first accent key} 1145 1146 DACU =$8a; { acute} 1147 DCIR =$8b; { circumflex} 1148 DTIL =$8c; { tilde} 1149 DMAC =$8d; { macron} 1150 DBRE =$8e; { breve} 1151 DDOT =$8f; { dot} 1152 DUML =$90; { umlaut/diaresis} 1153 DDIA =$90; { diaresis} 1154 DSLA =$91; { slash} 1155 DRIN =$92; { ring} 1156 DCED =$93; { cedilla} 1157 DAPO =$94; { apostrophe} 1158 DDAC =$95; { double acute} 1159 DOGO =$96; { ogonek} 1160 DCAR =$97; { caron} 1161 L_ACC =DCAR; { last accent key} 1162 1163 STBY =$98; { Go into standby mode (apm)} 1164 PREV =$99; { switch to previous screen} 1165 PNC =$9a; { force system panic} 1166 LSHA =$9b; { left shift key / alt lock} 1167 RSHA =$9c; { right shift key / alt lock} 1168 LCTRA =$9d; { left ctrl key / alt lock} 1169 RCTRA =$9e; { right ctrl key / alt lock} 1170 LALTA =$9f; { left alt key / alt lock} 1171 RALTA =$a0; { right alt key / alt lock} 1172 HALT =$a1; { halt machine} 1173 PDWN =$a2; { halt machine and power down} 1174 1175function kbio_F(x:longint):longint; 1176function kbio_S(x:longint):longint; 1177function kbio_ACC(x:longint):longint; 1178 1179type acc_t = record 1180 accchar : uchar; 1181 map : array[0..NUM_ACCENTCHARS-1,0..1] of uchar; 1182 end; 1183 1184 accentmap = record 1185 n_accs : ushort; 1186 acc : array[0..NUM_DEADKEYS-1] of acc_t 1187 end; 1188 1189 accentmap_t = accentmap ; 1190 1191 keyarg = record 1192 keynum : ushort; 1193 key : keyent_t; 1194 end; 1195 1196 keyarg_t = keyarg; 1197 1198 fkeytab = record 1199 str : array [0..MAXFK-1] of uchar; 1200 len : uchar; 1201 end; 1202 fkeytab_t = fkeytab; 1203 1204 fkeyarg =record 1205 keynum : ushort; 1206 keydef : array[0..MAXFK-1] of char; 1207 flen :char; 1208 end; 1209 1210 fkeyarg_t = fkeyarg; 1211 1212Function GETFKEY(fd:longint;var param1 : fkeyarg_t):boolean; 1213Function SETFKEY(fd:longint;var param1 : fkeyarg_t):boolean; 1214 1215{$ifndef definconsole} 1216Function GIO_SCRNMAP(fd:longint;var param1 : scrmap_t):boolean; 1217Function PIO_SCRNMAP(fd:longint;var param1 : scrmap_t):boolean; 1218{$endif} 1219Function GIO_KEYMAP(fd:longint;var param1 : keymap_t):boolean; 1220Function PIO_KEYMAP(fd:longint;var param1 : keymap_t):boolean; 1221Function GIO_DEADKEYMAP(fd:longint;var param1 : accentmap_t):boolean; 1222Function PIO_DEADKEYMAP(fd:longint;var param1 : accentmap_t):boolean; 1223Function GIO_KEYMAPENT(fd:longint;var param1 : keyarg_t):boolean; 1224Function PIO_KEYMAPENT(fd:longint;var param1 : keyarg_t):boolean; 1225 1226{ flags set to the return value in the KD_XLATE mode} 1227Const 1228 NOKEY =$100; { no key pressed marker} 1229 FKEY =$200; { function key marker} 1230 MKEY =$400; { meta key marker (prepend ESC)} 1231 BKEY =$800; { backtab (ESC [ Z)} 1232 1233 SPCLKEY =$8000; { special key} 1234 RELKEY =$4000; { key released} 1235 ERRKEY =$2000; { error} 1236 1237 1238function KEYCHAR(c:longint):longint; 1239 1240function KEYFLAGS(c:longint):longint; 1241 1242{----------------------------- machine/mouse.h -------------------------------} 1243 1244{ Based on machine/mouse.h from FreeBSD release 4.2 1245 1246 * Copyright (c) 1992, 1993 Erik Forsberg. 1247 * Copyright (c) 1996, 1997 Kazutaka YOKOTA 1248 * All rights reserved. 1249 * 1250 * Redistribution and use in source and binary forms, with or without 1251 * modification, are permitted provided that the following conditions 1252 * are met: 1253 * 1. Redistributions of source code must retain the above copyright 1254 * notice, this list of conditions and the following disclaimer. 1255 * 1256 * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED 1257 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1258 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 1259 * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1260 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1261 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 1262 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 1263 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 1264 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 1265 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1266 * 1267 * $FreeBSD: src/sys/i386/include/mouse.h,v 1.15.2.1 2000/03/21 14:44:10 yokota Exp $ 1268 } 1269 1270 1271{ FpIoctls } 1272 1273 1274{ mouse status block } 1275 1276type 1277 mousestatus = record 1278 flags : longint; { state change flags } 1279 button : longint; { button status } 1280 obutton : longint; { previous button status } 1281 dx : longint; { x movement } 1282 dy : longint; { y movement } 1283 dz : longint; { z movement } 1284 end; 1285 1286 mousestatus_t = mousestatus; 1287 1288CONST 1289 1290{ button } 1291 MOUSE_BUTTON1DOWN =$0001; { left } 1292 MOUSE_BUTTON2DOWN =$0002; { middle } 1293 MOUSE_BUTTON3DOWN =$0004; { right } 1294 MOUSE_BUTTON4DOWN =$0008; 1295 MOUSE_BUTTON5DOWN =$0010; 1296 MOUSE_BUTTON6DOWN =$0020; 1297 MOUSE_BUTTON7DOWN =$0040; 1298 MOUSE_BUTTON8DOWN =$0080; 1299 MOUSE_MAXBUTTON =31; 1300 MOUSE_STDBUTTONS =$0007; { buttons 1-3 } 1301 MOUSE_EXTBUTTONS =$7ffffff8; { the others (28 of them!) } 1302 MOUSE_BUTTONS =(MOUSE_STDBUTTONS or MOUSE_EXTBUTTONS); 1303 1304{ flags } 1305 MOUSE_STDBUTTONSCHANGED =MOUSE_STDBUTTONS; 1306 MOUSE_EXTBUTTONSCHANGED =MOUSE_EXTBUTTONS; 1307 MOUSE_BUTTONSCHANGED =MOUSE_BUTTONS; 1308 MOUSE_POSCHANGED =$80000000; 1309 1310type 1311 mousehw =record 1312 buttons : longint; { -1 if unknown } 1313 iftype : longint; { MOUSE_IF_XXX } 1314 _type : longint; { mouse/track ball/pad... } 1315 model : longint; { I/F dependent model ID: MOUSE_MODEL_XXX } 1316 hwid : longint; { I/F dependent hardware ID} 1317 { for the PS/2 mouse, it will be PSM_XXX_ID } 1318 end; 1319 1320 mousehw_t = mousehw; 1321 1322const 1323 1324{ iftype } 1325 MOUSE_IF_UNKNOWN =(-1); 1326 MOUSE_IF_SERIAL =0; 1327 MOUSE_IF_BUS =1; 1328 MOUSE_IF_INPORT =2; 1329 MOUSE_IF_PS2 =3; 1330 MOUSE_IF_SYSMOUSE =4; 1331 MOUSE_IF_USB =5; 1332 1333{ type } 1334 MOUSE_UNKNOWN =(-1); { should be treated as a mouse } 1335 MOUSE_MOUSE =0; 1336 MOUSE_TRACKBALL =1; 1337 MOUSE_STICK =2; 1338 MOUSE_PAD =3; 1339 1340{ model } 1341 MOUSE_MODEL_UNKNOWN =(-1); 1342 MOUSE_MODEL_GENERIC =0; 1343 MOUSE_MODEL_GLIDEPOINT =1; 1344 MOUSE_MODEL_NETSCROLL =2; 1345 MOUSE_MODEL_NET =3; 1346 MOUSE_MODEL_INTELLI =4; 1347 MOUSE_MODEL_THINK =5; 1348 MOUSE_MODEL_EASYSCROLL =6; 1349 MOUSE_MODEL_MOUSEMANPLUS =7; 1350 MOUSE_MODEL_KIDSPAD =8; 1351 MOUSE_MODEL_VERSAPAD =9; 1352 MOUSE_MODEL_EXPLORER =10; 1353 MOUSE_MODEL_4D =11; 1354 MOUSE_MODEL_4DPLUS =12; 1355 1356type mousemode = record 1357 protocol : longint; { MOUSE_PROTO_XXX } 1358 rate : longint; { report rate (per sec), -1 if unknown } 1359 resolution : longint; { MOUSE_RES_XXX, -1 if unknown } 1360 accelfactor : longint; { accelation factor (must be 1 or greater) } 1361 level : longint; { driver operation level } 1362 packetsize : longint; { the length of the data packet } 1363 syncmask : array[0..1] of uchar; { sync. data bits in the header byte } 1364 end; 1365 1366type mousemode_t = mousemode; 1367 1368{ protocol } 1369{ 1370 * Serial protocols: 1371 * Microsoft, MouseSystems, Logitech, MM series, MouseMan, Hitachi Tablet, 1372 * GlidePoint, IntelliMouse, Thinking Mouse, MouseRemote, Kidspad, 1373 * VersaPad 1374 * Bus mouse protocols: 1375 * bus, InPort 1376 * PS/2 mouse protocol: 1377 * PS/2 1378 } 1379 const 1380 1381 MOUSE_PROTO_UNKNOWN =(-1); 1382 MOUSE_PROTO_MS =0; { Microsoft Serial, 3 bytes } 1383 MOUSE_PROTO_MSC =1; { Mouse Systems, 5 bytes } 1384 MOUSE_PROTO_LOGI =2; { Logitech, 3 bytes } 1385 MOUSE_PROTO_MM =3; { MM series, 3 bytes } 1386 MOUSE_PROTO_LOGIMOUSEMAN =4; { Logitech MouseMan 3/4 bytes } 1387 MOUSE_PROTO_BUS =5; { MS/Logitech bus mouse } 1388 MOUSE_PROTO_INPORT =6; { MS/ATI InPort mouse } 1389 MOUSE_PROTO_PS2 =7; { PS/2 mouse, 3 bytes } 1390 MOUSE_PROTO_HITTAB =8; { Hitachi Tablet 3 bytes } 1391 MOUSE_PROTO_GLIDEPOINT =9; { ALPS GlidePoint, 3/4 bytes } 1392 MOUSE_PROTO_INTELLI =10; { MS IntelliMouse, 4 bytes } 1393 MOUSE_PROTO_THINK =11; { Kensignton Thinking Mouse, 3/4 bytes } 1394 MOUSE_PROTO_SYSMOUSE =12; { /dev/sysmouse } 1395 MOUSE_PROTO_X10MOUSEREM =13; { X10 MouseRemote, 3 bytes } 1396 MOUSE_PROTO_KIDSPAD =14; { Genius Kidspad } 1397 MOUSE_PROTO_VERSAPAD =15; { Interlink VersaPad, 6 bytes } 1398 1399 MOUSE_RES_UNKNOWN =(-1); 1400 MOUSE_RES_DEFAULT =0; 1401 MOUSE_RES_LOW =(-2); 1402 MOUSE_RES_MEDIUMLOW =(-3); 1403 MOUSE_RES_MEDIUMHIGH =(-4); 1404 MOUSE_RES_HIGH =(-5); 1405 1406type mousedata = record 1407 len : longint; { # of data in the buffer } 1408 buf : array [0..15] of longint; { data buffer } 1409 end; 1410 1411 mousedata_t=mousedata; 1412 1413 mousevar = record 1414 _var : array[0..15] of longint; 1415 end; 1416 1417type mousevar_t = mousevar; 1418 1419Function MOUSE_GETSTATUS(fd:longint;var param1 : mousestatus_t):boolean; 1420Function MOUSE_GETHWINFO(fd:longint;var param1 : mousehw_t):boolean; 1421Function MOUSE_GETMODE(fd:longint;var param1 : mousemode_t):boolean; 1422Function MOUSE_SETMODE(fd:longint;var param1 : mousemode_t):boolean; 1423Function MOUSE_GETLEVEL(fd:longint;var param1 : longint):boolean; 1424Function MOUSE_SETLEVEL(fd:longint;var param1 : longint):boolean; 1425Function MOUSE_GETVARS(fd:longint;var param1 : mousevar_t):boolean; 1426Function MOUSE_SETVARS(fd:longint;var param1 : mousevar_t):boolean; 1427Function MOUSE_READSTATE(fd:longint;var param1 : mousedata_t):boolean; 1428Function MOUSE_READDATA(fd:longint;var param1 : mousedata_t):boolean; 1429 1430Function MOUSE_SETRESOLUTION(fd:longint;var param1 : longint):boolean; 1431Function MOUSE_SETSCALING(fd:longint;var param1 : longint):boolean; 1432Function MOUSE_SETRATE(fd:longint;var param1 : longint):boolean; 1433Function MOUSE_GETHWID(fd:longint;var param1 : longint):boolean; 1434 1435 1436 1437const 1438 1439{ magic numbers in var[0] } 1440 MOUSE_VARS_PS2_SIG = $00325350; { 'PS2' } 1441 MOUSE_VARS_BUS_SIG = $00535542; { 'BUS' } 1442 MOUSE_VARS_INPORT_SIG = $00504e49; { 'INP' } 1443 1444{ Microsoft Serial mouse data packet } 1445 MOUSE_MSS_PACKETSIZE = 3; 1446 MOUSE_MSS_SYNCMASK = $40; 1447 MOUSE_MSS_SYNC = $40; 1448 MOUSE_MSS_BUTTONS = $30; 1449 MOUSE_MSS_BUTTON1DOWN = $20; { left } 1450 MOUSE_MSS_BUTTON2DOWN = $00; { no middle button } 1451 MOUSE_MSS_BUTTON3DOWN = $10; { right } 1452 1453{ Logitech MouseMan data packet (M+ protocol) } 1454 MOUSE_LMAN_BUTTON2DOWN = $20; { middle button, the 4th byte } 1455 1456{ ALPS GlidePoint extension (variant of M+ protocol) } 1457 MOUSE_ALPS_BUTTON2DOWN = $20; { middle button, the 4th byte } 1458 MOUSE_ALPS_TAP = $10; { `tapping' action, the 4th byte } 1459 1460{ Kinsington Thinking Mouse extension (variant of M+ protocol) } 1461 MOUSE_THINK_BUTTON2DOWN = $20; { lower-left button, the 4th byte } 1462 MOUSE_THINK_BUTTON4DOWN = $10; { lower-right button, the 4th byte } 1463 1464{ MS IntelliMouse (variant of MS Serial) } 1465 MOUSE_INTELLI_PACKETSIZE = 4; 1466 MOUSE_INTELLI_BUTTON2DOWN = $10; { middle button in the 4th byte } 1467 1468{ Mouse Systems Corp. mouse data packet } 1469 MOUSE_MSC_PACKETSIZE = 5; 1470 MOUSE_MSC_SYNCMASK = $f8; 1471 MOUSE_MSC_SYNC = $80; 1472 MOUSE_MSC_BUTTONS = $07; 1473 MOUSE_MSC_BUTTON1UP = $04; { left } 1474 MOUSE_MSC_BUTTON2UP = $02; { middle } 1475 MOUSE_MSC_BUTTON3UP = $01; { right } 1476 MOUSE_MSC_MAXBUTTON = 3; 1477 1478{ MM series mouse data packet } 1479 MOUSE_MM_PACKETSIZE = 3; 1480 MOUSE_MM_SYNCMASK = $e0; 1481 MOUSE_MM_SYNC = $80; 1482 MOUSE_MM_BUTTONS = $07; 1483 MOUSE_MM_BUTTON1DOWN = $04; { left } 1484 MOUSE_MM_BUTTON2DOWN = $02; { middle } 1485 MOUSE_MM_BUTTON3DOWN = $01; { right } 1486 MOUSE_MM_XPOSITIVE = $10; 1487 MOUSE_MM_YPOSITIVE = $08; 1488 1489{ PS/2 mouse data packet } 1490 MOUSE_PS2_PACKETSIZE = 3; 1491 MOUSE_PS2_SYNCMASK = $c8; 1492 MOUSE_PS2_SYNC = $08; 1493 MOUSE_PS2_BUTTONS = $07; { = $03 for 2 button mouse } 1494 MOUSE_PS2_BUTTON1DOWN = $01; { left } 1495 MOUSE_PS2_BUTTON2DOWN = $04; { middle } 1496 MOUSE_PS2_BUTTON3DOWN = $02; { right } 1497 MOUSE_PS2_TAP = MOUSE_PS2_SYNC; { GlidePoint (PS/2) `tapping' 1498 * Yes! this is the same bit 1499 * as SYNC! 1500 } 1501 1502 MOUSE_PS2_XNEG = $10; 1503 MOUSE_PS2_YNEG = $20; 1504 MOUSE_PS2_XOVERFLOW = $40; 1505 MOUSE_PS2_YOVERFLOW = $80; 1506 1507{ Logitech MouseMan+ (PS/2) data packet (PS/2++ protocol) } 1508 MOUSE_PS2PLUS_SYNCMASK = $48; 1509 MOUSE_PS2PLUS_SYNC = $48; 1510 MOUSE_PS2PLUS_ZNEG = $08; { sign bit } 1511 MOUSE_PS2PLUS_BUTTON4DOWN = $10; { 4th button on MouseMan+ } 1512 MOUSE_PS2PLUS_BUTTON5DOWN = $20; 1513 1514{ IBM ScrollPoint (PS/2) also uses PS/2++ protocol } 1515 MOUSE_SPOINT_ZNEG = $80; { sign bits } 1516 MOUSE_SPOINT_WNEG = $08; 1517 1518{ MS IntelliMouse (PS/2) data packet } 1519 MOUSE_PS2INTELLI_PACKETSIZE = 4; 1520{ some compatible mice have additional buttons } 1521 MOUSE_PS2INTELLI_BUTTON4DOWN = $40; 1522 MOUSE_PS2INTELLI_BUTTON5DOWN = $80; 1523 1524{ MS IntelliMouse Explorer (PS/2) data packet (variation of IntelliMouse) } 1525 MOUSE_EXPLORER_ZNEG = $08; { sign bit } 1526{ IntelliMouse Explorer has additional button data in the fourth byte } 1527 MOUSE_EXPLORER_BUTTON4DOWN = $10; 1528 MOUSE_EXPLORER_BUTTON5DOWN = $20; 1529 1530{ Interlink VersaPad (serial I/F) data packet } 1531 MOUSE_VERSA_PACKETSIZE = 6; 1532 MOUSE_VERSA_IN_USE = $04; 1533 MOUSE_VERSA_SYNCMASK = $c3; 1534 MOUSE_VERSA_SYNC = $c0; 1535 MOUSE_VERSA_BUTTONS = $30; 1536 MOUSE_VERSA_BUTTON1DOWN = $20; { left } 1537 MOUSE_VERSA_BUTTON2DOWN = $00; { middle } 1538 MOUSE_VERSA_BUTTON3DOWN = $10; { right } 1539 MOUSE_VERSA_TAP = $08; 1540 1541{ Interlink VersaPad (PS/2 I/F) data packet } 1542 MOUSE_PS2VERSA_PACKETSIZE = 6; 1543 MOUSE_PS2VERSA_IN_USE = $10; 1544 MOUSE_PS2VERSA_SYNCMASK = $e8; 1545 MOUSE_PS2VERSA_SYNC = $c8; 1546 MOUSE_PS2VERSA_BUTTONS = $05; 1547 MOUSE_PS2VERSA_BUTTON1DOWN = $04; { left } 1548 MOUSE_PS2VERSA_BUTTON2DOWN = $00; { middle } 1549 MOUSE_PS2VERSA_BUTTON3DOWN = $01; { right } 1550 MOUSE_PS2VERSA_TAP = $02; 1551 1552{ A4 Tech 4D Mouse (PS/2) data packet } 1553 MOUSE_4D_PACKETSIZE = 3; 1554 MOUSE_4D_WHEELBITS = $f0; 1555 1556{ A4 Tech 4D+ Mouse (PS/2) data packet } 1557 MOUSE_4DPLUS_PACKETSIZE = 3; 1558 MOUSE_4DPLUS_ZNEG = $04; { sign bit } 1559 MOUSE_4DPLUS_BUTTON4DOWN = $08; 1560 1561{ sysmouse extended data packet } 1562{ 1563 * /dev/sysmouse sends data in two formats, depending on the protocol 1564 * level. At the level 0, format is exactly the same as MousSystems' 1565 * five byte packet. At the level 1, the first five bytes are the same 1566 * as at the level 0. There are additional three bytes which shows 1567 * `dz' and the states of additional buttons. `dz' is expressed as the 1568 * sum of the byte 5 and 6 which contain signed seven bit values. 1569 * The states of the button 4 though 10 are in the bit 0 though 6 in 1570 * the byte 7 respectively: 1 indicates the button is up. 1571 } 1572 MOUSE_SYS_PACKETSIZE = 8; 1573 MOUSE_SYS_SYNCMASK = $f8; 1574 MOUSE_SYS_SYNC = $80; 1575 MOUSE_SYS_BUTTON1UP = $04; { left, 1st byte } 1576 MOUSE_SYS_BUTTON2UP = $02; { middle, 1st byte } 1577 MOUSE_SYS_BUTTON3UP = $01; { right, 1st byte } 1578 MOUSE_SYS_BUTTON4UP = $0001; { 7th byte } 1579 MOUSE_SYS_BUTTON5UP = $0002; 1580 MOUSE_SYS_BUTTON6UP = $0004; 1581 MOUSE_SYS_BUTTON7UP = $0008; 1582 MOUSE_SYS_BUTTON8UP = $0010; 1583 MOUSE_SYS_BUTTON9UP = $0020; 1584 MOUSE_SYS_BUTTON10UP = $0040; 1585 MOUSE_SYS_MAXBUTTON = 10; 1586 MOUSE_SYS_STDBUTTONS = $07; 1587 MOUSE_SYS_EXTBUTTONS = $7f; { the others } 1588 1589{ Mouse remote socket } 1590 _PATH_MOUSEREMOTE ='/var/run/MouseRemote'; 1591 1592 1593{fbio FpIoctl numbers} 1594 nr_FBIOGTYPE =$40184600; 1595 nr_FBIOGINFO =$40184602; 1596 nr_FBIOPUTCMAP =$80144603; 1597 nr_FBIOGETCMAP =$80144604; 1598 nr_FBIOGATTR =$40584606; 1599 nr_FBIOSVIDEO =$80044607; 1600 nr_FBIOGVIDEO =$40044608; 1601 nr_FBIOSCURSOR =$802c4618; 1602 nr_FBIOGCURSOR =$c02c4619; 1603 nr_FBIOSCURPOS =$8004461a; 1604 nr_FBIOGCURPOS =$8004461b; 1605 nr_FBIOGCURMAX =$4004461c; 1606 nr_FBIO_ADAPTER =$40044664; 1607 nr_FBIO_ADPTYPE =$40044665; 1608 nr_FBIO_ADPINFO =$40a44666; 1609 nr_FBIO_MODEINFO =$c09c4667; 1610 nr_FBIO_FINDMODE =$c09c4668; 1611 nr_FBIO_GETMODE =$40044669; 1612 nr_FBIO_SETMODE =$8004466a; 1613 nr_FBIO_GETWINORG =$4004466b; 1614 nr_FBIO_SETWINORG =$8004466c; 1615 nr_FBIO_GETDISPSTART =$4008466d; 1616 nr_FBIO_SETDISPSTART =$8008466e; 1617 nr_FBIO_GETLINEWIDTH =$4004466f; 1618 nr_FBIO_SETLINEWIDTH =$80044670; 1619 nr_FBIO_GETPALETTE =$80184671; 1620 nr_FBIO_SETPALETTE =$80184672; 1621 1622{consio FpIoctl numbers} 1623 1624 nr_KDGETMODE =$40044b09; 1625 nr_KDSETMODE =$20004b0a; 1626 nr_KDSBORDER =$20004b0d; 1627 nr_KDRASTER =$800c4b64; 1628 nr_GIO_SCRNMAP =$41006b02; 1629 nr_PIO_SCRNMAP =$81006b03; 1630 nr_GIO_ATTR =$40046100; 1631 nr_GIO_COLOR =$40046300; 1632 nr_CONS_CURRENT =$40046301; 1633 nr_CONS_GET =$40046302; 1634 nr_CONS_IO =$20006303; 1635 nr_CONS_BLANKTIME =$80046304; 1636 nr_CONS_SSAVER =$80186305; 1637 nr_CONS_GSAVER =$c0186306; 1638 nr_CONS_CURSORTYPE =$80046307; 1639 nr_CONS_BELLTYPE =$80046308; 1640 nr_CONS_HISTORY =$80046309; 1641 nr_CONS_MOUSECTL =$c014630a; 1642 nr_CONS_IDLE =$4004630b; 1643 nr_CONS_SAVERMODE =$8004630c; 1644 nr_CONS_SAVERSTART =$8004630d; 1645 nr_PIO_FONT8x8 =$88006340; 1646 nr_GIO_FONT8x8 =$48006341; 1647 nr_PIO_FONT8x14 =$8e006342; 1648 nr_GIO_FONT8x14 =$4e006343; 1649 nr_PIO_FONT8x16 =$90006344; 1650 nr_GIO_FONT8x16 =$50006345; 1651 nr_CONS_GETINFO =$c0146349; 1652 nr_CONS_GETVERS =$4004634a; 1653 nr_CONS_CURRENTADP =$40046364; 1654 nr_CONS_ADPINFO =$c0a46365; 1655 nr_CONS_MODEINFO =$c09c6366; 1656 nr_CONS_FINDMODE =$c09c6367; 1657 nr_CONS_SETWINORG =$20006368; 1658 nr_CONS_SETKBD =$2000636e; 1659 nr_CONS_RELKBD =$2000636f; 1660 nr_CONS_GETTERM =$c0686370; 1661 nr_CONS_SETTERM =$80686371; 1662 nr_ADJUST_CLOCK =$20007464; 1663 nr_VT_OPENQRY =$40047601; 1664 nr_VT_SETMODE =$80087602; 1665 nr_VT_GETMODE =$40087603; 1666 nr_VT_RELDISP =$20007604; 1667 nr_VT_ACTIVATE =$20007605; 1668 nr_VT_WAITACTIVE =$20007606; 1669 nr_VT_GETACTIVE =$40047607; 1670 nr_VT_GETINDEX =$40047608; 1671 nr_SW_B40x25 =$20005300; 1672 nr_SW_C40x25 =$20005301; 1673 nr_SW_B80x25 =$20005302; 1674 nr_SW_C80x25 =$20005303; 1675 nr_SW_BG320 =$20005304; 1676 nr_SW_CG320 =$20005305; 1677 nr_SW_BG640 =$20005306; 1678 nr_SW_EGAMONO80x25 =$20005307; 1679 nr_SW_CG320_D =$2000530d; 1680 nr_SW_CG640_E =$2000530e; 1681 nr_SW_EGAMONOAPA =$2000530f; 1682 nr_SW_CG640x350 =$20005310; 1683 nr_SW_ENH_MONOAPA2 =$20005311; 1684 nr_SW_ENH_CG640 =$20005312; 1685 nr_SW_ENH_B40x25 =$20005313; 1686 nr_SW_ENH_C40x25 =$20005314; 1687 nr_SW_ENH_B80x25 =$20005315; 1688 nr_SW_ENH_C80x25 =$20005316; 1689 nr_SW_ENH_B80x43 =$20005370; 1690 nr_SW_ENH_C80x43 =$20005371; 1691 nr_SW_MCAMODE =$200053ff; 1692 nr_SW_VGA_C40x25 =$20005317; 1693 nr_SW_VGA_C80x25 =$20005318; 1694 nr_SW_VGA_C80x30 =$20005320; 1695 nr_SW_VGA_C80x50 =$2000531e; 1696 nr_SW_VGA_C80x60 =$20005322; 1697 nr_SW_VGA_M80x25 =$20005319; 1698 nr_SW_VGA_M80x30 =$20005321; 1699 nr_SW_VGA_M80x50 =$2000531f; 1700 nr_SW_VGA_M80x60 =$20005323; 1701 nr_SW_VGA11 =$2000531a; 1702 nr_SW_BG640x480 =$2000531a; 1703 nr_SW_VGA12 =$2000531b; 1704 nr_SW_CG640x480 =$2000531b; 1705 nr_SW_VGA13 =$2000531c; 1706 nr_SW_VGA_CG320 =$2000531c; 1707 nr_SW_VGA_CG640 =$20005324; 1708 nr_SW_VGA_MODEX =$20005325; 1709 nr_SW_PC98_80x25 =$20005362; 1710 nr_SW_PC98_80x30 =$20005363; 1711 nr_SW_PC98_EGC640x400 =$20005364; 1712 nr_SW_PC98_PEGC640x400 =$20005365; 1713 nr_SW_PC98_PEGC640x480 =$20005366; 1714 nr_SW_VGA_C90x25 =$20005328; 1715 nr_SW_VGA_M90x25 =$20005329; 1716 nr_SW_VGA_C90x30 =$2000532a; 1717 nr_SW_VGA_M90x30 =$2000532b; 1718 nr_SW_VGA_C90x43 =$2000532c; 1719 nr_SW_VGA_M90x43 =$2000532d; 1720 nr_SW_VGA_C90x50 =$2000532e; 1721 nr_SW_VGA_M90x50 =$2000532f; 1722 nr_SW_VGA_C90x60 =$20005330; 1723 nr_SW_VGA_M90x60 =$20005331; 1724 nr_SW_TEXT_80x25 =$200053c8; 1725 nr_SW_TEXT_80x30 =$200053c9; 1726 nr_SW_TEXT_80x43 =$200053ca; 1727 nr_SW_TEXT_80x50 =$200053cb; 1728 nr_SW_TEXT_80x60 =$200053cc; 1729 nr_SW_TEXT_132x25 =$200053cd; 1730 nr_SW_TEXT_132x30 =$200053ce; 1731 nr_SW_TEXT_132x43 =$200053cf; 1732 nr_SW_TEXT_132x50 =$200053d0; 1733 nr_SW_TEXT_132x60 =$200053d1; 1734 nr_SW_VESA_CG640x400 =$20005600; 1735 nr_SW_VESA_CG640x480 =$20005601; 1736 nr_SW_VESA_800x600 =$20005602; 1737 nr_SW_VESA_CG800x600 =$20005603; 1738 nr_SW_VESA_1024x768 =$20005604; 1739 nr_SW_VESA_CG1024x768 =$20005605; 1740 nr_SW_VESA_1280x1024 =$20005606; 1741 nr_SW_VESA_CG1280x1024 =$20005607; 1742 nr_SW_VESA_C80x60 =$20005608; 1743 nr_SW_VESA_C132x25 =$20005609; 1744 nr_SW_VESA_C132x43 =$2000560a; 1745 nr_SW_VESA_C132x50 =$2000560b; 1746 nr_SW_VESA_C132x60 =$2000560c; 1747 nr_SW_VESA_32K_320 =$2000560d; 1748 nr_SW_VESA_64K_320 =$2000560e; 1749 nr_SW_VESA_FULL_320 =$2000560f; 1750 nr_SW_VESA_32K_640 =$20005610; 1751 nr_SW_VESA_64K_640 =$20005611; 1752 nr_SW_VESA_FULL_640 =$20005612; 1753 nr_SW_VESA_32K_800 =$20005613; 1754 nr_SW_VESA_64K_800 =$20005614; 1755 nr_SW_VESA_FULL_800 =$20005615; 1756 nr_SW_VESA_32K_1024 =$20005616; 1757 nr_SW_VESA_64K_1024 =$20005617; 1758 nr_SW_VESA_FULL_1024 =$20005618; 1759 nr_SW_VESA_32K_1280 =$20005619; 1760 nr_SW_VESA_64K_1280 =$2000561a; 1761 nr_SW_VESA_FULL_1280 =$2000561b; 1762 1763{kbdsio FpIoctl numbers} 1764 1765 nr_KDGKBMODE =$40044b06; 1766 nr_KDSKBMODE =$20004b07; 1767 nr_KDMKTONE =$20004b08; 1768{$ifndef definconsole} 1769 nr_KDGETMODE =$40044b09; 1770 nr_KDSETMODE =$20004b0a; 1771 nr_KDSBORDER =$20004b0d; 1772{$endif} 1773 nr_KDGKBSTATE =$40044b13; 1774 nr_KDSKBSTATE =$20004b14; 1775 nr_KDENABIO =$20004b3c; 1776 nr_KDDISABIO =$20004b3d; 1777 nr_KIOCSOUND =$20004b3f; 1778 nr_KDGKBTYPE =$40044b40; 1779 nr_KDGETLED =$40044b41; 1780 nr_KDSETLED =$20004b42; 1781 nr_KDSETRAD =$20004b43; 1782{$ifndef definconsole} 1783 nr_KDRASTER =$800c4b64; 1784{$endif} 1785 nr_KDGKBINFO =$40244b65; 1786 nr_KDSETREPEAT =$80084b66; 1787 nr_KDGETREPEAT =$40084b67; 1788 nr_GETFKEY =$c0146b00; 1789 nr_SETFKEY =$c0146b01; 1790{$ifndef definconsole} 1791 nr_GIO_SCRNMAP =$41006b02; 1792 nr_PIO_SCRNMAP =$81006b03; 1793{$endif} 1794 nr_GIO_KEYMAP =$4a026b06; 1795 nr_PIO_KEYMAP =$8a026b07; 1796 nr_GIO_DEADKEYMAP =$462a6b08; 1797 nr_PIO_DEADKEYMAP =$862a6b09; 1798 nr_GIO_KEYMAPENT =$c00c6b0a; 1799 nr_PIO_KEYMAPENT =$800c6b0b; 1800 1801 1802 1803{mouse FpIoctl numbers} 1804 nr_MOUSE_GETSTATUS =$40184d00; 1805 nr_MOUSE_GETHWINFO =$40144d01; 1806 nr_MOUSE_GETMODE =$401c4d02; 1807 nr_MOUSE_SETMODE =$801c4d03; 1808 nr_MOUSE_GETLEVEL =$40044d04; 1809 nr_MOUSE_SETLEVEL =$80044d05; 1810 nr_MOUSE_GETVARS =$40404d06; 1811 nr_MOUSE_SETVARS =$80404d07; 1812 nr_MOUSE_READSTATE =$c0444d08; 1813 nr_MOUSE_READDATA =$c0444d09; 1814 nr_MOUSE_SETRESOLUTION =$80044d0a; 1815 nr_MOUSE_SETSCALING =$80044d0b; 1816 nr_MOUSE_SETRATE =$80044d0c; 1817 nr_MOUSE_GETHWID =$40044d0d; 1818 1819{------------- Added procedures ---------------} 1820 1821function physicalconsole(fd:longint) : boolean; 1822 1823IMPLEMENTATION 1824 1825Uses BaseUnix,termio; 1826 1827function physicalconsole(fd:longint) : boolean; 1828 1829var name:string; 1830 1831begin 1832 if (isatty(fd)<>-1) then 1833 begin 1834 name:=ttyname(fd); 1835 if Copy(name,1,8)<>'/dev/tty' then 1836 physicalconsole:=false {isatty is true, but not /dev/tty. 1837 Could be /dev/pts support, but 1838 I reserve the case} 1839 else 1840 begin 1841 if name[9]='v' then {ttyv is phys console. see /etc/ttys} 1842 physicalconsole:=true 1843 else 1844 physicalconsole:=false; 1845 end; 1846 end 1847 else 1848 physicalconsole:=false; {Not a tty, then I don't know what it is} 1849end; 1850 1851{other macros (not FpIoctl)} 1852 1853function KEYCHAR(c:longint):longint; 1854 1855begin 1856 c:=c and $FF; 1857end; 1858 1859function KEYFLAGS(c:longint):longint; 1860 1861begin 1862 c:=c and NOT $FF; 1863end; 1864 1865function kbio_F(x:longint):longint; 1866begin 1867 kbio_f:=x+F_FN-1; 1868end; 1869 1870function kbio_S(x:longint):longint; 1871begin 1872 kbio_S:=x+F_SCR-1; 1873end; 1874 1875function kbio_ACC(x:longint):longint; 1876begin 1877 kbio_ACC:=x+F_ACC; 1878end; 1879 1880{fbio.h FpIoctl's} 1881 1882Function FBIOGTYPE(fd:longint;var param1 : fbtype):boolean; 1883{IOR('F',0,sizeof(struct fbtype) } 1884 1885Begin 1886 FBIOGTYPE:=FpIoctl(fd,nr_FBIOGTYPE,@param1)=0; 1887end; 1888 1889Function FBIOGINFO(fd:longint;var param1 : fbinfo):boolean; 1890{IOR('F',2,sizeof(struct fbinfo) } 1891 1892Begin 1893 FBIOGINFO:=FpIoctl(fd,nr_FBIOGINFO,@param1)=0; 1894end; 1895 1896Function FBIOPUTCMAP(fd:longint;var param1 : fbcmap):boolean; 1897{IOW('F',3,sizeof(struct fbcmap) } 1898 1899Begin 1900 FBIOPUTCMAP:=FpIoctl(fd,nr_FBIOPUTCMAP,@param1)=0; 1901end; 1902 1903Function FBIOGETCMAP(fd:longint;var param1 : fbcmap):boolean; 1904{IOW('F',4,sizeof(struct fbcmap) } 1905 1906Begin 1907 FBIOGETCMAP:=FpIoctl(fd,nr_FBIOGETCMAP,@param1)=0; 1908end; 1909 1910Function FBIOGATTR(fd:longint;var param1 : fbgattr):boolean; 1911{IOR('F',6,sizeof(struct fbgattr) } 1912 1913Begin 1914 FBIOGATTR:=FpIoctl(fd,nr_FBIOGATTR,@param1)=0; 1915end; 1916 1917Function FBIOSVIDEO(fd:longint;var param1 : longint):boolean; 1918{IOW('F',7,sizeof(int) } 1919 1920Begin 1921 FBIOSVIDEO:=FpIoctl(fd,nr_FBIOSVIDEO,@param1)=0; 1922end; 1923 1924Function FBIOGVIDEO(fd:longint;var param1 : longint):boolean; 1925{IOR('F',8,sizeof(int) } 1926 1927Begin 1928 FBIOGVIDEO:=FpIoctl(fd,nr_FBIOGVIDEO,@param1)=0; 1929end; 1930 1931Function FBIOSCURSOR(fd:longint;var param1 : fbcursor):boolean; 1932{IOW('F',24,sizeof(struct fbcursor) } 1933 1934Begin 1935 FBIOSCURSOR:=FpIoctl(fd,nr_FBIOSCURSOR,@param1)=0; 1936end; 1937 1938Function FBIOGCURSOR(fd:longint;var param1 : fbcursor):boolean; 1939{IOWR('F',25,sizeof(struct fbcursor) } 1940 1941Begin 1942 FBIOGCURSOR:=FpIoctl(fd,nr_FBIOGCURSOR,@param1)=0; 1943end; 1944 1945Function FBIOSCURPOS(fd:longint;var param1 : fbcurpos):boolean; 1946{IOW('F',26,sizeof(struct fbcurpos) } 1947 1948Begin 1949 FBIOSCURPOS:=FpIoctl(fd,nr_FBIOSCURPOS,@param1)=0; 1950end; 1951 1952Function FBIOGCURPOS(fd:longint;var param1 : fbcurpos):boolean; 1953{IOW('F',27,sizeof(struct fbcurpos) } 1954 1955Begin 1956 FBIOGCURPOS:=FpIoctl(fd,nr_FBIOGCURPOS,@param1)=0; 1957end; 1958 1959Function FBIOGCURMAX(fd:longint;var param1 : fbcurpos):boolean; 1960{IOR('F',28,sizeof(struct fbcurpos) } 1961 1962Begin 1963 FBIOGCURMAX:=FpIoctl(fd,nr_FBIOGCURMAX,@param1)=0; 1964end; 1965 1966Function FBIO_ADAPTER(fd:longint;var param1 : longint):boolean; 1967{IOR('F',100,sizeof(int) } 1968 1969Begin 1970 FBIO_ADAPTER:=FpIoctl(fd,nr_FBIO_ADAPTER,@param1)=0; 1971end; 1972 1973Function FBIO_ADPTYPE(fd:longint;var param1 : longint):boolean; 1974{IOR('F',101,sizeof(int) } 1975 1976Begin 1977 FBIO_ADPTYPE:=FpIoctl(fd,nr_FBIO_ADPTYPE,@param1)=0; 1978end; 1979 1980Function FBIO_ADPINFO(fd:longint;var param1 : video_adapter_info):boolean; 1981{IOR('F',102,sizeof(struct video_adapter_info) } 1982 1983Begin 1984 FBIO_ADPINFO:=FpIoctl(fd,nr_FBIO_ADPINFO,@param1)=0; 1985end; 1986 1987Function FBIO_MODEINFO(fd:longint;var param1 : video_info):boolean; 1988{IOWR('F',103,sizeof(struct video_info) } 1989 1990Begin 1991 FBIO_MODEINFO:=FpIoctl(fd,nr_FBIO_MODEINFO,@param1)=0; 1992end; 1993 1994Function FBIO_FINDMODE(fd:longint;var param1 : video_info):boolean; 1995{IOWR('F',104,sizeof(struct video_info) } 1996 1997Begin 1998 FBIO_FINDMODE:=FpIoctl(fd,nr_FBIO_FINDMODE,@param1)=0; 1999end; 2000 2001Function FBIO_GETMODE(fd:longint;var param1 : longint):boolean; 2002{IOR('F',105,sizeof(int) } 2003 2004Begin 2005 FBIO_GETMODE:=FpIoctl(fd,nr_FBIO_GETMODE,@param1)=0; 2006end; 2007 2008Function FBIO_SETMODE(fd:longint;var param1 : longint):boolean; 2009{IOW('F',106,sizeof(int) } 2010 2011Begin 2012 FBIO_SETMODE:=FpIoctl(fd,nr_FBIO_SETMODE,@param1)=0; 2013end; 2014 2015Function FBIO_GETWINORG(fd:longint;var param1 : u_int):boolean; 2016{IOR('F',107,sizeof(u_int) } 2017 2018Begin 2019 FBIO_GETWINORG:=FpIoctl(fd,nr_FBIO_GETWINORG,@param1)=0; 2020end; 2021 2022Function FBIO_SETWINORG(fd:longint;var param1 : u_int):boolean; 2023{IOW('F',108,sizeof(u_int) } 2024 2025Begin 2026 FBIO_SETWINORG:=FpIoctl(fd,nr_FBIO_SETWINORG,@param1)=0; 2027end; 2028 2029Function FBIO_GETDISPSTART(fd:longint;var param1 : video_display_start_t):boolean; 2030{IOR('F',109,sizeof(video_display_start_t) } 2031 2032Begin 2033 FBIO_GETDISPSTART:=FpIoctl(fd,nr_FBIO_GETDISPSTART,@param1)=0; 2034end; 2035 2036Function FBIO_SETDISPSTART(fd:longint;var param1 : video_display_start_t):boolean; 2037{IOW('F',110,sizeof(video_display_start_t) } 2038 2039Begin 2040 FBIO_SETDISPSTART:=FpIoctl(fd,nr_FBIO_SETDISPSTART,@param1)=0; 2041end; 2042 2043Function FBIO_GETLINEWIDTH(fd:longint;var param1 : u_int):boolean; 2044{IOR('F',111,sizeof(u_int) } 2045 2046Begin 2047 FBIO_GETLINEWIDTH:=FpIoctl(fd,nr_FBIO_GETLINEWIDTH,@param1)=0; 2048end; 2049 2050Function FBIO_SETLINEWIDTH(fd:longint;var param1 : u_int):boolean; 2051{IOW('F',112,sizeof(u_int) } 2052 2053Begin 2054 FBIO_SETLINEWIDTH:=FpIoctl(fd,nr_FBIO_SETLINEWIDTH,@param1)=0; 2055end; 2056 2057Function FBIO_GETPALETTE(fd:longint;var param1 : video_color_palette_t):boolean; 2058{IOW('F',113,sizeof(video_color_palette_t) } 2059 2060Begin 2061 FBIO_GETPALETTE:=FpIoctl(fd,nr_FBIO_GETPALETTE,@param1)=0; 2062end; 2063 2064Function FBIO_SETPALETTE(fd:longint;var param1 : video_color_palette_t):boolean; 2065{IOW('F',114,sizeof(video_color_palette_t) } 2066 2067Begin 2068 FBIO_SETPALETTE:=FpIoctl(fd,nr_FBIO_SETPALETTE,@param1)=0; 2069end; 2070 2071 2072{consio.h FpIoctl's} 2073 2074Function KDGETMODE(fd:longint;var param1 : longint):boolean; 2075{IOR('K',9,sizeof(int) } 2076 2077Begin 2078 KDGETMODE:=FpIoctl(fd,nr_KDGETMODE,@param1)=0; 2079end; 2080 2081Function KDSETMODE(fd:longint;param1 : longint):boolean; 2082{IO('K',10 /* int */)); 2083 } 2084 2085Begin 2086 KDSETMODE:=FpIoctl(fd,nr_KDSETMODE,pointer(param1))=0; 2087end; 2088 2089Function KDSBORDER(fd:longint;param1 : longint):boolean; 2090{IO('K',13 /* int */)); 2091 } 2092 2093Begin 2094 KDSBORDER:=FpIoctl(fd,nr_KDSBORDER,pointer(param1))=0; 2095end; 2096 2097Function KDRASTER(fd:longint;var param1 : scr_size_t):boolean; 2098{IOW('K',100,sizeof(scr_size_t) } 2099 2100Begin 2101 KDRASTER:=FpIoctl(fd,nr_KDRASTER,@param1)=0; 2102end; 2103 2104Function GIO_SCRNMAP(fd:longint;var param1 : scrmap_t):boolean; 2105{IOR('k',2,sizeof(scrmap_t) } 2106 2107Begin 2108 GIO_SCRNMAP:=FpIoctl(fd,nr_GIO_SCRNMAP,@param1)=0; 2109end; 2110 2111Function PIO_SCRNMAP(fd:longint;var param1 : scrmap_t):boolean; 2112{IOW('k',3,sizeof(scrmap_t) } 2113 2114Begin 2115 PIO_SCRNMAP:=FpIoctl(fd,nr_PIO_SCRNMAP,@param1)=0; 2116end; 2117 2118Function GIO_ATTR(fd:longint;var param1 : longint):boolean; 2119{IOR('a',0,sizeof(int) } 2120 2121Begin 2122 GIO_ATTR:=FpIoctl(fd,nr_GIO_ATTR,@param1)=0; 2123end; 2124 2125Function GIO_COLOR(fd:longint;var param1 : longint):boolean; 2126{IOR('c',0,sizeof(int) } 2127 2128Begin 2129 GIO_COLOR:=FpIoctl(fd,nr_GIO_COLOR,@param1)=0; 2130end; 2131 2132Function CONS_CURRENT(fd:longint;var param1 : longint):boolean; 2133{IOR('c',1,sizeof(int) } 2134 2135Begin 2136 CONS_CURRENT:=FpIoctl(fd,nr_CONS_CURRENT,@param1)=0; 2137end; 2138 2139Function CONS_GET(fd:longint;var param1 : longint):boolean; 2140{IOR('c',2,sizeof(int) } 2141 2142Begin 2143 CONS_GET:=FpIoctl(fd,nr_CONS_GET,@param1)=0; 2144end; 2145 2146Function CONS_IO(fd:longint):boolean; 2147{IO('c',3)); 2148 } 2149 2150Begin 2151 CONS_IO:=FpIoctl(fd,nr_CONS_IO,nil)=0; 2152end; 2153 2154Function CONS_BLANKTIME(fd:longint;var param1 : longint):boolean; 2155{IOW('c',4,sizeof(int) } 2156 2157Begin 2158 CONS_BLANKTIME:=FpIoctl(fd,nr_CONS_BLANKTIME,@param1)=0; 2159end; 2160 2161Function CONS_SSAVER(fd:longint;var param1 : ssaver_t):boolean; 2162{IOW('c',5,sizeof(ssaver_t) } 2163 2164Begin 2165 CONS_SSAVER:=FpIoctl(fd,nr_CONS_SSAVER,@param1)=0; 2166end; 2167 2168Function CONS_GSAVER(fd:longint;var param1 : ssaver_t):boolean; 2169{IOWR('c',6,sizeof(ssaver_t) } 2170 2171Begin 2172 CONS_GSAVER:=FpIoctl(fd,nr_CONS_GSAVER,@param1)=0; 2173end; 2174 2175Function CONS_CURSORTYPE(fd:longint;var param1 : longint):boolean; 2176{IOW('c',7,sizeof(int) } 2177 2178Begin 2179 CONS_CURSORTYPE:=FpIoctl(fd,nr_CONS_CURSORTYPE,@param1)=0; 2180end; 2181 2182Function CONS_BELLTYPE(fd:longint;var param1 : longint):boolean; 2183{IOW('c',8,sizeof(int) } 2184 2185Begin 2186 CONS_BELLTYPE:=FpIoctl(fd,nr_CONS_BELLTYPE,@param1)=0; 2187end; 2188 2189Function CONS_HISTORY(fd:longint;var param1 : longint):boolean; 2190{IOW('c',9,sizeof(int) } 2191 2192Begin 2193 CONS_HISTORY:=FpIoctl(fd,nr_CONS_HISTORY,@param1)=0; 2194end; 2195 2196Function CONS_MOUSECTL(fd:longint;var param1 : mouse_info_t):boolean; 2197{IOWR('c',10,sizeof(mouse_info_t) } 2198 2199Begin 2200 CONS_MOUSECTL:=FpIoctl(fd,nr_CONS_MOUSECTL,@param1)=0; 2201end; 2202 2203Function CONS_IDLE(fd:longint;var param1 : longint):boolean; 2204{IOR('c',11,sizeof(int) } 2205 2206Begin 2207 CONS_IDLE:=FpIoctl(fd,nr_CONS_IDLE,@param1)=0; 2208end; 2209 2210Function CONS_SAVERMODE(fd:longint;var param1 : longint):boolean; 2211{IOW('c',12,sizeof(int) } 2212 2213Begin 2214 CONS_SAVERMODE:=FpIoctl(fd,nr_CONS_SAVERMODE,@param1)=0; 2215end; 2216 2217Function CONS_SAVERSTART(fd:longint;var param1 : longint):boolean; 2218{IOW('c',13,sizeof(int) } 2219 2220Begin 2221 CONS_SAVERSTART:=FpIoctl(fd,nr_CONS_SAVERSTART,@param1)=0; 2222end; 2223 2224Function PIO_FONT8x8(fd:longint;var param1 : fnt8_t):boolean; 2225{IOW('c',64,sizeof(fnt8_t) } 2226 2227Begin 2228 PIO_FONT8x8:=FpIoctl(fd,nr_PIO_FONT8x8,@param1)=0; 2229end; 2230 2231Function GIO_FONT8x8(fd:longint;var param1 : fnt8_t):boolean; 2232{IOR('c',65,sizeof(fnt8_t) } 2233 2234Begin 2235 GIO_FONT8x8:=FpIoctl(fd,nr_GIO_FONT8x8,@param1)=0; 2236end; 2237 2238Function PIO_FONT8x14(fd:longint;var param1 : fnt14_t):boolean; 2239{IOW('c',66,sizeof(fnt14_t) } 2240 2241Begin 2242 PIO_FONT8x14:=FpIoctl(fd,nr_PIO_FONT8x14,@param1)=0; 2243end; 2244 2245Function GIO_FONT8x14(fd:longint;var param1 : fnt14_t):boolean; 2246{IOR('c',67,sizeof(fnt14_t) } 2247 2248Begin 2249 GIO_FONT8x14:=FpIoctl(fd,nr_GIO_FONT8x14,@param1)=0; 2250end; 2251 2252Function PIO_FONT8x16(fd:longint;var param1 : fnt16_t):boolean; 2253{IOW('c',68,sizeof(fnt16_t) } 2254 2255Begin 2256 PIO_FONT8x16:=FpIoctl(fd,nr_PIO_FONT8x16,@param1)=0; 2257end; 2258 2259Function GIO_FONT8x16(fd:longint;var param1 : fnt16_t):boolean; 2260{IOR('c',69,sizeof(fnt16_t) } 2261 2262Begin 2263 GIO_FONT8x16:=FpIoctl(fd,nr_GIO_FONT8x16,@param1)=0; 2264end; 2265 2266Function CONS_GETINFO(fd:longint;var param1 : vid_info_t):boolean; 2267{IOWR('c',73,sizeof(vid_info_t) } 2268 2269Begin 2270 CONS_GETINFO:=FpIoctl(fd,nr_CONS_GETINFO,@param1)=0; 2271end; 2272 2273Function CONS_GETVERS(fd:longint;var param1 : longint):boolean; 2274{IOR('c',74,sizeof(int) } 2275 2276Begin 2277 CONS_GETVERS:=FpIoctl(fd,nr_CONS_GETVERS,@param1)=0; 2278end; 2279 2280Function CONS_CURRENTADP(fd:longint;var param1 : longint):boolean; 2281{IOR('c',100,sizeof(int) } 2282 2283Begin 2284 CONS_CURRENTADP:=FpIoctl(fd,nr_CONS_CURRENTADP,@param1)=0; 2285end; 2286 2287Function CONS_ADPINFO(fd:longint;var param1 : video_adapter_info_t):boolean; 2288{IOWR('c',101,sizeof(video_adapter_info_t) } 2289 2290Begin 2291 CONS_ADPINFO:=FpIoctl(fd,nr_CONS_ADPINFO,@param1)=0; 2292end; 2293 2294Function CONS_MODEINFO(fd:longint;var param1 : video_info_t):boolean; 2295{IOWR('c',102,sizeof(video_info_t) } 2296 2297Begin 2298 CONS_MODEINFO:=FpIoctl(fd,nr_CONS_MODEINFO,@param1)=0; 2299end; 2300 2301Function CONS_FINDMODE(fd:longint;var param1 : video_info_t):boolean; 2302{IOWR('c',103,sizeof(video_info_t) } 2303 2304Begin 2305 CONS_FINDMODE:=FpIoctl(fd,nr_CONS_FINDMODE,@param1)=0; 2306end; 2307 2308Function CONS_SETWINORG(fd:longint;param1 : longint):boolean; 2309{IO('c',104 /* int */)); 2310 } 2311 2312Begin 2313 CONS_SETWINORG:=FpIoctl(fd,nr_CONS_SETWINORG,pointer(param1))=0; 2314end; 2315 2316Function CONS_SETKBD(fd:longint;param1 : longint):boolean; 2317{IO('c',110 /* int */)); 2318 } 2319 2320Begin 2321 CONS_SETKBD:=FpIoctl(fd,nr_CONS_SETKBD,pointer(param1))=0; 2322end; 2323 2324Function CONS_RELKBD(fd:longint):boolean; 2325{IO('c',111)); 2326 } 2327 2328Begin 2329 CONS_RELKBD:=FpIoctl(fd,nr_CONS_RELKBD,nil)=0; 2330end; 2331 2332Function CONS_GETTERM(fd:longint;var param1 : term_info_t):boolean; 2333{IOWR('c',112,sizeof(term_info_t) } 2334 2335Begin 2336 CONS_GETTERM:=FpIoctl(fd,nr_CONS_GETTERM,@param1)=0; 2337end; 2338 2339Function CONS_SETTERM(fd:longint;var param1 : term_info_t):boolean; 2340{IOW('c',113,sizeof(term_info_t) } 2341 2342Begin 2343 CONS_SETTERM:=FpIoctl(fd,nr_CONS_SETTERM,@param1)=0; 2344end; 2345 2346Function ADJUST_CLOCK(fd:longint):boolean; 2347{IO('t',100)); 2348 } 2349 2350Begin 2351 ADJUST_CLOCK:=FpIoctl(fd,nr_ADJUST_CLOCK,nil)=0; 2352end; 2353 2354Function VT_OPENQRY(fd:longint;var param1 : longint):boolean; 2355{IOR('v',1,sizeof(int) } 2356 2357Begin 2358 VT_OPENQRY:=FpIoctl(fd,nr_VT_OPENQRY,@param1)=0; 2359end; 2360 2361Function VT_SETMODE(fd:longint;var param1 : vtmode_t):boolean; 2362{IOW('v',2,sizeof(vtmode_t) } 2363 2364Begin 2365 VT_SETMODE:=FpIoctl(fd,nr_VT_SETMODE,@param1)=0; 2366end; 2367 2368Function VT_GETMODE(fd:longint;var param1 : vtmode_t):boolean; 2369{IOR('v',3,sizeof(vtmode_t) } 2370 2371Begin 2372 VT_GETMODE:=FpIoctl(fd,nr_VT_GETMODE,@param1)=0; 2373end; 2374 2375Function VT_RELDISP(fd:longint;param1 : longint):boolean; 2376{IO('v',4 /* int */)); 2377 } 2378 2379Begin 2380 VT_RELDISP:=FpIoctl(fd,nr_VT_RELDISP,pointer(param1))=0; 2381end; 2382 2383Function VT_ACTIVATE(fd:longint;param1 : longint):boolean; 2384{IO('v',5 /* int */)); 2385 } 2386 2387Begin 2388 VT_ACTIVATE:=FpIoctl(fd,nr_VT_ACTIVATE,pointer(param1))=0; 2389end; 2390 2391Function VT_WAITACTIVE(fd:longint;param1 : longint):boolean; 2392{IO('v',6 /* int */)); 2393 } 2394 2395Begin 2396 VT_WAITACTIVE:=FpIoctl(fd,nr_VT_WAITACTIVE,pointer(param1))=0; 2397end; 2398 2399Function VT_GETACTIVE(fd:longint;var param1 : longint):boolean; 2400{IOR('v',7,sizeof(int) } 2401 2402Begin 2403 VT_GETACTIVE:=FpIoctl(fd,nr_VT_GETACTIVE,@param1)=0; 2404end; 2405 2406Function VT_GETINDEX(fd:longint;var param1 : longint):boolean; 2407{IOR('v',8,sizeof(int) } 2408 2409Begin 2410 VT_GETINDEX:=FpIoctl(fd,nr_VT_GETINDEX,@param1)=0; 2411end; 2412 2413Function SW_B40x25(fd:longint):boolean; 2414{IO('S',M_B40x25)); 2415 } 2416 2417Begin 2418 SW_B40x25:=FpIoctl(fd,nr_SW_B40x25,nil)=0; 2419end; 2420 2421Function SW_C40x25(fd:longint):boolean; 2422{IO('S',M_C40x25)); 2423 } 2424 2425Begin 2426 SW_C40x25:=FpIoctl(fd,nr_SW_C40x25,nil)=0; 2427end; 2428 2429Function SW_B80x25(fd:longint):boolean; 2430{IO('S',M_B80x25)); 2431 } 2432 2433Begin 2434 SW_B80x25:=FpIoctl(fd,nr_SW_B80x25,nil)=0; 2435end; 2436 2437Function SW_C80x25(fd:longint):boolean; 2438{IO('S',M_C80x25)); 2439 } 2440 2441Begin 2442 SW_C80x25:=FpIoctl(fd,nr_SW_C80x25,nil)=0; 2443end; 2444 2445Function SW_BG320(fd:longint):boolean; 2446{IO('S',M_BG320)); 2447 } 2448 2449Begin 2450 SW_BG320:=FpIoctl(fd,nr_SW_BG320,nil)=0; 2451end; 2452 2453Function SW_CG320(fd:longint):boolean; 2454{IO('S',M_CG320)); 2455 } 2456 2457Begin 2458 SW_CG320:=FpIoctl(fd,nr_SW_CG320,nil)=0; 2459end; 2460 2461Function SW_BG640(fd:longint):boolean; 2462{IO('S',M_BG640)); 2463 } 2464 2465Begin 2466 SW_BG640:=FpIoctl(fd,nr_SW_BG640,nil)=0; 2467end; 2468 2469Function SW_EGAMONO80x25(fd:longint):boolean; 2470{IO('S',M_EGAMONO80x25)); 2471 } 2472 2473Begin 2474 SW_EGAMONO80x25:=FpIoctl(fd,nr_SW_EGAMONO80x25,nil)=0; 2475end; 2476 2477Function SW_CG320_D(fd:longint):boolean; 2478{IO('S',M_CG320_D)); 2479 } 2480 2481Begin 2482 SW_CG320_D:=FpIoctl(fd,nr_SW_CG320_D,nil)=0; 2483end; 2484 2485Function SW_CG640_E(fd:longint):boolean; 2486{IO('S',M_CG640_E)); 2487 } 2488 2489Begin 2490 SW_CG640_E:=FpIoctl(fd,nr_SW_CG640_E,nil)=0; 2491end; 2492 2493Function SW_EGAMONOAPA(fd:longint):boolean; 2494{IO('S',M_EGAMONOAPA)); 2495 } 2496 2497Begin 2498 SW_EGAMONOAPA:=FpIoctl(fd,nr_SW_EGAMONOAPA,nil)=0; 2499end; 2500 2501Function SW_CG640x350(fd:longint):boolean; 2502{IO('S',M_CG640x350)); 2503 } 2504 2505Begin 2506 SW_CG640x350:=FpIoctl(fd,nr_SW_CG640x350,nil)=0; 2507end; 2508 2509Function SW_ENH_MONOAPA2(fd:longint):boolean; 2510{IO('S',M_ENHMONOAPA2)); 2511 } 2512 2513Begin 2514 SW_ENH_MONOAPA2:=FpIoctl(fd,nr_SW_ENH_MONOAPA2,nil)=0; 2515end; 2516 2517Function SW_ENH_CG640(fd:longint):boolean; 2518{IO('S',M_ENH_CG640)); 2519 } 2520 2521Begin 2522 SW_ENH_CG640:=FpIoctl(fd,nr_SW_ENH_CG640,nil)=0; 2523end; 2524 2525Function SW_ENH_B40x25(fd:longint):boolean; 2526{IO('S',M_ENH_B40x25)); 2527 } 2528 2529Begin 2530 SW_ENH_B40x25:=FpIoctl(fd,nr_SW_ENH_B40x25,nil)=0; 2531end; 2532 2533Function SW_ENH_C40x25(fd:longint):boolean; 2534{IO('S',M_ENH_C40x25)); 2535 } 2536 2537Begin 2538 SW_ENH_C40x25:=FpIoctl(fd,nr_SW_ENH_C40x25,nil)=0; 2539end; 2540 2541Function SW_ENH_B80x25(fd:longint):boolean; 2542{IO('S',M_ENH_B80x25)); 2543 } 2544 2545Begin 2546 SW_ENH_B80x25:=FpIoctl(fd,nr_SW_ENH_B80x25,nil)=0; 2547end; 2548 2549Function SW_ENH_C80x25(fd:longint):boolean; 2550{IO('S',M_ENH_C80x25)); 2551 } 2552 2553Begin 2554 SW_ENH_C80x25:=FpIoctl(fd,nr_SW_ENH_C80x25,nil)=0; 2555end; 2556 2557Function SW_ENH_B80x43(fd:longint):boolean; 2558{IO('S',M_ENH_B80x43)); 2559 } 2560 2561Begin 2562 SW_ENH_B80x43:=FpIoctl(fd,nr_SW_ENH_B80x43,nil)=0; 2563end; 2564 2565Function SW_ENH_C80x43(fd:longint):boolean; 2566{IO('S',M_ENH_C80x43)); 2567 } 2568 2569Begin 2570 SW_ENH_C80x43:=FpIoctl(fd,nr_SW_ENH_C80x43,nil)=0; 2571end; 2572 2573Function SW_MCAMODE(fd:longint):boolean; 2574{IO('S',M_MCA_MODE)); 2575 } 2576 2577Begin 2578 SW_MCAMODE:=FpIoctl(fd,nr_SW_MCAMODE,nil)=0; 2579end; 2580 2581Function SW_VGA_C40x25(fd:longint):boolean; 2582{IO('S',M_VGA_C40x25)); 2583 } 2584 2585Begin 2586 SW_VGA_C40x25:=FpIoctl(fd,nr_SW_VGA_C40x25,nil)=0; 2587end; 2588 2589Function SW_VGA_C80x25(fd:longint):boolean; 2590{IO('S',M_VGA_C80x25)); 2591 } 2592 2593Begin 2594 SW_VGA_C80x25:=FpIoctl(fd,nr_SW_VGA_C80x25,nil)=0; 2595end; 2596 2597Function SW_VGA_C80x30(fd:longint):boolean; 2598{IO('S',M_VGA_C80x30)); 2599 } 2600 2601Begin 2602 SW_VGA_C80x30:=FpIoctl(fd,nr_SW_VGA_C80x30,nil)=0; 2603end; 2604 2605Function SW_VGA_C80x50(fd:longint):boolean; 2606{IO('S',M_VGA_C80x50)); 2607 } 2608 2609Begin 2610 SW_VGA_C80x50:=FpIoctl(fd,nr_SW_VGA_C80x50,nil)=0; 2611end; 2612 2613Function SW_VGA_C80x60(fd:longint):boolean; 2614{IO('S',M_VGA_C80x60)); 2615 } 2616 2617Begin 2618 SW_VGA_C80x60:=FpIoctl(fd,nr_SW_VGA_C80x60,nil)=0; 2619end; 2620 2621Function SW_VGA_M80x25(fd:longint):boolean; 2622{IO('S',M_VGA_M80x25)); 2623 } 2624 2625Begin 2626 SW_VGA_M80x25:=FpIoctl(fd,nr_SW_VGA_M80x25,nil)=0; 2627end; 2628 2629Function SW_VGA_M80x30(fd:longint):boolean; 2630{IO('S',M_VGA_M80x30)); 2631 } 2632 2633Begin 2634 SW_VGA_M80x30:=FpIoctl(fd,nr_SW_VGA_M80x30,nil)=0; 2635end; 2636 2637Function SW_VGA_M80x50(fd:longint):boolean; 2638{IO('S',M_VGA_M80x50)); 2639 } 2640 2641Begin 2642 SW_VGA_M80x50:=FpIoctl(fd,nr_SW_VGA_M80x50,nil)=0; 2643end; 2644 2645Function SW_VGA_M80x60(fd:longint):boolean; 2646{IO('S',M_VGA_M80x60)); 2647 } 2648 2649Begin 2650 SW_VGA_M80x60:=FpIoctl(fd,nr_SW_VGA_M80x60,nil)=0; 2651end; 2652 2653Function SW_VGA11(fd:longint):boolean; 2654{IO('S',M_VGA11)); 2655 } 2656 2657Begin 2658 SW_VGA11:=FpIoctl(fd,nr_SW_VGA11,nil)=0; 2659end; 2660 2661Function SW_BG640x480(fd:longint):boolean; 2662{IO('S',M_VGA11)); 2663 } 2664 2665Begin 2666 SW_BG640x480:=FpIoctl(fd,nr_SW_BG640x480,nil)=0; 2667end; 2668 2669Function SW_VGA12(fd:longint):boolean; 2670{IO('S',M_VGA12)); 2671 } 2672 2673Begin 2674 SW_VGA12:=FpIoctl(fd,nr_SW_VGA12,nil)=0; 2675end; 2676 2677Function SW_CG640x480(fd:longint):boolean; 2678{IO('S',M_VGA12)); 2679 } 2680 2681Begin 2682 SW_CG640x480:=FpIoctl(fd,nr_SW_CG640x480,nil)=0; 2683end; 2684 2685Function SW_VGA13(fd:longint):boolean; 2686{IO('S',M_VGA13)); 2687 } 2688 2689Begin 2690 SW_VGA13:=FpIoctl(fd,nr_SW_VGA13,nil)=0; 2691end; 2692 2693Function SW_VGA_CG320(fd:longint):boolean; 2694{IO('S',M_VGA13)); 2695 } 2696 2697Begin 2698 SW_VGA_CG320:=FpIoctl(fd,nr_SW_VGA_CG320,nil)=0; 2699end; 2700 2701Function SW_VGA_CG640(fd:longint):boolean; 2702{IO('S',M_VGA_CG640)); 2703 } 2704 2705Begin 2706 SW_VGA_CG640:=FpIoctl(fd,nr_SW_VGA_CG640,nil)=0; 2707end; 2708 2709Function SW_VGA_MODEX(fd:longint):boolean; 2710{IO('S',M_VGA_MODEX)); 2711 } 2712 2713Begin 2714 SW_VGA_MODEX:=FpIoctl(fd,nr_SW_VGA_MODEX,nil)=0; 2715end; 2716 2717Function SW_PC98_80x25(fd:longint):boolean; 2718{IO('S',M_PC98_80x25)); 2719 } 2720 2721Begin 2722 SW_PC98_80x25:=FpIoctl(fd,nr_SW_PC98_80x25,nil)=0; 2723end; 2724 2725Function SW_PC98_80x30(fd:longint):boolean; 2726{IO('S',M_PC98_80x30)); 2727 } 2728 2729Begin 2730 SW_PC98_80x30:=FpIoctl(fd,nr_SW_PC98_80x30,nil)=0; 2731end; 2732 2733Function SW_PC98_EGC640x400(fd:longint):boolean; 2734{IO('S',M_PC98_EGC640x400)); 2735 } 2736 2737Begin 2738 SW_PC98_EGC640x400:=FpIoctl(fd,nr_SW_PC98_EGC640x400,nil)=0; 2739end; 2740 2741Function SW_PC98_PEGC640x400(fd:longint):boolean; 2742{IO('S',M_PC98_PEGC640x400)); 2743 } 2744 2745Begin 2746 SW_PC98_PEGC640x400:=FpIoctl(fd,nr_SW_PC98_PEGC640x400,nil)=0; 2747end; 2748 2749Function SW_PC98_PEGC640x480(fd:longint):boolean; 2750{IO('S',M_PC98_PEGC640x480)); 2751 } 2752 2753Begin 2754 SW_PC98_PEGC640x480:=FpIoctl(fd,nr_SW_PC98_PEGC640x480,nil)=0; 2755end; 2756 2757Function SW_VGA_C90x25(fd:longint):boolean; 2758{IO('S',M_VGA_C90x25)); 2759 } 2760 2761Begin 2762 SW_VGA_C90x25:=FpIoctl(fd,nr_SW_VGA_C90x25,nil)=0; 2763end; 2764 2765Function SW_VGA_M90x25(fd:longint):boolean; 2766{IO('S',M_VGA_M90x25)); 2767 } 2768 2769Begin 2770 SW_VGA_M90x25:=FpIoctl(fd,nr_SW_VGA_M90x25,nil)=0; 2771end; 2772 2773Function SW_VGA_C90x30(fd:longint):boolean; 2774{IO('S',M_VGA_C90x30)); 2775 } 2776 2777Begin 2778 SW_VGA_C90x30:=FpIoctl(fd,nr_SW_VGA_C90x30,nil)=0; 2779end; 2780 2781Function SW_VGA_M90x30(fd:longint):boolean; 2782{IO('S',M_VGA_M90x30)); 2783 } 2784 2785Begin 2786 SW_VGA_M90x30:=FpIoctl(fd,nr_SW_VGA_M90x30,nil)=0; 2787end; 2788 2789Function SW_VGA_C90x43(fd:longint):boolean; 2790{IO('S',M_VGA_C90x43)); 2791 } 2792 2793Begin 2794 SW_VGA_C90x43:=FpIoctl(fd,nr_SW_VGA_C90x43,nil)=0; 2795end; 2796 2797Function SW_VGA_M90x43(fd:longint):boolean; 2798{IO('S',M_VGA_M90x43)); 2799 } 2800 2801Begin 2802 SW_VGA_M90x43:=FpIoctl(fd,nr_SW_VGA_M90x43,nil)=0; 2803end; 2804 2805Function SW_VGA_C90x50(fd:longint):boolean; 2806{IO('S',M_VGA_C90x50)); 2807 } 2808 2809Begin 2810 SW_VGA_C90x50:=FpIoctl(fd,nr_SW_VGA_C90x50,nil)=0; 2811end; 2812 2813Function SW_VGA_M90x50(fd:longint):boolean; 2814{IO('S',M_VGA_M90x50)); 2815 } 2816 2817Begin 2818 SW_VGA_M90x50:=FpIoctl(fd,nr_SW_VGA_M90x50,nil)=0; 2819end; 2820 2821Function SW_VGA_C90x60(fd:longint):boolean; 2822{IO('S',M_VGA_C90x60)); 2823 } 2824 2825Begin 2826 SW_VGA_C90x60:=FpIoctl(fd,nr_SW_VGA_C90x60,nil)=0; 2827end; 2828 2829Function SW_VGA_M90x60(fd:longint):boolean; 2830{IO('S',M_VGA_M90x60)); 2831 } 2832 2833Begin 2834 SW_VGA_M90x60:=FpIoctl(fd,nr_SW_VGA_M90x60,nil)=0; 2835end; 2836 2837Function SW_TEXT_80x25(fd:longint):boolean; 2838{IO('S',M_TEXT_80x25)); 2839 } 2840 2841Begin 2842 SW_TEXT_80x25:=FpIoctl(fd,nr_SW_TEXT_80x25,nil)=0; 2843end; 2844 2845Function SW_TEXT_80x30(fd:longint):boolean; 2846{IO('S',M_TEXT_80x30)); 2847 } 2848 2849Begin 2850 SW_TEXT_80x30:=FpIoctl(fd,nr_SW_TEXT_80x30,nil)=0; 2851end; 2852 2853Function SW_TEXT_80x43(fd:longint):boolean; 2854{IO('S',M_TEXT_80x43)); 2855 } 2856 2857Begin 2858 SW_TEXT_80x43:=FpIoctl(fd,nr_SW_TEXT_80x43,nil)=0; 2859end; 2860 2861Function SW_TEXT_80x50(fd:longint):boolean; 2862{IO('S',M_TEXT_80x50)); 2863 } 2864 2865Begin 2866 SW_TEXT_80x50:=FpIoctl(fd,nr_SW_TEXT_80x50,nil)=0; 2867end; 2868 2869Function SW_TEXT_80x60(fd:longint):boolean; 2870{IO('S',M_TEXT_80x60)); 2871 } 2872 2873Begin 2874 SW_TEXT_80x60:=FpIoctl(fd,nr_SW_TEXT_80x60,nil)=0; 2875end; 2876 2877Function SW_TEXT_132x25(fd:longint):boolean; 2878{IO('S',M_TEXT_132x25)); 2879 } 2880 2881Begin 2882 SW_TEXT_132x25:=FpIoctl(fd,nr_SW_TEXT_132x25,nil)=0; 2883end; 2884 2885Function SW_TEXT_132x30(fd:longint):boolean; 2886{IO('S',M_TEXT_132x30)); 2887 } 2888 2889Begin 2890 SW_TEXT_132x30:=FpIoctl(fd,nr_SW_TEXT_132x30,nil)=0; 2891end; 2892 2893Function SW_TEXT_132x43(fd:longint):boolean; 2894{IO('S',M_TEXT_132x43)); 2895 } 2896 2897Begin 2898 SW_TEXT_132x43:=FpIoctl(fd,nr_SW_TEXT_132x43,nil)=0; 2899end; 2900 2901Function SW_TEXT_132x50(fd:longint):boolean; 2902{IO('S',M_TEXT_132x50)); 2903 } 2904 2905Begin 2906 SW_TEXT_132x50:=FpIoctl(fd,nr_SW_TEXT_132x50,nil)=0; 2907end; 2908 2909Function SW_TEXT_132x60(fd:longint):boolean; 2910{IO('S',M_TEXT_132x60)); 2911 } 2912 2913Begin 2914 SW_TEXT_132x60:=FpIoctl(fd,nr_SW_TEXT_132x60,nil)=0; 2915end; 2916 2917Function SW_VESA_CG640x400(fd:longint):boolean; 2918{IO('V',M_VESA_CG640x400 - M_VESA_BASE)); 2919 } 2920 2921Begin 2922 SW_VESA_CG640x400:=FpIoctl(fd,nr_SW_VESA_CG640x400,nil)=0; 2923end; 2924 2925Function SW_VESA_CG640x480(fd:longint):boolean; 2926{IO('V',M_VESA_CG640x480 - M_VESA_BASE)); 2927 } 2928 2929Begin 2930 SW_VESA_CG640x480:=FpIoctl(fd,nr_SW_VESA_CG640x480,nil)=0; 2931end; 2932 2933Function SW_VESA_800x600(fd:longint):boolean; 2934{IO('V',M_VESA_800x600 - M_VESA_BASE)); 2935 } 2936 2937Begin 2938 SW_VESA_800x600:=FpIoctl(fd,nr_SW_VESA_800x600,nil)=0; 2939end; 2940 2941Function SW_VESA_CG800x600(fd:longint):boolean; 2942{IO('V',M_VESA_CG800x600 - M_VESA_BASE)); 2943 } 2944 2945Begin 2946 SW_VESA_CG800x600:=FpIoctl(fd,nr_SW_VESA_CG800x600,nil)=0; 2947end; 2948 2949Function SW_VESA_1024x768(fd:longint):boolean; 2950{IO('V',M_VESA_1024x768 - M_VESA_BASE)); 2951 } 2952 2953Begin 2954 SW_VESA_1024x768:=FpIoctl(fd,nr_SW_VESA_1024x768,nil)=0; 2955end; 2956 2957Function SW_VESA_CG1024x768(fd:longint):boolean; 2958{IO('V',M_VESA_CG1024x768 - M_VESA_BAS)); 2959 } 2960 2961Begin 2962 SW_VESA_CG1024x768:=FpIoctl(fd,nr_SW_VESA_CG1024x768,nil)=0; 2963end; 2964 2965Function SW_VESA_1280x1024(fd:longint):boolean; 2966{IO('V',M_VESA_1280x1024 - M_VESA_BASE)); 2967 } 2968 2969Begin 2970 SW_VESA_1280x1024:=FpIoctl(fd,nr_SW_VESA_1280x1024,nil)=0; 2971end; 2972 2973Function SW_VESA_CG1280x1024(fd:longint):boolean; 2974{IO('V',M_VESA_CG1280x1024 - M_VESA_BA)); 2975 } 2976 2977Begin 2978 SW_VESA_CG1280x1024:=FpIoctl(fd,nr_SW_VESA_CG1280x1024,nil)=0; 2979end; 2980 2981Function SW_VESA_C80x60(fd:longint):boolean; 2982{IO('V',M_VESA_C80x60 - M_VESA_BASE)); 2983 } 2984 2985Begin 2986 SW_VESA_C80x60:=FpIoctl(fd,nr_SW_VESA_C80x60,nil)=0; 2987end; 2988 2989Function SW_VESA_C132x25(fd:longint):boolean; 2990{IO('V',M_VESA_C132x25 - M_VESA_BASE)); 2991 } 2992 2993Begin 2994 SW_VESA_C132x25:=FpIoctl(fd,nr_SW_VESA_C132x25,nil)=0; 2995end; 2996 2997Function SW_VESA_C132x43(fd:longint):boolean; 2998{IO('V',M_VESA_C132x43 - M_VESA_BASE)); 2999 } 3000 3001Begin 3002 SW_VESA_C132x43:=FpIoctl(fd,nr_SW_VESA_C132x43,nil)=0; 3003end; 3004 3005Function SW_VESA_C132x50(fd:longint):boolean; 3006{IO('V',M_VESA_C132x50 - M_VESA_BASE)); 3007 } 3008 3009Begin 3010 SW_VESA_C132x50:=FpIoctl(fd,nr_SW_VESA_C132x50,nil)=0; 3011end; 3012 3013Function SW_VESA_C132x60(fd:longint):boolean; 3014{IO('V',M_VESA_C132x60 - M_VESA_BASE)); 3015 } 3016 3017Begin 3018 SW_VESA_C132x60:=FpIoctl(fd,nr_SW_VESA_C132x60,nil)=0; 3019end; 3020 3021Function SW_VESA_32K_320(fd:longint):boolean; 3022{IO('V',M_VESA_32K_320 - M_VESA_BASE)); 3023 } 3024 3025Begin 3026 SW_VESA_32K_320:=FpIoctl(fd,nr_SW_VESA_32K_320,nil)=0; 3027end; 3028 3029Function SW_VESA_64K_320(fd:longint):boolean; 3030{IO('V',M_VESA_64K_320 - M_VESA_BASE)); 3031 } 3032 3033Begin 3034 SW_VESA_64K_320:=FpIoctl(fd,nr_SW_VESA_64K_320,nil)=0; 3035end; 3036 3037Function SW_VESA_FULL_320(fd:longint):boolean; 3038{IO('V',M_VESA_FULL_320 - M_VESA_BASE)); 3039 } 3040 3041Begin 3042 SW_VESA_FULL_320:=FpIoctl(fd,nr_SW_VESA_FULL_320,nil)=0; 3043end; 3044 3045Function SW_VESA_32K_640(fd:longint):boolean; 3046{IO('V',M_VESA_32K_640 - M_VESA_BASE)); 3047 } 3048 3049Begin 3050 SW_VESA_32K_640:=FpIoctl(fd,nr_SW_VESA_32K_640,nil)=0; 3051end; 3052 3053Function SW_VESA_64K_640(fd:longint):boolean; 3054{IO('V',M_VESA_64K_640 - M_VESA_BASE)); 3055 } 3056 3057Begin 3058 SW_VESA_64K_640:=FpIoctl(fd,nr_SW_VESA_64K_640,nil)=0; 3059end; 3060 3061Function SW_VESA_FULL_640(fd:longint):boolean; 3062{IO('V',M_VESA_FULL_640 - M_VESA_BASE)); 3063 } 3064 3065Begin 3066 SW_VESA_FULL_640:=FpIoctl(fd,nr_SW_VESA_FULL_640,nil)=0; 3067end; 3068 3069Function SW_VESA_32K_800(fd:longint):boolean; 3070{IO('V',M_VESA_32K_800 - M_VESA_BASE)); 3071 } 3072 3073Begin 3074 SW_VESA_32K_800:=FpIoctl(fd,nr_SW_VESA_32K_800,nil)=0; 3075end; 3076 3077Function SW_VESA_64K_800(fd:longint):boolean; 3078{IO('V',M_VESA_64K_800 - M_VESA_BASE)); 3079 } 3080 3081Begin 3082 SW_VESA_64K_800:=FpIoctl(fd,nr_SW_VESA_64K_800,nil)=0; 3083end; 3084 3085Function SW_VESA_FULL_800(fd:longint):boolean; 3086{IO('V',M_VESA_FULL_800 - M_VESA_BASE)); 3087 } 3088 3089Begin 3090 SW_VESA_FULL_800:=FpIoctl(fd,nr_SW_VESA_FULL_800,nil)=0; 3091end; 3092 3093Function SW_VESA_32K_1024(fd:longint):boolean; 3094{IO('V',M_VESA_32K_1024 - M_VESA_BASE)); 3095 } 3096 3097Begin 3098 SW_VESA_32K_1024:=FpIoctl(fd,nr_SW_VESA_32K_1024,nil)=0; 3099end; 3100 3101Function SW_VESA_64K_1024(fd:longint):boolean; 3102{IO('V',M_VESA_64K_1024 - M_VESA_BASE)); 3103 } 3104 3105Begin 3106 SW_VESA_64K_1024:=FpIoctl(fd,nr_SW_VESA_64K_1024,nil)=0; 3107end; 3108 3109Function SW_VESA_FULL_1024(fd:longint):boolean; 3110{IO('V',M_VESA_FULL_1024 - M_VESA_BASE)); 3111 } 3112 3113Begin 3114 SW_VESA_FULL_1024:=FpIoctl(fd,nr_SW_VESA_FULL_1024,nil)=0; 3115end; 3116 3117Function SW_VESA_32K_1280(fd:longint):boolean; 3118{IO('V',M_VESA_32K_1280 - M_VESA_BASE)); 3119 } 3120 3121Begin 3122 SW_VESA_32K_1280:=FpIoctl(fd,nr_SW_VESA_32K_1280,nil)=0; 3123end; 3124 3125Function SW_VESA_64K_1280(fd:longint):boolean; 3126{IO('V',M_VESA_64K_1280 - M_VESA_BASE)); 3127 } 3128 3129Begin 3130 SW_VESA_64K_1280:=FpIoctl(fd,nr_SW_VESA_64K_1280,nil)=0; 3131end; 3132 3133Function SW_VESA_FULL_1280(fd:longint):boolean; 3134{IO('V',M_VESA_FULL_1280 - M_VESA_BASE)); 3135 } 3136 3137Begin 3138 SW_VESA_FULL_1280:=FpIoctl(fd,nr_SW_VESA_FULL_1280,nil)=0; 3139end; 3140 3141{----------------------------- kbio.h FpIoctl's ---------------------------} 3142 3143Function KDGKBMODE(fd:longint;var param1 : longint):boolean; 3144{IOR('K',6,sizeof(int) } 3145 3146Begin 3147 KDGKBMODE:=FpIoctl(fd,nr_KDGKBMODE,@param1)=0; 3148end; 3149 3150Function KDSKBMODE(fd:longint;param1 : longint):boolean; 3151{IO('K',7 /* int */)); 3152 } 3153 3154Begin 3155 KDSKBMODE:=FpIoctl(fd,nr_KDSKBMODE,pointer(param1))=0; 3156end; 3157 3158Function KDMKTONE(fd:longint;param1 : longint):boolean; 3159{IO('K',8 /* int */)); 3160 } 3161 3162Begin 3163 KDMKTONE:=FpIoctl(fd,nr_KDMKTONE,pointer(param1))=0; 3164end; 3165 3166{$ifndef definconsole} 3167Function KDGETMODE(fd:longint;var param1 : longint):boolean; 3168{IOR('K',9,sizeof(int) } 3169 3170Begin 3171 KDGETMODE:=FpIoctl(fd,nr_KDGETMODE,@param1)=0; 3172end; 3173 3174Function KDSETMODE(fd:longint;param1 : longint):boolean; 3175{IO('K',10 /* int */)); 3176 } 3177 3178Begin 3179 KDSETMODE:=FpIoctl(fd,nr_KDSETMODE,pointer(param1))=0; 3180end; 3181 3182Function KDSBORDER(fd:longint;param1 : longint):boolean; 3183{IO('K',13 /* int */)); 3184 } 3185 3186Begin 3187 KDSBORDER:=FpIoctl(fd,nr_KDSBORDER,pointer(param1))=0; 3188end; 3189{$endif} 3190Function KDGKBSTATE(fd:longint;var param1 : longint):boolean; 3191{IOR('K',19,sizeof(int) } 3192 3193Begin 3194 KDGKBSTATE:=FpIoctl(fd,nr_KDGKBSTATE,@param1)=0; 3195end; 3196 3197Function KDSKBSTATE(fd:longint;param1 : longint):boolean; 3198{IO('K',20 /* int */)); 3199 } 3200 3201Begin 3202 KDSKBSTATE:=FpIoctl(fd,nr_KDSKBSTATE,pointer(param1))=0; 3203end; 3204 3205Function KDENABIO(fd:longint):boolean; 3206{IO('K',60)); 3207 } 3208 3209Begin 3210 KDENABIO:=FpIoctl(fd,nr_KDENABIO,nil)=0; 3211end; 3212 3213Function KDDISABIO(fd:longint):boolean; 3214{IO('K',61)); 3215 } 3216 3217Begin 3218 KDDISABIO:=FpIoctl(fd,nr_KDDISABIO,nil)=0; 3219end; 3220 3221Function KIOCSOUND(fd:longint;param1 : longint):boolean; 3222{IO('K',63 /* int */)); 3223 } 3224 3225Begin 3226 KIOCSOUND:=FpIoctl(fd,nr_KIOCSOUND,pointer(param1))=0; 3227end; 3228 3229Function KDGKBTYPE(fd:longint;var param1 : longint):boolean; 3230{IOR('K',64,sizeof(int) } 3231 3232Begin 3233 KDGKBTYPE:=FpIoctl(fd,nr_KDGKBTYPE,@param1)=0; 3234end; 3235 3236Function KDGETLED(fd:longint;var param1 : longint):boolean; 3237{IOR('K',65,sizeof(int) } 3238 3239Begin 3240 KDGETLED:=FpIoctl(fd,nr_KDGETLED,@param1)=0; 3241end; 3242 3243Function KDSETLED(fd:longint;param1 : longint):boolean; 3244{IO('K',66 /* int */)); 3245 } 3246 3247Begin 3248 KDSETLED:=FpIoctl(fd,nr_KDSETLED,pointer(param1))=0; 3249end; 3250 3251Function KDSETRAD(fd:longint;param1 : longint):boolean; 3252{IO('K',67 /* int */)); 3253 } 3254 3255Begin 3256 KDSETRAD:=FpIoctl(fd,nr_KDSETRAD,pointer(param1))=0; 3257end; 3258{$ifndef definconsole} 3259 3260Function KDRASTER(fd:longint;var param1 : scr_size_t):boolean; 3261{IOW('K',100,sizeof(scr_size_t) } 3262 3263Begin 3264 KDRASTER:=FpIoctl(fd,nr_KDRASTER,@param1)=0; 3265end; 3266{$endif} 3267Function KDGKBINFO(fd:longint;var param1 : keyboard_info_t):boolean; 3268{IOR('K',101,sizeof(keyboard_info_t) } 3269 3270Begin 3271 KDGKBINFO:=FpIoctl(fd,nr_KDGKBINFO,@param1)=0; 3272end; 3273 3274Function KDSETREPEAT(fd:longint;var param1 : keyboard_repeat_t):boolean; 3275{IOW('K',102,sizeof(keyboard_repeat_t) } 3276 3277Begin 3278 KDSETREPEAT:=FpIoctl(fd,nr_KDSETREPEAT,@param1)=0; 3279end; 3280 3281Function KDGETREPEAT(fd:longint;var param1 : keyboard_repeat_t):boolean; 3282{IOR('K',103,sizeof(keyboard_repeat_t) } 3283 3284Begin 3285 KDGETREPEAT:=FpIoctl(fd,nr_KDGETREPEAT,@param1)=0; 3286end; 3287 3288Function GETFKEY(fd:longint;var param1 : fkeyarg_t):boolean; 3289{IOWR('k',0,sizeof(fkeyarg_t) } 3290 3291Begin 3292 GETFKEY:=FpIoctl(fd,nr_GETFKEY,@param1)=0; 3293end; 3294 3295Function SETFKEY(fd:longint;var param1 : fkeyarg_t):boolean; 3296{IOWR('k',1,sizeof(fkeyarg_t) } 3297 3298Begin 3299 SETFKEY:=FpIoctl(fd,nr_SETFKEY,@param1)=0; 3300end; 3301{$ifndef definconsole} 3302Function GIO_SCRNMAP(fd:longint;var param1 : scrmap_t):boolean; 3303{IOR('k',2,sizeof(scrmap_t) } 3304 3305Begin 3306 GIO_SCRNMAP:=FpIoctl(fd,nr_GIO_SCRNMAP,@param1)=0; 3307end; 3308 3309Function PIO_SCRNMAP(fd:longint;var param1 : scrmap_t):boolean; 3310{IOW('k',3,sizeof(scrmap_t) } 3311 3312Begin 3313 PIO_SCRNMAP:=FpIoctl(fd,nr_PIO_SCRNMAP,@param1)=0; 3314end; 3315{$endif} 3316Function GIO_KEYMAP(fd:longint;var param1 : keymap_t):boolean; 3317{IOR('k',6,sizeof(keymap_t) } 3318 3319Begin 3320 GIO_KEYMAP:=FpIoctl(fd,nr_GIO_KEYMAP,@param1)=0; 3321end; 3322 3323Function PIO_KEYMAP(fd:longint;var param1 : keymap_t):boolean; 3324{IOW('k',7,sizeof(keymap_t) } 3325 3326Begin 3327 PIO_KEYMAP:=FpIoctl(fd,nr_PIO_KEYMAP,@param1)=0; 3328end; 3329 3330Function GIO_DEADKEYMAP(fd:longint;var param1 : accentmap_t):boolean; 3331{IOR('k',8,sizeof(accentmap_t) } 3332 3333Begin 3334 GIO_DEADKEYMAP:=FpIoctl(fd,nr_GIO_DEADKEYMAP,@param1)=0; 3335end; 3336 3337Function PIO_DEADKEYMAP(fd:longint;var param1 : accentmap_t):boolean; 3338{IOW('k',9,sizeof(accentmap_t) } 3339 3340Begin 3341 PIO_DEADKEYMAP:=FpIoctl(fd,nr_PIO_DEADKEYMAP,@param1)=0; 3342end; 3343 3344Function GIO_KEYMAPENT(fd:longint;var param1 : keyarg_t):boolean; 3345{IOWR('k',10,sizeof(keyarg_t) } 3346 3347Begin 3348 GIO_KEYMAPENT:=FpIoctl(fd,nr_GIO_KEYMAPENT,@param1)=0; 3349end; 3350 3351Function PIO_KEYMAPENT(fd:longint;var param1 : keyarg_t):boolean; 3352{IOW('k',11,sizeof(keyarg_t) } 3353 3354Begin 3355 PIO_KEYMAPENT:=FpIoctl(fd,nr_PIO_KEYMAPENT,@param1)=0; 3356end; 3357 3358 3359 3360{----------------------------- mouse.h FpIoctl's ---------------------------} 3361 3362Function MOUSE_GETSTATUS(fd:longint;var param1 : mousestatus_t):boolean; 3363{IOR('M',0,sizeof(mousestatus_t))); 3364} 3365 3366Begin 3367 MOUSE_GETSTATUS:=FpIoctl(fd,nr_MOUSE_GETSTATUS,@param1)=0; 3368end; 3369 3370Function MOUSE_GETHWINFO(fd:longint;var param1 : mousehw_t):boolean; 3371{IOR('M',1,sizeof(mousehw_t))); 3372} 3373 3374Begin 3375 MOUSE_GETHWINFO:=FpIoctl(fd,nr_MOUSE_GETHWINFO,@param1)=0; 3376end; 3377 3378Function MOUSE_GETMODE(fd:longint;var param1 : mousemode_t):boolean; 3379{IOR('M',2,sizeof(mousemode_t))); 3380} 3381 3382Begin 3383 MOUSE_GETMODE:=FpIoctl(fd,nr_MOUSE_GETMODE,@param1)=0; 3384end; 3385 3386Function MOUSE_SETMODE(fd:longint;var param1 : mousemode_t):boolean; 3387{IOW('M',3,sizeof(mousemode_t))); 3388} 3389 3390Begin 3391 MOUSE_SETMODE:=FpIoctl(fd,nr_MOUSE_SETMODE,@param1)=0; 3392end; 3393 3394Function MOUSE_GETLEVEL(fd:longint;var param1 : longint):boolean; 3395{IOR('M',4,sizeof(int))); 3396} 3397 3398Begin 3399 MOUSE_GETLEVEL:=FpIoctl(fd,nr_MOUSE_GETLEVEL,@param1)=0; 3400end; 3401 3402Function MOUSE_SETLEVEL(fd:longint;var param1 : longint):boolean; 3403{IOW('M',5,sizeof(int))); 3404} 3405 3406Begin 3407 MOUSE_SETLEVEL:=FpIoctl(fd,nr_MOUSE_SETLEVEL,@param1)=0; 3408end; 3409 3410Function MOUSE_GETVARS(fd:longint;var param1 : mousevar_t):boolean; 3411{IOR('M',6,sizeof(mousevar_t))); 3412} 3413 3414Begin 3415 MOUSE_GETVARS:=FpIoctl(fd,nr_MOUSE_GETVARS,@param1)=0; 3416end; 3417 3418Function MOUSE_SETVARS(fd:longint;var param1 : mousevar_t):boolean; 3419{IOW('M',7,sizeof(mousevar_t))); 3420} 3421 3422Begin 3423 MOUSE_SETVARS:=FpIoctl(fd,nr_MOUSE_SETVARS,@param1)=0; 3424end; 3425 3426Function MOUSE_READSTATE(fd:longint;var param1 : mousedata_t):boolean; 3427{IOWR('M',8,sizeof(mousedata_t))); 3428} 3429 3430Begin 3431 MOUSE_READSTATE:=FpIoctl(fd,nr_MOUSE_READSTATE,@param1)=0; 3432end; 3433 3434Function MOUSE_READDATA(fd:longint;var param1 : mousedata_t):boolean; 3435{IOWR('M',9,sizeof(mousedata_t))); 3436} 3437 3438Begin 3439 MOUSE_READDATA:=FpIoctl(fd,nr_MOUSE_READDATA,@param1)=0; 3440end; 3441 3442Function MOUSE_SETRESOLUTION(fd:longint;var param1 : longint):boolean; 3443{IOW('M',10,sizeof(int))); 3444} 3445 3446Begin 3447 MOUSE_SETRESOLUTION:=FpIoctl(fd,nr_MOUSE_SETRESOLUTION,@param1)=0; 3448end; 3449 3450Function MOUSE_SETSCALING(fd:longint;var param1 : longint):boolean; 3451{IOW('M',11,sizeof(int))); 3452} 3453 3454Begin 3455 MOUSE_SETSCALING:=FpIoctl(fd,nr_MOUSE_SETSCALING,@param1)=0; 3456end; 3457 3458Function MOUSE_SETRATE(fd:longint;var param1 : longint):boolean; 3459{IOW('M',12,sizeof(int))); 3460} 3461 3462Begin 3463 MOUSE_SETRATE:=FpIoctl(fd,nr_MOUSE_SETRATE,@param1)=0; 3464end; 3465 3466Function MOUSE_GETHWID(fd:longint;var param1 : longint):boolean; 3467{IOR('M',13,sizeof(int))); 3468} 3469 3470Begin 3471 MOUSE_GETHWID:=FpIoctl(fd,nr_MOUSE_GETHWID,@param1)=0; 3472end; 3473 3474end. 3475