MiSTer Floppy

Floppy Drive Interface for the MiSTer FPGA


History of Development

Since getting real floppy drives working in WinUAE I'be been on a long mission to achieve the same with the Minimig core on the MiSTer FPGA!

My journey started in 2022 learning Verilog, the language that the Minimig core was written in. I'd never seen this language before, but with a strong background in electronics I got through the basics fairly quickly.

After figuring out the pin out for the User Port and understanding how it interfaced with the code I created my first prototype board. Of corse it didn't work, but it was a great learning curve. My biggest concern was frying the DE10-Nano board as they were becoming more and more expensive at this point...

I also created a moc interface using an Arduino to see if it was possible to control a full floppy drive with the small number of pins available on the user port, but that was a long time ago...


10th April 2022

I kept picking this project up and putting it down for quite a while, with some rather large time gaps between. During this time I revised my design for how the pins on the user port should work and redesigned several iterations of prototype PCBs and actually managed to get some basic booting, even fixing some of the disk implementations with how some of the registers in the Amiga were being implemented which made some copy protected games work.

I was mainly working on the thru-hole design at this point as it was very easy to manage, update and monitor. Writing wasn't working properly and there was a strange issue I later discovered when multiple drives were connected...


6th August 2023

There was quite a large time gap between working on this and moving onto the next stage. I'd had many many issues I was trying to understand, like the writing issue, which turned out to be related to when an ADF was streamed from disk, it missed out the MFM clock bits, not normally needed, but with real disks it is.

I also fixed some bugs in the I2C communication with the port expander that caused the device to mis-behave after a while under certain situations.

I hadn't at this point tested anything other than Kickstart 2.04, and when trying on 1.3 it failed to boot anything. This turned out to be to do with the way the Sync Word code worked in the Paula implementation, which isn't used by the operating system on Kickstart 1.3, but I still had it enabled.

I had also sent out six boards to do some beta testing, and whilst some of these worked flawlessly, some people were reporting problems. One in particular I couldn't understand until I asked them to post me their drive, and it turned out to be a strange issue with certain models under Kickstart 1.3, thankfully, easily patched in code.

This knocked my confidence, as there were still some intermittent issues I couldnt account for as it was working perfectly for me...


21st January 2024

The first rule with anything like this, is always check your Power Supply. I sent out another prototype to someone else and this proved very useful as they were getting some strange results. Turned out their board wasn't getting a full 5V from the MiSTer, getting only around 4.5v which caused all the logic ICs to misbehave. Fixing that helped. But it still wasn't stable.

Some floppy drives just draw far too much power, and the the MiSTer power supply can't always deliver, leaving the drive clicking strangely. So I changed the way the board was powered.

Originally, I had placed a little jumper on the board that switched the 5V supply for the board between the MiSTer and external. I changed this so the board was always powered by the MiSTer but the floppy drive supply could be switched. This had two advantages. Firstly, any noise generated from the floppy drive couldn't interfere with the MiSTer or the MiSTer floppy board, and secondly, it proved the circuit was actually working properly...

Now I was feeling more confident so I set about implementing SCP flux file support. This wasn't that hard, although streaming it to the core without using any additional memory proved quite tricky. The buffer that is normally used for ADF data was perfect, but I had to redirect its output. I created a virtual floppy drive inside the core that would simulate playing this flux data and fed the output into the code I used to read data from the floppy drive. After a lot of failures it finally worked!

Now it was time for IPF support. Originally I tried to use the IPF library from the MAME project, but it wasn't feature complete enough to allow even games like Lemming to load. So, instead, I turned to the official CAPSIMG library, and after figuring out how to compile it for the ARM part of the processor on the DE10-Nano, I started to implement this too. With SCP already working, this was fairly trivial, although due to licensing, you do have to manually copy this library to your MiSTer system.

Finally I had the job of tidying everything up. For the duration of this project I'd literally disabled the MT32-Pi support so I could use the User Port, but obviously that isn't a suitable solution. So I implemented a method where you could choose what the User Port was to be used for, and crazy enough, this will even hot swap! Took me a while to get it all working properly (and figuring out how to find something on the Amiga that actually played MIDI!)

Literally leading up to the week before release I made some very subtle changes that allowed the original Dunegon Master game to work properly too!

And that leads me to where we are right now. The Core and Menu code are up-to-date, but currently on my GitHub account. I'm not even sure if or how this would get merged into the official core, I guess I need to speak to some people nicely, but in the mean time, you can play with it all yourself...