mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 00:29:24 +02:00
* regcall update
This commit is contained in:
parent
eca9713796
commit
ff4c4f2e08
@ -2996,6 +2996,8 @@ type
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function SelToFlat (AFarPtr: TFarPtr): pointer;
|
function SelToFlat (AFarPtr: TFarPtr): pointer;
|
||||||
|
function SelToFlat (AFarPtr: cardinal): pointer;
|
||||||
|
{The second variant can make use of the register calling convention.}
|
||||||
|
|
||||||
{Convert a 32 bit near pointer to a 16 bit far pointer.
|
{Convert a 32 bit near pointer to a 16 bit far pointer.
|
||||||
This procedure needs to be called from assembler.
|
This procedure needs to be called from assembler.
|
||||||
@ -5222,7 +5224,7 @@ procedure DosFlatToSel; cdecl;
|
|||||||
external 'DOSCALLS' index 425;
|
external 'DOSCALLS' index 425;
|
||||||
|
|
||||||
{$ASMMODE INTEL}
|
{$ASMMODE INTEL}
|
||||||
function SelToFlat (AFarPtr: TFarPtr): pointer; assembler;
|
function SelToFlat (AFarPtr: cardinal): pointer; assembler;
|
||||||
asm
|
asm
|
||||||
push ebx
|
push ebx
|
||||||
push esi
|
push esi
|
||||||
@ -5236,6 +5238,18 @@ function SelToFlat (AFarPtr: TFarPtr): pointer; assembler;
|
|||||||
pop ebx
|
pop ebx
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function SelToFlat (AFarPtr: TFarPtr): pointer; assembler;
|
||||||
|
asm
|
||||||
|
push ebx
|
||||||
|
push esi
|
||||||
|
push edi
|
||||||
|
mov eax, AFarPtr
|
||||||
|
call DosSelToFlat
|
||||||
|
pop edi
|
||||||
|
pop esi
|
||||||
|
pop ebx
|
||||||
|
end;
|
||||||
|
|
||||||
function FlatToSel (APtr: pointer): cardinal; assembler;
|
function FlatToSel (APtr: pointer): cardinal; assembler;
|
||||||
asm
|
asm
|
||||||
push ebx
|
push ebx
|
||||||
@ -5342,7 +5356,10 @@ external 'DOSCALLS' index 582;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.26 2004-05-23 21:47:34 hajny
|
Revision 1.27 2004-05-24 19:33:22 hajny
|
||||||
|
* regcall update
|
||||||
|
|
||||||
|
Revision 1.26 2004/05/23 21:47:34 hajny
|
||||||
* final part of longint2cardinal fixes for doscalls
|
* final part of longint2cardinal fixes for doscalls
|
||||||
|
|
||||||
Revision 1.24 2003/12/04 21:22:38 peter
|
Revision 1.24 2003/12/04 21:22:38 peter
|
||||||
|
@ -100,7 +100,7 @@ begin
|
|||||||
{ Get the address of the videobuffer.}
|
{ Get the address of the videobuffer.}
|
||||||
if VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0) = 0 then
|
if VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0) = 0 then
|
||||||
begin
|
begin
|
||||||
SysVideoBuf := SelToFlat (TFarPtr (SysVideoBuf));
|
SysVideoBuf := SelToFlat (cardinal (SysVideoBuf));
|
||||||
SetHighBitBlink (true);
|
SetHighBitBlink (true);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -209,7 +209,7 @@ begin
|
|||||||
if (VioGetBuf (PScr, PWord (@ScrSize)^, 0) = 0) and
|
if (VioGetBuf (PScr, PWord (@ScrSize)^, 0) = 0) and
|
||||||
(ScrSize = OrigScreenSize) then
|
(ScrSize = OrigScreenSize) then
|
||||||
begin
|
begin
|
||||||
PScr := SelToFlat (TFarPtr (PScr));
|
PScr := SelToFlat (cardinal (PScr));
|
||||||
Move (OrigScreen^, PScr^, OrigScreenSize);
|
Move (OrigScreen^, PScr^, OrigScreenSize);
|
||||||
VioShowBuf (0, ScrSize, 0);
|
VioShowBuf (0, ScrSize, 0);
|
||||||
end;
|
end;
|
||||||
@ -248,7 +248,7 @@ begin
|
|||||||
if VioSetMode (MI, 0) = 0 then
|
if VioSetMode (MI, 0) = 0 then
|
||||||
if VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0) = 0 then
|
if VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0) = 0 then
|
||||||
begin
|
begin
|
||||||
SysVideoBuf := SelToFlat (TFarPtr (SysVideoBuf));
|
SysVideoBuf := SelToFlat (cardinal (SysVideoBuf));
|
||||||
SysVideoModeSelector := true;
|
SysVideoModeSelector := true;
|
||||||
SetHighBitBlink (true);
|
SetHighBitBlink (true);
|
||||||
CheckCellHeight;
|
CheckCellHeight;
|
||||||
@ -260,7 +260,7 @@ begin
|
|||||||
SysVideoModeSelector := false;
|
SysVideoModeSelector := false;
|
||||||
VioSetMode (OldMI, 0);
|
VioSetMode (OldMI, 0);
|
||||||
VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0);
|
VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0);
|
||||||
SysVideoBuf := SelToFlat (TFarPtr (SysVideoBuf));
|
SysVideoBuf := SelToFlat (cardinal (SysVideoBuf));
|
||||||
SetHighBitBlink (true);
|
SetHighBitBlink (true);
|
||||||
CheckCellHeight;
|
CheckCellHeight;
|
||||||
SetCursorType (LastCursorType);
|
SetCursorType (LastCursorType);
|
||||||
@ -270,7 +270,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
SysVideoModeSelector := false;
|
SysVideoModeSelector := false;
|
||||||
VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0);
|
VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0);
|
||||||
SysVideoBuf := SelToFlat (TFarPtr (SysVideoBuf));
|
SysVideoBuf := SelToFlat (cardinal (SysVideoBuf));
|
||||||
SetHighBitBlink (true);
|
SetHighBitBlink (true);
|
||||||
SetCursorType (LastCursorType);
|
SetCursorType (LastCursorType);
|
||||||
end;
|
end;
|
||||||
@ -456,7 +456,7 @@ begin
|
|||||||
{Get the address of the original videobuffer and size.}
|
{Get the address of the original videobuffer and size.}
|
||||||
if VioGetBuf (PScr, PWord (@OrigScreenSize)^, 0) = 0 then
|
if VioGetBuf (PScr, PWord (@OrigScreenSize)^, 0) = 0 then
|
||||||
begin
|
begin
|
||||||
PScr := SelToFlat (TFarPtr (PScr));
|
PScr := SelToFlat (cardinal (PScr));
|
||||||
GetMem (OrigScreen, OrigScreenSize);
|
GetMem (OrigScreen, OrigScreenSize);
|
||||||
Move (PScr^, OrigScreen^, OrigScreenSize);
|
Move (PScr^, OrigScreen^, OrigScreenSize);
|
||||||
end;
|
end;
|
||||||
@ -470,7 +470,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.9 2003-10-07 21:26:35 hajny
|
Revision 1.10 2004-05-24 19:33:22 hajny
|
||||||
|
* regcall update
|
||||||
|
|
||||||
|
Revision 1.9 2003/10/07 21:26:35 hajny
|
||||||
* stdcall fixes and asm routines cleanup
|
* stdcall fixes and asm routines cleanup
|
||||||
|
|
||||||
Revision 1.8 2003/10/03 21:46:41 peter
|
Revision 1.8 2003/10/03 21:46:41 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user