free pascal for MorphOS
  • Order of the Butterfly
    Order of the Butterfly
    Chain-Q
    Posts: 347 from 2003/10/12
    From: 1 AU, EU, DE/HU
    Quote:

    Lazarus on win32 version seems use a win32 implementation of the GUI, so why not a MUI implementation of the GUI ?

    Want to volunteer? ;-) I'm not really a man of GUI programming and especially not the man of RAD tools...
    [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
    [.Free Pascal Compiler MorphOS Port.]
    [.Hosting AmigaSpirit.hu.]
  • »17.07.04 - 14:28
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Chain-Q
    Posts: 347 from 2003/10/12
    From: 1 AU, EU, DE/HU
    Quote:

    PowerPC code-generator is broken now in the CVS.

    Hopefully, it's fixed now. :-) I'm not at my Pegasos, so i can't test it now, but maybe tomorrow.
    [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
    [.Free Pascal Compiler MorphOS Port.]
    [.Hosting AmigaSpirit.hu.]
  • »17.07.04 - 15:25
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    Posts: 979 from 2003/6/28
    @Chain-Q

    AS and LD will not be longer needed in some future and fpc will make all the job for generating MorphOS binaries?
  • »17.07.04 - 16:10
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Chain-Q
    Posts: 347 from 2003/10/12
    From: 1 AU, EU, DE/HU
    Quote:

    AS and LD will not be longer needed in some future and fpc will make all the job for generating MorphOS binaries?

    To replace AS, one needs to implement an object binary writer into the compiler. Such a thing only exists for some of the i386 targets now, all other CPU targets, including PPC, currently using various external assemblers.

    There is currently no way to replace LD, because there is only some very basic work done to have an FPC linker (and this is true for all targets).

    To replace AS and LD is quite a low-priority target, because assembling and linking is transparent to the user, and except for probably some slight speed advantages, there is no difference between using an internal or external assembler/linker. Do you have any problems with GNU AS/LD, or why do you want to avoid them?

    If you dislike GNU tools, it's pretty easy to implement support for other external assemblers/linkers, however, currently i see no need for that.
    [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
    [.Free Pascal Compiler MorphOS Port.]
    [.Hosting AmigaSpirit.hu.]
  • »17.07.04 - 22:29
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    TheMagicM
    Posts: 1217 from 2003/6/17
    I asked a UAE question in the free pascal forum but no reply...
    I want this to WORK and am disappointed that it does not.


    I tried compiling for example 'stars.pas' but it cannot find unit WORKBENCH..
    its there because I can find it in 'amigaunits' ... none of the demo's compile btw. At first it was because of the path..so I manually added it..but still no go.


    Do you have a working version for the Amiga that actually compiles demo code etc?
  • »25.07.04 - 18:11
    Profile Visit Website
  • Just looking around
    maya
    Posts: 7 from 2004/6/9
    Quote:


    TheMagicM wrote:

    I tried compiling for example 'stars.pas' but it cannot find unit WORKBENCH..
    its there because I can find it in 'amigaunits' ... none of the demo's compile btw. At first it was because of the path..so I manually added it..but still no go.


    Do you have a working version for the Amiga that actually compiles demo code etc?


    Are the paths to the various "include"-files set correctly in the fpc.cfg file? My guess is that there is something missing there. If required I may send you my .cfg-file. It works quite well for me.

    And btw: One should not only use the archive of fpc for amiga as there seems some important stuff like classes.pas missing...

    Regards, maya
  • »26.07.04 - 08:13
    Profile
  • Just looking around
    maya
    Posts: 7 from 2004/6/9
    Quote:


    TheMagicM wrote:
    thats just it.. I dont want to use MUI.



    You don't have to. You may use good old intuition/graphics.library or any other gui you want. All you have to do (if no one else did it) is to write the library-call-functions and off you go.
  • »26.07.04 - 08:15
    Profile
  • Just looking around
    maya
    Posts: 7 from 2004/6/9
    Quote:


    Quote:

    does FP have code to let you build pulldown menu's, windows etc ?

    Free Pascal Compiler is a command line (CLI) compiler. However, it does have a branch-project called Lazarus, which is GUI-builder & RAD tool for FPC. But it is heavily based on GTK, so until someone ports GTK to MOS it's not very useful to us. Lazarus is available here. Volunteers are welcomed to have a MOS port. :-)


    I think he ment building a gui WITH fp not for :)

    Quote:

    I've started using fpc on uae for doing some mui-stuff (to be able to switch to mos soon). There were some bugs in the domethod etc. stuff. To whom should I send fixes for that?

    You can send them to me, and i'll integrate it if necessary. However there will not be any new 1.0.x/68k release, 1.9.x branch does not support 68k (yet) and PPC/MOS/1.9.x does not yet have a MUI and other GUI unit(s).


    So the old ones can't be used anymore? Why not? Because of the different calls to libraries? What about the other amiga-specific stuff like hooks. Will they work in an MOS-version of fp?

    BTW: Did anyone build a custom class in fp for mui?
  • »26.07.04 - 08:20
    Profile
    • Order of the Butterfly
      Order of the Butterfly
      Chain-Q
      Posts: 347 from 2003/10/12
      From: 1 AU, EU, DE/HU
      Quote:

      I think he ment building a gui WITH fp not for :)

      Yes, but that's not possible now. So if he want a GUI builder for FPC, he has to port it first. :-)

      Quote:

      So the old ones can't be used anymore? Why not? Because of the different calls to libraries?

      Exactly. Current Amiga units contains heavy amount of 68k assembly. That's one problem. The second problem is, that some of the system structures also changed in MOS, so i decided to re-implement the units from scratch, instead of hunting for the changes through the MOS includes. But this is a slow and boring job, so i'll need to find a somewhat automatized way to do it soon. Since most of the Amiga units were build with fp2pragma, found on Aminet, i'll think i'm going to adapt fd2pragma to support building of an FPC/MOS unit too. (But fd2pragma is in C, and i hate to programm in C. :-) )

      Quote:

      What about the other amiga-specific stuff like hooks. Will they work in an MOS-version of fp?

      I think they'll definitely work, however, i did not tested it yet. If some special support still needed which does not yet exists in the compiler, it will be added, it's not too difficult. Please note that FPC/MOS compiler (not including the RTL) already has better support for the platform than the Amiga compiler ever had, just take a look on ABox syscall support. Such a thing never existed in the classic Amiga compiler. Also the PPC code generator is already much better than the 68k one was.

      Quote:

      BTW: Did anyone build a custom class in fp for mui?

      Don't know. I never did such a thing. As i said, i'm not really a man of GUI programming.
      [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
      [.Free Pascal Compiler MorphOS Port.]
      [.Hosting AmigaSpirit.hu.]
    • »26.07.04 - 10:35
      Profile Visit Website
    • Paladin of the Pegasos
      Paladin of the Pegasos
      TheMagicM
      Posts: 1217 from 2003/6/17
      Quote:

      Are the paths to the various "include"-files set correctly in the fpc.cfg file? My guess is that there is something missing there. If required I may send you my .cfg-file. It works quite well for me.

      And btw: One should not only use the archive of fpc for amiga as there seems some important stuff like classes.pas missing...



      sure, email it to bartonekdragracing at yahoo dot com


      also, I didnt mean if there was a app that builds the GUI for you.. I meant, does FP have commands to build pulldown menus, windows etc ? I'm sure it does by looking at the demo code but it wont compile.

      If you can help me get the Amiga version working that will be great. I want to see sample screens (your demos will probably do just fine) etc.

      last time I used intuition/graphics.library, the screens looked ugly.. Mui is alot better looking then that, yet I dont want to code in C for now as I'm better at pascal then c.

      -Alex

      [ Edited by TheMagicM on 2004/7/26 16:15 ]
    • »26.07.04 - 22:13
      Profile Visit Website
    • Order of the Butterfly
      Order of the Butterfly
      Chain-Q
      Posts: 347 from 2003/10/12
      From: 1 AU, EU, DE/HU
      Free Pascal for MorphOS first unofficial development snapshot is just released. You can get it from here. Don't expect anything big, now it's more likely only a toy for the curious ones than a real tool for real developments, but this will change soon...
      [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
      [.Free Pascal Compiler MorphOS Port.]
      [.Hosting AmigaSpirit.hu.]
    • »03.08.04 - 22:47
      Profile Visit Website
    • Leo
    • Order of the Butterfly
      Order of the Butterfly
      Leo
      Posts: 417 from 2003/8/18
      Quote:


      Free Pascal for MorphOS first unofficial development snapshot is just released. You can get it from here. Don't expect anything big, now it's more likely only a toy for the curious ones than a real tool for real developments, but this will change soon...



      Ok, just downloaded it and I can't make it compile anything, even a simple hellworld.pas ;(

      With this one:

      ------- cut ---------
      program test;

      begin

      end.
      ------ /cut ----------

      I got a runtime error of fpc...

      And with this one:

      --------- cut ---------
      program test;

      begin

      WriteLn('Hello');

      end.
      ---------- /cut --------

      I got: Fatal: Illegal character "' '" ($A0)

      => I know you warned to not expect a lot of things from it... But I had expected something more ;)

      Leo.

      PS: I used "fpc [file.pas]" to compile... With this line, is the link automatically done ? if not, how to compile and link ?

      [ Edited by Leo on 2004/8/4 19:06 ]
      Nothing hurts a project more than developers not taking the time to let their community know what is going on.
    • »04.08.04 - 20:04
      Profile Visit Website
    • Order of the Butterfly
      Order of the Butterfly
      Chain-Q
      Posts: 347 from 2003/10/12
      From: 1 AU, EU, DE/HU
      Quote:

      Ok, just downloaded it and I can't make it compile anything, even a simple hellworld.pas ;(


      I can't reproduce the errors you reported. Can you send me the files you're trying to compile? Can you specify which runtime error you got exactly? At wich line you got the fatal error in the second example? The compiler works OK for me (the same one i archived and uploaded). Eg:

      program hello;
      begin
      writeln('hello world!');
      end.

      9.Ram Disk:> fpc hello
      Free Pascal Compiler version 1.9.5 [2004/08/03] for powerpc
      Copyright (c) 1993-2004 by Florian Klaempfl
      Target OS: MorphOS
      Compiling hello.pas
      Assembling hello
      Linking hello
      4 Lines compiled, 0.8 sec
      9.Ram Disk:> hello
      hello world!

      In fact, the uploaded compiler is capable to compile itself into a working executable on MorphOS, and that is over 170000 lines of Pascal source...

      Quote:

      I used "fpc [file.pas]" to compile... With this line, is the link automatically done ? if not, how to compile and link ?


      Assembling and linking should happen automatically after a successful compile. The compiler will call as to assemble what's needed and then ld to link the whole stuff together into an executable. It will even do the stripping with -Xs parameter on (which is the default in fpc.cfg).

      (Note: while writing this, i've discovered that i'd accidentally left out strip from the archive, so you can't strip debug info from executables unless you've MOS SDK installed, or you copied strip from the MOS SDK archive to FPC's bin/morphos directory. This will be fixed in the next release, but this problem shouldn't affect working of the compiler, only result bigger executables, and an "Error: Util strip not found, switching to external linking
      " message at linking time.)

      If you just can't get it working, you can try to use 'fpc -va [file.pas] > log.txt' command, and send the resulting log.txt to me.
      [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
      [.Free Pascal Compiler MorphOS Port.]
      [.Hosting AmigaSpirit.hu.]
    • »05.08.04 - 11:53
      Profile Visit Website
    • HAK
    • Order of the Butterfly
      Order of the Butterfly
      Posts: 221 from 2003/2/24
      From: Austria, Vienna
      Hi,


      Hm, I tried the upper "Hello World" programm after I installed fpc and it worked without problems here.

      Maybe you have used the wrong backtics "'"?


      <mutters>
      Now to find out whether my long lost Modula2 knowledge can help me.
      </mutters>


      Bye HAK
    • »05.08.04 - 13:06
      Profile
    • Leo
    • Order of the Butterfly
      Order of the Butterfly
      Leo
      Posts: 417 from 2003/8/18
      OK, now I cannot reproduce the RunTime error...

      But here is the error I got when trying to compile http://nogfx.free.fr/test.pas :

      --------------
      Free Pascal Compiler version 1.9.5 [2004/08/03] for powerpc
      Copyright (c) 1993-2004 by Florian Klaempfl
      Target OS: MorphOS
      Compiling test.pas
      test.pas(6,6) Fatal: illegal character "' '" ($A0)
      --------------

      Leo.
      Nothing hurts a project more than developers not taking the time to let their community know what is going on.
    • »05.08.04 - 13:36
      Profile Visit Website
    • Order of the Butterfly
      Order of the Butterfly
      Chain-Q
      Posts: 347 from 2003/10/12
      From: 1 AU, EU, DE/HU
      Quote:

      http://nogfx.free.fr/test.pas
      test.pas(6,6) Fatal: illegal character "' '" ($A0)

      The compiler works well, there's really an invalid character $A0 (dec:160) after the word "Begin" at line 6, character position 6. Just turn on whitespace display in your favourite editor, and see. It's probably a typo by you. Accidentally this character is also empty by default, and shows ups as a space.

      After the removal of that character, it's working:

      9.Ram Disk:> fpc test.pas
      Free Pascal Compiler version 1.9.5 [2004/08/03] for powerpc
      Copyright (c) 1993-2004 by Florian Klaempfl
      Target OS: MorphOS
      Compiling test.pas
      Assembling lesson1_program3
      Linking test
      14 Lines compiled, 1.0 sec

      9.Ram Disk:> test
      Input number 1:123
      Input number 2:
      234
      357
      [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
      [.Free Pascal Compiler MorphOS Port.]
      [.Hosting AmigaSpirit.hu.]
    • »05.08.04 - 14:10
      Profile Visit Website
    • Paladin of the Pegasos
      Paladin of the Pegasos
      TheMagicM
      Posts: 1217 from 2003/6/17
      I was getting the same thing and gave up... but now since you said that, I will definitely give it a shot...

      I take it CygnusED should reveal those white spaces.... oh man, I sure do hope this works.
    • »05.08.04 - 19:13
      Profile Visit Website
    • Leo
    • Order of the Butterfly
      Order of the Butterfly
      Leo
      Posts: 417 from 2003/8/18
      3rd try ;)

      I removed the illegal character from the source and accountered a new runtime error:

      -------------
      Free Pascal Compiler version 1.9.5 [2004/08/03] for powerpc
      Copyright (c) 1993-2004 by Florian Klaempfl
      Target OS: MorphOS
      Compiling test.pas
      Assembling lesson1_program3
      Linking test
      Compilation aborted test.pas:15
      Runtime error 204 at $21AC790C
      $21AC790C
      $21AC7C10
      $21AC6114
      $21AA7488
      $21AAF208
      $21AAF14C
      $21A843B4
      $2198F818
      $21A1DE44
      $21A8FF00

      Data:dev/FPC/bin/morphos/ppcppc failed returncode 204
      -----------------

      Leo.

      PS: Despite the runtime error, it seems the executable is created and works...

      [ Edited by Leo on 2004/8/5 21:25 ]
      Nothing hurts a project more than developers not taking the time to let their community know what is going on.
    • »05.08.04 - 21:35
      Profile Visit Website
    • HAK
    • Order of the Butterfly
      Order of the Butterfly
      Posts: 221 from 2003/2/24
      From: Austria, Vienna
      Hm,


      Nope, not here.

      Just corrected the source as told by Chain-Q and it compiled without error.



      Bye HAK
    • »05.08.04 - 23:52
      Profile
    • Order of the Butterfly
      Order of the Butterfly
      Chain-Q
      Posts: 347 from 2003/10/12
      From: 1 AU, EU, DE/HU
      @Leo:
      Runtime error 204: (quote from FPC manual)

      "204 Invalid pointer operation
      This you will get if you call Dispose or Freemem with an invalid pointer (notably, Nil)"

      Since the compiler works OK here, and at other people, my guess there is something wrong at you. Which version of ixemul.library do you have installed? Wrong version could cause memory corruption which can hurt the compiler, and result such error. Do you have MOS SDK installed? If not, did you install strip by hand? If yes, which version? (You need the one from MOS SDK!)
      [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
      [.Free Pascal Compiler MorphOS Port.]
      [.Hosting AmigaSpirit.hu.]
    • »06.08.04 - 14:43
      Profile Visit Website
    • Leo
    • Order of the Butterfly
      Order of the Butterfly
      Leo
      Posts: 417 from 2003/8/18
      Something wrong with me ?
      Nah... I just did a clean reboot.

      And: yes, I have SDK, and got ixemul which was shipped with MOS 1.4 so there's nothing wrong here. And I have strip which came from MOS SDK as well...

      Leo.
      Nothing hurts a project more than developers not taking the time to let their community know what is going on.
    • »06.08.04 - 19:20
      Profile Visit Website
    • Priest of the Order of the Butterfly
      Priest of the Order of the Butterfly
      Posts: 979 from 2003/6/28
      Chain-Q, what about this? ;-)
    • »15.08.04 - 12:02
      Profile
    • Leo
    • Order of the Butterfly
      Order of the Butterfly
      Leo
      Posts: 417 from 2003/8/18
      Btw, what libs can we access from FPascal today ?

      .DOS/Exec ?
      .Intuition/Graphics ?
      .CGX ?

      Leo.
      Nothing hurts a project more than developers not taking the time to let their community know what is going on.
    • »15.08.04 - 15:26
      Profile Visit Website
    • Order of the Butterfly
      Order of the Butterfly
      Chain-Q
      Posts: 347 from 2003/10/12
      From: 1 AU, EU, DE/HU
      Most MorphOS-releated units are incomplette yet, and untested. In the current CVS, there are units for exec, dos, utility libraries and for timer.device. I've a partially-done (around 50% completted) unit for graphics and intuition.library on my HDD. There will be units for CGFX and AHI too soon, since i need that for some of my own programs. MUI and other stuff will come later.

      Please also note that currently calls using taglists cannot be used, because they're not yet added to the units. This will also change very soon.

      (Anyway, i wrote down most of this already in readme.MorphOS, and on the FPC Wiki page, but i know users just never read the @#$(*@*#($&ing readmes... :-D )

      [ Edited by Chain-Q on 2004/8/16 10:45 ]
      [.PegasosII/G4.:.Efika.:.Amiga2000/060.]
      [.Free Pascal Compiler MorphOS Port.]
      [.Hosting AmigaSpirit.hu.]
    • »16.08.04 - 09:43
      Profile Visit Website
    • Just looking around
      hellbeard
      Posts: 15 from 2004/5/1
      Great work with FPC, Chain-Q. Now I hopefully won't have to use c++, hehe.
      Say, how about the CRT unit, when are you going port it?
    • »16.08.04 - 11:27
      Profile