mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-04 19:09:22 +01:00
* fix cursor position for linux vcsa support
This commit is contained in:
parent
beb6c868bd
commit
f93b587cdb
@ -22,6 +22,13 @@ uses
|
|||||||
{$ifdef win32}
|
{$ifdef win32}
|
||||||
windows,
|
windows,
|
||||||
{$endif win32}
|
{$endif win32}
|
||||||
|
{$ifdef Unix}
|
||||||
|
{$ifdef VER1_0}
|
||||||
|
linux,
|
||||||
|
{$else}
|
||||||
|
unix,
|
||||||
|
{$endif}
|
||||||
|
{$endif}
|
||||||
video,Objects;
|
video,Objects;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -122,6 +129,8 @@ type
|
|||||||
ConsHeight, ConsWidth,
|
ConsHeight, ConsWidth,
|
||||||
ConsCursorX, ConsCursorY : byte;
|
ConsCursorX, ConsCursorY : byte;
|
||||||
ConsVideoBufSize : longint;
|
ConsVideoBufSize : longint;
|
||||||
|
ConsTio : termios;
|
||||||
|
ConsTioValid : boolean;
|
||||||
end;
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
@ -172,13 +181,6 @@ uses
|
|||||||
{$ifdef GO32V2}
|
{$ifdef GO32V2}
|
||||||
,Dpmiexcp, Go32
|
,Dpmiexcp, Go32
|
||||||
{$endif}
|
{$endif}
|
||||||
{$ifdef Unix}
|
|
||||||
{$ifdef VER1_0}
|
|
||||||
,linux
|
|
||||||
{$else}
|
|
||||||
,unix
|
|
||||||
{$endif}
|
|
||||||
{$endif}
|
|
||||||
{$endif}
|
{$endif}
|
||||||
,Drivers,App
|
,Drivers,App
|
||||||
{$ifdef TEST_GRAPH_SWITCH}
|
{$ifdef TEST_GRAPH_SWITCH}
|
||||||
@ -736,8 +738,8 @@ end;
|
|||||||
|
|
||||||
procedure TLinuxScreen.GetCursorPos(var P: TPoint);
|
procedure TLinuxScreen.GetCursorPos(var P: TPoint);
|
||||||
begin
|
begin
|
||||||
P.X:=ConsCursorX;
|
P.X:=ConsCursorX+1;
|
||||||
P.Y:=ConsCursorY;
|
P.Y:=ConsCursorY+1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -788,6 +790,7 @@ begin
|
|||||||
ConsCursorY:=0;
|
ConsCursorY:=0;
|
||||||
ConsVideoBuf:=nil;
|
ConsVideoBuf:=nil;
|
||||||
end;
|
end;
|
||||||
|
ConsTioValid:=TCGetAttr(1,ConsTio);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -800,13 +803,15 @@ begin
|
|||||||
end
|
end
|
||||||
else if (TTyfd<>-1) then
|
else if (TTyfd<>-1) then
|
||||||
begin
|
begin
|
||||||
fdSeek(TTYFd, 4, Seek_Set);
|
fdSeek(TTYFd, 2, Seek_Set);
|
||||||
|
fdWrite(TTYFd, ConsCursorX, sizeof(byte));
|
||||||
|
fdWrite(TTYFd, ConsCursorY, sizeof(byte));
|
||||||
fdWrite(TTYFd, ConsVideoBuf^,ConsVideoBufSize);
|
fdWrite(TTYFd, ConsVideoBuf^,ConsVideoBufSize);
|
||||||
fdWrite(TTYFd, ConsCursorX, sizeof(word));
|
|
||||||
fdWrite(TTYFd, ConsCursorY, sizeof(word));
|
|
||||||
{ FreeMem(ConsVideoBuf,ConsVideoBufSize);
|
{ FreeMem(ConsVideoBuf,ConsVideoBufSize);
|
||||||
ConsVideoBuf:=nil; }
|
ConsVideoBuf:=nil; }
|
||||||
end;
|
end;
|
||||||
|
If ConsTioValid then
|
||||||
|
TCSetAttr(1,TCSANOW,ConsTio);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLinuxScreen.SwitchBackToIDEScreen;
|
procedure TLinuxScreen.SwitchBackToIDEScreen;
|
||||||
@ -1221,7 +1226,10 @@ end;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.19 2002-09-13 07:17:33 pierre
|
Revision 1.20 2002-09-13 08:15:06 pierre
|
||||||
|
* fix cursor position for linux vcsa support
|
||||||
|
|
||||||
|
Revision 1.19 2002/09/13 07:17:33 pierre
|
||||||
+ use vcsa for linux console
|
+ use vcsa for linux console
|
||||||
|
|
||||||
Revision 1.18 2002/09/07 21:04:42 carl
|
Revision 1.18 2002/09/07 21:04:42 carl
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user