+ interactive test for bug #2002

This commit is contained in:
pierre 2002-10-29 11:43:45 +00:00
parent ca424bbc32
commit b5cc48ecac
2 changed files with 44 additions and 0 deletions

22
tests/webtbs/tu2002.pp Normal file
View File

@ -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
tests/webtbs/tw2002.pp Normal file
View File

@ -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.