tu2002.pp 401 B

12345678910111213141516171819202122
  1. unit {vidutil}tu2002;
  2. Interface
  3. uses
  4. video;
  5. Procedure TextOut(X,Y : Word;Const S :
  6. String);
  7. Implementation
  8. Procedure TextOut(X,Y : Word;Const S :
  9. String);
  10. Var
  11. W,P,I,M : Word;
  12. begin
  13. P:=((X-1)+(Y-1)*ScreenWidth);
  14. M:=Length(S);
  15. If P+M>ScreenWidth*ScreenHeight then
  16. M:=ScreenWidth*ScreenHeight-P;
  17. For I:=1 to M do
  18. VideoBuf^[P+I-1]:=Ord(S[i])+($07 shl 8);
  19. end;
  20. end.