mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 20:49:26 +02:00
+ Cursor* implemented
This commit is contained in:
parent
ef1a05333a
commit
802a4f713c
111
rtl/emx/crt.pas
111
rtl/emx/crt.pas
@ -73,6 +73,21 @@ type Tkbdkeyinfo=record
|
|||||||
end;
|
end;
|
||||||
Pviomodeinfo=^viomodeinfo;
|
Pviomodeinfo=^viomodeinfo;
|
||||||
|
|
||||||
|
TVioCursorInfo=record
|
||||||
|
case boolean of
|
||||||
|
false:(
|
||||||
|
yStart:word; {Cursor start (top) scan line (0-based)}
|
||||||
|
cEnd:word; {Cursor end (bottom) scan line}
|
||||||
|
cx:word; {Cursor width (0=default width)}
|
||||||
|
Attr:word); {Cursor colour attribute (-1=hidden)}
|
||||||
|
true:(
|
||||||
|
yStartInt: integer; {integer variants can be used to specify negative}
|
||||||
|
cEndInt:integer; {negative values (interpreted as percentage by OS/2)}
|
||||||
|
cxInt:integer;
|
||||||
|
AttrInt:integer);
|
||||||
|
end;
|
||||||
|
PVioCursorInfo=^TVioCursorInfo;
|
||||||
|
|
||||||
{EMXWRAP.DLL has strange calling conventions: All parameters must have
|
{EMXWRAP.DLL has strange calling conventions: All parameters must have
|
||||||
a 4 byte size.}
|
a 4 byte size.}
|
||||||
|
|
||||||
@ -102,6 +117,13 @@ function viogetmode(var Amodeinfo:viomodeinfo;viohandle:longint):word; cdecl;
|
|||||||
external 'EMXWRAP' index 121;
|
external 'EMXWRAP' index 121;
|
||||||
function viosetmode(var Amodeinfo:viomodeinfo;viohandle:longint):word; cdecl;
|
function viosetmode(var Amodeinfo:viomodeinfo;viohandle:longint):word; cdecl;
|
||||||
external 'EMXWRAP' index 122;
|
external 'EMXWRAP' index 122;
|
||||||
|
function VioSetCurType(var CurData:TVioCursorInfo;VioHandle:word):word; cdecl;
|
||||||
|
external 'EMXWRAP' index 132;
|
||||||
|
{external 'VIOCALLS' index 32;}
|
||||||
|
function VioGetCurType(var CurData:TVioCursorInfo;VioHandle:word):word; cdecl;
|
||||||
|
external 'EMXWRAP' index 127;
|
||||||
|
{external 'VIOCALLS' index 27;}
|
||||||
|
|
||||||
|
|
||||||
procedure setscreenmode(mode:word);
|
procedure setscreenmode(mode:word);
|
||||||
|
|
||||||
@ -764,21 +786,97 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cursoron;
|
|
||||||
|
|
||||||
|
|
||||||
|
{****************************************************************************
|
||||||
|
Extra Crt Functions
|
||||||
|
****************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
{$ASMMODE INTEL}
|
||||||
|
procedure CursorOn;
|
||||||
|
var
|
||||||
|
I: TVioCursorInfo;
|
||||||
begin
|
begin
|
||||||
|
if Os_Mode = osOS2 then
|
||||||
|
begin
|
||||||
|
VioGetCurType (I, 0);
|
||||||
|
with I do
|
||||||
|
begin
|
||||||
|
yStartInt := -90;
|
||||||
|
cEndInt := -100;
|
||||||
|
Attr := 15;
|
||||||
|
end;
|
||||||
|
VioSetCurType (I, 0);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
asm
|
||||||
|
push es
|
||||||
|
push bp
|
||||||
|
mov ax, 1130h
|
||||||
|
mov bh, 0
|
||||||
|
mov ecx, 0
|
||||||
|
int 10h
|
||||||
|
pop bp
|
||||||
|
pop es
|
||||||
|
or ecx, ecx
|
||||||
|
jnz @COnOld
|
||||||
|
mov cx, 0707h
|
||||||
|
jmp @COnAll
|
||||||
|
@COnOld:
|
||||||
|
dec cx
|
||||||
|
mov ch, cl
|
||||||
|
dec ch
|
||||||
|
@COnAll:
|
||||||
|
mov ah, 1
|
||||||
|
int 10h
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cursoroff;
|
|
||||||
|
|
||||||
|
procedure CursorOff;
|
||||||
|
var
|
||||||
|
I: TVioCursorInfo;
|
||||||
begin
|
begin
|
||||||
|
if Os_Mode = osOS2 then
|
||||||
|
begin
|
||||||
|
VioGetCurType (I, 0);
|
||||||
|
I.AttrInt := -1;
|
||||||
|
VioSetCurType (I, 0);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
asm
|
||||||
|
mov ah, 1
|
||||||
|
mov cx, 0FFFFh
|
||||||
|
int 10h
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cursorbig;
|
|
||||||
|
|
||||||
|
procedure CursorBig;
|
||||||
|
var
|
||||||
|
I: TVioCursorInfo;
|
||||||
begin
|
begin
|
||||||
|
if Os_Mode = osOS2 then
|
||||||
|
begin
|
||||||
|
VioGetCurType (I, 0);
|
||||||
|
with I do
|
||||||
|
begin
|
||||||
|
yStart := 0;
|
||||||
|
cEndInt := -100;
|
||||||
|
Attr := 15;
|
||||||
|
end;
|
||||||
|
VioSetCurType (I, 0);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
asm
|
||||||
|
mov ah, 1
|
||||||
|
mov cx, 1Fh
|
||||||
|
int 10h
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ASMMODE DEFAULT}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -851,7 +949,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
windmin:=0;
|
windmin:=0;
|
||||||
windmax:=((maxrows-1) shl 8) or (maxcols-1);
|
windmax:=((maxrows-1) shl 8) or (maxcols-1);
|
||||||
if os_mode=osDOS then
|
if os_mode <> osOS2 then
|
||||||
initdelay;
|
initdelay;
|
||||||
crt_error:=cenoerror;
|
crt_error:=cenoerror;
|
||||||
assigncrt(input);
|
assigncrt(input);
|
||||||
@ -862,7 +960,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2004-02-08 16:22:20 michael
|
Revision 1.4 2004-03-21 20:28:43 hajny
|
||||||
|
+ Cursor* implemented
|
||||||
|
|
||||||
|
Revision 1.3 2004/02/08 16:22:20 michael
|
||||||
+ Moved CRT interface to common include file
|
+ Moved CRT interface to common include file
|
||||||
|
|
||||||
Revision 1.2 2003/10/19 09:35:28 hajny
|
Revision 1.2 2003/10/19 09:35:28 hajny
|
||||||
|
@ -67,6 +67,22 @@ type Tkbdkeyinfo=record
|
|||||||
ext_data_addr:pointer; { ????? info wanted !}
|
ext_data_addr:pointer; { ????? info wanted !}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TVioCursorInfo=record
|
||||||
|
case boolean of
|
||||||
|
false:(
|
||||||
|
yStart:word; {Cursor start (top) scan line (0-based)}
|
||||||
|
cEnd:word; {Cursor end (bottom) scan line}
|
||||||
|
cx:word; {Cursor width (0=default width)}
|
||||||
|
Attr:word); {Cursor colour attribute (-1=hidden)}
|
||||||
|
true:(
|
||||||
|
yStartInt: integer; {integer variants can be used to specify negative}
|
||||||
|
cEndInt:integer; {negative values (interpreted as percentage by OS/2)}
|
||||||
|
cxInt:integer;
|
||||||
|
AttrInt:integer);
|
||||||
|
end;
|
||||||
|
PVioCursorInfo=^TVioCursorInfo;
|
||||||
|
|
||||||
|
|
||||||
{EMXWRAP.DLL has strange calling conventions: All parameters must have
|
{EMXWRAP.DLL has strange calling conventions: All parameters must have
|
||||||
a 4 byte size.}
|
a 4 byte size.}
|
||||||
|
|
||||||
@ -94,6 +110,14 @@ function viogetmode(var Amodeinfo:viomodeinfo;viohandle:longint):word; cdecl;
|
|||||||
external 'EMXWRAP' index 121;
|
external 'EMXWRAP' index 121;
|
||||||
function viosetmode(var Amodeinfo:viomodeinfo;viohandle:longint):word; cdecl;
|
function viosetmode(var Amodeinfo:viomodeinfo;viohandle:longint):word; cdecl;
|
||||||
external 'EMXWRAP' index 122;
|
external 'EMXWRAP' index 122;
|
||||||
|
function VioSetCurType(var CurData:TVioCursorInfo;VioHandle:word):word; cdecl;
|
||||||
|
external 'EMXWRAP' index 132;
|
||||||
|
{external 'VIOCALLS' index 32;}
|
||||||
|
function VioGetCurType(var CurData:TVioCursorInfo;VioHandle:word):word; cdecl;
|
||||||
|
external 'EMXWRAP' index 127;
|
||||||
|
{external 'VIOCALLS' index 27;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
procedure setscreenmode(mode:word);
|
procedure setscreenmode(mode:word);
|
||||||
|
|
||||||
@ -509,22 +533,54 @@ procedure nosound;
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{Extra Functions}
|
|
||||||
procedure cursoron;
|
|
||||||
|
|
||||||
|
|
||||||
|
{****************************************************************************
|
||||||
|
Extra Crt Functions
|
||||||
|
****************************************************************************}
|
||||||
|
|
||||||
|
|
||||||
|
procedure CursorOn;
|
||||||
|
var
|
||||||
|
I: TVioCursorInfo;
|
||||||
begin
|
begin
|
||||||
|
VioGetCurType (I, 0);
|
||||||
|
with I do
|
||||||
|
begin
|
||||||
|
yStartInt := -90;
|
||||||
|
cEndInt := -100;
|
||||||
|
Attr := 15;
|
||||||
|
end;
|
||||||
|
VioSetCurType (I, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cursoroff;
|
|
||||||
|
|
||||||
|
procedure CursorOff;
|
||||||
|
var
|
||||||
|
I: TVioCursorInfo;
|
||||||
begin
|
begin
|
||||||
|
VioGetCurType (I, 0);
|
||||||
|
I.AttrInt := -1;
|
||||||
|
VioSetCurType (I, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure cursorbig;
|
|
||||||
|
|
||||||
|
procedure CursorBig;
|
||||||
|
var
|
||||||
|
I: TVioCursorInfo;
|
||||||
begin
|
begin
|
||||||
|
VioGetCurType (I, 0);
|
||||||
|
with I do
|
||||||
|
begin
|
||||||
|
yStart := 0;
|
||||||
|
cEndInt := -100;
|
||||||
|
Attr := 15;
|
||||||
|
end;
|
||||||
|
VioSetCurType (I, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{Initialization.}
|
{Initialization.}
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -558,7 +614,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2004-02-08 16:22:20 michael
|
Revision 1.7 2004-03-21 20:28:43 hajny
|
||||||
|
+ Cursor* implemented
|
||||||
|
|
||||||
|
Revision 1.6 2004/02/08 16:22:20 michael
|
||||||
+ Moved CRT interface to common include file
|
+ Moved CRT interface to common include file
|
||||||
|
|
||||||
Revision 1.5 2003/10/18 16:53:21 hajny
|
Revision 1.5 2003/10/18 16:53:21 hajny
|
||||||
|
Loading…
Reference in New Issue
Block a user