home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
misc
/
messages.lzh
/
FASTVID.INC
< prev
next >
Wrap
Text File
|
1984-08-31
|
4KB
|
85 lines
{FILE: FASTVID.INC }
{ Procedures to do fast video output under MS-DOS }
CONST
FBold : BYTE = 12; { These are the attribute codes for the }
FReverse : BYTE = 15; { various combinations of video attributes. }
FBlink : BYTE = 10; { They must be set up as global, so that }
FUnder : BYTE = 6; { When you call the procedure, you can }
FNormal : BYTE = 14; { specify the attributes beforehand. }
FBoldBlink : BYTE = 8;
FBoldUnder : BYTE = 4;
FBoldReverse : BYTE = 13;
FReverseBlink : BYTE = 11;
FReverseUnder : BYTE = 7;
FBlinkUnder : BYTE = 2;
TYPE
STR = String[80];
{ The following are various options you may use with Fast Video: }
{ both Chars & Attribs, Chars Only, or Attribs Only. }
FV_Subfunction_type = (Char_Attrib,Attrib_Only,Char_Only);
VAR
FV_Subfunction : FV_Subfunction_type;
PROCEDURE FastVideo ( Var Text : STR; Attrib : BYTE;
Subfunc : FV_Subfunction_type;
TextLength, TRow, TCol : INTEGER);
{ Displays text given in "fast video" mode. }
{ Written by Stew Stryker, 1/21/85, MK01-2/H32 }
VAR
TextString, AttributeString : STR; { Need to set up these locals }
{ so they are in the same }
{ data segment area. }
{ These are the different data registers used for MSDOS interrupts }
{ It uses a variant record definition, that I got from Borland's
Turbo Tutor, but I don't know what it means. All I know is that
you can access the registers as integer or byte quantities,
depending on what you need for the particular value. }
Result : Record case Integer of
1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : INTEGER);
2: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
end;
BEGIN
{ Fill up attribute string with attribute codes }
{ Add one extra byte to fill it out }
FillChar(AttributeString,TextLength + 1,Attrib);
TextString := Text;
{ Load up the necessary registers. }
WITH Result DO
BEGIN
{ Put the Subfunction selection into the AX Reg }
AX := Ord(Subfunc);
{ Put the row and col # into lower BX and upper BX respectively}
BL := TRow;
BH := TCol;
{ Put the length of the string (or its attributes ) in CX }
CX := TextLength;
{ Stuff the offsets of the text and attribute strings in SI & DX }
{ Add 1 to them to get past the length byte in [0] }
DX := Ofs(AttributeString) + 1;
SI := Ofs(TextString) + 1;
{ Make sure the Base Pointer shows the Segment of the strings. }
{ N.B. These MUST be in the same segment. }
{ This is why we set up the local variables. }
BP := SEG(TextString);
{ Put the proper value into the DI Reg for Fast Video. }
DI := 20;
END;
{ Call Interrupt MSDOS with these values }
INTR(24,Result);
{ That's all there is to it. }
END; { Procedure FastVideo }