AMIGA alive

AMIGA alive

Saturday, April 11, 2026

AADevLog #7 - Creating "the demo"

Writing a demo is a lot of fun, because there are basically no limitations. You just use what you have, and there's no fixed goal. You can make it as short or as long as you like, and when something doesn't work, you either change it, or just drop it. 

While all along the way, of course, you run into a lot of issues. A proper demo generates graphics and sound, and has some sort of timing. That's a little less work than a game, which additionally needs user interaction (input) and "rules of engagement", but it's still quite a lot to handle. 

It's interesting: creating graphics and sound with some math is great, but at a certain level it's all about timing. Assembler coding gurus doing elaborate sprite multiplexing and stuff know much more about this - but even a simple piece of software like "the demo", written in C, involves dozens of little timing considerations. How long does it take to load something from disk, how long does it take to make the calculations, what needs to happen concurrently, does something have a proper effect at the given speed, etc. - and what's the runtime of the complete end result on different machines? In the end, to simplify things a bit, I decided that "the demo" is tailored to a 7Mhz OCS Amiga without FastMEM. It runs fine on faster Amigas, but you lose the nice realtime-drawing Lissajous curves, they just pop up, and the music cuts off at the end.

A tile-effect in "the demo"

Fixed-point math was used for the Lissajous curves and the 3D graphics. It not fully optimized, e.g. uses multiplications where maybe a bit-shift would've been possible, but it's still waaaay faster than software floating-point calculations. 

Sine and cosine functions were replaced by a CORDIC algorithm, adapted from the Python code found on Wikipedia: https://en.wikipedia.org/wiki/CORDIC.

The Lissajous curves code is an adaptation of the code found at BIT-101's old blog: https://bit-101.com/2017/2022/11/coding-curves-04-lissajous-curves/

The mandelbrot set code is also an adaptation of the code found on Wikipedia: https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set

"The demo" uses medplayer.library for music playback. I was surprised by hearing the floppy drive load the graphics from floppy disk, while the music kept playing. Wasn't there a thing with PAULA and the disk drive? Or is it in medplayer.library? Anyway, very nice, no need to handle music pauses when loading new data.

Overall, the amount of tech that went into "the demo" was a little bigger than expected: It also has graphics double-buffering, multitasking, IFF ILBM loading, and an interrupt server.

You can download "the demo" from AmiNet, and run it on your own Amiga, if you like:

https://aminet.net/package/demo/disk/amigaalive


A bash script to run different configurations of fs-uae

Chances are you want to change your Amiga emulator's configuration quite often, for example for developing and testing purposes. A script that runs the emulator can help you to do so without effort.

There are thousands of ways to somehow simplify Amiga emulator usage. If you're a GUI & mouse user some of the work has already been done, but for the CLI user there might be some annoying typing involved.

Below is an example Linux bash script that selects fs-uae emulator configurations and sets options based on a single short command line argument. It doesn't do very much, but it saves some typing, especially because fs-uae has a somewhat clumsy way of handling floppy disk images, aka ADFs.

Linux bash script to run fs-uae with different setups

The idea is this:

- You run the script without additional command line arguments, it runs your emulator with your preferred default configuration.

- You run the script with a given keyword (e.g. "4000", see script below), it runs your emulator with another configuration.

- You run the script with a path to an ADF, it additionally inserts that ADF in drive 1 (without booting from it).

- You run the script with the keyword "adf" (see script below), and a path to an ADF, it runs your emulator with a basic Amiga 500 configuration, and inserts that ADF in drive 0 to boot from.

There's of course room for improvement here, for example there's no proper error checking for the "adf" setup (ADF path?) in this script, and sometimes it might be nice to reuse some configuration with another fs-uae command line parameter than the floppy configuration, e.g. input device selection.


#!/bin/bash

UAEBIN=fs-uae

# no trailing slash here:
CONFDIR=/home/data/uae/configurations
# default configuration:
UAECONFIG=$CONFDIR/A4000-040-fast.fs-uae

OPTS=
ADF="$1"
DRIVE=1

if [ "x$1x" == "x4000x" ] ; then
    UAECONFIG=$CONFDIR/A4000-040.fs-uae
    ADF="$2"
fi
if [ "x$1x" == "x600x" ] ; then
    UAECONFIG=$CONFDIR/a600.fs-uae
    ADF="$2"
fi
if [ "x$1x" == "x500x" ] ; then
    UAECONFIG=$CONFDIR/a500-wb13.fs-uae
    ADF="$2"
fi
if [ "x$1x" == "xadfx" ] ; then
    UAECONFIG=$CONFDIR/a500-adf.fs-uae
    ADF="$2"
    DRIVE=0
fi

if [ "x${ADF}x" != "xx" ] ; then
    OPTS="--floppy_image_0=$ADF --floppy_drive_$DRIVE=$ADF $OPTS"
fi


CMD="$UAEBIN $UAECONFIG $OPTS"

echo "running fs-uae:"
echo " $CMD"
echo
$CMD

* * *

DISCLAIMER: No responsibility is taken. Use at your own risk.

Sunday, April 5, 2026

I Love The `80s - Men Without Hats like the Amiga 500

Walkman, arcade, Live Aid: Pop band "Men Without Hats" of "Safety Dance" fame released an ode to the `80s a couple of months ago, that features an Amiga 500.

Ok, admittedly, the Amiga really plays only a minor role here. But it's always fun to see one out there in the wild, and in this particular context, it's evidence how much of a cultural icon an Amiga computer is. Who would've thought that 40 years after release it shows up in a YouTube video that got 1.5 million views in its first nine months?

It happens at 1 minute and 53 seconds into the song. "Sounds like 1986!" - the editing is probably no coincidence.

Congratulations to the Men Without Hats for their success, and kudos to the video director for using the A500 literally at the right time. And it's a really nice tune they created here, good job!

I think we agree: We love the `80s.

 


Friday, March 27, 2026

AMIGA alive - the demo

Going back to the oldskool: first demo by Amiga alive.

It was about time to create a demo. It runs on MC68000, Kickstart 1.2, 512KB RAM.

 https://www.youtube.com/watch?v=0oettY1Dj10

 

Saturday, February 21, 2026

Spot the mistake... #6

This looks oddly familiar. But it still doesn't boot AmigaOS. Sigh. ;-)


Psst, there's a really an actual mistake (aside from the mouse/OS mismatch) in the picture. Can you spot it?

* * *

Friday, February 20, 2026

Pete Cannon and OctaMED 4

British electronic music producer Pete Cannon and his Amiga/AtariST driven studio.

The video is a bit old, but if you haven't seen it, like Amiga, OctaMED, and old electronic music gear, it's a must-watch. Pete Cannon creates jungle/house/hip-hop music, and is an avid OctaMED user. This report shows some of his synths and samplers, oldskool production techniques, and is also a nice, pretty extensive demonstration of OctaMED (he uses version 4). We also get to see some vintage AtariST Cubase, hear some groovy jungle music (OctaMED playthrough), and of course listen to Pete talking about his experience. 

It's always nice to see Amiga computers still getting some proper creative and professional use, and Pete seems to be a very nice guy - very enjoyable and inspiring watch.

 

If you wanna get the true retro experience with OctaMED on your Amiga, you can download version 4 here:

https://aminet.net/package/mus/edit/OctaMEDv4

The most advanced version to date is "SoundStudio":

https://aminet.net/package/mus/edit/OctamedSS1.03c
https://aminet.net/package/docs/help/OctamedSSManual (updated manual)

Additional sources:

https://en.wikipedia.org/wiki/Pete_Cannon
https://en.wikipedia.org/wiki/OctaMED


Friday, February 13, 2026

APTR is dead - long live APTR!

When browsing through AmigaOS developer documentation and C code, there's always a funny, interesting, sometimes enlightening little find.

It's just nice to see how it all ties together, and the changes made from one operating system (API) release to the next. Learning about the infrastructure of software, esp. over multiple versions, exposes some of the thinking process of the operating system developers. 

Sometimes, it also reveals long forgotten secrets. If you're a C coder using AmigaOS, chances are you've been using a datatype known as "APTR" somewhere in your code. It is used extensively throughout AmigaOS 1.3 Native Developer Kit (NDK) C include-files, and even more extensively throughout later NDK releases. 

And it turns out it's wrong!

From NDK 1.3 Includes exec/types.h:

typedef STRPTR      *APTR;      /* absolute memory pointer */

/* sigh.  APTR was misdefined, but compatibility rules.  Heres what it
 * should have been
 */
typedef ULONG       CPTR;       /* absolute memory pointer */

Yes, even the pros make a little mistake from time to time. Obviously, they kept compatibility, meaning they (and everybody else) kept using APTR, when it should be CPTR. 

Interestingly, in NDK 1.3 there is - a little - use of CPTR (in resources/filesysres.h, libraries/romboot_base.h, and libraries/expansion.h), but it has been half-removed (from libraries/romboot_base.h and libraries/expansion.h) and half-reintroduced (in dos/dosextens.h) with later NDK versions.

Chances are you've also been using datatypes SHORT and USHORT in your C code. Guess what: It's wrong, too! Here's another little snippet from NDK 1.3 exec/types.h that may clarify this further, long standing issue:

typedef short       WORD;       /* signed 16-bit quantity */
typedef unsigned short  UWORD;      /* unsigned 16-bit quantity */

...

/* For compatability only: (don't use in new code) */
typedef short       SHORT;      /* signed 16-bit quantity (WORD) */
typedef unsigned short  USHORT;     /* unsigned 16-bit quantity (UWORD) */

SHORT and USHORT are just backwards-compatable [sic] aliases for WORD and UWORD. 

Given the very non-volatile situation of AmigaOS development, both APTR and (U)SHORT won't give you a headache. APTR is used throughout the operating system, and will most likely never be replaced. CPTR is used only in less than a handful of cases - you'll probably never need it (and it has been moved to the "compatibility only" [sic] section of NDK 3.9 exec/types.h). (U)SHORT is deprecated since NDK 1.3, and hasn't been removed in later releases, so it's probably cemented into today's global AmigaOS code base, and will never be removed from the NDK.

So - lessons learned:

- use APTR, it's (not) correct

- (don't) use SHORT and USHORT

;-)

* * *

BONUS: 

Here's yet another nice, ancient compatibility [sic] snippet, from NDK 1.3 Includes libraries/dos.h, moved to dos/dos.h in NDK 3.9:

/* Relative position to Seek() */
#define OFFSET_BEGINNING    -1      /* relative to Begining Of File */

...

#define OFFSET_BEGINING     OFFSET_BEGINNING  /* ancient compatibility */

Thank you - one less typing error to worry about. :-)