* fix for bug #1998 (write in window) + removed warnings

This commit is contained in:
Tomas Hajny 2002-08-04 19:37:55 +00:00
parent 32f3f65a26
commit f163e8b037

View File

@ -1,5 +1,7 @@
{**************************************************************************** {****************************************************************************
$Id$
Standard CRT unit. Standard CRT unit.
Free Pascal runtime library for OS/2. Free Pascal runtime library for OS/2.
Copyright (c) 1997 Daniel Mantione. Copyright (c) 1997 Daniel Mantione.
@ -255,7 +257,7 @@ begin
end; end;
end; end;
{$asmmode intel} {$ASMMODE INTEL}
procedure setcursor(y,x:word); procedure setcursor(y,x:word);
{Set the cursor position.} {Set the cursor position.}
@ -265,11 +267,11 @@ begin
viosetcurpos(y,x,0) viosetcurpos(y,x,0)
else else
asm asm
mov ah, 2 mov ah, 2
mov bl, 0 mov bh, 0
mov dh, byte ptr y mov dh, byte ptr y
mov dl, byte ptr x mov dl, byte ptr x
int 010h int 10h
end; end;
end; end;
@ -280,15 +282,15 @@ begin
vioscrollup(top,left,bottom,right,lines,screl,0) vioscrollup(top,left,bottom,right,lines,screl,0)
else else
asm asm
mov ah, 6 mov ah, 6
mov al, byte ptr lines mov al, byte ptr lines
mov edi, screl mov edi, screl
mov bl, byte ptr [edi+1] mov bh, [edi + 1]
mov ch, byte ptr top mov ch, byte ptr top
mov cl, byte ptr left mov cl, byte ptr left
mov dh, byte ptr bottom mov dh, byte ptr bottom
mov dl, byte ptr right mov dl, byte ptr right
int 010h int 10h
end; end;
end; end;
@ -299,20 +301,19 @@ begin
vioscrolldn(top,left,bottom,right,lines,screl,0) vioscrolldn(top,left,bottom,right,lines,screl,0)
else else
asm asm
mov ah, 7 mov ah, 7
mov al, byte ptr lines mov al, byte ptr lines
mov edi, screl mov edi, screl
mov bh, byte ptr [edi+1] mov bh, [edi + 1]
mov ch, byte ptr top mov ch, byte ptr top
mov cl, byte ptr left mov cl, byte ptr left
mov dh, byte ptr bottom mov dh, byte ptr bottom
mov dl, byte ptr right mov dl, byte ptr right
int 010h int 10h
end; end;
end; end;
{$asmmode att} {$ASMMODE ATT}
function keypressed:boolean; function keypressed:boolean;
{Checks if a key is pressed.} {Checks if a key is pressed.}
@ -570,6 +571,7 @@ begin
gotoXY(1,1); gotoXY(1,1);
end; end;
{$ASMMODE INTEL}
procedure writePchar(s:Pchar;len:word); procedure writePchar(s:Pchar;len:word);
{Write a series of characters to the screen. {Write a series of characters to the screen.
@ -604,7 +606,8 @@ begin
ca:=@s[i]; ca:=@s[i];
n:=1; n:=1;
while not(s[i+1] in [#8,#9,#10,#13]) and while not(s[i+1] in [#8,#9,#10,#13]) and
(x+n<=lo(windmax)+1) and (i<len-1) do { (x+n<=lo(windmax)+1) and (i<len-1) do}
(x+n<=lo(windmax)) and (i<len-1) do
begin begin
inc(n); inc(n);
inc(i); inc(i);
@ -612,21 +615,18 @@ begin
if os_mode=osOS2 then if os_mode=osOS2 then
viowrtcharstratt(ca,n,y,x,textattr,0) viowrtcharstratt(ca,n,y,x,textattr,0)
else else
{$asmmode intel}
asm asm
mov ax, 01300h mov ax, 1300h
mov bh, 0 mov bh, 0
mov bl, TEXTATTR mov bl, TEXTATTR
{ mov bl, U_CRT_TEXTATTR } mov dh, byte ptr y
mov dh, byte ptr y mov dl, byte ptr x
mov dl, byte ptr x mov cx, n
mov cx, n
push ebp push ebp
mov ebp, ca mov ebp, ca
int 010h int 10h
pop ebp pop ebp
end; end;
{$asmmode att}
x:=x+n; x:=x+n;
end; end;
end; end;
@ -649,11 +649,12 @@ begin
setcursor(y,x); setcursor(y,x);
end; end;
{$ASMMODE ATT}
function crtread(var f:textrec):word; function crtread(var f:textrec):word;
{Read a series of characters from the console.} {Read a series of characters from the console.}
var max,curpos,i:integer; var max,curpos:integer;
c:char; c:char;
clist:array[0..2] of char; clist:array[0..2] of char;
@ -890,3 +891,11 @@ begin
assigncrt(output); assigncrt(output);
textrec(output).mode:=fmoutput; textrec(output).mode:=fmoutput;
end. end.
{
$Log$
Revision 1.3 2002-08-04 19:37:55 hajny
* fix for bug 1998 (write in window) + removed warnings
}