vidutil.pp 472 B

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