Please login or register.

Login with username, password and session length
Advanced search  


Created for developers of all Amiga camps

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - magorium

Pages: [1] 2 3 ... 15
Free Pascal / Re: Unit testing
« on: August 14, 2017, 08:44:30 PM »
As seem to happen more often to me than i would like these days: thank you for the corrections ALB42 !

Free Pascal / Re: Unit testing
« on: August 14, 2017, 08:06:22 PM »
btw: before i forget.

We do have a dedicated wiki page for 3th party units/projects/components/classes that are compatible with our platforms (usually written in Pascal itself without any platform dependencies) which can be found here.

It's just that it is something that we never seem to get around to adding to that page. We either copy-paste what we need from other projects or write our own code. I have a long todo list, which either requires minor changes to the existing component/project, await further features of FPC itself or some things are rather difficult to implement on Amiga platform. Sometimes i get lost in my todo list  :-\

Free Pascal / Re: Unit testing
« on: August 14, 2017, 07:40:21 PM »
Well, you could of course take your queue from Graeme's link and either tear out the usage of epiktimer or implement a dummy.

More on that link to Graeme's unit test project that you provided can be found here (in case you did not know already).

Free Pascal / Re: Unit testing
« on: August 14, 2017, 07:20:05 PM »
Tried to compile it but some EpikTimer, which is a dependency, requires 'baseunix'.
EpikTimer is a so called 3th party component and although some of those components compiles and work out of the box when compiling for Amiga/Aros/Morphos, a lot of them don't because of their platform dependency.

That doesn't seem to be available on the Amiga distribution.
Unfortunately one of the flaws that nowadays programmers seem to have is to follow this kind of flow in their code:
Code: [Select]
// do window stuff]
// do linux stuff
Or vice verse.

Either way our beloved platform (and any other platform that FPC/Lazarus supports) is 'f*cked' by this kind of programming style.

For example, if you would to compile this for windows it depends on queryperformancecounter native Windows api.

The fact that you are confronted with missing unit baseunix is not something that is missing for our Amiga platforms (unless perhaps when targeting bsd) but is caused by sloppy programming.

There should not be a unit baseunix for Amiga, et all.

Any ideas?
I've given it some though, but seem unable to locate functionality on amiga API that could mimic epiktimer. At least not with such high precision.

fwiw: epiktimer is a high resolution stopwatch component. e.g. measured time between start and stop moment is very precise. afaik it originates from Delphi, and Delphi was a product targeting windows only.

afaik ALB42 and Chain-Q are trying (or already succeeded to a certain extend) to get the standard fpc test-suite working. I don't believe we have a working unit test already/

Free Pascal / Re: Documentation for amiga based units.
« on: August 11, 2017, 12:27:35 AM »
Aaargh !  :-[

I keep forgetting about those links. Thank you very much for mentioning those links ALB42 !

fwiw: the wiki-page with Aros (and Amiga) related specifics (here), was updated to (hopefully) reflect current FPC trunk status.

AmigaOS 3.x Dev / Re: Opening a console window
« on: August 10, 2017, 08:30:24 PM »
Splendid ! Glad that you got that sorted out :)

AmigaOS 3.x Dev / Re: Opening a console window
« on: August 09, 2017, 12:20:47 AM »
As could be noted from ALB42's post: a con: window <> a full shell command interpreter.

I'm also a bit puzzled about what it is you actually wish to accomplish but ALB42's smiley on his shell example seems to suggest that he at least has some sort of clue ?

if ALB42's example does not really accomplish what it is that you wish to do, then could you please try to describe what you would like to accomplish ?

Free Pascal / Re: Documentation for amiga based units.
« on: August 08, 2017, 07:19:59 PM »
The BPTR, the result of the Open() call, do I just take a longint in Pascal?
Use a BPTR.

It is a type that is declared in either Exec or AmigaDOS (sorry i do not even know that from memory :shame:).

Edit: BPTR type is declared inside unit exec.

In case you wish to have a quick overview have a look at the online units here.

For instance the exec unit can be viewed here.

The followng is a small excerpt from that unit, declaring the basic native API types
Code: [Select]
98        STRPTR   = PChar;
99        ULONG    = Longword;
100        LONG     = longint;
101        APTR     = Pointer;
102        BPTR     = Longint;
103        BSTR     = Longint;
104        BOOL     = smallint;
105        UWORD    = Word;
106        WORDBITS = Word;
107        LONGBITS = longword;
109        UBYTE    = Byte;
110        PULONG   = ^longword;
111        PAPTR    = ^APTR;
112        PLONG    = ^LONG;

Note the P in front of a pointer to a specific type (which differs from c code which uses a circumflex).

Free Pascal / Re: Documentation for amiga based units.
« on: August 08, 2017, 07:05:51 PM »
For some reason we seem active both at the same time  :D

Ok, in basics you can follow rkrm for 3.x. The only difference is that for a pointer to a structure Pascal uses by default P<name of structure> and for structures itself T<name of structure>. It is just a convention used in Pascal language.

But, Free Pascal itself also has its own RTL. Sometimes the names used in the Free Pascal RTL collides with those from native Amiga API.

For example Open() and Close() functions are also present inside Free Pascal RTL. Therefor it is a bit difficult to distinguish between those function from RTL and Native platform API.

To make that a bit easier for the end-user we've decided to rename some of the native API calls. A collection of those changes can be found on this wikipage.

Please also note that some of the units names (what c programmers name include files) are changed as Free Pascal RTL has it's own DOS and Graphics untis. e.g. resp. AmigaDOS and AGraphics for Amiga.

In addition to that: whenever c includes a specific includefile, for example, exec/interrupts.h, it is enough for Free Pascal to add the exec unit to your uses clause. This contains all header information that c has split-up in separated header files.

AmigaOS 3.x Dev / Re: Screen mode list
« on: August 08, 2017, 06:27:17 PM »
Was that Screen requester added later?
Yups, you noted that correctly.

This is old AllocAslRequest(), and this is new AllocAslRequest().

Note the differences in supported requester types for the first parameter.

Free Pascal / Re: Compile speed and binary size on AmigaOS 3
« on: August 08, 2017, 05:52:27 PM »
Can I cross-compile with FreePascal for a different target?
Yes, see also steps mentioned above. e.g. not by default.
I have to correct myself there a little.

FP-IDE editor is able to target platforms that uses the same processor that your host uses. It is restricted to that as FP-IDE uses its own internal compiler.

Free Pascal / Re: Compile speed and binary size on AmigaOS 3
« on: August 08, 2017, 05:06:19 PM »
Thank you very much Chain-Q !

a) would at least take away the burden for TS to build his own binutils
b) answered my question if vlink/vasm is compilable on/for mac (as i hadn't checked for that yet).

In addition to that, it is just as easy to add support for targeting other platforms with that (same) Free Pascal compiler.

The main hurdle there is (again) the binutils. The rest is more or less about configuring things correctly, providing the correct parameters or placing executables/compiled units inside the correct locations.

Aros, for instance, require some additional steps in order to produce gnu binutils.
- download gnu sources for the (AROS supported version of the) binutils
- patch those sources with the patches that can be found inside AROS source-tree
- build binutils
- build collect AROS
- Install/copy produced executables to your binutils directory

And you should be able to target AROS as well (with gnu binutils), using the same compiler.

Alternatively the 64-bit MacOS binutils to be able to target Aros can also be downloaded from here

Something similar can be done for cross-compiling to MorphOS, AmigaOS4 or whatever target you wish to cross-compile for.

As a fun fact: did you know that cross-compiling that way also offers the possibilty to use Lazarus IDE to edit and (cross-)compile your sources ? The only requirement for that is installing Lazarus on your Mac and point Lazarus configuration to use your (own) compiled Free Pascal compiler.

Note that compiling the Free Pascal sources from trunk offers you the most advanced version for our AROS, MorphOS and Amiga targets (native API calls). Version 3.0.2 (and upcoming 3.0.4) of Free Pascal release versions lacks a bit behind as we were/are still improving things.

Please keep that in mind as some (source) incompatibilities could arise (when using a newer compiler) from using such 'older' compiler (with regards to native 'Amiga' api calls). In case you run into difficulties with that then please do not hesitate to inform us about that so we are able to address that (either by providing a solution or that we can document that properly).


Free Pascal / Re: Syntax highlighting for Cubic IDE?
« on: August 07, 2017, 04:52:14 PM »
Small advise: just use/choose whatever you are most comfortable with. Not what someone else advises (although i did advise annotate in case you perhaps weren't familiar with this editor at all).

For me personally, i spend a lot of time inside the editor, and it should works as i expect it to work. e.g. not the editor telling me what i should do and/or how to do it.

Downside of that is that i also waste a fair amount of time trying other editors and learning all the inns and outs, pro's and con's. There simply aren't many (very) good editors around, and even less so for Amiga platform.

If you prefer vim then use that, if you prefer cubic, then use that. Just try to bend the editor rules your way  ;)

i had a quik glance at cubic, and i am a bit baffled by the configuration. e.g. as far as i was able to see there was not much english documentation available on the used configuration files (but perhaps everything is configured using the gui). For example, i have no idea where the syntax parser for a particular programming language is originating from...

Free Pascal / Re: Compile speed and binary size on AmigaOS 3
« on: August 07, 2017, 04:25:57 PM »
So, how is the cross-compiling being done, say, when I'm on Mac.
To put it into very simple words (practice can sometimes be a bit tougher, especially since i have no hands on experience with mac):
- Download and install latest point release of Free Pascal for your Mac (native compiler)
- install (cross)-binutils
- download latest Free Pascal sources from trunk (or if you prefer download sources of latest stable point release of Free Pascal).
- compile the sources for your host (macOs). can be skipped if you want to use point release as you already installed that.
- cross compile the downloaded sources for preferred target(s) and add units/cross compiler to either your existing Free Pascal installation or the newly compiled FPC compiler that you compiled from trunk.
- Configure your installed Free Pascal correctly
- Open up an editor and write simple helloworld program.
- compile and/or cross-compile the helloworld example using preferred options for your target.
- copy compiled executable(s) over to your target(s).

Can I cross-compile with FreePascal for a different target?
Yes, see also steps mentioned above. e.g. not by default.

There are some wiki pages on that as well, see here

It might perhaps sound complicated but once you've done it once, it actually isn't. The most difficult part is to get the binutils into place (because usually they do not exist in a already compiled form).

In case you wish more detailed information for each step (or certain steps) then please feel free to ask. For me helping you it would be a bit trail and error, but perhaps ALB or Chain are able to chime in and offer some advise.

Free Pascal / Re: Compile speed and binary size on AmigaOS 3
« on: August 07, 2017, 04:12:07 PM »
I would assume that how much memory is used for doing the job faster is determined on how much memory is available. If less is available more disk operations have to be done.
Yes, one would think that as it is most logical of choices...

... unfortunately practice for gnu linker (with default settings, i have no idea if gnu linker can be tamed that way) means that it takes everything that is available and simply crashes when running out of memory. Might be an platform specific issue though, but at least AROS and Amiga show this behavior.

Admittingly, i have not tried the same test with vlinker on native.

PS: i probably should rephrase myself and not put all the blame on gnu linker: the build process crashes/halts.

Pages: [1] 2 3 ... 15