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 >
Text File  |  1984-08-31  |  4KB  |  85 lines

  1. {FILE: FASTVID.INC }
  2. { Procedures to do fast video output under MS-DOS }
  3.    CONST
  4.       FBold : BYTE = 12;      { These are the attribute codes for the }
  5.       FReverse : BYTE = 15;   { various combinations of video attributes. }
  6.       FBlink : BYTE = 10;     { They must be set up as global, so that }
  7.       FUnder : BYTE = 6;      { When you call the procedure, you can }
  8.       FNormal : BYTE = 14;    { specify the attributes beforehand. }
  9.       FBoldBlink : BYTE = 8;
  10.       FBoldUnder : BYTE = 4;
  11.       FBoldReverse : BYTE = 13;
  12.       FReverseBlink : BYTE = 11;
  13.       FReverseUnder : BYTE = 7;
  14.       FBlinkUnder   : BYTE = 2;
  15.  
  16.    TYPE
  17.       STR = String[80];
  18.  
  19.       { The following are various options you may use with Fast Video: }
  20.       { both Chars & Attribs, Chars Only, or Attribs Only. }
  21.       FV_Subfunction_type = (Char_Attrib,Attrib_Only,Char_Only);
  22.  
  23.    VAR
  24.       FV_Subfunction : FV_Subfunction_type;
  25.  
  26.  
  27.    PROCEDURE FastVideo ( Var Text : STR; Attrib : BYTE;
  28.                             Subfunc : FV_Subfunction_type;
  29.                             TextLength, TRow, TCol : INTEGER);
  30.       { Displays text given in "fast video" mode. }
  31.       { Written by Stew Stryker, 1/21/85, MK01-2/H32 }
  32.       VAR
  33.          TextString, AttributeString : STR;   { Need to set up these locals }
  34.                                               { so they are in the same }
  35.                                               { data segment area. }
  36.  
  37.          { These are the different data registers used for MSDOS interrupts }
  38.          { It uses a variant record definition, that I got from Borland's
  39.            Turbo Tutor, but I don't know what it means.  All I know is that
  40.            you can access the registers as integer or byte quantities,
  41.            depending on what you need for the particular value. }
  42.          Result : Record case Integer of
  43.                   1: (AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : INTEGER);
  44.                   2: (AL,AH,BL,BH,CL,CH,DL,DH: Byte);
  45.                 end;
  46.  
  47.       BEGIN
  48.          { Fill up attribute string with attribute codes }
  49.          { Add one extra byte to fill it out }
  50.          FillChar(AttributeString,TextLength + 1,Attrib);
  51.          TextString := Text;
  52.  
  53.          { Load up the necessary registers. }
  54.          WITH Result DO
  55.             BEGIN
  56.                { Put the Subfunction selection into the AX Reg }
  57.                AX := Ord(Subfunc);
  58.                { Put the row and col # into lower BX and upper BX respectively}
  59.                BL := TRow;
  60.                BH := TCol;
  61.  
  62.                { Put the length of the string (or its attributes ) in CX }
  63.                CX := TextLength;
  64.  
  65.                { Stuff the offsets of the text and attribute strings in SI & DX }
  66.                { Add 1 to them to get past the length byte in [0] }
  67.                DX := Ofs(AttributeString) + 1;
  68.                SI := Ofs(TextString) + 1;
  69.  
  70.                { Make sure the Base Pointer shows the Segment of the strings. }
  71.                { N.B. These MUST be in the same segment. }
  72.                {      This is why we set up the local variables. }
  73.                BP := SEG(TextString);
  74.  
  75.                { Put the proper value into the DI Reg for Fast Video. }
  76.                DI := 20;
  77.                END;
  78.  
  79.          { Call Interrupt MSDOS with these values }
  80.          INTR(24,Result);
  81.          { That's all there is to it. }
  82.          END; { Procedure FastVideo }
  83.  
  84.  
  85.