home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / DESQ10 / DESQDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1988-06-05  |  3KB  |  73 lines

  1. { =========================================================================== }
  2. { DESQdemo.pas - Demo for DESQview interface routines      ver 1.0, 06-05-88  }
  3. {                                                                             }
  4. { It is assumed that you are an operator of DESQview and that you are         }
  5. { familiar with it's operation.                                               }
  6. { TO TEST:                                                                    }
  7. {   1. Make DESQdemo.exe.                                                     }
  8. {   2. Compile DESQloop.exe.                                                  }
  9. {   3. Add these programs to DV with Direct video = "N".                      }
  10. {   4. Run DESQloop in one or more windows, say 1 and 2.                      }
  11. {   3. Run this program in another one, say 3.                                }
  12. {   4. Observe results.                                                       }
  13. { TO USE:                                                                     }
  14. {   1. Optionally rename DESQ10.TPU to DESQ.TPU                               }
  15. {   2. Follow instruction provided by DESQview                                }
  16. {   3. For high speed buffer writing to a DESQview window, use QWIK41A.ARC    }
  17. { by James H. LeMay, CIS 76011,217                                            }
  18. { =========================================================================== }
  19.  
  20. program DESQdemo;
  21.  
  22. USES Crt, {$U DESQ10} DESQ;
  23.  
  24. var
  25.   VideoMode:  byte absolute $0040:$0049;
  26.   VideoSeg:   word;
  27.   DV_version: word;
  28.  
  29. type
  30.   Str9 = string[9];
  31.  
  32. { -- Converts any number into a Hex character string -- }
  33. function DecToHex (Number: longint; HexChars: byte): str9;
  34. const
  35.   D2H: array[0..$F] of char = '0123456789ABCDEF';
  36. var
  37.   HexStr:       Str9;
  38.   HexChar,Bits: byte;
  39. begin
  40.   HexStr:='';
  41.   for HexChar:=0 to pred(HexChars) do
  42.     begin
  43.       Bits:=HexChar shl 2;
  44.       HexStr:=D2H[(Number shr Bits) and $F] + HexStr;
  45.     end;
  46.   DecToHex:='$' + HexStr;
  47. end;
  48.  
  49. begin
  50.   DirectVideo:=false;
  51.   if VideoMode=7 then
  52.        VideoSeg:=$B000
  53.   else VideoSeg:=$B800;
  54.   VideoSeg:=DV_Get_Video_Buffer (VideoSeg);
  55.   DV_Version:=DV_Get_Version;   { Optional }
  56.   ClrScr;
  57.   if DV_Version=0 then
  58.     Writeln ('DESQview not active')
  59.   else
  60.     begin
  61.       Writeln ('DESQview version = ',(Hi(DV_Version)+Lo(DV_Version)/100):4:2);
  62.       Writeln ('Video Segment = ',DecToHex(VideoSeg,4));
  63.       Writeln ('First character in row 1 is = ',char(Mem[VideoSeg:0]));
  64.       Writeln ('All windows should now freeze for 3 seconds');
  65.       delay (1000);
  66.       DV_Begin_Critical;
  67.       delay (3000);
  68.       DV_End_Critical;
  69.       Writeln ('Now all windows will continue.');
  70.       Writeln ('Test completed.  Scroll back to see row 1.');
  71.     end
  72. end.
  73.