Categories
DevOps & Infrastructure

Installing A Drive Selector In An Amiga 500 Plus

In this post, I install a drive selector in my Amiga 500 Plus, letting it boot from USBs and a Gotek instead of floppy disks.

Introduction

So, remember that YouTube channel I started? Yeah – me neither.

Well, it’s back! I recently won an eBay auction for an external Gotek and Amiga 500 drive selector, and that gave me the nudge I needed to make a video!

eBayGotekAuction

This isn’t me chasing YouTube stardom. Rather:

In this post, I will cover some key concepts for those less familiar with 90s Commodore hardware, explain what happened during filming and then leave you with the finished video. Watch me flailing with drives and chips for 20 minutes!

Let’s begin with some explanations.

Some Key Concepts

Before jumping into the video, it’s worth covering the hardware and installation steps involved.

About Goteks

The Gotek floppy emulator was originally developed by Gotek System, based in Shenzhen, China, primarily for the industrial sector.

gotek pcb
A Gotek PCB

Original Gotek Design

The Gotek was originally designed to replace 3.5-inch floppy drives in legacy hardware such as CNC machines, aviation devices and musical workstations. Many of these machines depend on floppy disks for data input, making them difficult to operate as working floppy disks become harder to find.

The Gotek functions as a hardware bridge by emulating the electronic signals of a mechanical floppy drive. Instead of using physical disks, the emulator reads digital disk images from a standard USB flash drive. USB drives can store and manage multiple virtual disks, offering modern storage reliability without requiring invasive modifications to the host machine’s internal components.

gotek initial
Basic Gotek with three-digit navigation display & file selection buttons

Modern Gotek Usage

Gotek capabilities have greatly improved over time, thanks to people like Keir Fraser, the creator of the open-source FlashFloppy firmware. While basic Gotek models are still available, most enthusiasts now use FlashFloppy for compatibility with a wide range of vintage electronics.

Over the years, several Gotek models have been released. Current hardware options often include usability enhancements like OLED screens for clearer file navigation, rotary encoders for quick file scrolling and built-in speakers that mimic the seek sounds of traditional drives.

gotek modern
Modern Gotek with OLED navigation display and file selection rotary dial

About Drive Selectors

An Amiga drive selector is a device that switches the signals between the internal floppy drive and an external drive.

Why Are Drive Selectors Needed?

In the Amiga architecture, the internal floppy drive is designated as DF0, while external daisy-chained drives are assigned as DF1, DF2 and DF3. This hierarchy is fundamentally tied to how the hardware and software interact.

The earliest Amiga 500 models used Kickstart 1.3, which has no user-accessible way to select an alternative boot drive. Later Kickstart versions, starting with 2.0, introduced the option to select a boot drive through the early boot menu:

AmigaEarlyBootMenu

However, a significant issue remained: the software itself. A lot of classic Amiga software used custom trackloaders. These were low-level routines that bypassed AmigaDOS and read physical disk tracks directly. Developers used them to improve loading speed, reduce memory use and add copy protection.

By bypassing AmigaDOS, these NDOS (Non-DOS) disks could:

  • Load faster by reducing drive head movement.
  • Conserve memory by not loading the full OS disk-reading library.
  • Prevent piracy through non-standard disk formatting.

The downside was that many of these disks were hard-coded to expect DF0. Even if a program was launched from DF1, it might still look for files or data on DF0. If DF0 was empty, the Amiga would crash or simply hang.

That is where a drive selector becomes useful. Rather than changing the software, the selector changes the hardware’s view of the drives.

How Drive Selectors Operate

Drive selectors are available as switched and switchless versions. Mine is from AmigaStore.eu, judging by the PCB markings.

To understand how a drive selector works, one must look at the 8520 CIA (Complex Interface Adapter) chips on the Amiga motherboard. Specifically, CIA-A (located at address $BFE001) is responsible for handling the floppy disk interface signals, including the Drive Select lines.

cia even
An Even CIA Chip

Upon boot, the Amiga identifies which drive to talk to using four active-low Select signals: _SEL0, _SEL1, _SEL2, and _SEL3.

  • _SEL0 triggers the internal drive DF0.
  • _SEL1 triggers the first external drive port DF1.

A drive selector sits between the CIA-A chip and its socket. It intercepts the relevant traces and swaps the logic lines when activated:

  1. The _SEL0 signal coming from the CIA is routed to the motherboard’s DF1 circuitry.
  2. The _SEL1 signal is routed to the internal DF0 circuitry.

Because this happens electrically before the signal reaches the drive cables, the Amiga does not know anything has changed. It still believes it is talking to the internal drive, but the signal is actually being redirected to the external Gotek.

That gives a level of compatibility that software-based drive remappers cannot always match. Even persistent trackloader-based software will treat the Gotek as if it were an internal drive.

SelectorFitted
A fitted drive selector and switch

Video

Here’s the full video walkthrough of the install – droppages, shark noises and all!

Video Summary

In the video, I open my 1991 Amiga 500 Plus and install a drive selector PCB. I took a fairly quick-and-dirty approach and worked around the internal components, but in hindsight I should have removed the floppy drive entirely to give myself more room.

The installation involves carefully removing the Even CIA chip from its socket on the motherboard. I then connect the drive selector PCB to the original 40-pin socket and place the chip into the selector.

After that, I test the setup with an Amiga Test Kit floppy disk and a Cannon Fodder ADF. The selector successfully redirects the DF0 boot signal to the external Gotek, letting me boot from USB while keeping the original internal floppy drive fully functional.

This is not presented as the optimal method – retro hardware can be unpredictable, and a cleaner approach would involve removing more components before starting.

Video Chapters

If you prefer, you can jump to specific sections using the chapters below.

  • 00:00 – Introduction
  • 02:08 – Explaining the DF0/DF1 boot problem
  • 02:53 – The Drive Selector PCB & Toggle Switch
  • 03:59 – Opening the Amiga (Safety First!)
  • 04:32 – Identifying the Even CIA Chip (U8)
  • 06:04 – The delicate art of chip extraction (and bending pins)
  • 10:54 – Amiga 500+ Hardware: Agnus, Denise, and current values
  • 12:37 – Installing the Switcher & Re-seating the CIA
  • 16:35 – The first boot & a mysterious Guru Meditation
  • 18:46 – Success! Testing with Amiga Test Kit
  • 20:05 – Final Demo: Loading Cannon Fodder from the Gotek

Technical Errata & Clarifications

  • 02:08 – I called it a “Godrive,” I meant Gotek.
  • 09:25 / 10:11 – I mentioned “bent chips” – I meant the metal pins/legs!
  • 11:14 – Confirming: The 8375 Agnus is the 2MB Chip RAM version. Standard A500 Agnuses (8370/71/72) only support 512KB or 1MB.
  • 17:15 – The Guru Meditation was likely a seating issue with the CIA adapter. If the pins aren’t making perfect contact, the CPU will throw this error immediately.
  • 17:53 – The ticking sound is the stepper motor resetting to track 0. It has nothing to do with the drive heads.

Plus I erroneously call it a ‘Drive Switcher’ throughout. Oops.

Summary

In this post, I installed a drive selector in my Amiga 500 Plus, letting it boot from USBs and a Gotek instead of floppy disks.

I had fun with this! Which was the point! It was a chance to work on something familiar in a cosy space, and get more comfortable on camera while doing it. This and the recent Kubernetes lab reminded me why I like retro projects so much: they are practical, technical and just unpredictable enough to keep things interesting.

Like this post? Click the button below for links to contact, socials, projects and sessions:

SharkLinkButton 1

Thanks for reading ~~^~~

Categories
Me

Emotive Amiga Code

In this post, I respond to July 2023’s T-SQL Tuesday #164 Invitation and talk about emotive code on the Amiga.

tsql tuesday

Introduction

This month’s T-SQL Tuesday comes from Erik Darling. To paraphrase his invitation:

Think back to the last time you saw code that made you feel a thing. Hopefully a positive thing. Think along the lines of: surprise, awe, inspiration, excitement. Or maybe it was just code that sort of sunk its teeth into you and made you want to learn a whole lot more.

Now, while Erik’s invitation mentions the last time, I want to talk about the first time. This is an ideal opportunity to expand on something I wrote on my About page about AMOS tutorials. But before I start explaining why I consider some mid-nineties Amiga code to be emotive, I should explain a few things.

Key Topics

This section introduces some of the key topics I talk about in this post.

Amiga

The Amiga home computer was first released by Commodore in 1985, and was one of the first computers with custom graphics and sound hardware.

Amiga500 system
An Amiga 500

The Amiga was designed to compete with the Apple Macintosh and the IBM PC. It had a custom chipset and a multitasking operating system. These made the Amiga appeal to a wide range of audiences including:

The Amiga also had expansion capabilities, with various third-party add-ons available like the Video Toaster production tool. This allowed the Amiga to be used for visual effects in TV shows like Babylon 5 and SeaQuest DSV, and films like Apollo 13 and Titanic.

The Amiga Wikipedia page has information on history, chipsets, trivia and more.

Amiga Format

Amiga Format was a monthly UK computer magazine published from 1989 to 2000.

logo amiga format

Broadly, there were three types of Amiga magazines:

  • Game-focused magazines like Amiga Power (Yayyy – Ed).
  • Serious magazines like Amiga Shopper.
  • Magazines with some of both, like Amiga Format.

Amiga Format was about 50% games to 50% serious. This expanded to their coverdisks, with a fairly even split of utilities and game demos across each month’s disks.

My first Amiga Format was issue 30, purchased alongside the family Amiga 500+ Cartoon Classics bundle:

AmigaFormat iss30

And I still have them both! Young me chucked the magazine around a fair bit, so years later I bought a copy from eBay in better condition. I’ll get some photos on Instagram when I get a chance.

The Amiga Format Wikipedia page has some additional information including some regular features.

AMOS

AMOS (or to give its full name AMOS BASIC) is an Amiga dialect of the BASIC game programming language.

AMOSBox

First published in 1990 by Europress Software, AMOS was well received and sold over 40,000 copies worldwide.

Interaction comes via the AMOS Editor: a text editor with the AMOS language built into it. This allows users to type, edit, save and run AMOS programs from within the editor, without the need for a separate runtime tool or compiler.

amos

The AMOS Wikipedia page goes into more technical detail, and this PowerPrograms page has a user’s AMOS perspective.

In addition, AMOS Professional has a GitHub repo, and I would be remiss if I didn’t include Dan Wood’s excellent AMOS retrospective video:

From AMOS To YAML

In this section, I talk about the Amiga code that ended up being so emotive and indirectly set my future career in motion.

Scene Setting

It’s Christmas 1992, and I’m a young shark pup still in single digits. I hit the newsagent’s magazine shelves with pocket money in hand and buy that month’s Amiga Format:

AmigaFormat iss42

Yes – it does say January 1993 on the cover. Before writing this post I never had a good explanation for this, so I reached out to the Amiga Addict Discord for some clarity.

It turns out that, during this period, Amiga Format produced issues every four weeks instead of monthly. Former Amiga Format editor Marcus Dyson speaks about this at around 38:30 in Maximum Power Up podcast episode 139.

But anyway.

Throughout 1992, Amiga Format’s coverdisks featured a series of fully-functional software packages known as The Amiga Format Collection. This collection included:

  • Fractal landscape generator Vista (AF33)
  • HAM paint and animation package Spectracolor Jr (AF35)
  • Machine code assembler Devpac 2 (AF39)

Adorning Amiga Format 42’s cover was AMOS:

af42 1993 01 d1

I’d read about AMOS before. Amiga Format issue 35 had a demo of Easy AMOS, and even the games-centric Amiga Power mentioned AMOS in its Public Domain section. And now, suddenly every Amiga Format buyer had an unrestricted copy of it.

Amiga Format partnered this with a Learning AMOS magazine section. Basic principles, syntax and screenshots were introduced across nine pages, with the tenth page having a tutorial for a scrolling text demo. This was to be the first part of a monthly Mastering AMOS series.

What A Pong

Now, young me didn’t pay much attention to this part of issue 42. It was Christmas after all, and I had demos of Lemmings 2, Fire & Ice and Bill’s Tomato Game to keep me busy!

Enter Amiga Format issue 43. This month’s AMOS tutorial was Solo Pong – a simple version of Pong with the player controlling both bats. This was deliberate – the focus here was on learning AMOS as opposed to learning coding.

Young me was intrigued! The scrolling demo didn’t really appeal, but this was a game! The complete script was only half a page long, and the tutorial explained each line. So I gave it a shot, and within an afternoon I had my very own Pong clone!

2023 07 07 solopong

The code itself made no sense to me – I was copying words from a magazine onto a screen and hoping for the best. But I found the process itself captivating. The idea that all the software I’d run on my Amiga was made by words on a screen – and words that I could type myself at that – was a revelation!

On an unrelated note, Amiga Format 43 included the last of the Amiga Format Collection series – the database package Prodata. So not only did issue 43 introduce me to coding – it also foreshadowed my eventual tech career!

Mastering AMOS Legacy

Amiga Format continued the Mastering AMOS series until issue 51. They went on to include AMOS Professional with issue 67, and ran an Ultimate AMOS tutorial series from issue 68 to issue 73.

Damien Junior didn’t do much more with the Mastering AMOS series after Amiga Format 43. I vaguely remember having a go at the Amiga Format 44 tutorial, which added some bells and whistles to the existing Pong code. But after that, it started going over my head and I lost interest. Although to be fair, I was a child!

The coding curiosity remained. As the 1990s went by I found myself trying out Amiga Format’s DevPac 2 and Blitz Basic tutorials, and by the end of the 1990s I was learning Excel formulae and VBScript at school. During the 2000s I started using HTML, CSS and PHP, and began using T-SQL, Powershell and DAX at work in the 2010s.

Which brings me to the present day, where I find myself learning Python and experimenting with reStructuredText (for Read The Docs) and YAML (for CloudFormation). And I thought, after thirty years, why not revisit the Amiga Format tutorial and see how I feel about AMOS now?

Thirty Years Later

Like many self-respecting Amiga fans I have WinUAE installed on my laptop, and an ADF of the AMOS coverdisk isn’t hard to find. So I fired everything up! And, after thirty minutes of typing, squinting and error troubleshooting, witness the result of my mighty endeavour – SHARK PONG:

2023 07 07 sharkpong

I clearly wasn’t squinting hard enough though. In this script, AMOS uses the ball’s X coordinate to determine if a player has lost. Where the tutorial’s LOSE conditions are:

If X>=320 Then LOSE : Goto RESTART
If X<=-20 Then LOSE : Goto RESTART

I missed the minus in the second IF statement and wrote:

If X<=20 Then LOSE : Goto RESTART

Thus creating a version of Shark Pong that Left Paddle can never win, as the losing X coordinate is in front of the paddle:

SharkPongFail

But then again, it wouldn’t be an early 90s tutorial follow-along without an unintended and slightly hilarious bug, right? And the command to stop running the code? Control-C. That broke my brain briefly.

But yeah. Revisiting the same code that captivated me 30 years ago was a blast! The original tutorial code is in my GitHub for those curious to see it, both as an unformatted text file and in glorious BlitzBasic!

Further Reading

Summary

In this post, I responded to July 2023’s T-SQL Tuesday #164 Invitation and talked about emotive code on the Amiga.

I had a lot of fun writing this! A phrase like ’emotive Amiga code’ might not sound fascinating on paper, but it was interesting to revisit that tutorial after so long. I even finally answered a question that’s lingered in my head for a few decades.

Thanks to Erik for this month’s topic! My previous T-SQL Tuesday posts are here. If this post has been useful, please feel free to follow me on the following platforms for future updates:

Thanks for reading ~~^~~