With a background in the demoscene, the Amiga was a natural place for us to explore a practical question: how useful is AI when the code has to work closely with specialised hardware?
We chose a rotating triangle tunnel. It is a familiar demo effect, but building it for an Amiga 500 brings very concrete constraints: a Motorola 68000, limited memory, custom graphics hardware and a strict frame deadline.
The Amiga became our retro test bed for the kind of work found on embedded platforms: understanding the memory layout, coordinating the CPU with dedicated hardware, and measuring whether the result actually finishes on time.
Give the AI a real target
We worked with an AI coding agent on a local development setup with a 68k compiler, assembler, bootable disk images and the FS-UAE emulator. The agent could write C and assembly, run build tools, inspect the output and revise the implementation.
The target was specific: a native Amiga effect, a 320 × 200 drawing area inside a PAL display, and eventually one completed frame every 20 milliseconds. That gave us a way to judge each change.
Human input supplied the visual direction and the hardware ideas. We asked for changes to the movement, suggested reusing earlier frames for motion blur, and explored using static bitplanes to add depth. AI helped turn those ideas into working experiments and the tools to check them.
Let the hardware help
The Amiga stores this display in bitplanes: layers of one-bit pixel data whose combined bits select a colour from a palette. Its Blitter can draw lines and fill areas, while the Copper runs a small display-synchronised instruction list that sets graphics registers. These mechanisms are described in Commodore's playfield documentation, Blitter chapter and Copper chapter.
We divided the work accordingly. The CPU calculated and clipped the triangle contours. The Blitter drew their edges and filled the result. The Copper configured the bitplane pointers and colours, and completed buffers were exchanged at vertical blank.
That division mattered. On a constrained machine, the shape of the solution depends on what the hardware can do efficiently.
A frame deadline is a useful editor
The first 320 × 200 version ran at 25 fps in the A500 emulator. Rendering took roughly 26 ms, which missed the 20 ms PAL frame window and pushed display of the completed frame to the next refresh.
Measurements showed that geometry and clipping were the largest opportunity. We used AI to help rewrite that stage in 68000 assembly, while retaining the C implementation as a reference.
The recorded comparison brought geometry work from around 14 ms to around 6 ms, and the worst measured frame from 26.2 ms to 18.8 ms. All 2,048 tested phases matched the reference geometry. The rewritten version reached 50 fps in the emulator.
A visible effect, a measured bottleneck and a reference implementation gave the agent a concrete problem to solve. Each improvement could be checked for both correctness and cost.
Depth and blur from five bitplanes
Once the solid tunnel worked, we kept that version and experimented with shading and motion trails. The final combination used five displayed bitplanes:
| Bitplanes | Contents | Purpose |
|---|---|---|
| 1 | The newly rendered tunnel | Current movement |
| 2 | The previous rendered frame | A short motion trail |
| 3–5 | Three static depth masks | Eight levels of shading |
The 32-entry palette combined the current frame, the previous frame and the depth level. The CPU and Blitter only generated one new moving plane per frame; the previous one was retained and the shading masks were loaded once. A third moving buffer stayed offscreen as a safe drawing target while the hardware displayed the other two.
There was a useful limit here. A trail-only experiment displaying five moving frames fell to 25 fps in the measured emulator run. Combining two moving frames with three static shading planes brought the effect back to 50 fps in the measured interval.
The dark centre offered another saving: triangles fully hidden inside it could be skipped. A comparison against the complete geometry checked that this removed no visible pixels.
Check more than the picture
We checked the effect at several levels. Geometry comparisons covered the assembly rewrite. Captured emulator memory was compared bit by bit with a host reference. Further checks covered buffer history, display pointers, palette values and the pixels omitted behind the dark centre.
For the final circular-shading version, two saved captures matched across all six stored bitplanes. When producing this article's GIF, we repeated that comparison: zero differing bits across 853,248 bitplane bits, with matching rendered previews.
The native effect's recorded performance checks used a PAL A500/68000 emulator profile with 512 KiB of Chip RAM and no JIT. They reached 50 fps in the measured intervals. Physical Amiga hardware testing is still outstanding. The GIF above is a separately rendered illustration, so its playback rate is not a performance measurement.
What we take into embedded work
This experiment suggests a useful way to work with AI on specialised platforms:
- Describe the target precisely. Give the agent the processor, memory layout, hardware rules and timing budget.
- Build a small working baseline. Keep it available while trying more ambitious versions.
- Measure before optimising. A frame deadline and a timing breakdown make the next task concrete.
- Check changes against independent evidence. Use reference code, hardware documentation, emulator captures and, eventually, the physical device.
The transferable lesson is the working method. AI made it easier to try implementations, build comparison tools and explore alternatives. Hardware knowledge and visual judgement gave that work direction; measurements told us which ideas earned their place.
A physical Amiga run is the next useful check. For now, the tunnel is an example of AI-assisted development close to the hardware, and a good excuse to spend some time in the demoscene again.
