Archives for Coding

Unify ASL

Posted by ALB42 on 21. August 2017No Comments

I checked the ASL.library units of MorphOS and Amiga 68k against the official C includes of the SDKs. Especially the TFileRequester structure was always a little bit trouble because the old Amiga asl unit still used the old field names rf_* but from V38 of the Library this fields are all names fr_* and some other tiny dame differences (e.g. Dir vs. Drawer). In AROS and AmigaOS4 I only added the newer names because here I do not have any “old” code. This resulted in a big inconsistency between the platforms and need ifdef’s in the final programs. To prevent a direct breakage of the existing sources (e.g. LCL, MUIMapparium) Amiga and MorphOS have both field names in the structure (as case). The aim will be to remove that ifdef’s from the sources.

Route Orders

Posted by ALB42 on 20. August 2017No Comments

Finally found some motivation to work on the route display not so difficult at all. But the search for the route I need to think a little bit more. Until now it only shows the saved orders. On double click it jumps to there and also shows the described route points in a different color. That should be ok for now.
 

More colors

Posted by ALB42 on 20. August 2017No Comments

Due to user wishes one can now change the color of each track and route individually, which is also saved to the GPX File. Routes and Tracks in GPX have an extension area where you can add own properties without violating the GPX format, which is very nice. The Routes and Track property window have now a Color Button next to the Name to choose the color of the feature (you have to save that before the change is visible in the map).
In principle it would be nice to have the color next to the name in the Track/Route List as a little colored square (like I did for track plot axes). But I’m not sure if and how that is possible at all for such a list, without creating a selfdrawn one.
 
Besides that I implemented that MUIMapparium remembers the position and open status of the Statistics window, seems some user like to keep it always open to observe the loading status or something like this.
 

Colored routes and Tracks in MUIMapparium

Amiga Future

Posted by ALB42 on 18. August 2017No Comments

Do you read journals…? I’m not. I seldom read such things and if it happens then science related. But there is still an Amiga related journal the Amiga Future. I saw it once or twice at the Amiga meeting here in Berlin but never actually cared about. But maybe the next issue would be something worth to buy 😉 Especially the one article which already has a preview there.

MUIMapparium 0.5

Posted by ALB42 on 9. Juli 20176 Comments

I decided to release the next Version of MUIMapparium even not all features are finished as I planed just to get the bugfixes out. Routes (calculated directions) can be loaded from GPX and showed on map. But I did not implement the route finding and direction command showing until now. Especially the Track curve plot was still very buggy, and of course I described in a previous blog post the pixel to position calculation which is now much better, much more precise but also much slower than before, with FPU it does not make big difference, but with SoftFloat not really funny. Routes and Tracks are now pre-calculated for the current zoom level. If the zoom level is very small and the track therefore not really good to see, only some pixels wide, it does only paint some points of it, which makes the overviews much faster. Still, with SoftFPU on 68k it still will be too slow if you have some Tracks/Routes. The drawing of Tracks/Marker/Routes can be completely switched off in Menu or buy a FPU 🙂 The package for Amiga68k does contain a FPU and Non-FPU.
I also created a little GPX file with a Track, some Markers and a Route to test the features. (Even you can use any GPX/KML/KMZ/FIT File you can find on the Internet as well)

Changes:
  • Bugfix: imperial units
  • Bugfix: key mapping
  • Bugfix: 2nd track curve drawing
  • Bugfix: Date/Time loading from GPX,KML,KMZ files
  • Level of Detail for Tracks
  • Precalculation of Trackpositions (Speed optimization for NonFPU systems)
  • Route drawing
  • Marker in Plot, shows also a marker in the Track
  • Turn off Marker, Track and Route drawing via Menu
  • Define Directory for Images via ToolTypes: e.g. DATAPATH=DH1:TmpDir
  • Change find IP to freegeoip.net (old one is too slow currently)
  • FPU Version for 68k
Downloads: MUIMapparium Page

 

MUIMapparium 0.5

Show me some routes

Posted by ALB42 on 28. Juni 2017No Comments

Working again a little bit on MUIMapparium. I want to include some more features before the next Release 0.5. I included marker for the plot which is then also shown as little triangle in the map. I’m not really satisfied with the colors and visibility of the current open track and marker for the point maybe I get a better solution later. The marker is atm. only one pixel wide, in principle it would be possible to make it 2 pixel or 3 pixel, but that looked a little bit too massive.

MUIMapparium with Track Marker

Another thing I wanted to include for the next version are calculated routes and maybe also photos with EXIF tags. If this is done MUIMapparium has the same Featureset as Mapparium, even a little bit more. I started with Routes which is not very difficult, some routines even can be reused from tracks drawing and so on. It only loads tracks from gpx files currently (created by Mapparium for example). The creation of a new route will be the next step.

MUIMapparium with a Route


Also visible in the image is the new possibility to disable all Marker, Tracks and Route drawing. Helpful if you have many items and want to concentrate on the Map or so (or just to increase the speed).

Do it online

Posted by ALB42 on 16. Juni 2017No Comments

A crazy idea came up to me. Would it be possible to create a webpage with a nice javascript Editor which could directly compile FreePascal sources for all our beloved Amiga Platforms. The answer is certainly yes, I googled around to find a small package without too many nodejs, npm and such things, which always fails on my old server ;-). I found ACE which seems rather nice an easy to use. The rest is just some little php magic and of course the cross compilers, which I know already long time how to create and use and voila, ready to use webpage to create a simple (one file) Pascal application for all amiga platforms. I tried it on MorphOS, AROS and even native on an Amiga 600 with Vampire using iBrowse. Of course in iBrowse the editor does not work. I included a special page with a simple HTML textarea for such old browsers.

The compilation speed is much faster as a native compilation.

On MorphOS it runs much better of course the MorphOS OWB is even capable to show the editor, very nice.

It’s a little bit slow because it’s recorded via VNC, in reality it feels rather fast.

AROS was a little bit of disappointment for me. I downloaded the latest Icaros 2.2 especially to test this webpage. But sadly the editor does not show up. No Error message shown. I guess it’s some missing font problem, because when I change the theme the background color changes, only the text is not visible. It’s a pity. I had to switch to the old Browser interface which works nicely but I expected more.

A yes, you will ask where can I try this: here
With Javascript Editor e.g. for MorphOS
With HTML Editor e.g. for Amiga 68k

ECMAScript 5 MorphOS/Amiga

Posted by ALB42 on 3. Juni 2017No Comments

Compiled Besen for Amiga and MorphOS, some more small changes needed (mostly because for both CPUs no jit compiler is available). On MorphOS the it fails with a senseless error message: expected identifier found “”. when checking the position, no error to be found in middle of a parameter definition. Increasing the stack before compiling make it work, little bit strange, thats the first time fpc compiler need a bigger than normal stack (which is 256k defined inside the fpc code). It works nicely.
On Amiga the compilation was much less problematic, but the Exe do not work completely already gives error message on boot up about not initialized variable… most example sources only give this uninitialized variable error message, only this number guessing “game” works. Little bit strange, maybe some m68k compilation problem?

ECMAScript 5 on MorphOS



I downloaded the conformity test for ECMAScript 5 and let it run on AROS and the result is not bad: “Total tests: 1221 Passed: 1140 Failed: 80 Could not load: 1” to put that into perspective my current Firefox (52.0.2 64-Bit Linux) gets following result: “Total tests: 1236 Passed: 1098 Failed: 135 Could not load: 3”.

ECMA 5

Posted by ALB42 on 2. Juni 2017No Comments

Today I found Besen by random 😉 “Complete ECMAScript Fifth Edition Implemention in Object Pascal”. If you do not know what ECMAScript is: usually it’s called JavaScript.
With very little changes it runs it compiles with FPC for AROS. 😉

BESENShell on AROS

To FPU or not to FPU

Posted by ALB42 on 28. Mai 2017No Comments

When I work on MUIMapparium usually I only work in Linux and test on AROS Linux-hosted. which is very convenient and fast. When starting the MUIMapparium I also tested at the end on every platform if it works and how is the speed. For the last two Releases I skipped this part, due to lack of time.

But yesterday I tried MUIMapparium on my Amiga 600 with Vampire and was shocked how slow it behave. The map moving is just not usable around a second reaction time. I downloaded/compiled older versions to check when this problem appeared. Deep in the back of my brain I guessed already that the fixed position calculation could be the reason (see here). Thats pure floating point calculation and a lot of them. I tested that on the initial implementation and it seemed not too slow, because for simple map moving and zoom only very two-three times this conversation have to be done, so the influence is not very big.

So why it’s now so slow? The difference is that before I tested with a bare MUIMapparium without any marker or tracks loaded. Marker only add a single conversation to the list. But Tracks need a conversation for every recorded (and maybe drawn) point. Remember the most GPS devices measure the position once per second, that means for an hour walk you get something about 3600 points (usually the GPS already strip them from “not moved” points, nevertheless you get around 1000 points). For NG Amigas with their massive computing power especially on the FPU side, this is not much of a problem, 1000 fpu calculation with some hundreds MFlops are just done some milliseconds.
But on Vampire it’s a different story, no FPU, it has to use the softFPU emulation of FreePascal. This raised the question: How fast is the softFPU emulation on a Vampire in comparison to a real 68060 / 50Mhz FPU. The Vampire integer performance is much higher than the 68060 (around twice as fast, see here) but emulated FPU, there is a lot of code needed to emulate that correctly.
I used two tests for that, a simple Mandelbrot algorithm, in single and double precision and the well known SciMark from NIST. Compiled with either with FPC SoftFPU emulation or the 68881 FPU support.

Mandelbrot results (Runtimes, shorter is better)

Test 68060/50 MHz FPU 68060/50Mhz SoftFPU Vampire SoftFPU
Mandelbrot single precision 0.12 s 9.53 s 3.81 s

Mandelbrot double precision 0.15 s 23.72 s 13.37 s

When comparing the SoftFPU times of 060 and Vampire you can see the 2-3 times I experienced before already. But the (often called “very slow”) 68060 FPU leaves the SoftFPU Vampire in the dust far behind it. (In fact the dust is already settled down again, before the SoftFPU finished the calculation). Of course the errorbars for the calculations with FPU are huge, the time is too short for a reliable time measurement, but a bigger calculation just would need ages with SoftFPU 😉 and the trend is nicely visible.

Next is the SciMark, it uses various real life floating point calculation, like FFT, matrix multiplication, monte carlo simulation, if you work in science you know that stuff, if not just believe me that is what science programs do all day 😉

SciMark2 results (MFlops, higher is better)


Vampire V600 V2+ 128 MB SoftFPU code
** ** ** SciMark2a Numeric Benchmark, see http://math.nist.gov/scimark ** ** ** ** Delphi Port, see http://code.google.com/p/scimark-delphi/ ** ** ** Mininum running time = 2.00 seconds Composite Score MFlops: 0.06 FFT Mflops: 0.03 (N=1024) SOR Mflops: 0.12 (100 x 100) MonteCarlo: Mflops: 0.03 Sparse matmult Mflops: 0.08 (N=1000, nz=5000) LU Mflops: 0.02 (M=100, N=100)

Amiga1200 68060/50 FPU code
**                                                               **
** SciMark2a Numeric Benchmark, see http://math.nist.gov/scimark **
**                                                               **
** Delphi Port, see http://code.google.com/p/scimark-delphi/     **
**                                                               **
Mininum running time = 2.00 seconds
Composite Score MFlops:     2.26
FFT             Mflops:     1.18    (N=1024)
SOR             Mflops:     5.05    (100 x 100)
MonteCarlo:     Mflops:     0.86
Sparse matmult  Mflops:     1.81    (N=1000, nz=5000)
LU              Mflops:     2.41    (M=100, N=100)

So it just shows the same trend. Attention: do not compare this MFlops with the theoretically MFlops most speedtests show you (like sysinfo), you can see, how different the tests behave. It depends very strong on which commands are used and how much memory bandwidth is needed.

In conclusion it shows really nicely why the MUIMapparium with a track on a Vampire is so slow currently, because of the slow SoftFPU. Very sad that the Vampire still lacks a proper FPU support. We (ChainQ and me) believe that it is possible to optimize the SoftFPU performance maybe 50% faster or even double, or lets aim for the stars.. 10 times faster than now (I do not believe that is even close to possible at all). It would still be around 5 times slower than a 68060/50 Mhz FPU, for the people believing a SoftFPU implementation could be a replacement for a native FPU in the FPGA.

That means, if it reacts very slowly on Vampire, just remove the track. 😉 I will work on this, reduce the needed calculations, (by using more memory), see at which places I could possibly go down to single precision (not much hope there ;-)) and of course reduce the number of points, in principle a LOD on the Zoomlevel.

P.S.
if you want to test SciMark you can download the FPu and SoftFPU exe from my server:SciMark FPU Version, SciMark SoftFPU Version. (I would be very interested in 68881/2 Results)