Browse Source

+ interactive test for bug #2002

pierre 23 years ago
parent
commit
b5cc48ecac
2 changed files with 44 additions and 0 deletions
  1. 22 0
      tests/webtbs/tu2002.pp
  2. 22 0
      tests/webtbs/tw2002.pp

+ 22 - 0
tests/webtbs/tu2002.pp

@@ -0,0 +1,22 @@
+unit {vidutil}tu2002;
+ Interface
+ uses
+   video;
+ Procedure TextOut(X,Y : Word;Const S :
+ String);
+ Implementation
+
+ Procedure TextOut(X,Y : Word;Const S :
+ String);
+ Var
+  W,P,I,M : Word;
+ begin
+   P:=((X-1)+(Y-1)*ScreenWidth);
+   M:=Length(S);
+   If P+M>ScreenWidth*ScreenHeight then
+     M:=ScreenWidth*ScreenHeight-P;
+   For I:=1 to M do
+     VideoBuf^[P+I-1]:=Ord(S[i])+($07 shl 8);
+ end;
+
+ end.

+ 22 - 0
tests/webtbs/tw2002.pp

@@ -0,0 +1,22 @@
+{ %INTERACTIVE }
+
+program testvideo;
+ uses video,keyboard,{vidutil}tu2002;
+ Var
+   i : longint;
+   k : TkeyEvent;
+
+ begin
+   InitVideo;
+   InitKeyboard;
+   For I:=1 to 10 do
+     TextOut(i,i, 'Press any key to clear screen');
+   UpdateScreen(false);
+   K:=GetKeyEvent;
+   ClearScreen;
+   TextOut(1,1,'Cleared screen. Press any key to end');
+   UpdateScreen(true);
+   K:=GetKeyEvent;
+   DoneKeyBoard;
+   DoneVideo;
+ end.