소스 검색

* support large screens

peter 24 년 전
부모
커밋
382ddb52ed
2개의 변경된 파일38개의 추가작업 그리고 86개의 파일을 삭제
  1. 21 44
      rtl/unix/crt.pp
  2. 17 42
      rtl/win32/crt.pp

+ 21 - 44
rtl/unix/crt.pp

@@ -123,6 +123,10 @@ Const
 Var
   CurrX,CurrY : Byte;
   OutputRedir, InputRedir : boolean; { is the output/input being redirected (not a TTY) }
+  WinMinX,
+  WinMinY,
+  WinMaxX,
+  WinMaxY : Longint;
 
 
 {*****************************************************************************
@@ -501,46 +505,6 @@ end;
 
 
 
-Function WinMinX: Longint;
-{
-  Current Minimum X coordinate
-}
-Begin
-  WinMinX:=(WindMin and $ff)+1;
-End;
-
-
-
-Function WinMinY: Longint;
-{
-  Current Minimum Y Coordinate
-}
-Begin
-  WinMinY:=(WindMin shr 8)+1;
-End;
-
-
-
-Function WinMaxX: Longint;
-{
-  Current Maximum X coordinate
-}
-Begin
-  WinMaxX:=(WindMax and $ff)+1;
-End;
-
-
-
-Function WinMaxY: Longint;
-{
-  Current Maximum Y coordinate;
-}
-Begin
-  WinMaxY:=(WindMax shr 8) + 1;
-End;
-
-
-
 Function FullWin:boolean;
 {
   Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
@@ -698,6 +662,10 @@ Begin
   if (X1>X2) or (X2>ScreenWidth) or
      (Y1>Y2) or (Y2>ScreenHeight) then
    exit;
+  WinMinX:=X1;
+  WinMaxX:=X2;
+  WinMinY:=Y1;
+  WinMaxY:=Y2;
   WindMin:=((Y1-1) Shl 8)+(X1-1);
   WindMax:=((Y2-1) Shl 8)+(X2-1);
   GoToXY(1,1);
@@ -762,17 +730,21 @@ Begin
    end
   else
    begin
-   { Tweak windmax so no scrolling happends }
+   { Tweak winmaxx and winmaxy so no scrolling happends }
      len:=WinMaxX-CurrX+1;
      IsLastLine:=false;
      if CurrY=WinMaxY then
       begin
-        inc(WindMax,$0203);
+        inc(WinMaxX,3);
+        inc(WinMaxY,2);
         IsLastLine:=true;
       end;
      ttySendStr(Space(len));
      if IsLastLine then
-      dec(WindMax,$0203);
+      begin
+        dec(WinMaxX,3);
+        dec(WinMaxY,2);
+      end;  
      ttyGotoXY(0,0);
    end;
 End;
@@ -1660,6 +1632,8 @@ Initialization
     (TTYName(TextRec(Input).Handle) <> TTYName(TextRec(Output).Handle)));
 { Get Size of terminal and set WindMax to the window }
   GetConsoleBuf;
+  WinMaxX:=ScreenWidth;
+  WinMaxY:=ScreenHeight;
   WindMax:=((ScreenHeight-1) Shl 8)+(ScreenWidth-1);
 {Get Current X&Y or Reset to Home}
   if OutputRedir then
@@ -1693,7 +1667,10 @@ Finalization
 End.
 {
   $Log$
-  Revision 1.5  2001-03-21 16:07:03  jonas
+  Revision 1.6  2001-06-27 20:21:46  peter
+    * support large screens
+
+  Revision 1.5  2001/03/21 16:07:03  jonas
     * fixed problems when using together with graph (web bugs 1225 and 1441)
 
   Revision 1.4  2001/01/21 20:21:40  marco

+ 17 - 42
rtl/win32/crt.pp

@@ -64,6 +64,11 @@ var
   TextAttr: Byte;         { Current text attribute }
   WindMin: Word;          { Window upper left coordinates }
   WindMax: Word;          { Window lower right coordinates }
+  { FPC Specific for large screen support }
+  WinMinX,
+  WinMinY,
+  WinMaxX,
+  WinMaxY  : Longint;
 
 { Interface procedures }
 procedure AssignCrt(var F: Text);
@@ -114,7 +119,6 @@ var
     SaveCursorSize: Longint;
 
 
-
 {
   definition of textrec is in textrec.inc
 }
@@ -209,46 +213,6 @@ end;
 ****************************************************************************}
 
 
-Function WinMinX: Byte;
-{
-  Current Minimum X coordinate
-}
-Begin
-  WinMinX:=(WindMin and $ff)+1;
-End;
-
-
-
-Function WinMinY: Byte;
-{
-  Current Minimum Y Coordinate
-}
-Begin
-  WinMinY:=(WindMin shr 8)+1;
-End;
-
-
-
-Function WinMaxX: Byte;
-{
-  Current Maximum X coordinate
-}
-Begin
-  WinMaxX:=(WindMax and $ff)+1;
-End;
-
-
-
-Function WinMaxY: Byte;
-{
-  Current Maximum Y coordinate;
-}
-Begin
-  WinMaxY:=(WindMax shr 8) + 1;
-End;
-
-
-
 Function FullWin:boolean;
 {
   Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
@@ -343,6 +307,10 @@ Begin
   if (X1>X2) or (X2>ScreenWidth) or
      (Y1>Y2) or (Y2>ScreenHeight) then
    exit;
+  WinMinX:=X1;
+  WinMaxX:=X2;
+  WinMinY:=Y1;
+  WinMaxY:=Y2;
   WindMin:=((Y1-1) Shl 8)+(X1-1);
   WindMax:=((Y2-1) Shl 8)+(X2-1);
   GoToXY(1,1);
@@ -990,6 +958,10 @@ begin
   IsWindowsNT := (GetPlatformID = VER_PLATFORM_WIN32_NT);
   TurnMouseOff;
 
+  WinMinX:=1;
+  WinMinY:=1;
+  WinMaxX:=ScreenWidth;
+  WinMaxY:=ScreenHeight;
   WindMax := (ScreenWidth - 1) OR ((ScreenHeight - 1) SHL 8);
   DoingNumChars := false;
   DoingNumCode := 0;
@@ -1006,7 +978,10 @@ end. { unit Crt }
 
 {
   $Log$
-  Revision 1.8  2001-04-14 14:05:42  peter
+  Revision 1.9  2001-06-27 20:21:47  peter
+    * support large screens
+
+  Revision 1.8  2001/04/14 14:05:42  peter
     * fixed for stricter checking
 
   Revision 1.7  2001/04/10 21:28:36  peter