home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / BOXMENU.ZIP / SCRNDEF.BOX < prev    next >
Encoding:
Text File  |  1985-09-17  |  4.6 KB  |  153 lines

  1. {------------------------------------------------------------------------}
  2. {                      Areas for internal use Begin Here                 }
  3. {------------------------------------------------------------------------}
  4. { These Constants and Variables are reserved for the use of the          }
  5. { screen routines.  ONLY REFERENCE THESE ITEMS if you know what you      }
  6. { are doing.                                                             }
  7. {------------------------------------------------------------------------}
  8.  
  9.  
  10. Const
  11.   Color_Screen_Address       = $B800; { Address of color screen          }
  12.   Mono_Screen_Address        = $B000; { Address of mono screen           }
  13.   Screen_Length              = 2000;  { 80 x 25  = screen area length    }
  14.   Screen_Line_Min            = 1;     { screen line lower limit          }
  15.   Screen_Line_Max            = 25;    { screen line upper limit          }
  16.   Screen_Pos_Min             = 1;     { screen position lower limit      }
  17.   Screen_Pos_Max             = 80;    { screen position upper limit      }
  18.   Open_Min                   = 0;     { lower bound for the window array }
  19. {------------------------------------------------------------------------}
  20.  
  21. {------------------------------------------------------------------------}
  22. {                  Begin Screen Definition                               }
  23. {------------------------------------------------------------------------}
  24.  
  25. Type
  26.   Screen_Char       = record
  27.                         Character : Char;
  28.                         Attribute : Byte;
  29.                       end;
  30.   Screen_Type       = Array [ Screen_Line_Min..Screen_Line_Max,
  31.                               Screen_Pos_Min..Screen_Pos_Max ]
  32.                             Of Screen_Char;
  33.   Screen_Ptr        = ^Screen_Image_Type;
  34.   Screen_Image_Type = record
  35.                         Screen_Image: Screen_Type;
  36.                           end;
  37. {------------------------------------------------------------------------}
  38.  
  39.  
  40. {------------------------------------------------------------------------}
  41. {                  Variable Pointer to Screen Display RAM                }
  42. {------------------------------------------------------------------------}
  43. Var
  44.    Actual_Screen        : Screen_Ptr;
  45. {------------------------------------------------------------------------}
  46.  
  47.  
  48. {------------------------------------------------------------------------}
  49. {   this procedure disables the screen during direct screen update       }
  50. {   and will work for both Mono and C/G monitors.                        }
  51. {------------------------------------------------------------------------}
  52. procedure Disable_Display;
  53. begin  {  Disable_Display  }
  54.   inline
  55.    ($55/
  56.     $8B/$EC/
  57.     $06/$BB/$B0/$00/
  58.     $2B/$C9/
  59.     $FC/
  60.     $8E/$C1/
  61.     $26/$8B/$3E/$4E/$04/
  62.     $B4/$19/
  63.     $26/$8A/$16/$49/$04/
  64.     $80/$EA/$07/
  65.     $74/$1B/
  66.     $B7/$B8/
  67.     $80/$C2/$03/
  68.     $78/$02/
  69.     $B4/$C8/
  70.     $B9/$DA/$03/
  71.     $EC/
  72.     $A8/$08/
  73.     $74/$FB/
  74.     $BA/$D8/$03/
  75.     $26/$A0/$65/$04/
  76.     $24/$F7/
  77.     $EE/
  78.     $07/
  79.     $5D);
  80. end;   {  Disable_Display  }
  81.  
  82.  
  83. {------------------------------------------------------------------------}
  84. {   this procedure reenables the screen during direct screen update      }
  85. {   and will work for both Mono and C/G monitors.                        }
  86. {------------------------------------------------------------------------}
  87. procedure Enable_Display;
  88. begin  {  Enable_Display  }
  89.   inline
  90.    ($55/
  91.     $8B/$EC/
  92.     $06/
  93.     $BB/$B0/$00/
  94.     $2B/$C9/
  95.     $FC/
  96.     $8E/$C1/
  97.     $26/$8B/$3E/$4E/$04/
  98.     $B4/$19/
  99.     $26/$8A/$16/$49/$04/
  100.     $80/$EA/$07/
  101.     $74/$1B/
  102.     $B7/$B8/
  103.     $80/$C2/$03/
  104.     $78/$02/
  105.     $B4/$C8/
  106.     $B9/$DA/$03/
  107.     $EC/
  108.     $A8/$08/
  109.     $74/$FB/
  110.     $BA/$D8/$03/
  111.     $26/$A0/$65/$04/
  112.     $0C/$08/
  113.     $EE/
  114.     $07/
  115.     $5D);
  116. end;   {  Enable_Display  }
  117.  
  118.  
  119. {.page}
  120. { if the Color Screen is in use, this returns true else false. }
  121. function Color_Screen_Active : Boolean;
  122. Type
  123.   IntrRegs = record
  124.                ax, bx, cx, dx, bp, si, di, ds, es, flags : integer
  125.                end;
  126. Var
  127.   Regs : IntrRegs;
  128. begin  {  Color_Screen_Active  }
  129.   Regs.Ax := 15 Shl 8;
  130.   Intr( $10 , Regs );
  131.   Color_Screen_Active := ( Regs.Ax And $FF ) <> 7;
  132. end;   {  Color_Screen_Active  }
  133.  
  134.  
  135. procedure Set_Screen_Address( Var Actual_Screen : Screen_Ptr );
  136. begin  {  Set_Screen_Address  }
  137.   if Color_Screen_Active then
  138.     Actual_Screen := Ptr( Color_Screen_Address , 0 )
  139.   else
  140.     Actual_Screen := Ptr( Mono_Screen_Address , 0 );
  141. end;   {  Set_Screen_Address   }
  142.  
  143. 
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.