RetroMatic 2000 update 6: HxC floppy drive emulator

The second part of my retro computer “helper” is to be a floppy drive emulator, to load files off a memory card or stick.  This should be more convenient and reliable than physical disks.  It will also allow me to transfer files to more modern computers.

My chosen floppy emulator was the HxC: it seems very well designed, and supports almost any format you can imagine.  I should be able to use it on all these machines I own:

  • Amstrad CPC 464
  • Amstrad CPC 6128
  • Video Genie II
  • TRS-80 Model 3
  • BBC Master
  • Texas TI 99/4a

I think I may be able to get it working with some on my others with appropriate disk interfaces, but I’m not sure yet (ZX Spectrum 48k, ZX Spectrum 128k, Sinclair QL)?

Sadly it won’t work with my Commodore PET 8032, as that uses an IEEE488 interface instead of Shugart.

Initially I was going to buy the fully assembled and cased HxC revision C that uses SD cards.  But as my project went on, and it looked like I was going to design my own box, I looked at the more ‘kit’ versions.  And then I read about the Gotek floppy emulator.  This is a cheap Chinese device that will emulate a PC style floppy using a USB memory stick.  But the creator of the HxC has ported his firmware to the Gotek hardware, and you can buy the firmware upgrade for €10.  If you flash the firmware and add an i2c LCD display you get very close to the full HxC hardware for a fraction of the price.  I decided to go down that route.

It seems there are a number of models of Gotek emulators available, but I gather the main difference is the firmware, and we’re going to be overwriting that anyway.  The important thing is to get one with a 3-digit display, not a 2-digit display.  I ended up buying a “SFR1M44-U100K” from eBay for £14.99.

So here’s my new purchase. I’ve already dismantled it to see what I need to do to upgrade the firmware to do what I want:

Here I am trying to flash the boot loader to load the HxC software:

It kept failing at 49% of the way through.  Posts on the support forum with the same symptoms suggested it might be a cheap serial board which doesn’t correctly support full duplex.  I tried three times, every time the same symptoms.

But the third time I left it for a while while I read the forums.  When I tried the fourth time the software said I had already installed the firmware and refused to do it again without buying another licence.  I was about to email the creator to try to resolve this when I thought I’d just try booting up the emulator.  It worked!  I wonder if the hang on the second half was as it was trying to verify the image and it actually had installed?

Of course, an unverified firmware could be a worry.  But in this case it was just installing a boot-loader, to allow the full firmware to be loaded via USB.  So provided the boot loader was ok to load the real firmware, I reckoned we were fine.

Firmware installed! (No fancy LCD display yet, just the default Gotek 3 digit display.)

And a first test as a B drive on the Amstrad CPC 6128.  A disk image downloaded from the internet loaded off USB memory stick into a physical Amstrad   Plus extra files to test read/writing.

The next stage is to connect up a 16×2 LCD display, and solder on some extra interfaces to the Gotek board to do more advanced stuff:

Clockwise from top left:

  • 16 pin header on an LCD for the video converter
  • rotary encoder control for the video encoder
  • rotary encoder control for the USB floppy
  • USB floppy with red, yellow, blue additional header added for drive D selection, head step signal, and drive C selection (more on this later)
  • 16 pin header on an LCD with the i2c interface plugged in ready to connect it to the USB floppy

But not quite finished … I went to look at the docs to see which pins on the USB floppy connect to which pins on the LCD.  Apparently I need 5v into the LCD, which means soldering on a header to the 5v pin on the USB floppy.

And the i2c lines also need pull-up resistors – I’m presuming because the USB floppy is 3.3v and the i2c board is 5v? I think I’ll just solder them onto the back of the i2c interface board since it’ll only be used in this application:

So now my USB floppy emulator now has a lovely LCD display:

Top line is disk name, bottom line is technical details of tracks/sectors that it’s accessing.  None of this is my own work, I’m just following the instructions provided by the author of the firmware.  I did find that the second line of the display flickered a lot.  I searched the forums, and found that there was a random alpha release that resolved the problem.  It was only in the forum post though, not on the firmware download page!

Eventually the blue display will be replaced by a green one to give a retro look. But that will take a couple of months to arrive from China, so I bought a cheap blue one as a stop gap.

I did find a couple of irritations with my Gotek hardware/HxC firmware/Mac OS computer combination, which I set out to fix:

  1. This hardware apparently isn’t fast enough to sort the directory listings on the USB stick, so the files appear in a ‘random’ order (whatever order the FAT32 filesystem has stored them).
  2. “Hidden” files (starting with a dot) aren’t hidden – and my Mac likes to put loads of hidden files on any USB stick you plug in!  Having to scroll past them all was very irritating.
  3. My Mac tries to index any USB stick you plug in – and then refuses to allow you to eject it because a process (the indexing service) still has a file lock on the disk!

But software is my main thing (all this hardware dabbling is very new to me!) So I knocked up a software solution at the Mac end.

The FAT32 file sorting is a well known problem, mainly from older MP3 players, and car stereos. So there are a number of solutions for sorting FAT32 memory sticks. I found one for Mac OS: FATSort.  Having compiled it for Mac OS, I wrote a shell script to:

  • stop the indexing service
  • delete the hidden file crap
  • unmount (i.e. eject) the disk
  • sort the disk directory using fatsort

Here’s my “hxc_eject” script in action:

Currently I’ve hardcoded the USB stick I’m using.  I hope to make the script a bit more user-friendly, and then put it up on GitHub at the end of this project.  But in the meantime here’s a quick look at what it’s doing:

Next up, extending the Gotek/HxC combination to move it beyond its original design :-)