level 6
overture_wy
楼主
crt.tpu{**************************************************************************** Standard CRT unit. Free Pascal runtime library for EMX. Copyright (c) 1997 Daniel Mantione. This file may be reproduced and modified under the same conditions as all other Free Pascal source code.****************************************************************************}unit crt;{$ASMMODE ATT}interface{$i crth.inc}{cemodeset means that the procedure textmode has failed to set up a mode.}type cexxxx=(cenoerror,cemodeset);var crt_error:cexxxx; {Crt-status. RW}{***************************************************************************}implementation{$i textrec.inc}const extkeycode:char=#0;var maxrows,maxcols:word; calibration:longint;type Tkbdkeyinfo=record charcode,scancode:char; fbstatus,bnlsshift:byte; fsstate:word; time:longint; end; {if you have information on the folowing datastructure, please send them to me at [email protected]} {This datastructure is needed when we ask in what video mode we are, or we want to set up a new mode.} viomodeinfo=record cb:word; { length of the entire data structure } fbtype, { bit mask of mode being set} color: byte; { number of colors (power of 2) } col, { number of text columns } row, { number of text rows } hres, { horizontal resolution } vres: word; { vertical resolution } fmt_ID, { attribute format ! more info wanted !} attrib: byte; { number of attributes } buf_addr, { physical address of videobuffer, e.g. $0b800} buf_length, { length of a videopage (bytes)} full_length, { total video-memory on video- card (bytes)} partial_length:longint; { ????? info wanted !} ext_data_addr:pointer; { ????? info wanted !} end; Pviomodeinfo=^viomodeinfo; TVioCursorInfo=record case boolean of false:( yStart:word; {Cursor start (top) scan line (0-based)} cEnd:word; {Cursor end (bottom) scan line} cx:word; {Cursor width (0=default width)} Attr:word); {Cursor colour attribute (-1=hidden)} true:( yStartInt: integer; {integer variants can be used to specify negative} cEndInt:integer; {negative values (interpreted as percentage by OS/2)} cxInt:integer; AttrInt:integer); end; PVioCursorInfo=^TVioCursorInfo;{EMXWRAP.DLL has strange calling conventions: All parameters must have a 4 byte size.}function kbdcharin(var Akeyrec:Tkbdkeyinfo;wait,kbdhandle:longint):word; cdecl; external 'EMXWRAP' index 204;function kbdpeek(var Akeyrec:TkbdkeyInfo;kbdhandle:word):word; cdecl; external 'EMXWRAP' index 222;function dossleep(time:cardinal):cardinal; cdecl; external 'DOSCALLS' index 229;function vioscrollup(top,left,bottom,right,lines:longint; var screl:word;viohandle:longint):word; cdecl; external 'EMXWRAP' index 107;function vioscrolldn(top,left,bottom,right,lines:longint; var screl:word;viohandle:longint):word; cdecl; external 'EMXWRAP' index 147;function viogetcurpos(var row,column:word;viohandle:longint):word; cdecl;
2006年04月23日 11点04分
1