Archives by ALB42

Hardware programming on Amiga with Free Pascal

Posted by ALB42 on 17. Juni 2021No Comments

It’s very common on 68k Amiga to turn off the operating system and directly write to hardware registers to get maximum speed. Many games and demos does it this way. Usually they are written in assembler, but of course this is also possible with Free Pascal for Amiga.

I got that idea because Charlie did a little test how small a program in Free Pascal on Amiga can be. (I guess it can be even smaller than that, when replacing the DosWrite(Output()) by PutStr() and compile for 68020).

So I took his source and tried to make a little bit more useful example out of it and remembered my time doing Amiga 68k Assembler (in ASM-One, I was never good with that, but hey I can learn a bit now)

So I did a little copper list example and it’s 700 bytes long, not bad, as second I tried some bit-plane manipulation. The program became around 3kbyte (most of that is because of the huge sinus table included).

And it runs very nicely on my A1200.

The Source with compiled executable is available on Gitub.

Free Pascal 3.2.2 Release

Posted by ALB42 on 20. Mai 2021No Comments

New Release of Free Pascal is done. It’s a bug fix release for 3.2.0 it has also some bug fixes for the Amiga systems, especially structures and functions are checked against official SDKs (especially for MorphOS with its latest SDK Version). For changes that break compatibility you can check official changes document.

Downloads

or you go directly to the Free Pascal home page and download from one of the mirrors. Have Fun.

Hex2 for SinclairQL

Posted by ALB42 on 19. Mai 2021No Comments

Charlie was introducing SinclairQL port of Free Pascal, another platform using m68k processor. To be honest I never heard of it before. It also uses vasm and vlink as on Amiga, so it’s rather easy to create the cross compiler for it, the port is still in a very early stage but some stuff is already working, for example my HEX2 pocket calculator already works nicely (after some tine bugfixes 😉 in the code and in the Free Pascal code). I got a emulator for SinclairQL and it works, very nice.

If you want to try you can download the program here: Hex2-QDOS

Some little facts I should mention, the source was developed for TurboPascal 3.3 for CP/M (for my KC85) I tried a lot o things, all seems to work, but maybe some errors still hidden.

Because it was developed for KC85, so very little RAM available I decided to load the error messages and help messages from file only when needed. But that seems not so easy on SinclairQL. I had to add the “mdv1_” (representing the first microdrive) before the filename that it can find the help or error file. Until now it seems there is no way to find out at which drive my program is (ParamStr(0) is empty), so I just hard coded that for now.

Amiga CDXL converter

Posted by ALB42 on 14. Mai 2021No Comments

Someone asked me to try a CDXL converter (agaconv) but I did not get to work until i compiled it for myself on Linux. CDXL if you don’t know, was an very early movie format invented by Comodore to use for the Amiga CDTV, so it aimed at a 68000 with 7 MHz with a Single speed CD Rom (150 kb/s).

I tried to create some little movies with it and it works quite nicely, especially the agablaster is very good and fast for viewing on a native Amiga (if you have AGA I guess from the Name? I do not own an OCS or ECS Amiga so I can not try). To really get the movie to the small size (to meet the 150kb/s target) you really have to tweak the options. You need to lower den resolution to 160×100 (or lower) and the colors to 5bit (32 colors) or 6bit (HAM6) reduce the number of frames per second to 12 and recalculate the audio to mono 11025 kbit/s.

For me it was interesting to see how the movie would look like with such low quality, as example I took the OpenSource Big Bug Bunny Movie, which is nicely short and free to use without any legal problems.

For a faster Amiga (like a A1200) with a normal HD (around 1 MB/s) you can make the movie in something like 320×200 in 256 colors or even HAM8 and looks rather decent texts still readable sound is ok (just the 8 bit sound conversation is a bit weak, I increased the loudness a bit) and you get a nice movie result, just a bit big (around 500 MB for 8,5 minutes movie). Not all CDXL player can show this format (agablaster does it very nicely)

If you go to the original CDXL format description (as above), it becomes hard, it’s really tiny and greasy you can easily see the dithering and color reduction, texts (except Main Title) not readable at all, back in the days maybe nice (in 1991 or so, when CDTV came out) to at least see a movie but its much worse than CD-i (1990) or VCD (1993).

Because the agaconv is not directly running, need FFMPEG and java (if you want convert to HAM and it it needs a X Server) I created a docker container where all is installed inside working. I created two little scripts (one for Linux and one for Windows) to start the agaconv using the docker, all you need is installed docker and this script and of course the movie.

for example to create the standard movie format as decribed before you need to start it with (linux example):

agaconf.sh test.mkv test.cdxl --fps=12 --color-mode=ham6 --width=160 --audio-mode=mono --frequency=11025 --std-cdxl

Example movie: Big Bug Bunny with CDXL Standard settings ready for a stock Amiga.

I played this movie on my Amiga1200 and it looks like this:

I compiled 2 more versions, one with 32 colors (–color-mode=ocs5) and one for AGA Amigas (–color-mode=aga5) but the other settings stay the same.

So if you want to watch videos on your old Amiga try CDXL (and to convert you can use the docker container)

Ask Your Amiga 0.5

Posted by ALB42 on 15. April 2021No Comments

I added assumptions to Ask Your Amiga. Assumptions are the way the different meaning of one word are separated from each other in Wolfram alpha. For example if you ask for “Berlin” it will show you information about the capital of germany, but also shows you a list of other cities (mostly in USA) named Berlin and also other meanings like Berlin as a name or a music band (never heard that before) and so on.

Like on the web page I put these assumptions to at the top of the results to select from a cycle widget.

AYA 0.5 with Assumptions

Download latest AYA at hte AYA Page or use the build-in Update Version

Chess mate TProcess

Posted by ALB42 on 10. April 2021No Comments

Still trying the TProcess and Pip stuff on MorphOS (I do not want to steal the gdb from Charlie though 😉 ). I remembered, a while before someone told me that he has a shell based chess program for MorphOS compiled Predateur. It uses a rather common command line API (uci). I also found a UCI GUI written in FreePascal the GUI itself is made with fpGUI, but that’s not a big problem. I changed the GUI to MUIClass and try it. It did not work directly on the first try, there are some problems with the TProcess. I have to think about that, how to solve. But with a little bit tweaking it works now. You can play chess nicely. The author of the GUI also has some uci compatible engines written in FreePascal, but they sometimes crash after some moves. But this Predateur one works quite nicely. Disclaimer: I’m very bad at chess, never really played, barely know the rules.

Test Result

Posted by ALB42 on 23. März 2021One Comment

Some might wondering what happened to the Free Pascal test result on the Amiga. There are some reasons I did not write about the results. 1. it took much longer than though, especially later tests need much longer to compile and run (more like 30s per test) and 2. some tests crash what leaded to idling computer half of the night until I can let it continue, overall it stopped 8 time, of which it was 3 times a “Guru” and 4 times the enforcer (of Draco) killed the program before it could crash the computer because the program accessed some memory it’s not supposed to and once the Hard disk went full and it stopped with a Disk full requester (I did not notice that the logs and programs need such big amount of HD).

Overall 326 tests are failing either do not compile or the compiled program does not work correctly + for mentioned 7 that crash, which is much more than the m68k-linux test for this compiler version which should be around 40 or. I guess that must be some implementations are missing for the Amiga. I saw scrolling by some Link LibC or other c library errors, which will not work because we did not implement that. The rest I have to check slowly the next days.

It’s not bad after all, 333 tests give problems means around 5600 tests ran well without problems and my Draco did run 3 days without interruption without any problem, also nice to know. After checking the errors, maybe I can fix some of them and make a test list without the 7 crashing tests that I can run on one go. I should repeat that test with the latest Free Pascal and compiled for FPU, especially some tests which are not working with the qemu setup I’m using atm. (if they really show an FPU compiler error or just an qemu problem)

ALB goes crazy episode 9843: Free Pascal test suite on a real Amiga

Posted by ALB42 on 20. März 2021No Comments

Again got a crazy idea… after my attempts to run the Free Pascal test suite on a real m68k linux (I’m not sure whats the problem it it just stopped at some point but did not start the actual tests) I looked a bit closer how these test run is designed (with a bit Makefile, which does not work on Amiga even with unix kind shell installed, I tried already) I wrote a little program make the list of tests and I got around 5800 test, not the same amount as the original (which is nearly 9000) but ok for first list creation, later maybe find out where are the other tests hidden.

the “dotest” util making the actual test (checking if on the right CPU/OS/Version and so on) does not run because it’s only implemented for windows/dos and unix… and full of {ifdef windows}doDOSstuff{$else}doUNIXstuff{$endif} or vice versa… I made some very nasty changes and implemented a little routine for Amiga to make it at least work to run the tests gather the output and check return code and it works.

Next transfer everything to my Amiga (Draco 68060 in this case) and start and press all thumbs it works somehow.

And? Yeah it works, needs around 10s per test hmmm that makes around 16h for the full 5900 tests :-O ok the Draco is very stable, I just hope none of the test let it crash 😉 lets see tomorrow the result, which tests fail and why 😉 (running currently with 3.2)

If that works well I should also make a run with FPU (thats SoftFPU atm.)

Docker direct compile and AROS update

Posted by ALB42 on 14. März 2021No Comments

Besides the documentation work I also updated the docker container. I created 4 scripts to compile directly from the docker (without using VNC/lazarus) so you can directly compile in your linux installation, that there is a docker container behind it you barely notice. But it only can compile standard Free Pascal things, no LCL applications (missing pathes to the lcl units, also not easy possible, but without Lazarus make not much sense, I think)

The AROS compilation had a big problem, when you compile without -g option it tries to strip but the strip tool was not installed, so I added some more tools to make it possible to compile without -g (makes the executable much smaller)

On this I updated the lazarus version to the latest version 2.0.12 as well.

If you want to use the newest Version of the docker (with the AROS bugfix) start the “CheckForUpdate.sh” script if you also want to have the direct compile command download the CrossAmigaLazarus Package.