Trinity in Trouble

From Freepascal Amiga wiki
Jump to: navigation, search

Note

Based on Free Pascal branch "fixes 3.0"

Feel free to add delete or change status.

Our trinity consist of Amiga, AROS and MorphOS.

Unfortunately, there are (still) some incompatibilities and/or some lack of consistency here and there. The idea is to have a list here that mentions them all. Layout may change, i simply had to start somewhere.

NOTE: I thought there is no use to mention the Tag, Tags, Taglist, etc. inconsistency and additional incompatibilities that this causes. We are all aware of those and will hopefully get some unity in the future

Table of units

The triforce repo introduced the usage of unit trinitypes in order to fight the type inconsistencies (at least for the new units, not the examples). The contents of trinitype will be extended as things progresses. A simple load-search-replace-save routine/program can be applied since the used types are fairly unique.

List of available units per platform:
Unit Category OS3.x AROS MorphOS Remark(s)
#agraphics graphics.library yes yes yes
ahi ahi.device yes MAG yes
ahi_sub ahi_sub.library yes no no
akeyboard keyboard.device yes test test
amarquee amarquee.library yes n/a n/a
#amigados dos.library yes yes yes
amigaguide amigaguide.library yes MAG no No use though, AROS' lib functions are not implemented
#amigalib amigalib yes test yes Unit amigalib has it's own status page, AmigaLib
amigaprinter printer.device yes test test
aroslib aros.library n/a yes n/a
#asl asl.library yes yes yes
audio audio.device yes MAG no
bootblock bootblock.device yes no no
bullet bullet.library yes no no
cd cd.device yes no no
clipboard clipboard.device yes yes yes
colorwheel colorwheel.gadget yes no no
#commodities commodities.library yes test test
configregs see expansion yes test test
configvars see expansion yes test test
console console.device yes test test
conunit console.device yes test test
cgxvideo no no yes Recently added to MorphOS by Chain-Q
cybergraphics cybergraphics.library yes yes yes Recently added to MorphOS by Chain-Q
datatypes datatypes.library yes test yes Unit source (AROS) is still a bit of a mess. Amiga version needs an overhaul (no PObject_ being used where it should -> concerns most if not all of declared functions).
diskfont diskfont.library yes yes test A diskfont unit was added to MorphOS by Chain-Q
#exec exec.library yes yes yes MorphOS: noticed some things missing in comparison to SDK 3.9 (this is meant as a reminder to verify this unit)
#expansion expansion.library yes test test
expansionbase see expansion yes test test
#gadtools gadtools.library yes yes test
gameport gameport.device yes no no
get9  ? n/a n/a yes silly MorphOS-only historic .library, Pascal interface unit exist as a joke, ignore this :)
gradientslider gradientslider.gadget yes no no
gtlayout gtlayout.library yes no no
guigfx guigfx.library yes no no
hardblocks hardblocks.device yes no no
hardware hardware.resource yes yes yes
icon icon.library yes yes test
identify identify.lbrary yes no no
iffparse iffparse.library yes yes yes
input input.device yes test test
inputevent see input.device yes yes yes
#intuition intuition.library yes yes yes
#keymap keymap.library yes yes yes
kvm  ? n/a n/a n/a This unit is now dropped. It was a helper unit for the KVM stuff, but it's no longer used, and it doesn't provide any other useful functionality. It's "API" was never meant for public use either. The idea was, mouse unit could be used w/o the video and keyboard, and doesn't depend on each other. But it doesn't really matter any more. I removed it from trunk.
layers layers.library yes yes yes
locale locale.library yes test test
lowlevel lowlevel.library yes MAG no
lucyplay lucyplay.library yes no no
mui mui.library (ZUNE) yes yes yes
muihelper see mui.library no no yes MUIHelper contains some Pascal syntax-sugar and helpers for writing MUI code. It can be moved to ami-extra Package when it's verified it works everywhere.
mysticview mysticview.library yes no no
nonvolatile nonvolatile.library yes no no
parallel parallel.device yes no no
picasso96api picasso library yes n/a n/a MorphOS and AROS don't have Picasso96 support.
preferences preferences.library yes n/a no
prefs see preferences yes test test
prtbase printer.device yes no no
prtgfx  ? yes no no
ptreplay ptreplay.library yes MAG no
realtime realtime.library yes no no
render render.library yes no no
reqtools reqtools.library yes no no
#rexx rexxsyslib.library yes test test
romboot_base yes no no
scsidisk scscidisk.device yes no no
serial serial.device yes no no
tapedeck tapedeck.gadget yes no no
timer timer.device yes yes yes
tinygl tinygl library n/a n/a yes TinyGL is MorphOS specific and the unit there is only used to get the OpenGL package of FPC running.
trackdisk trackdisk.device yes no no
translator translator.library yes no no
triton triton.library yes no no
tritonmacros macros for triton yes no no
ttengine ttengine.library yes MAG no
utility utility.library yes yes yes
#workbench workbench.library yes yes test
xadmaster xadmaster.library yes MAG no
zlib zlib.library yes no no
amigautils amigautils yes no no Should be moved to ami-extra when it's verified it works elsewhere and contains no deprecated code.
amsgbox msgbox using easyasl yes no no Should be moved to ami-extra when it's verified it works elsewhere and contains no deprecated code.
consoleio crt using console yes no no
deadkeys console deadkeys yes no no
doublebuffer yes no no
easyasl easyasl.library yes no no
hisoft yes no no Should be moved to ami-extra when it's verified it works elsewhere and contains no deprecated code.
linklist yes no no Should be moved to ami-extra when it's verified it works elsewhere and contains no deprecated code.
longarray yes yes no
pastoc yes no no This is deprecated, and must *not* be ported to other platforms.
pcq yes no no Should be moved to ami-extra when it's verified it works elsewhere and contains no deprecated code.
systemvartags yes no no NOTE: this unit cannot be used when trying to create executables to be run on AROS-m68k because AROS misses bullet.library.
tagsarray yes yes no Tagsarray implementation is not thread safe, at least on classic.
timerutils yes no no Should be moved to ami-extra when it's verified it works elsewhere.
vartags yes no no
wbargs yes no no

List of issues

agraphics

  • record: Isrvstr
AROS: Missing
  • var: GfxBase
AROS: type is PGfxBase
Amiga: type is PLibrary
MorphOS: type is Pointer
Note: According to rkrm it should be PGfxBase

amigados

  • function: DOSRename()
aros: function DOSRename(const OldName: STRPTR; const NewName: STRPTR): LongInt; syscall AOS_DOSBase 13;
os4: function DosRename(const OldName: STRPTR; const NewName: STRPTR): LongBool; syscall IDos 108;
os3: FUNCTION DOSRename(const oldName : pCHAR location 'd1';const newName : pCHAR location 'd2') : LongBool; syscall _DOSBase 078;
mos: function dosRename(oldName: PChar location 'd1'; newName: PChar location 'd2'): LongInt; SysCall MOS_DOSBase 78;
remark: PChar vs STRPTR (should be STRPTR) and LongInt vs LongBool (should be BOOL)
  • function: Examine()
aros: function Examine(Lock: BPTR; FileInfoBlock: PFileInfoBlock): LongInt; syscall AOS_DOSBase 17;
os4: function Examine(Lock: BPTR; FileInfoBlock: PFileInfoBlock): LongBool; syscall IDos 124;
os3: FUNCTION Examine(lock: BPTR location 'd1'; fileInfoBlock: pFileInfoBlock location 'd2'): LongBool; syscall _DOSBase 102;
mos: function Examine(lock: BPTR location 'd1'; fileInfoBlock: PFileInfoBlock location 'd2'): LongInt; SysCall MOS_DOSBase 102;
remark: LongInt vs LongBool (should be BOOL)
  • function: Execute()
aros: function Execute(const String_: STRPTR; Input: BPTR; Output: BPTR): LongInt; syscall AOS_DOSBase 37;
os4: function Execute(const String_: STRPTR; File_: BPTR; File2: BPTR): LongBool; syscall IDos 204;
os3: FUNCTION Execute(const string_ : pCHAR location 'd1'; file_ : LONGINT location 'd2'; file2 : LONGINT location 'd3') : LongBool; syscall _DOSBase 222;
mos: function Execute(string1: PChar location 'd1'; file1 : BPTR location 'd2'; file2 : BPTR location 'd3'): LongBool;
remark: PChar vs STRPTR (should be STRPTR), BPTR vs LONGINT (should be BPTR) and LongInt vs LongBool (should be BOOL)
  • function: ExNext()
aros: function ExNext(Lock: BPTR; FileInfoBlock: PFileInfoBlock): LongInt; syscall AOS_DOSBase 18;
os4: function ExNext(Lock: BPTR; FileInfoBlock: PFileInfoBlock): LongBool; syscall IDos 128;
os3: FUNCTION ExNext(lock: BPTR location 'd1'; fileInfoBlock: pFileInfoBlock location 'd2'): LongBool; syscall _DOSBase 108;
mos: function ExNext(lock: BPTR location 'd1'; fileInfoBlock: PFileInfoBlock location 'd2'): LongInt; SysCall MOS_DOSBase 108;
remark: LongInt vs LongBool (should be BOOL)

amigalib

  • function: CreatePort()
Missing for AROS and MorphOS
  • function: DeletePort()
Missing for AROS and MorphOS
  • function: CreateExtIO()
Missing for AROS and MorphOS
  • function: DeleteExtIO()
Missing for AROS and MorphOS
  • function: DoMethod()
Amiga version seems missing completely.
Implemented versions for AROS and MorphOS don't follow autodocs 100% and are inconsistent.
  • function: CoerceMethod()
MorphOS version seems missing completely (including CoerceMethodA().
Amiga version has CoerceMethodA() implemented but no CoerceMethod()
Implemented versions for AROS and Amiga don't follow autodocs 100% and are inconsistent.


asl

AROS' implementation of asl uses 'modern' function names, ending with or without an A depending whether it's a varargs version or not. Amiga and MorphOS implementations uses 'old-style' naming scheme as dictated by classic autodocs. In order to 'fix' this, unit trinity re-declares asl functions using the 'old-style' naming scheme (it was the quickest fix).

exec

  • structure: Hook
AROS version, entries are not IPTR rather APTR. Amiga version uses ULONG's for h_entry and h_subentry, but that doesn't comply on 64-bit. AROS version can be found here.
Remark: In case it's compatibility holding back the change, i'm willing to create a multiplatform advanced record solution
  • function: NewCreateTask()
AROS: missing.
Note: Most probably introduced when v0-on-trunk became v0.
  • function: AVL_FindNextNodeByKey()
AROS: Missing of 3th parameter 'comparefunction'
AROS sdk: struct AVLNode *AVL_FindNextNodeByKey(const struct AVLNode *node, AVLKey key, AVLKEYCOMP func) (A0, A1, A2)
  • function: AVL_FindPrevNodeByKey()
AROS: Missing of 3th parameter 'comparefunction'
AROS sdk: struct AVLNode *AVL_FindPrevNodeByKey(const struct AVLNode *root, AVLKey key, AVLKEYCOMP func) (A0, A1, A2)
  • function: AVL_FindNode()
AROS: 3th parameter Func is declared as type PAVLNODECOMP. Should be PAVLKEYCOMP.
  • function: AVL_RemNodeByKey()
AROS: 3th parameter Func is declared as type PAVLNODECOMP. Should be PAVLKEYCOMP.

commodities

expansion

(see also other expansion support units)

  • syscall routine: ReadExpansionRom
Amiga: declared as procedure. autodocs are inconsistent (both procedure and function are being mentioned). AROS (also 68k) tells it is indeed a function and returning a bool.
  • syscall routine: ConfigBoard()
Amiga: declared as procedure. autodocs are inconsistent (both procedure and function are being mentioned). AROS (also 68k) tells it is indeed a function and returning a bool.

gadtools

  • unit: gadtools
MorphOS: unit missing Available in fpc-triforce repo (for link see unit table). Waiting for testing/approval.
  • varargs function: CreateGadget()
AROS: missing
  • varargs function: CreateMenus()
AROS: missing
  • varargs function: DrawBevelBox()
AROS: missing
  • varargs function: GetVisualInfo()
AROS: missing
  • varargs function: GT_GetGadgetAttrs()
AROS: missing
  • varargs function: GT_SetGadgetAttrs()
AROS: missing
  • varargs function: LayoutMenuItems()
AROS: missing
  • varargs function: LayoutMenus()
AROS: missing
  • function: CreateContext()
Amiga SDK: struct Gadget *CreateContext(struct Gadget **);
AROS SDK: struct Gadget *CreateContext(struct Gadget **glistpointer) (A0)
Amiga: FUNCTION CreateContext(glistptr : pGadget location 'a0'): pGadget; syscall GadToolsBase 114;
AROS: function CreateContext(GListPtr: PGadget): PGadget; syscall GadToolsBase 19;
Note: glistpointer is a pointer to a pointer

intuition

keymap

rexx

workbench

uncategorized

Fixed in triforce

Additional units, added to triforce repo. Note that all issues listed above are already addressed with using unit trinity.

  • unit: akeyboard
AROS: missing | fixed in triforce[1]
MorphOS: missing | fixed in triforce[2]
  • unit: diskfont
MorphOS: missing | fixed in triforce[3]
  • unit: prefs
AROS: missing | fixed in triforce[4]
MorphOS: missing | fixed in triforce[5]
  • unit: AmigaPrinter
AROS: missing | fixed in triforce[6]
MorphOS: missing | fixed in triforce[7]
  • unit: Datatypes
AROS: missing | fixed in triforce[8]
  • unit: input
AROS: missing | fixed in triforce[9]
MorphOS: missing | fixed in triforce[10]
  • unit: workbench
MorphOS: missing | fixed in triforce[11]
  • unit: icon
MorphOS: missing | fixed in triforce[12]
  • unit: locale
AROS: missing | fixed in triforce[13]
MorphOS: missing | fixed in triforce[14]
  • unit: gadtools
MorphOS: missing | fixed in triforce[15]
  • unit: commodities
AROS: missing | fixed in triforce[16]
MorphOS: missing | fixed in triforce[17]
  • unit: configregs
AROS: missing | fixed in triforce[18]
MorphOS: missing | fixed in triforce[19]
  • unit: configvars
AROS: missing | fixed in triforce[20]
MorphOS: missing | fixed in triforce[21]
  • unit: configregs
AROS: missing | fixed in triforce[22]
MorphOS: missing | fixed in triforce[23]
  • unit: expansionbase
AROS: missing | fixed in triforce[24]
MorphOS: missing | fixed in triforce[25]
  • unit: expansion
AROS: missing | fixed in triforce[26]
MorphOS: missing | fixed in triforce[27]
  • unit: rexx
AROS: missing | fixed in triforce[28]
MorphOS: missing | fixed in triforce[29]
  • unit: aroslib
AROS: added to triforce[30]

Fixed in current trunk

  • unit: systemvartags [31]
This utility unit is Amiga specific and implements most if not all vartags versions of library-calls rendering it incompatible with AROS and MorphOS
  • function: AddAppIconA() [32]
Autodocs: struct AppIcon *AddAppIconA(ULONG, ULONG, char *, struct MsgPort *, BPTR, struct DiskObject *, struct TagItem *);
Amiga: FUNCTION AddAppIconA(id : ULONG location 'd0'; userdata : ULONG location 'd1'; text_ : pCHAR location 'a0'; msgport : pMsgPort location 'a1'; lock : pFileLock location 'a2'; diskobj : pDiskObject location 'a3'; const taglist : pTagItem location 'a4') : pAppIcon; syscall WorkbenchBase 060;
Note: lock parameter is of type BPTR not pFileLock
  • varargs function: AddAppIcon() [33]
Amiga: Missing
  • function: DeleteArgstring() [34]
Amiga SDK: VOID DeleteArgstring(UBYTE* argstring:A0)
Amiga: procedure DeleteArgstring(argstring: PChar location 'd0'); syscall RexxSysBase 132;
Note: d0 as location ?
  • function: MapANSI() [35]
Amiga SDK: LONG MapANSI( STRPTR, LONG, STRPTR, LONG, struct KeyMap * );
MorphOS: function MapANSI(CONST strg : pSHORTINT location 'a0'; count : longint location 'd0'; buffer : pSHORTINT location 'a1'; length : longint location 'd1'; CONST keyMap : pKeyMap location 'a2') : longint; SysCall KeymapBase 048;
Note: PShortInt vs STRPTR for buffer/strg argument
  • function: MapRawKey() [36]
Amiga SDK: WORD MapRawKey( struct InputEvent *, STRPTR, WORD, struct Keymap * );
MorphOS: function MapRawKey(CONST event : pInputEvent location 'a0'; buffer : pSHORTINT location 'a1'; length : longint location 'd1'; CONST keyMap : pKeyMap location 'a2') : INTEGER; SysCall KeymapBase 042;
Note: PShortInt vs STRPTR for buffer argument
  • function: SetPointer() [37]
Amiga SDK: SetPointer( Window, Pointer, Height, Width, XOffset, YOffset )
AROS SDK: void SetPointer(struct Window * window, const UWORD* pointer, LONG height, LONG width, LONG xOffset, LONG yOffset );
MorphOS SDK: VOID SetPointer( struct Window *window, UWORD *pointer, LONG height, LONG width, LONG xOffset, LONG yOffset );
Amiga: PROCEDURE SetPointer(window : pWindow location 'a0'; pointer_ : pword location 'a1'; height : LONGINT location 'd0'; width : LONGINT location 'd1'; xOffset : LONGINT location 'd2'; yOffset : LONGINT location 'd3'); syscall _IntuitionBase 270;
AROS: procedure SetPointer(Window: PWindow; Pointer_: PWord; Height: LongInt; Width: LongInt; XOffset: LongInt; YOffset: LongInt); syscall IntuitionBase 45;
MorphOS: procedure SetPointer(window : pWindow location 'a0'; VAR pointer : Word location 'a1'; height : LongInt location 'd0'; width : LongInt location 'd1'; xOffset : LongInt location 'd2'; yOffset : LongInt location 'd3'); SysCall IntuitionBase 270;
Note: Using a var for pointerdata seems a bad idea. If must, then please provide both options.
  • structure: TExpansionControl() [38]
Amiga: field ec_Reserved11 is currently advertised with name ec_Z3_HighBase
Autodocs: "typedef ULONG Tag;"
Amiga: "Type Tag = LongInt;"
  • record field: ti_Data of record tTagItem [40]
Autodocs: "ULONG ti_Data;"
Amiga: "ti_Data : LongInt;"
  • function: ASLRequestTags() [41]
AROS implementation seems missing. [42]
Amiga implements it in utility unit systemvartags (see also unit: systemvartags)
MorphOS implements it in unit ASL
  • function: AslRequest() [43]
autodocs: BOOL AslRequest( APTR,struct TagItem * );
Amiga: FUNCTION AslRequest(requester : POINTER location 'a0'; tagList : pTagItem location 'a1') : LongInt; syscall AslBase 060;
AROS: function AslRequest(Requester: Pointer; const Tags: array of const): LongBool;
MorphOS: function AslRequest(requester: Pointer location 'a0'; tagList : pTagItem location 'a1'): LongBool; SysCall AslBase 060;
  • function: RequestFile() [44]
Autodocs: BOOL RequestFile(struct FileRequester *);
Amiga: FUNCTION RequestFile(fileReq : pFileRequester location 'a0') : LongInt; syscall AslBase 042;
Remark: Here the boolean return type is allowed (as is used on the other platforms)
  • function: AslRequest() [45]
Autodocs: BOOL AslRequest(APTR,struct TagItem *);
Amiga: FUNCTION AslRequest(requester: POINTER location 'a0'; tagList: pTagItem location 'a1'): LongInt; syscall AslBase 060;
Remark: Here the boolean return type is allowed (as is used on the other platforms)


  • function: BltClear() [46]
Amiga: PROCEDURE BltClear(memBlock : pCHAR location 'a1'; byteCount : ULONG location 'd0'; flags : ULONG location 'd1'); syscall GfxBase 300;
AROS: procedure BltClear(MemBlock: Pointer; ByteCount: LongWord; Flags: LongWord); syscall GfxBase 50; deprecated;
MorphOS: procedure BltClear(memBlock : pCHAR location 'a1'; byteCount : CARDINAL location 'd0'; flags : CARDINAL location 'd1'); SysCall GfxBase 300;
Note: Parameter MemBlock should really be a generic pointer.
  • function: VideoControl() [47]
Amiga: FUNCTION VideoControl(colorMap : pColorMap location 'a0'; tagarray : pTagItem location 'a1') : LongBool; syscall GfxBase 708;
AROS: function VideoControl(Cm: PColorMap; Tags: PTagItem): LongWord; syscall GfxBase 118; unimplemented;
MorphOS: function VideoControl(colorMap : pColorMap location 'a0'; tagarray : pTagItem location 'a1') : LongBool; SysCall GfxBase 708;
Note: suggest to use LongBool as return-type.
  • function: LoadRGB4() [48]
Amiga: PROCEDURE LoadRGB4(vp : pViewPort location 'a0';const colors : pWord location 'a1'; count : LONGINT location 'd0'); syscall GfxBase 192;
AROS: procedure LoadRGB4(Vp: PViewPort; Colors: PWord; Count: LongInt); syscall GfxBase 32;
MorphOS: procedure LoadRGB4(vp : pViewPort location 'a0'; VAR colors : Integer location 'a1'; count : LongInt location 'd0'); SysCall GfxBase 192;
Note: This time MorphOS is the odd one out using var for colour parameter.


  • function: GetAttr() fixed in trunk [49]
MorphOS uses a var for parameter Return-Value while Amiga + AROS uses a pointer. Autodocs states it to be a pointer.
  • function: AllocMem() (high priority) Fixed in trunk [50]
MorphOS implemented it as ExecAllocMem
Amiga + AROS version have this function declared as AllocMem(), which is ambiguous with Free Pascal's AllocMem function.
  • function: Info() fixed in trunk [51]
AutoDocs: BOOL = Info( BPTR, struct InfoData * )
Amiga declaration: FUNCTION Info(lock : LONGINT location 'd1'; parameterBlock : pInfoData location 'd2') : LongBool; syscall _DOSBase 114;
AROS declaration: function Info(Lock: BPTR; ParameterBlock: PInfoData): LongInt; syscall AOS_DOSBase 19;
MorphOS declaration: function Info(lock : LongInt location 'd1'; parameterBlock: PInfoData location 'd2'): LongInt; SysCall MOS_DOSBase 114;
  • macros: All MUI macros fixed in trunk [52]
Amiga: The OBJ_xxx() macros are not implemented as macro's at all, rather as a cast to a particular structure in order to obtain information -> that is totally completely wickedly wrong.
MorphOS: See Amiga.
  • Constants: MUIX_R, MUIX_C, MUIX_L, MUIX_N, MUIX_B, MUIX_I, MUIX_U, MUIX_PT and MUIX_PH fixed in trunk [53]
AMIGA + AROS: these MUI constants uses c-language escape code characters, which won't work for Free Pascal.
MorphOS: declared them as they should.
  • function: NextTagItem() fixed in trunk [54]
autodocs: struct TagItem *NextTagItem(struct TagItem **);
Amiga: function NextTagItem(Item : ppTagItem location 'a0') : pTagItem; syscall _UtilityBase 048;
AROS: function NextTagItem(var Item: PTagItem): PTagItem; syscall AOS_UtilityBase 8;
MorphOS: function NextTagItem(tagListPtr: pPTagItem location 'a0'): PTagItem; SysCall MOS_UtilityBase 048;
  • function: ReadPixelArray8() fixed in [55]
autodocs: LONG ReadPixelArray8(struct RastPort *, UWORD, UWORD, UWORD, UWORD, UBYTE *, struct RastPort *);
Amiga: FUNCTION ReadPixelArray8(rp: pRastPort location 'a0'; xstart: ULONG location 'd0'; ystart: ULONG location 'd1'; xstop: ULONG location 'd2'; ystop: ULONG location 'd3'; array_: pointer location 'a2'; temprp: pRastPort location 'a1'): LONGINT; syscall GfxBase 780;
AROS: function ReadPixelArray8(Rp: PRastPort; xStart, yStart, xStop, yStop: LongWord; Array_: PByte; TempRp: PRastPort): LongInt; syscall GfxBase 130;
MorphOS: function ReadPixelArray8(rp: pRastPort location 'a0'; xstart: CARDINAL location 'd0'; ystart: CARDINAL location 'd1'; xstop: CARDINAL location 'd2'; ystop: CARDINAL location 'd3'; array1: pCHAR location 'a2'; temprp: pRastPort location 'a1'): LongInt; SysCall GfxBase 780;
Remark: PChar for pointing to Array data ?
  • function: WritePixelArray8()
See: ReadPixelArray8()
  • function: PolyDraw() fixed in trunk [56]
Autodocs: void PolyDraw( struct RastPort *, WORD, WORD * );
Amiga: PROCEDURE PolyDraw(rp : pRastPort location 'a1'; count : LONGINT location 'd0';const polyTable : pLongint location 'a0'); syscall GfxBase 336;
AROS: procedure PolyDraw(Rp: PRastPort; Count: LongInt; PolyTable: PSmallInt); syscall GfxBase 56;
MorphOS: procedure PolyDraw(rp : pRastPort location 'a1'; count : LongInt location 'd0'; VAR polyTable : INTEGER location 'a0'); SysCall GfxBase 336;
Remark: MorphOS' use of var for argument polyTable is imho just plain weird and also dictates the array to consist out of integers. Amiga version dictates using LongInt for the PolyTable array.
  • type: PPObject_ fixed in trunk[57]
Missing for Amiga and MorphOS
  • function: TextLength() fixed in trunk[58]
MorphOS: types the string parameter as pShortInt. Autodocs/Amiga/AROS uses type STRPTR.
  • function: Text() fixed in trunk[59]
MorphOS: still called Text() while Amiga and AROS named it GfxText(). Also the string parameter for MorphOS is declared as pShortInt. Autodocs/Amiga/AROS uses type STRPTR.
  • const: ACTION_READ fixed in trunk[60]
MorphOS: Defines this constant as 'R', which is incompatible with TDOSPacket.dp_Type (LONG)
Remark: Amiga + AROS defines this constant as ACTION_READ = $52; // 'R'
  • const: ACTION_WRITE fixed in trunk[61]
MorphOS: Defines this constant as 'W', which is incompatible with TDOSPacket.dp_Type (LONG)
Remark: Amiga + AROS defines this constant as ACTION_WRITE = $57; // 'W'
  • Function: ReadArgs() fixed in trunk[62]
autodocs: struct RDArgs * ReadArgs(STRPTR, LONG *, struct RDArgs *)
Amiga: FUNCTION ReadArgs(const arg_template : pCHAR location 'd1'; arra : pLONGINT location 'd2'; args : pRDArgs location 'd3') : pRDArgs; syscall _DOSBase 798;
AROS: function ReadArgs(const Template: STRPTR; var Array_: IPTR; RdArgs: PRDArgs): PRDArgs; syscall AOS_DOSBase 133;
MorphOS: function ReadArgs(arg_template: PChar location 'd1'; var array1: LongInt location 'd2'; args: PRDArgs location 'd3'): PRDArgs; SysCall MOS_DOSBase 798;
Remark: using var for Array_ parameter is ok, but restricts when attempting to pass f.i. a record structure. Why not declare both variants in such cases ?
  • macro: RASSIZE() fixed in trunk[63]
Amiga: missing
MorphOS: missing
  • Const: MIDDLEUP fixed in trunk[64]
Amiga: Missing
MorphOS: Missing
  • Const: MIDDLEDOWN fixed in trunk[65]
Amiga: Missing
MorphOS: Missing
  • unit: diskfont fixed in triforce[66], fixed in trunk[67]
MorphOS: missing
  • unit: CyberGraphics fixed in trunk[68]
MorphOS: Missing
  • function: ObtainBestPen() fixed in trunk[69]
MorphOS: Missing
  • macro: DrawCircle fixed in trunk[70]
Amiga: missing
MorphOS: missing
  • varargs function: BestModeID() fixed in trunk[71]
MorphOS: missing
  • function: AllocDosObjectTags() fixed in trunk[72]
MorphOS: Function missing.
  • function FPuts() fixed in trunk[73]
Autodocs: LONG FPuts(BPTR, STRPTR)
Amiga1: FUNCTION FPuts(fh : LONGINT location 'd1';const str : pCHAR location 'd2') : LongBool; syscall _DOSBase 342;
Amiga2: FUNCTION FPuts(fh : LONGINT;const str : string) : BOOLEAN;
AROS: function FPuts(File_: BPTR; const String_: STRPTR): LongInt; syscall AOS_DOSBase 57;
MorphOS: function FPuts(fh : LongInt location 'd1'; str: PChar location 'd2'): LongInt; SysCall MOS_DOSBase 342;
Remark: note the use of different return-types as well as not using BPTR for filehandle type.
Note: returns zero on success, -1 if an error occurs, so please forget using a boolean return type.
  • function: VFPrintf() fixed in trunk[74]
AutoDocs: LONG = VFPrintf(BPTR, STRPTR, LONG *)
Amiga declaration: FUNCTION VFPrintf(fh : LONGINT location 'd1';const format : pCHAR location 'd2';const argarray : POINTER location 'd3') : LONGINT; syscall _DOSBase 354;
AROS declaration: function VFPrintf(Fh: BPTR; const format: STRPTR; const ArgArray: PLongInt): LongInt; syscall AOS_DOSBase 59;
MorphOS declaration: function VFPrintf(fh : LongInt location 'd1'; format: PChar location 'd2'; argarray: Pointer location 'd3'): LongInt; SysCall MOS_DOSBase 354;
NOTE: the generic pointer declaration prevents using "VFPrintf(nil/0, 'text', vargs );" where vargs = array of long.
Remark: AFAIK for AROS it is theoretically possible to pass 64-bit formatted values.
  • function: SetAttrs() fixed in trunk[75]
Amiga + MorphOS implementations seems missing
  • function: SetGadgetAttrs() fixed in trunk[76]
MorphOS version seems missing
  • function: EasyRequest() fixed in trunk[77]
Amiga: Missing
AROS: version with no array of const is missing -> forced to use [TAG_END, 0] <- extra 0 required for AROS due to small issue
MorphOS: Missing
  • field: dri_pens of structure tDrawInfo fixed in trunk[78]
Autodocs: UWORD *dri_Pens; /* pointer to pen array */
Amiga: dri_Pens : Pointer; { pointer to pen array }
AROS: dri_Pens : PWord; // pointer to pen array
MorphOS: dri_Pens : Pointer; { pointer to pen array }
Remark: afaik the pen array is an array of word (for all platforms), so the only really practical type for dri_pens would then be a Pointer to an unsigned word
  • varargs function: SetWindowPointer() fixed in trunk[79]
Amiga: Seems missing
MorphOS: Seems missing
  • function: CloseScreen() fixed in trunk[80]
Amiga: Amiga declaration is still pre v36 (procedure), and does not return a boolean value (function) on success/failure which is the case on v36+ systems.
  • structure: TWindow field WScreen fixed in trunk[81]
Autodocs: struct Screen *WScreen;
Amiga: WScreen : Pointer;
AROS: WScreen : PScreen;
MorphOS: WScreen : Pointer;
Status: Needs complete rewrite of intuition unit
  • type: TDateTime fixed in trunk[82]
Amiga + AROS: declares this structure (and accompanied pointer) as TDateTime,
MorphOS: declares this structure _TDateTime and accompanied pointer _PDateTime
Remark: TDateTime declared in AmigaDOS conflicts with Free Pascal's declared TDateTime structure.
  • function: DateToStr() fixed in trunk[83]
All: This function conflicts with Free Pascal own DateToStr function. Renamed to DOSSateToStr (and StrToDate to DOSStrToDate)
  • record TmemChunk fixed in trunk[84]
MorphOS: the field names right now are nc_Next and nc_Bytes -> should read mc_Next and mc_Bytes
  • vararg function: SystemTags() fixed in trunk[85]
MorphOS: missing.
  • record: TNewBroker (was already) fixed in trunk[86]
Amiga: This structure seems aligned wrongly.
Note1: Packrecords c failed, packrecords 2 seems to work, but its influence on other record structure (InputXpression) was not tested (it uses two bytes as first entry in its structure).
Note2: Amiga and morphos sdk seems to use pragmapack #2, so also for the second structure.
  • function CxBroker() fixed in trunk[87]
AutoDocs: CxObj *CxBroker(struct NewBroker *,LONG *);
Amiga: 238 FUNCTION CxBroker(nb : pNewBroker location 'a0'; error : pCxObj location 'd0') : pCxObj; syscall CxBase 036;
Note: according to autodocs, error is a pointer to a generic LONG, not pCxObj;
  • function CreateCxObj() fixed in trunk[88]
AutoDocs: co = CreateCxObj(type,arg1,arg2); D0 = D0 A0 A1
Amiga: 237 FUNCTION CreateCxObj(typ : ULONG location 'd0'; arg1 : LONGINT location 'a1'; arg2 : LONGINT location 'a2') : pCxObj; syscall CxBase 030;
Note: notice different use of address registers. I have not faintest idea why they don't match. Maybe there's a valid reason ? (although aros and mos also uses same registers as stated by autodocs).
  • function: WriteStr() fixed in trunk[89]
On MorphOS this function seems declared as Amiga-function, which clashes with Free Pascal build-in function WriteStr. Strange as WriteStr seems only declared as dos/stdio.h macro.
  • function: ChangeSprite() fixed in trunk[90]
Amiga: PROCEDURE ChangeSprite(vp : pViewPort location 'a0'; sprite : pSimpleSprite location 'a1'; newData : pWORD location 'a2'); syscall GfxBase 420;
AROS: procedure ChangeSprite(Vp: PViewPort; s: PSimpleSprite; NewData: Pointer); syscall GfxBase 70; unimplemented;
MorphOS: procedure ChangeSprite(vp : pViewPort location 'a0'; sprite : pSimpleSprite location 'a1'; VAR newData : Integer location 'a2'); SysCall GfxBase 420;
Note: MOS version uses var for sprite data parameter. Should be opaque pointer type (perhaps also for amiga ?)


Some of your finest

  • AslRequest()
 {$IFDEF AMIGA}
 if (AslRequest(fr, nil) <> 0) then
 {$ENDIF}
 {$IFDEF AROS}
 if (AslRequestA(fr, nil)) then
 {$ENDIF}
 {$IFDEF MORPHOS}
 if (AslRequest(fr, nil)) then
 {$ENDIF}
 begin
  // Could we now please check what the requester returned ?
 end;


Hardening trinity

In order to circumvent some of the inconsistencies and incompatibilities, there was need for a solution without tempering with the RTL and/or default support units.

That's were unit trinity comes into play, which solves some of the encountered issues (the unit itself is a work in progress). It provides the user with a way to solve things and let sources compile without too much hassle/workarounds.

The latest version of unit trinity is kindly provided by Magorium and can be found here.