Browse Source

Amiga, MorphOS: Missing varargs version and type unification

git-svn-id: trunk@32642 -
marcus 9 years ago
parent
commit
3622b2165c

+ 13 - 0
packages/amunits/src/coreunits/agraphics.pas

@@ -2419,6 +2419,9 @@ PROCEDURE ON_SPRITE (cust: pCustom);
 PROCEDURE OFF_VBLANK (cust: pCustom);
 PROCEDURE OFF_VBLANK (cust: pCustom);
 PROCEDURE ON_VBLANK (cust: pCustom);
 PROCEDURE ON_VBLANK (cust: pCustom);
 
 
+procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt); inline;
+function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
+
 function RasSize(w, h: Word): Integer;
 function RasSize(w, h: Word): Integer;
 
 
 {Here we read how to compile this unit}
 {Here we read how to compile this unit}
@@ -2539,6 +2542,16 @@ begin
   RasSize := h * (((w + 15) shr 3) and $FFFE);
   RasSize := h * (((w + 15) shr 3) and $FFFE);
 end;
 end;
 
 
+procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt); inline;
+begin
+  DrawEllipse(Rp, xCenter, yCenter, r, r);
+end;
+
+function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
+begin
+  AreaCircle := AreaEllipse(Rp, xCenter, yCenter, r, r);
+end;
+
 const
 const
     { Change VERSION and LIBVERSION to proper values }
     { Change VERSION and LIBVERSION to proper values }
 
 

+ 5 - 5
packages/amunits/src/coreunits/amigados.pas

@@ -1639,7 +1639,7 @@ FUNCTION FindSegment(const name : pCHAR location 'd1';const seg : pSegment locat
 FUNCTION FindVar(const name : pCHAR location 'd1'; type_ : ULONG location 'd2') : pLocalVar; syscall _DOSBase 918;
 FUNCTION FindVar(const name : pCHAR location 'd1'; type_ : ULONG location 'd2') : pLocalVar; syscall _DOSBase 918;
 FUNCTION Format(const filesystem : pCHAR location 'd1';const volumename : pCHAR location 'd2'; dostype : ULONG location 'd3') : LongBool; syscall _DOSBase 714;
 FUNCTION Format(const filesystem : pCHAR location 'd1';const volumename : pCHAR location 'd2'; dostype : ULONG location 'd3') : LongBool; syscall _DOSBase 714;
 FUNCTION FPutC(fh : BPTR location 'd1'; ch : LONGINT location 'd2') : LONGINT; syscall _DOSBase 312;
 FUNCTION FPutC(fh : BPTR location 'd1'; ch : LONGINT location 'd2') : LONGINT; syscall _DOSBase 312;
-FUNCTION FPuts(fh : BPTR location 'd1';const str : pCHAR location 'd2') : LongBool; syscall _DOSBase 342;
+FUNCTION FPuts(fh : BPTR location 'd1';const str : pCHAR location 'd2') : LongInt; syscall _DOSBase 342;
 FUNCTION FRead(fh : BPTR location 'd1'; block : POINTER location 'd2'; blocklen : ULONG location 'd3'; number : ULONG location 'd4') : LONGINT; syscall _DOSBase 324;
 FUNCTION FRead(fh : BPTR location 'd1'; block : POINTER location 'd2'; blocklen : ULONG location 'd3'; number : ULONG location 'd4') : LONGINT; syscall _DOSBase 324;
 PROCEDURE FreeArgs(args : pRDArgs location 'd1'); syscall _DOSBase 858;
 PROCEDURE FreeArgs(args : pRDArgs location 'd1'); syscall _DOSBase 858;
 PROCEDURE FreeDeviceProc(dp : pDevProc location 'd1'); syscall _DOSBase 648;
 PROCEDURE FreeDeviceProc(dp : pDevProc location 'd1'); syscall _DOSBase 648;
@@ -1730,9 +1730,9 @@ PROCEDURE UnLock(lock : BPTR location 'd1'); syscall _DOSBase 090;
 PROCEDURE UnLockDosList(flags : ULONG location 'd1'); syscall _DOSBase 660;
 PROCEDURE UnLockDosList(flags : ULONG location 'd1'); syscall _DOSBase 660;
 FUNCTION UnLockRecord(fh : BPTR location 'd1'; offset : ULONG location 'd2'; length : ULONG location 'd3') : LongBool; syscall _DOSBase 282;
 FUNCTION UnLockRecord(fh : BPTR location 'd1'; offset : ULONG location 'd2'; length : ULONG location 'd3') : LongBool; syscall _DOSBase 282;
 FUNCTION UnLockRecords(recArray : pRecordLock location 'd1') : LongBool; syscall _DOSBase 288;
 FUNCTION UnLockRecords(recArray : pRecordLock location 'd1') : LongBool; syscall _DOSBase 288;
-FUNCTION VFPrintf(fh : BPTR location 'd1';const format : pCHAR location 'd2';const argarray : POINTER location 'd3') : LONGINT; syscall _DOSBase 354;
+FUNCTION VFPrintf(fh : BPTR location 'd1';const format : pCHAR location 'd2';const argarray : PLongInt location 'd3') : LONGINT; syscall _DOSBase 354;
 PROCEDURE VFWritef(fh : BPTR location 'd1';const format : pCHAR location 'd2';const argarray : pLONGINT location 'd3'); syscall _DOSBase 348;
 PROCEDURE VFWritef(fh : BPTR location 'd1';const format : pCHAR location 'd2';const argarray : pLONGINT location 'd3'); syscall _DOSBase 348;
-FUNCTION VPrintf(const format : pCHAR location 'd1'; const argarray : POINTER location 'd2') : LONGINT; syscall _DOSBase 954;
+FUNCTION VPrintf(const format : pCHAR location 'd1'; const argarray : PLongInt location 'd2') : LONGINT; syscall _DOSBase 954;
 FUNCTION WaitForChar(file_ : BPTR location 'd1'; timeout : LONGINT location 'd2') : LongBool; syscall _DOSBase 204;
 FUNCTION WaitForChar(file_ : BPTR location 'd1'; timeout : LONGINT location 'd2') : LongBool; syscall _DOSBase 204;
 FUNCTION WaitPkt : pDosPacket; syscall _DOSBase 252;
 FUNCTION WaitPkt : pDosPacket; syscall _DOSBase 252;
 FUNCTION WriteChars(const buf : pCHAR location 'd1'; buflen : ULONG location 'd2') : LONGINT; syscall _DOSBase 942;
 FUNCTION WriteChars(const buf : pCHAR location 'd1'; buflen : ULONG location 'd2') : LONGINT; syscall _DOSBase 942;
@@ -1772,7 +1772,7 @@ FUNCTION FindVar(const name : string; type_ : ULONG) : pLocalVar;
 FUNCTION Format(const filesystem : string;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
 FUNCTION Format(const filesystem : string;const volumename : pCHAR; dostype : ULONG) : BOOLEAN;
 FUNCTION Format(const filesystem : pCHAR;const volumename : string; dostype : ULONG) : BOOLEAN;
 FUNCTION Format(const filesystem : pCHAR;const volumename : string; dostype : ULONG) : BOOLEAN;
 FUNCTION Format(const filesystem : string;const volumename : string; dostype : ULONG) : BOOLEAN;
 FUNCTION Format(const filesystem : string;const volumename : string; dostype : ULONG) : BOOLEAN;
-FUNCTION FPuts(fh : LONGINT;const str : string) : BOOLEAN;
+FUNCTION FPuts(fh : LONGINT;const str : string) : LongInt;
 FUNCTION GetDeviceProc(const name : string; dp : pDevProc) : pDevProc;
 FUNCTION GetDeviceProc(const name : string; dp : pDevProc) : pDevProc;
 FUNCTION GetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
 FUNCTION GetVar(const name : string; buffer : pCHAR; size : LONGINT; flags : LONGINT) : LONGINT;
 FUNCTION Inhibit(const name : string; onoff : LONGINT) : BOOLEAN;
 FUNCTION Inhibit(const name : string; onoff : LONGINT) : BOOLEAN;
@@ -1974,7 +1974,7 @@ begin
     Format := Format(PChar(RawByteString(filesystem)),PChar(RawByteString(volumename)),dostype);
     Format := Format(PChar(RawByteString(filesystem)),PChar(RawByteString(volumename)),dostype);
 end;
 end;
 
 
-FUNCTION FPuts(fh : LONGINT;const str : string) : BOOLEAN;
+FUNCTION FPuts(fh : LONGINT;const str : string) : LongInt;
 begin
 begin
     FPuts := FPuts(fh,PChar(RawByteString(str)));
     FPuts := FPuts(fh,PChar(RawByteString(str)));
 end;
 end;

+ 2 - 2
packages/amunits/src/coreunits/intuition.pas

@@ -1793,7 +1793,7 @@ Type
  tDrawInfo = record
  tDrawInfo = record
     dri_Version : Word;    { will be  DRI_VERSION                 }
     dri_Version : Word;    { will be  DRI_VERSION                 }
     dri_NumPens : Word;    { guaranteed to be >= numDrIPens       }
     dri_NumPens : Word;    { guaranteed to be >= numDrIPens       }
-    dri_Pens    : Pointer;  { pointer to pen array                 }
+    dri_Pens    : PWord;  { pointer to pen array                 }
 
 
     dri_Font    : pTextFont;      { screen default font          }
     dri_Font    : pTextFont;      { screen default font          }
     dri_Depth   : Word;            { (initial) depth of screen bitmap     }
     dri_Depth   : Word;            { (initial) depth of screen bitmap     }
@@ -4081,7 +4081,7 @@ PROCEDURE ChangeWindowBox(window : pWindow location 'a0'; left : LONGINT locatio
 FUNCTION ClearDMRequest(window : pWindow location 'a0') : LongBool; syscall _IntuitionBase 048;
 FUNCTION ClearDMRequest(window : pWindow location 'a0') : LongBool; syscall _IntuitionBase 048;
 PROCEDURE ClearMenuStrip(window : pWindow location 'a0'); syscall _IntuitionBase 054;
 PROCEDURE ClearMenuStrip(window : pWindow location 'a0'); syscall _IntuitionBase 054;
 PROCEDURE ClearPointer(window : pWindow location 'a0'); syscall _IntuitionBase 060;
 PROCEDURE ClearPointer(window : pWindow location 'a0'); syscall _IntuitionBase 060;
-PROCEDURE CloseScreen(screen : pScreen location 'a0'); syscall _IntuitionBase 066;
+function CloseScreen(screen : pScreen location 'a0'): LongBool; syscall _IntuitionBase 066;
 PROCEDURE CloseWindow(window : pWindow location 'a0'); syscall _IntuitionBase 072;
 PROCEDURE CloseWindow(window : pWindow location 'a0'); syscall _IntuitionBase 072;
 FUNCTION CloseWorkBench : LongBool; syscall _IntuitionBase 078;
 FUNCTION CloseWorkBench : LongBool; syscall _IntuitionBase 078;
 PROCEDURE CurrentTime(VAR seconds : ULONG location 'a0'; VAR micros : ULONG location 'a1'); syscall _IntuitionBase 084;
 PROCEDURE CurrentTime(VAR seconds : ULONG location 'a0'; VAR micros : ULONG location 'a1'); syscall _IntuitionBase 084;

+ 18 - 0
packages/amunits/src/utilunits/systemvartags.pas

@@ -109,8 +109,11 @@ FUNCTION WeighTAMatchTags(reqTextAttr : pTextAttr; targetTextAttr : pTextAttr; C
 FUNCTION OpenScreenTags(newScreen : pNewScreen; tagList : array of const) : pScreen;
 FUNCTION OpenScreenTags(newScreen : pNewScreen; tagList : array of const) : pScreen;
 FUNCTION OpenWindowTags(newWindow : pNewWindow; tagList : array of const) : pWindow;
 FUNCTION OpenWindowTags(newWindow : pNewWindow; tagList : array of const) : pWindow;
 FUNCTION NewObject(classPtr : pIClass; classID : pCHAR; Const argv : Array Of Const) : POINTER;
 FUNCTION NewObject(classPtr : pIClass; classID : pCHAR; Const argv : Array Of Const) : POINTER;
+FUNCTION SetAttrs(obj : POINTER; tags: array of DWord) : ULONG;
 FUNCTION SetGadgetAttrs(gadget : pGadget; window : pWindow; requester : pRequester; Const argv : Array Of Const) : ULONG;
 FUNCTION SetGadgetAttrs(gadget : pGadget; window : pWindow; requester : pRequester; Const argv : Array Of Const) : ULONG;
 FUNCTION NewObject(classPtr : pIClass; classID : string; Const argv : array of const ) : POINTER;
 FUNCTION NewObject(classPtr : pIClass; classID : string; Const argv : array of const ) : POINTER;
+FUNCTION EasyRequest(window : pWindow;const easyStruct : pEasyStruct; idcmpPtr : pULONG; args : array of DWord) : LONGINT;
+PROCEDURE SetWindowPointer(win : pWindow; tags: array of DWord);
 
 
 { from locale }
 { from locale }
 FUNCTION OpenCatalog(locale : pLocale; name : pCHAR; Const argv : Array Of Const) : pCatalog;
 FUNCTION OpenCatalog(locale : pLocale; name : pCHAR; Const argv : Array Of Const) : pCatalog;
@@ -180,11 +183,26 @@ begin
       NewObject := NewObjectA(classPtr,pas2c(classID),readintags(argv));
       NewObject := NewObjectA(classPtr,pas2c(classID),readintags(argv));
 end;
 end;
 
 
+FUNCTION SetAttrs(obj : POINTER; tags: array of DWord) : ULONG;
+begin
+  SetAttrs := SetAttrsA(obj, @tags);
+end;
+
 FUNCTION SetGadgetAttrs(gadget : pGadget; window : pWindow; requester : pRequester; Const argv : Array Of Const) : ULONG;
 FUNCTION SetGadgetAttrs(gadget : pGadget; window : pWindow; requester : pRequester; Const argv : Array Of Const) : ULONG;
 begin
 begin
     SetGadgetAttrs := SetGadgetAttrsA(gadget,window,requester,readintags(argv));
     SetGadgetAttrs := SetGadgetAttrsA(gadget,window,requester,readintags(argv));
 end;
 end;
 
 
+FUNCTION EasyRequest(window : pWindow;const easyStruct : pEasyStruct; idcmpPtr : pULONG; args : array of DWord) : LONGINT;
+begin
+  EasyRequest := EasyRequestArgs(window, easystruct, idcmpptr, @args);
+end;
+
+PROCEDURE SetWindowPointer(win : pWindow; tags: array of DWord);
+begin
+  SetWindowPointerA(win, @tags);
+end;
+
 FUNCTION AddAmigaGuideHost(h : pHook; name : pCHAR; Const argv : Array Of Const) : POINTER;
 FUNCTION AddAmigaGuideHost(h : pHook; name : pCHAR; Const argv : Array Of Const) : POINTER;
 begin
 begin
     AddAmigaGuideHost := AddAmigaGuideHostA(h,name,readintags(argv));
     AddAmigaGuideHost := AddAmigaGuideHostA(h,name,readintags(argv));

+ 26 - 3
packages/morphunits/src/agraphics.pas

@@ -2704,16 +2704,19 @@ procedure ON_SPRITE (cust: pCustom);
 procedure OFF_VBLANK (cust: pCustom);
 procedure OFF_VBLANK (cust: pCustom);
 procedure ON_VBLANK (cust: pCustom);
 procedure ON_VBLANK (cust: pCustom);
 
 
+procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt); inline;
+function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
+
 function RasSize(w, h: Word): Integer;
 function RasSize(w, h: Word): Integer;
 
 
+function ObtainBestPen(cm : pColorMap; r, g, b: CARDINAL; Tags: array of DWord) : LongInt; inline;
+function BestModeID(Tags: array of DWord) : CARDINAL; inline;
+
 { unit/library initialization }
 { unit/library initialization }
 function InitGraphicsLibrary : boolean;
 function InitGraphicsLibrary : boolean;
 
 
-
-
 implementation
 implementation
 
 
-
 procedure BNDRYOFF (w: pRastPort);
 procedure BNDRYOFF (w: pRastPort);
 begin
 begin
   with w^ do Flags := Flags And (Not AREAOUTLINE);
   with w^ do Flags := Flags And (Not AREAOUTLINE);
@@ -2809,6 +2812,26 @@ begin
   RasSize := h * (((w + 15) shr 3) and $FFFE);
   RasSize := h * (((w + 15) shr 3) and $FFFE);
 end;
 end;
 
 
+procedure DrawCircle(Rp: PRastPort; xCenter, yCenter, r: LongInt); inline;
+begin
+  DrawEllipse(Rp, xCenter, yCenter, r, r);
+end;
+
+function AreaCircle(Rp: PRastPort; xCenter, yCenter, r: SmallInt): LongWord; inline;
+begin
+  AreaCircle := AreaEllipse(Rp, xCenter, yCenter, r, r);
+end;
+
+function ObtainBestPen(cm : pColorMap; r, g, b: CARDINAL; Tags: array of DWord) : LongInt;
+begin
+  ObtainBestPen := ObtainBestPenA(cm, r, g, b, @Tags);
+end;
+
+function BestModeID(Tags: array of DWord) : CARDINAL;
+begin
+  BestModeID := BestModeIDA(@Tags);
+end;
+
 const
 const
   { Change VERSION and LIBVERSION to proper values }
   { Change VERSION and LIBVERSION to proper values }
   VERSION : string[2] = '50';
   VERSION : string[2] = '50';

+ 7 - 3
packages/morphunits/src/amigados.pas

@@ -1637,7 +1637,7 @@ SysCall MOS_DOSBase 348;
 
 
 function VFPrintf(fh      : BPTR location 'd1';
 function VFPrintf(fh      : BPTR location 'd1';
                   format  : PChar   location 'd2';
                   format  : PChar   location 'd2';
-                  argarray: Pointer location 'd3'): LongInt;
+                  argarray: PLongInt location 'd3'): LongInt;
 SysCall MOS_DOSBase 354;
 SysCall MOS_DOSBase 354;
 
 
 function dosFlush(fh: BPTR location 'd1'): LongInt;
 function dosFlush(fh: BPTR location 'd1'): LongInt;
@@ -2085,8 +2085,7 @@ procedure VWritef(format: PChar; argv: Pointer); Inline;
   * }
   * }
 
 
 function CreateNewProcTags(tags: array of dword): PProcess; Inline;
 function CreateNewProcTags(tags: array of dword): PProcess; Inline;
-
-
+function AllocDosObjectTags(type1: Cardinal; Tags: array of DWord): Pointer; inline;
 
 
 implementation
 implementation
 
 
@@ -2158,6 +2157,11 @@ begin
   CreateNewProcTags:=CreateNewProc(@tags);
   CreateNewProcTags:=CreateNewProc(@tags);
 end;
 end;
 
 
+function AllocDosObjectTags(type1: Cardinal; Tags: array of DWord): Pointer; inline;
+begin
+  AllocDosObjectTags := AllocDosObject(type1, @Tags);
+end;
+
 
 
 begin
 begin
   DosBase:=MOS_DOSBase;
   DosBase:=MOS_DOSBase;

+ 25 - 1
packages/morphunits/src/intuition.pas

@@ -1767,7 +1767,7 @@ Type
  tDrawInfo = record
  tDrawInfo = record
     dri_Version : Word;    { will be  DRI_VERSION                 }
     dri_Version : Word;    { will be  DRI_VERSION                 }
     dri_NumPens : Word;    { guaranteed to be >= numDrIPens       }
     dri_NumPens : Word;    { guaranteed to be >= numDrIPens       }
-    dri_Pens    : Pointer;  { pointer to pen array                 }
+    dri_Pens    : PWord;  { pointer to pen array                 }
 
 
     dri_Font    : pTextFont;      { screen default font          }
     dri_Font    : pTextFont;      { screen default font          }
     dri_Depth   : Word;            { (initial) depth of screen bitmap     }
     dri_Depth   : Word;            { (initial) depth of screen bitmap     }
@@ -4466,6 +4466,11 @@ function ITEMNUM( n : Word): Word;
 function MENUNUM( n : Word): Word;
 function MENUNUM( n : Word): Word;
 function SUBNUM( n : Word): Word;
 function SUBNUM( n : Word): Word;
 
 
+function SetAttrs(object1 : POINTER; tags : array of dword) : CARDINAL; inline;
+function SetGadgetAttrs(gadget:  pGadget; window : pWindow; requester : pRequester; tags : array of dword) : CARDINAL; inline;
+function EasyRequest(window : pWindow;const easyStruct : pEasyStruct; idcmpPtr : pULONG; args : array of DWord) : LONGINT; inline;
+procedure SetWindowPointer(win : pWindow; tags: array of DWord); inline;
+
 {
 {
 FUNCTION DisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal) : BOOLEAN;
 FUNCTION DisplayAlert(alertNumber : Cardinal;string_ : string; height : Cardinal) : BOOLEAN;
 FUNCTION LockPubScreen(name : string) : pScreen;
 FUNCTION LockPubScreen(name : string) : pScreen;
@@ -4667,6 +4672,25 @@ begin
 end;
 end;
 }
 }
 
 
+function SetAttrs(object1 : POINTER; tags : array of dword) : CARDINAL; inline;
+begin
+  SetAttrs := SetAttrsA(object1, @tags);
+end;
+
+function SetGadgetAttrs(gadget:  pGadget; window : pWindow; requester : pRequester; tags : array of dword) : CARDINAL; inline;
+begin
+  SetGadgetAttrs := SetGadgetAttrsA(gadget, window, requester, @tags);
+end;
+
+function EasyRequest(window : pWindow;const easyStruct : pEasyStruct; idcmpPtr : pULONG; args : array of DWord) : LONGINT; inline;
+begin
+  EasyRequest := EasyRequestArgs(window, easystruct, idcmpptr, @args);
+end;
+
+procedure SetWindowPointer(win : pWindow; tags: array of DWord); inline;
+begin
+  SetWindowPointerA(win, @tags);
+end;
 
 
 const
 const
   { Change VERSION and LIBVERSION to proper values }
   { Change VERSION and LIBVERSION to proper values }