Archives for Freepascal

AROS 64bit Distribution

Posted by ALB42 on 5. März 2016One Comment

I played around with AROS64 and freepascal for x86_64-aros. the compiler self works nicely, only sometimes some crashes because it does not make it’s own stack like the other amiga/aros implementations. I should really implement that soon.

 

For that I got the AROS source and compiled my own AROS 64 bootable CD and setup a qemu with it. There is no official AROS 64bit distribution now. I remember some announced one long time before but nothing happend. So now I will release my little work, together with a working freepascal compiler and named it „The 100% useless AROS distribution“ or short T100pUAD.

The Distribution gets its own page: T100pUAD Page

 

It includes some ore themes and freepascal, later I will try to improve it more and update it to the latest changes, maybe the 64bit get a little boost, it really needs it.

 

The freepascal IDE I did not get to work, always crash at the same place, but it’s deep inside of AROS and maybe some memory corruption before. So rather hard to find a reason.

Spying on MUI

Posted by ALB42 on 20. Februar 20166 Comments

I wrote a program to Inspect MUI properties. Very helpful to read out positions and recheck the size calculations of LCL. The main problem at the start was how to tell the program which object I want to inspect. The idea was to type the address from debugout. But then I noticed that the Userdata of the intuition Window structure points to the MUI Window.mui object. Thats means I can simply browse through all the windows on the screen and search for windows with a Userdata and try to find if it is a MUI object. Check if the Class of the object is „window.mui“. I tested also with other UserData contents, „mostly“ it does not crash.
 
But this only works on AROS, I tried the same on MorphOS but there the UserData is always nil. Seems they use an other method to link them together, its a pity.

The program for i386-AROS is named MUIInspector and can be downloaded here:
 
MUIInspector 1.0 for AROS
 
MUIInspector
 
Sadly many important fields of the MUI object are not readable so not all important things can be read back to the list.
 
Be warned, when the program which is inspected is quickly changing, means destroy/create objects, maybe the MUIInspector is crashing. So its really only a debugging tool for me, but maybe other find it interresting as well

Applications for MorphOS

Posted by ALB42 on 3. Februar 20164 Comments

With this new fixed LCL for MorphOS I recompiled some of my AROS LCL Programs for MorphOS. THis time I striped them and packed the program with lzmaloader to make the executable smaller. So here they are:

 

  • ColorIt – Game – Flood the field with the same Color
  • FPCMines – Game – Minesweeper clone
  • BinShifter – Game – 2048 clone
  • PasteQuick – Application – Copy Clipboard contents to Pastebin.com and receive the link in Clipboard

Some MorphOS applications

Faster Morphing

Posted by ALB42 on 3. Februar 20162 Comments

I tried to find the origin of the slowness for buffered drawing at MorphOS and it seems I found a clue. I allocated my Bitmaps always without BMF_DISPLAYABLE and this seems to be the Origin of the stuttering mouse and speed problems, now I changed all AllocBitmaps to use this flag and all it fast, especially the Bootup is now fast as I would expect. Seems my Drawing routine needs a little bit more work and thinking. At least its fast now and the color problems are also gone.

EdiMorphSyn

Posted by ALB42 on 2. Februar 20163 Comments

EdiSyn on MorphOS, at least it does not crash anymore, but it need long time to start and the SynEdit does not show anything, Menu also does not work, hmm strange.
EdiSyn @ MorphOS

Some more strange things appear, the Edits does not show the contents if the edit cursor is active in it, when one leave the Edit, the test is visible, also the TextEditor and Scrollbars have some strange colors. But it become even more strange: When I start the m68k-amiga version on MorphOS it looks ok to me (also in WinUAE or on a Native Amiga 1200)

Buffered MorphOS Drawing

Posted by ALB42 on 31. Januar 20162 Comments

I noticed something strange in MorphOS LCL, I made a little Painting program in LCL. When the mouse moves over the image and the window is not active it works as expected (coordinate and pixel color) but when clicked into the Painting area or the window is active it becomes very slow and the mouse pointer stops.
I made some tests and noticed the difference is that the main painting region gets repainted and there it becomes slow, but its not the drawing routine self.
 

MorphOS SimplePaint

MorphOS SimplePaint


 

The drawing works at the moment in this (buffered) way:

  • MUIM_Draw – Event appears
  • MUI_AddClipping – set a Clipping
  • Create a new Buffer RastPort
  • Create a Bitmap (AllocBitmap) for the Buffer Rastport, with width and height of the drawing area, Depth from the MUI rastport (from Renderinfo), BMF_MINPLANES or BMF_CLEAR and the bitmap of the MUI rastports Bitmap as Friend Bitmap
  • ClipBlit of the MUI Rastport to the Buffer Rastport
  • Drawing of the LCL things to the Buffer Rastport
  • ClipBlit of the Buffer Rastport to the MUI RastPort
  • Destroy Buffer Rastport and Bitmap
  • Remove Clipping
  • Leave Draw Event

If I remove the Buffering, so draw directly onto the MUI RastPort it stays fast and the mouse pointer makes no problems. When the program starts this stuttering mouse pointer is maybe related to it also? I noticed also other programs have this stuttering mouse on start (OWB for example). I still have no idea why.

VarArgs Changes

Posted by ALB42 on 24. Januar 2016One Comment

This weekend I did some bigger changes in the AROSUnits for better use of variadic functions in the SDK. The „array of const“ is replaced by „array of PtrUInt“ for all variadic wrappers. Because of this changes all this wrappers can be defined as inline and the arrays does not need to be copied inside the wrapper so it should be a little bit faster (even the effect is not that big I guess).
Also all dependencies to objfpc is removed so if someone want to write a freepascal program without objfpc dependency it should be possible now.
All this changes were discussed here.
But this all means that sources using such variadic functions must be changed, I changed already the fpGUI, LCL and example sources.

About this year … 2015

Posted by ALB42 on 31. Dezember 2015One Comment

This year freepascal got a big advance on many levels, in general with the freepascal 3.0 and for the Amiga-style systems also. Even more advances on the LCL/Lazarus topic on Amiga, AROS and MorphOS.

 

It began in 2014 already, when I restarted the MUI LCL implementation for AROS. Begin of 2015 I cared more about some applications to test the implementation especially the owner drawn things. So I wrote ColorIt and FPCMines for AROS and tried to write or port some little apps and some more.

 

A milestone reached in march 2015 when I got the SynEdit component to work. The little test program I used to play around with the needed changes in LCL grew on requests from the AROS community to a full usable Editor, which got the name Edisyn. By improving the editor many additional features are included into LCL, like key events, advanced mouse events, tabs, scrollbars, colors and much more.

 

With all this improvements I felt ready to give the lazarus ide another try and finally at least it starts. So we are on a good way to bring lazarus natively to work on AROS.

 

But how about the other platforms (AmigaOS and MorphOS)? I did already some changes in the code with the other platforms in mind. When the resource support was enabled in freepascal I took the opportunity to try to port the LCL for MorphOS and m68k AmigaOS. Which somewhat worked but not in the same way as in AROS especially the layout did not work and the program always crashed on the end. But it gave me much insight how MUI is working also for AROS Zune which is a little bit more error tolerant than the original MUI.

 

Also on the freepascal front some new things appeared, the support for x86_64 AROS was included, but sadly because of the ABI difference the port is still not finish and unusable. I’m waiting for the ABI switching feature in freepascal. The implementation is done just I need the decision to do it in the proposed way.

 

In October I did something unusual for me, I did C coding for AROS, trying to code a dynamic Amiga-style Library (in this case sql) to use it in freepascal AROS. But later I found out this wrapper library is not needed and I can directly use the C linklibs as they are.

 

At the end of the year I took more work again on the MorphOS and m68k Amiga LCL and finally got it to work. So the first LCL programs can be compiled for MorphOS and m68k Amiga.

 

What 2016 will bring

I hope I can join the two LCL implementations (AROS on the one side and MorphOS and Amiga on the other) together again. Bring the MorphOS port to the same level as AROS, that maybe Edisyn will work. The next logical step would be to continue on lazarus ide and try to make it somewhat usable.

Merry Christmas

Posted by ALB42 on 24. Dezember 20155 Comments

to everyone who read this 😉 I hope you have a nice christmas meal and some quiet time with the family, I will certainly have.

As Greeting to everyone I wrote a little program, nothing special, just a christmas tree and some falling snowflakes (needed 10 minutes to write in lazarus, I watched the clock).

 

merrychristmas

 

You can download this little program for:
Amiga, AROS, MorphOS and if someone is interested the Source

Bring it together

Posted by ALB42 on 23. Dezember 2015No Comments

Since MorphOS works rather nicely I tried to compare with Amiga 68k some more things have to be changes, especially drawing is much more difficult. AmigaOS3.x does not have the concept of RPTAG_FGColor to set directly the forground color with 24 bit values instead you have to use ObtainBestPen and so on. And there it is difficult to find out how long this Pen should stay before it can be released again. A little bit helping here is the Pen and Brush concept but for Background color and Text color its not really helping. But finally its working. But the picture looks very strange. After some testing I noticed that the GfxMove command make something strange, Even I call it with GfxMove(RastPort, 120, 130); the point is somehere in the negative region for X and Y. But Draw(RastPort, 120,130) for example work. Ok MY GfxMove call looks not like this but more like
GfxMove(RastPort, GetOffset.X + X, GetOffset.Y + Y); (Getoffset is a function which returns a TPoint) It seems that the m68k compiler have a problem with this construct because if I calculate an NX := GetOffset.X + X; and NY := GetOffset.Y + Y and then Call GfxMove(RastPort, Nx, Ny); it work. really strange. Besides it seems sometime it does not update the background and you get something like a ghost pattern hmm still much things to investigate. But for now I’m very happy that it already somehow work.

 

LCLTests on Amiga, MorphOS, AROS, Linux, Windows

LCLTests on Amiga, MorphOS, AROS, Linux, Windows

 

I compiled the two test programs Button (Source) and PaintBox (Source) on every platform I have available.

There we have:
Upper line, Left Linux, Right Windows (via Wine)
Lower line from left, AmigaOS3.9 (WinUAE), MorphOS (via VNC), AROS (Linux hosted)

All programs compiled from the same source without a single ifdef, as you can check at github. Amazing isn’t it :-D.