mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 08:29:29 +02:00
* regcall update
This commit is contained in:
parent
eca9713796
commit
ff4c4f2e08
@ -2996,6 +2996,8 @@ type
|
||||
end;
|
||||
|
||||
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.
|
||||
This procedure needs to be called from assembler.
|
||||
@ -5222,7 +5224,7 @@ procedure DosFlatToSel; cdecl;
|
||||
external 'DOSCALLS' index 425;
|
||||
|
||||
{$ASMMODE INTEL}
|
||||
function SelToFlat (AFarPtr: TFarPtr): pointer; assembler;
|
||||
function SelToFlat (AFarPtr: cardinal): pointer; assembler;
|
||||
asm
|
||||
push ebx
|
||||
push esi
|
||||
@ -5236,6 +5238,18 @@ function SelToFlat (AFarPtr: TFarPtr): pointer; assembler;
|
||||
pop ebx
|
||||
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;
|
||||
asm
|
||||
push ebx
|
||||
@ -5342,7 +5356,10 @@ external 'DOSCALLS' index 582;
|
||||
end.
|
||||
{
|
||||
$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
|
||||
|
||||
Revision 1.24 2003/12/04 21:22:38 peter
|
||||
|
@ -100,7 +100,7 @@ begin
|
||||
{ Get the address of the videobuffer.}
|
||||
if VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0) = 0 then
|
||||
begin
|
||||
SysVideoBuf := SelToFlat (TFarPtr (SysVideoBuf));
|
||||
SysVideoBuf := SelToFlat (cardinal (SysVideoBuf));
|
||||
SetHighBitBlink (true);
|
||||
end
|
||||
else
|
||||
@ -209,7 +209,7 @@ begin
|
||||
if (VioGetBuf (PScr, PWord (@ScrSize)^, 0) = 0) and
|
||||
(ScrSize = OrigScreenSize) then
|
||||
begin
|
||||
PScr := SelToFlat (TFarPtr (PScr));
|
||||
PScr := SelToFlat (cardinal (PScr));
|
||||
Move (OrigScreen^, PScr^, OrigScreenSize);
|
||||
VioShowBuf (0, ScrSize, 0);
|
||||
end;
|
||||
@ -248,7 +248,7 @@ begin
|
||||
if VioSetMode (MI, 0) = 0 then
|
||||
if VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0) = 0 then
|
||||
begin
|
||||
SysVideoBuf := SelToFlat (TFarPtr (SysVideoBuf));
|
||||
SysVideoBuf := SelToFlat (cardinal (SysVideoBuf));
|
||||
SysVideoModeSelector := true;
|
||||
SetHighBitBlink (true);
|
||||
CheckCellHeight;
|
||||
@ -260,7 +260,7 @@ begin
|
||||
SysVideoModeSelector := false;
|
||||
VioSetMode (OldMI, 0);
|
||||
VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0);
|
||||
SysVideoBuf := SelToFlat (TFarPtr (SysVideoBuf));
|
||||
SysVideoBuf := SelToFlat (cardinal (SysVideoBuf));
|
||||
SetHighBitBlink (true);
|
||||
CheckCellHeight;
|
||||
SetCursorType (LastCursorType);
|
||||
@ -270,7 +270,7 @@ begin
|
||||
begin
|
||||
SysVideoModeSelector := false;
|
||||
VioGetBuf (SysVideoBuf, PWord (@VideoBufSize)^, 0);
|
||||
SysVideoBuf := SelToFlat (TFarPtr (SysVideoBuf));
|
||||
SysVideoBuf := SelToFlat (cardinal (SysVideoBuf));
|
||||
SetHighBitBlink (true);
|
||||
SetCursorType (LastCursorType);
|
||||
end;
|
||||
@ -456,7 +456,7 @@ begin
|
||||
{Get the address of the original videobuffer and size.}
|
||||
if VioGetBuf (PScr, PWord (@OrigScreenSize)^, 0) = 0 then
|
||||
begin
|
||||
PScr := SelToFlat (TFarPtr (PScr));
|
||||
PScr := SelToFlat (cardinal (PScr));
|
||||
GetMem (OrigScreen, OrigScreenSize);
|
||||
Move (PScr^, OrigScreen^, OrigScreenSize);
|
||||
end;
|
||||
@ -470,7 +470,10 @@ end.
|
||||
|
||||
{
|
||||
$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
|
||||
|
||||
Revision 1.8 2003/10/03 21:46:41 peter
|
||||
|
Loading…
Reference in New Issue
Block a user