Archives for Applications

Playing with SDL

Posted by ALB42 on 5. Mรคrz 2017No Comments

I never worked with SDL before so I searched for a little tutorial for it and came across a YT video showing SDL game making with freepascal YouTube Link.

I tested the source and applied the special changes for AROS (basically to initialize the SDL and other link libs) and it works really a nice tiny game. I will look more to source to understand the SDL behind it. But first of course a little video

About this year โ€ฆ 2016

Posted by ALB42 on 31. Dezember 20162 Comments

Again a year passed so I will try to give a short summary about things going on in the Freepascal world for Amiga-style systems.

 

In Januar 2016 a big change in Freepascal was done to fix the Varargs version of the amiga library version. All “array of const” are replaced with the better “array of PtrUInt” which is much better to emulate the open end parameter list

 

The MorphOS LCL implementation took a big step in the begin of the year until got the usual suspects to work. All resulted in the first MorphOS FPC release including LCL units in March 2016.

 

A little funny new experience started also in March. I created the first 64Bit ABIv1 AROS distribution. Mainly, of course because I need a test field for the FreePascal AROS x64. For me x64 would be the perfect successor of the i386-aros ABIv1. My suggestion for AROS developer would be to leave i386 ABIv0 as it is, backport changes to there. And change then to x64 ABIv1 (and do not use/promote i386 ABIv1). But the x64 AROS still need much work, many things still crash, much code still cast Pointers to integer so not 64bit ready. This is also the main reason the 64bit distribution did not get much new version, not much changed with the problems there, I retest the usual problems from time to time. Also the FPC 64bit had big problems, which I found out end of 2016 are mainly alignment problems, where AROS made it’s own life much harder than it should be. (reminder “stacked int”s)

 

EdiSyn got a new Version with some bugfixes and basic printing support. End of year it got also a ARM version of EdiSyn to public with some more advanced features.
I also tried EdiSyn on MorphOS and Amiga. But both have some problems because of the different behavior of MUI and Zune. And I did not took much work on it because on MorphOS there is already a very good Editor with syntax highlighting and on Amiga m68k it’s just too slow. But in principle it works just LCL need some more work.

 

LCL on a native Amiga got some improvements to work also if no Graphic card is present, like my A1200 and also ported the usual suspects to m68k Amiga.

 

I used already a Lazarus on Linux to cross compile to AROS i386, in April I created a Lazarus which can cross compile for all supported Platforms (AmigaOS 3, AROS, MorphOS). Because it worked to nicely I planed to release a Lazarus for Linux including the binutils and cross compilers for all Amiga systems. But I noticed it is very difficult, even to write a Manual how to install such a systems. Therefore I decided to create a virtual machine which includes Lazarus, cross compilers and binutils for all Amiga Systems. After Amiga OS 4 was added to Freepascal and LCL I released a 2nd Version including the Amiga OS 4 binutils and cross compiler.

 

ChainQ implemented FreePascal for OS4 long time before already but because of changes in FreePascal and without a maintainer it did not compile anymore. In April ChainQ resurrected it and fixed some basic things, make it self compiling again. Then I took the lead and implemented some OS4units bring FP-IDE to work and finally the LCL with the usual suspects for OS4. Which resulted to a Amiga OS 4 FPC release including LCL. I will continue to maintain the OS4 fpc but will not improve it much more, maybe someone will appear to continue it especially with the unusual interfaces can be found on AmigaOS4.

 

I continued to work on applications using my LCL. This time I got the idea to create a Map application showing routes of my bike GPS. I played around with google maps API and openstreet API. Openstreetmap is much better because google maps you are forced to use the google libs which is difficult at AROS. It get some releases for all available platforms. I also experimented with GPS support, first via a extra program later also directly inside Mapparium, which is still not released.

 

Long Time before I got the direct linking of C static objects to freepascal programs at AROS to work, which was really nice, but no real program resulted from it. On magoriums work on mikmod, I got an idea for a Delitracker like program for AROS, to Play my old modules. I results into my first native Zune program (so without LCL wrapper) ZuPaPlayer. And because Delitracker is working directly on MorphOS and Amiga I concentrated on AROS.

There I also noticed its rather difficult to write MUI applications in Freepascal. In C there are many many macros to make it easier, but they are not directly possible to convert to pascal. There is a muihelper unit in MorphOS with some starts to make it easier. I moved it to ami-extra to make it available to all platforms and extended it a lot. To test and prove the usability of it I started to port the example codes of the official MUI 3.8 release. On Amiga it works very nice on AROS it shows very good the differences of MUI and Zune.

 

Because ChainQ included support for 68000 processor which need some more alignment care. Because of this I created a little RTL for Workbench 1.3 which is really difficult because much things are not available.

 

This year also the port of FPC to ARM AROS including LCL and the usual suspects was done.

 

I try to bring the MUI-LCL to the official repository, started with the basic LCL implementation. Announced at mailing list. We will see how it goes.

EdiSyn for ARM-AROS

Posted by ALB42 on 25. November 2016No Comments

After the compilation problems are solved, it is also possible to compile and use EdiSyn (finally a good editor in ARM-AROS :-P).
 
So here it is, same case as for Mapparium, it’s a special version for ARM-AROS (0.55). This new Version has already some advanced features like reload last open files (also remember the line the cursor is placed)

 

Download at EdiSyn Page

EdiSyn 0.55 ARM-AROS

EdiSyn 0.55 ARM-AROS

Mapparium 0.7 ARM-AROS special Release

Posted by ALB42 on 23. November 2016No Comments

I found the reason Mapparium, Edisyn and some other application crashed. All things have to be compiled with “-CaEABIHF” to make sure all sources use the same way to transfer floating point values. The -dFPC_ARMHF is only needed by the compiler, the ABI has to set for every other compilation, so I added them also to the fpc.cfg, fp.cfg.
 
I created Mapparium Release, with the latest not official Release 0.7 which already has some basic GPS Support (position only) and the Zoom and Find me Buttons are moved into a small menu inside the map (like google maps and open streetmap webpage also have). The menu can be hidden if this disturbs someone ๐Ÿ˜‰
 
Releases for all the other Platforms will need more time.
 
Download at the Mapparium Page
 

Mapparium 0.7 on RasPi AROS

Mapparium 0.7 on RasPi AROS

ARM LCL Problems

Posted by ALB42 on 23. November 2016No Comments

In principle the ARM AROS freepascal works very nicely, but some of the LCL programs does crash, especially EdiSyn and Mapparium have this problem. I try to debug it, its strange that it only appears on ARM (i386, PowerPC, m68k no problem at this point). It seems that it is a classical use after free, but the source seems to be right. I need to check if this also happen on the other platforms and only work by random. Or ARM has special properties which bring this error. With some tricks I come around this problem and got EdiSyn and Mapparium to work. Both work well on RasPi AROS but still crash on exit so I guess there are more problems inside.

EdiSyn and Mapparium on ARM-AROS

EdiSyn and Mapparium on ARM-AROS

ZuPa, ZuPa, ZuPaPlayaaaahhh

Posted by ALB42 on 17. November 2016No Comments

Tried a little bit more the ZuPaPlayer on ARM, seems the Zune on ARM is not on the same status as i386. A List event fired on i386, seems never fire on ARM, which makes it impossible to move songs in the list. Because I compiled the libmikmod myself, I increased the buffer for the AHI mikmod module (on i386 AROS I had some stutter problems). It works but now the pause button needs nearly 500 ms before it really stops. Not so nice, so I edited the AHI driver again a little bit and calculate the Buffersize dynamically from the frequency to cover 120 ms (got the idea from the Windows driver). Works rather nicely. So I made a release for ARM-AROS of ZuPaPlayer 0.2
 
Download: ZuPaPlayer 0.2 for arm-aros
 
zupaplayer-02-arm

Lalalarm

Posted by ALB42 on 16. November 2016No Comments

I tried some linking to AROS C Linklibs on ARM-AROS and the basic example with sqlite3 works rather nicely. But more interesting for me would be the mikmod lib because then I could compile ZuPaPlayer for my RasPi.
The main problem is the Libmikmod is not available for arm as binary. But I found the source a while ago. I tried to compile directly on the ARM-AROS and it works. And I was also amazed that also my ZuPaPlayer compiles without much changes… and you would not believe ZuPaPlayer even plays the sounds without any problems ๐Ÿ™‚

ZuPaPlayer on arm-AROS

ZuPaPlayer on arm-AROS

Very nice, my Raspi has a touchscreen, so now I can use my Raspi as nice little Mod Player ๐Ÿ˜‰

Playing on ARM

Posted by ALB42 on 14. November 2016No Comments

Compiled some programs for ARM AROS, most work, but some also do not work, with a rather strange error message. First I will add my new startup code to official repository, then I will try to debug this problem.

 

Games on ARM AROS

Games on ARM AROS

 

Download for arm-aros:
FPCMines – A Mines clone
ColorIt – Fill field with one color
APict – Simple Image Viewer

Bincompat

Posted by ALB42 on 13. November 2016One Comment

Working on the startupcode, added option to alloc a new Stack if the freepascal needed stack is bigger than the stack supplied by AROS. (which is mostly the case, AROS delivers 40k stack, FPC wants 256k). It works, even not completely finished. It’s my first bigger project with arm assembler better let someone check with more arm assembler knowledge ๐Ÿ˜‰
 
I tried also LCL on arm, but it did not work, the Handlemessage inside MUI/Zune makes the problem. When I checked on the Structures involved. I noticed that on AROS there are two different structures, one for BINCOMPAT mode one without this define. Until now the BINCOMPAT was only needed for m68k, but there is no special m68k-aros but only m68k-amiga and the x64-aros does not work well because AROS on x64 is near to not usable.
The define AROS_FLAVOUR_BINCOMPAT is now defined as default for arm-aros and it seems to work. Compiled the FPCMines as first try and it is working well.

FPCMines on ARM AROS

FPCMines on ARM AROS