Please login or register.

Login with username, password and session length
Advanced search  


Created for developers of all Amiga camps

Pages: [1] 2 3 ... 10
 on: March 24, 2018, 01:11:11 PM 
Started by Fastbit66 - Last post by Fastbit66
Hello dear Pascal Coders!

I would like to understand how calling and using a function from a library in AmigaOS 4.1 with fpc works.
I really would be grateful if someone can give me an example.

So far I found this on the fpcAmigaWiki:

Code: [Select]
Call Library

AmigaOS4 (powerpc)
AddTail you can find in include_h/interfaces/exec.h

struct ExecIFace
struct InterfaceData Data;

ULONG APICALL (*Obtain)(struct ExecIFace *Self);
// ...
        void APICALL (*AddTail)(struct ExecIFace *Self, struct List * list, struct Node * node);
From this entry we can read the return value (void) so its a procedure and the parameter, the first parameter is always the interface self, this will be added by the syscall automtically, so we can ignore it. Most tricky problem is the needed offset. You have to count the position in this structure. The first field Data (struct InterfaceData) has a size of 60 bytes. so the first function Entry (it is always Obtain) has the Offset 60. You have to count every function entry in the list. Every entry is a function Pointer and we are on a 32 Bit processor every Entry adds 4 bytes to the Offset. AddTail is the 8th function entry (starting from 1) which results in an Offset of 60 + 4 * (8-1) = 88 for AddTail. AmigaOS4 uses Interfaces instead of the LibBase to make the function jumps. Currently there is no direct support for Interfaces in freepascal. The syscalls can be used in the same way as on the other platforms, because the the function offsets are exactly the same relative to the interface as relative to the libbase for the other platforms. The only thing you should remember is that you need to open the 'main' interface of the library and supply this Pointer as the Base for Syscalls.

Now we bring all this together to our syscall function in pascal:

  procedure AddTail(list: PList; Node: PNode); syscall IExec 88;

So this is an example to use a function from the exec library whis is always open on AmigaOS
But - please correct me if wrong - as far as I know you have to open any other library you want to use with OpenLibrary call from exec library first.
How can I do this in fpc?

Let's say I want to use the dos library function delay()

Can someone show me how to declare the procedure an finally open the dos library and use this function?

I know the delay function is present under fpc for AmigaOS - this could be just a simple example to show how the process works.

Thnx a lot for your time and reading!

Best regards

 on: March 16, 2018, 01:55:36 PM 
Started by Fastbit66 - Last post by Fastbit66
Hello Pascal@Amiga Lovers ;)

Does anyone know if it is possible to use the serial device on AmigaOS4.1 PPC with fpc?

Thanx in advance!


 on: January 31, 2018, 05:52:03 PM 
Started by ALB42 - Last post by ALB42
I wrote a wrapper for MUI which encapsulates the MUI classes into Pascal Object, which have the fields as direct access and the Events in the usual way you expect them in an Pascal Object. This makes it much easier to use them.

for more informations about that see:

The Source with some examples is available at github:

 on: December 03, 2017, 12:47:01 PM 
Started by SamuraiCrow - Last post by SamuraiCrow

 on: August 13, 2017, 12:54:51 PM 
Started by asrael22 - Last post by asrael22

What options do I have to follow a test-driven approach?
Is there a unit-testing framework or unit for FreePascal with a fast turnaround?


 on: August 08, 2017, 10:26:09 PM 
Started by asrael22 - Last post by asrael22

I need to bother you guys a bit more. :)

Now, I have opened a screen and a window in it.
Then I open CON: into that window:
Code: [Select]
DOSOpen(Format('CON://///WINDOW0x%p', [Win]));
That seems to be working.

But there is no Shell in there. Just a cursor, and I can type. Well, that's already something...
How do I get a full Shell in there?


 on: August 08, 2017, 06:46:36 PM 
Started by asrael22 - Last post by asrael22

Where can I get API documentation of the Amiga based units?
I mean, I can look at the RKRM library docs but using that under FreePascal is different.
In particular, I was searching for how to open a console window using amigados Open() call on a new screen.
But couldn't really find this as an example in the distribution.
Where could I get more information on this kind of stuff?


 on: August 08, 2017, 09:49:22 AM 
Started by SamuraiCrow - Last post by SamuraiCrow
I'm trying to add support to this forum so that it can be viewed using the Tapatalk app and similar apps that use the same plugin such as Owl.  This has the potential to speed up access to systems with limited web browser support by using a custom app.

 on: August 07, 2017, 08:33:38 AM 
Started by asrael22 - Last post by asrael22

Which editor do you guys use?
Is there a syntax plugin for Cubic IDE?


 on: August 06, 2017, 08:47:24 PM 
Started by asrael22 - Last post by asrael22

Can someone guide me to some docs on how to present a screen mode requester?
I'd like the user to choose from the available screen modes and finally open a new screen.


Pages: [1] 2 3 ... 10