Présentation

Hardware

Programmation

Liens

Divers

Contact

A Universal Floppy Disk Drive Emulator

Last Update : 23/01/2010

Introduction:

For those who as me began the computing with legendary computers as Atari ST or Amiga and still possessing one, they sometimes organize some moments of nostalgias by viewing some demos or by playing some old video games. However these computers being based on 3"1/2 floppy disk of 720KB, it is mostly necessary to prepare these disks from a PC. And it's a real pain: you have to find a floppy disk in good condition, to format it with DOS using a makedisk (because it doesn't work with Windows) from an floppy disk image, etc. After some long minutes of preparation, we boot up the Atari ST with this floppy disk and then we realize that the floppy disk lost some sectors and is unusable... This phenomenon often occurs because in a lot of cases the floppy disk drive of the computer is tired.

Regarding Amiga floppy disks, it's impossible to create them from a PC because their format is totally incompatible with the PC controllers.
Anyway the tiredness of the floppy disk drive, the decline of floppy disks and their close disappearance required a fall-back solution to be able to use our dear computers in the future...

The aim of this project is to replace the floppy disk drive by an electronic device emulating the floppy disk drive.
At this day there are two differents floppy disk drive emulator:

- A USB version which allows to connect the floppy disk drive interface of the computer to a PC via a USB cable.
For more information on this interface, go to "USB HxC Floppy Drive Emulator" part.

- A SDCARD version which allows to emulate floppy disks which images are stored in a SDCARD.
For more information on this interface, go to "SDCARD HxC Floppy Drive Emulator" part.

In the table below, you can find the list of supported hardware/floppy file images:

Supported Computer/Hardware
Supported File Formats Notes

Atari ST
(STE/STF/Falcon...)

*.ST 9,10,11 and 18 (1.44MB) sectors/track format supported.
*.MSA  
*.STX / Pasti

Warning : Alpha version/unstable.

"Non images" files.

The HxC Floppy Emulator software allows to create an virtual FAT12 (Atari ST/ MS DOS) floppy disk containing files present in a PC folder.

Amiga
(500/600/1000/1200...)

*.ADF  
*.ADZ Based on the zlib.
*.DMS Based on xdms.
*.IPF/Caps 26/03/2008 > New software and CPLD core -> Full support of protected floppies image. Variable bitrate and flakeys bits protection are now supported.
"Non images" files.

The HxC Floppy Emulator software allows to create an virtual AmigaDOS floppy disk containing files present in a PC folder.

Amstrad CPC6128/CPC6128+
*.DSK  
*.DSK (extended)  

Synthétiser Korg DSS-1
Thanks to Tobias ;-)

*.DSK (CopyQM)  
Oric+MicroDisk
*.DSK

Oric & MicroDisc support tested at the Infoticaires 2008 convention party

PC
*.IMG 720kB and 1.44MB floppy image files supported

Super Wildcard DX-SWC3201
Thanks to Giants ;-)

*.SMC Create a MS-DOS FAT12 floppy disk containing the SMC Super NES / Super Famicon ROM file.

MSX2

*.DSK

Warning : The MSX2 computers often used a non-standard floppy connector pinout.
Before plugging the HxC Floppy Emulator please check that the pinout is compatible.

Sinclair ZX Spectrum +3

DSK and Extended DSK  
TRD (BetaDisk)
SCL (BetaDisk)

Thomson TO8D

*.SAP Based on Libsap.
*.FD

FD files can be loaded with the raw image loader (in the gui software) with these parameters :
MFM-256bytes/sector or FM-128bytes/sector, 16 sectors/tracks, 2 or 1 sides.

PC88

*.D88  
x68000
*.HDM 360RPM, 500Kb/s, 8 1024Bytes sectors, 2 sides, 77 tracks floppy format.
*.XDF
TI99/4A
TI99 PC99 MFM & FM tracks supported.
IMD file format *.IMD

ImageDisk File format
Note: supported modes: MFM & FM.

MFM file format *.MFM Internal format of the software: contains encoded tracks.
HFE file format *.HFE File format used by the SDCard HxC Floppy Emulator
VTR file format *.VTR File format used by the VTrucco Floppy Emulator (variant of the SDCard HxC Floppy Emulator)

To download the software please go to the software section.

 

Here are the main features of the USB HxC Floppy Emulator:

Hardware specification:

- Read only Floppy emulator (SD,DD,HD & ED mode)
- USB 1.1 device interface (based on the FTDI FT245.).
- MFM, FM and GCR compatible (can handle custom encoding).
- Bitrate between 63Kbits/s and 1MBits/s.(250 differents bitrates by step of 62.5ns).
- Variable bitrate, flakey bits and long tracks, custom tracks support (emulating of copy protected floppies).
- Can emulate floppies up to 128 tracks.
- "jumper free" Design : Device configuration on the software.
- Flexible Floppy Interface: Shugart, IBM PC and Amiga compatible.

To see the list of computer tested with it, please go to this List

click here for pictures and videos.

Fonctionnement de l'émulateur USB:

Le fonctionnement de l'émulateur est relativement simple :

Le PC transforme les données utiles présentent dans fichier image d'une disquette (*.ST,*.MSA,*.ADF,...) en données compréhensibles par le contrôleur de la machine cible : Les données brutes présentent dans l'image sont encodées pour créer une copie physique de la disquette. Une fois l'ensemble des pistes de la disquette encodé, celles-ci sont envoyées directement par l'USB. La gestion des transferts de données par paquet est faite de telle sorte que l'on puisse émuler n'importe quelle longueur de piste, vitesse de rotation et format de disquette et ceci en émulant le plus fidelement possible le comportement d'un véritable lecteur.

Pour ceux qui voudraient plus de détails techniques, la carte se compose d'un serialiseur et d'un générateur d'impulsions pour transmettre à la machine cible les données MFM encodées par le serveur. Le CPLD contrôle 8ko de SRAM. Cette mémoire est en fait un ring-buffer par lequel le flux MFM transite. Les données en provenance de l'USB sont stockées dans la SRAM, pour être lues en temps voulu par le générateur FM/MFM.
La carte possède un compteur qui est incrémenté ou décrémenté selon les signaux /STEP et /DIR de l'interface Floppy pour simuler le déplacement de la tête de lecture.

Tout les éléments permettant de monter son propre émulateur sont présents ci-dessous:

Un premier prototype de cet émulateur fonctionnant sur port parallèle a été développé à l'aide de bonnes vieilles portes logiques. Il s'est vite avéré que le nombre de composants nécessaires serait assez important et le routage serait un vrai supplice ;-). J'ai donc réorienté l'étude pour me baser sur un CPLD. Les fonctions de cette carte ont donc été écrites en VHDL. L'ensemble a été développé et testé sur un CPLD de 128 macrocells de la série MAX7000 (l'EPM7128S, compatible avec l'Atmel ATF1508AS).

Avertissement : Avec cette interface on branche 2 appareils électriques ensemble (le serveur et une machine cible). Ces appareils peuvent avoir un défaut de masse et ainsi présenter une tension importante qui peut endommager la carte, ainsi que les 2 appareils au moment des branchements.
Quelques précautions sont donc à prendre:

- Vérifier la présence de la terre sur vos appareils. Si l'un des appareils se trouve sans terre il est préférable de relier les masses des 2 appareils avec un fil avant de relier l'interface.

- Toujours éteindre votre machine cible (le ST ou l'Amiga ainsi que son moniteur) et débrancher l'USB de l'interface avant de brancher ou de débrancher l'interface de votre machine cible.

De manière générale il ne faut pas brancher/débrancher la nappe floppy si l'USB est connecté.


Schematic of the USB HxC Floppy Emulator:

Le CPLD de la carte:

Voici le bitstream à envoyer dans le CPLD EPM7128S. Quartus II et une sonde JTAG compatible Altera (par exemple la sonde ByteBlaster) sont nécésssaires pour programmer le chip. La sonde ByteBlaster peut facilement être construite. Il est également possible de brancher le port parrallel du PC directement sur le CPLD pour le programmer. Le programmateur peut être téléchargé sur le site d'Altera. Pour ceux voulant aller plus loin (devellopement,etc), Quartus II Web edition peut être téléchargé gratuitement sur le site d'altera.
Note : le CPLD EPM7128S peut être directement remplacé par l'Atmel ATF1508AS.

Une fois programmé le CPLD aura le brochage ci-contre ->

Quatre LEDs sont présentes sur la carte, chacune ayant une signification particulière:

D1 : Power LED
D2 : Select LED : Indique la sélection du lecteur par la machine cible.
D3 : Step LED : Indique un changement de piste.
D4 : Link LED : Indication de communication entre la carte et le PC.

Pour ceux voulant utiliser un autre hardware (une carte d'évaluation FPGA, un autre CPLD ou encore un FPGA) les sources VHDL sont disponibles ici:

Sources VHDL : HxCFloppyEmulator_ipcore.zip

Montage de la carte :

click here to download

Il existe à l'heure actuelle 2 versions de PCB :

- Une version dite "homebrew" (Rev B), conçu dans un premier temps pour être facilement montable par un particuiler. Sa particularité est d'être simple face.

- Une version dite "de production" (Rev C), créee pour pouvoir réaliser des petites séries de PCB chez un professionnel. Cette version a pour particularité d'être en double face et d'avoir un routage d'aspect plus propre. Pour les personnes capables de faire du double face à la maison, ce PCB peut-être aussi fabriqué "à la homebrew". Je recommande personnellement celui-ci.

Au niveau fonctionnel les 2 pcb n'ont aucune différence.

L'ensemble du dossier de fabrication de la carte (revision B & C) peut-être téléchargé ici.

 

Note : The SDCARD HxC Floppy Emulator still in development, so all the below informations/specifications (schematic, pcb,...) can change without notice.

Here are the main features of the SDCard HxC Floppy Emulator:

Hardware/software specifications:

- 40Mhz PIC18F4525/PIC18F4620 based.

- Read/Write support:
Track mode based floppy emulator (Full track pre-encoded in the image file)
>Read support: Most of existing formats (FM/MFM/Amiga track...) supported. Custom tracks supported.
>Write support: ISO MFM 256/512/1024Bytes sector write supported.

- Floppy bitrate supported:
>250Kbits/s (DD floppies)
>500Kbits/s (HD floppies)
(others bitrates possible)

-RPM:
300 RPM , 360 RPM supported.
(others RPM possible).

-Tracks / Side:
>Up to 256 tracks per floppy.
>1 or 2 sides.

-SDCard support:
>SD Card up to 2GB.
>SDHC Card supported up to 32GB.
(10Mhz SPI bus mode. Average byterate: ~500KB/s)

- Filesystem :
>FAT32 supported

-Floppy interface:
>Shugart compatible mode supported.
>PC compatible mode supported.
Tested on PC, Atari ST, Amiga, Amstrad CPC, Thomson, MSX ,ZX Spectrum series computers.

- User Interface:
>3 buttons ("Up","Select/Eject","Down")
> 2*16 chars Alphanumerical LCD

-Additionnal features:
>Firmware update via the SDCard.
>Last Loaded Floppy Image autostart at power up.
>Fast floppy image loading (<1second).

 

click here for pictures and videos

Fonctionnement de l'émulateur SDCARD:

Le fonctionnement de l'émulateur SDCard est relativement simple :

La SDCard contient les images des disquettes pré-encodées et directement compréhensibles par le controlleur de la machine cible.

Le PC transforme les données utiles présentent dans fichier image d'une disquette (*.ST,*.MSA,*.ADF,...) en données compréhensibles par le contrôleur de la machine cible : Les données brutes présentent dans l'image sont encodées pour créer une copie physique de la disquette. Une fois l'ensemble des pistes de la disquette encodé, celles-ci sont directement enregistrées sur la SDCARD.

La carte se contente ensuite de relire les tracks pré-encodées a partir de la SDCARD et de les sérialiser vers l'interface floppy. L'implémentation matériel/logiciel à été étudier pour garantir un flux MFM continu, enfin de garantir une compatibilité logiciel maximum, comme dans la cas de la version USB.

Schematic of the SDCard HxC FLoppy Emulator :

 

SDCard HxC Floppy Emulator PCB Layout / Bill of material:

All informations needed to build a prototype SDCard HxC Floppy Emulator can be found in this file.

 

Firmware:

The latest PIC firmware binary can be donwloaded here : HxCFloppyEmulator_Soft_PIC.zip
If you don't have the official Microchip programmer, you can use WinPic with an home made programmer (JDM for example)

20/12/2009: Firmware SD HxCFloppyEmulator v0.2.2.0
- Another write bug corrected.
- Power consumption enhancement : Idle mode in the main loop.

17/11/2009: Firmware SD HxCFloppyEmulator v0.2.1.0
- New track position display format :"aa T:ppp/ttt S:s" aa->current access type, ppp->current track number,ttt->number of track, s->current side.
- a bug around the hot sdcard swapping feature corrected.

15/11/2009: Firmware SD HxCFloppyEmulator v0.2.0.0
- LCD Backlight control on RB5 added.
- Doze mode added. (actived after 5 seconds without access).
- FAT32 browser bugs corrected (folders name / scroller).
- UPD file format enhanced. (Note: bootloader replacement needed!)

28/10/2009: Firmware SD HxCFloppyEmulator v0.1.1.0
- Hot SDCard swapping (works but not very recommended).
- Write protect switch : without SDCard in the emulator press select to change the write protect state.
- Fast floppy change: press up/down buttons to change the floppy without ejecting the loaded floppy.

27/10/2009: Firmware SD HxCFloppyEmulator v0.1.0.0
New bootstrap added - update procedure enhanced ! :
- New bootstrap allowing to upgrade the firmware with an SDCard :

-> Copy the new firmware file (*.upd) to a freshly formated FAT32 SDCard.
-> Insert the SDCard into the emulator.
-> Press Up and Down buttons at power up.
-> Wait some seconds .... its done !

03/10/2009: Firmware SD HxCFloppyEmulator v0.0.6.0
Some bugs corrected ! - update highly recommended to fix write related bugs ! :
- "write sector dropped" bug corrected.
- 1KB sector write support corrected.
- 500kbits write mode buffer overflow protection added (protection against track format).
- Interface mode setting (amiga/shugart) bug corrected.
- 256/512/1024bytes sectors write is now functionnal in 250kbits/s and 500kbits/s mode.

20/09/2009: Firmware SD HxCFloppyEmulator v0.0.5.1
- 1KB sector write support added. (to be tested)
- Autoload feature added: At power up the lastest floppy emulator state is restored.
The floppy image loaded during a power down will be reloaded at power up.
To activate this feature you must copy HXCSDFE.CFG at the root of the SDCard.
- UI : version code at startup

09/08/2009: Firmware SD HxCFloppyEmulator v0.0.4.4
-MSSP PIC18F4525/4620 Rev. A4 Silicon Errata applied.
-SPI code optimized

26/04/2009: Firmware SD HxCFloppyEmulator v0.0.4.3
-Write support : MFM encoder bug corrected, GAP3 first byte encoding (WD1793)

18/04/2009: Firmware SD HxCFloppyEmulator v0.0.4.2
-Faster write routines
-500kb/s write support (warning alpha version/unstable)

21/03/2009: Firmware SD HxCFloppyEmulator v0.0.4.1
-256bytes-sector write support added

15/03/2009: Firmware SD HxCFloppyEmulator v0.0.4.0
-Write support added :
Warning: the only sector format supported by the write feature is 250kbits/s MFM (DD) 512bytes sector.
Tested with PC and Atari ST. Should work with any computer using this common format (CPC, ZX SPECTRUM, MSX ,etc).
-Some code optimizations : table driven crc7 generator and faster MFM handler.

11/12/2008: Firmware SD HxCFloppyEmulator v0.0.3.0
-SDHC SDcard support (up to 32GB - tested with 8GB SDHC Card)

14/10/2008: Firmware SD HxCFloppyEmulator v0.0.2.0
-(beta version): Sub-folders support.
Bug in Sdcard routines corrected. LCD routines rewritten.
SDcard change support.

21/02/2008: Firmware SD HxCFloppyEmulator v0.0.1.0
-First public version (alpha version):
Support Amiga, Atari ST and Amstrad CPC series computers.
FAT32 only

 

This software act as the floppy server with the USB HxC Floppy Emulator.
This program also allow you to convert floppy image files for the SDCard based HxC Floppy Emulator.
Supports many input floppy image file formats: List of the supported floppy image formats.

Notes:
- Works on Windows 98 / 2000 / XP / Vista / Seven.
- The USB HxC Floppy Emulator support is based on the FTDI D2XX Direct Drivers.
If you have the USB HxC Floppy Emulator you must install this driver.

The lastest software sources codes can be donwloaded here : HxC_Floppy_Emulator_soft_src.zip

23/01/2010: HxCFloppyEmulator 1.3.7.0
-> New files Support : Ensoniq EDE file support.

22/01/2010: HxCFloppyEmulator 1.3.6.0
-> New files support : Apricot APRIDISK file support.
-> "Load RAW Image" : New "Sector ID start" parameter (ensoniq eps support).

20/12/2009: HxCFloppyEmulator 1.3.5.0
-> "Create FS FLoppy": New floppy format : "Big" HD floppy (FAT12 - 127tracks, 26 Sectors, 2 sides, 500kbits/s)
-> "Create FS FLoppy": 1.68MB format Bug corrected.
-> "FAT12 Floppy": Empty sector filled with 0xE6.
-> RAW sector Extractor: AmigaDOS sector format support added.

28/11/2009: HxCFloppyEmulator 1.3.4.0
-> New files Support : TI99 PC99 file support (MFM and FM mode).
-> "Create FS FLoppy": New floppy format : 902KB Atari ST floppy (FAT12 - 82tracks, 11 Sectors, 2 sides)
-> "Load RAW Image" : FM track format bug corrected.
-> raw_file_writer : FM track sector extraction added.

07/11/2009: HxCFloppyEmulator 1.3.3.0
-> New files Support : *.HDM and *.XDF (x68000: 360RPM,500Kb/s,8 1024Bytes sectors, 2 sides,77 tracks).

01/11/2009: HxCFloppyEmulator 1.3.2.0
-> IPF Loader: Index signal generation improved.
-> USB HxC Floppy Emulator :
-Variable bitrate emulation improved.
-Up to 4 USB Floppy Emulator can be used in the same time now.
-> New file Support : D88 file format (PC88 floppy disks).

27/09/2009: HxCFloppyEmulator 1.3.1.1
-> GUI: Manual Interface mode behavior corrected.
-> SMC loader : Super UFO & Super Pro Fighter file support added.

20/09/2009: HxCFloppyEmulator 1.3.1.0
-> GUI: Drag&drop converting possible on the "Batch converting" window (you just need to select the target directory before)
-> SMC loader : file type detection modified: read the file header. SMD file support added. SMD/SMC part file support.
-> File system creation : 1.68MB ms dos floppy added.

08/08/2009: HxCFloppyEmulator 1.3.0.0
-> Windows GUI redesigned.
-> Windows GUI: Batch conversion tool added.
-> Memory leak corrected in the iso/ibm track builder.
-> file Handle leak corrected.
-> VTrucco file format (*.VTR) support added (read & write) (variant of the SDCard HxC Floppy Emulator hardware).

19/07/2009: HxCFloppyEmulator 1.2.1.1
-> HFE file Writer/loader : bits reversing code optimisation.
-> Index generation : for all file format based on ISO track, the index signal timing was changed (duration of 2.5ms before the first sector)
-> USB HxC Floppy Emulator : a bug was corrected regarding the index signal generation.
-> USB HxC Floppy Emulator : interface settings now take effect even if no floppy disk are loaded.
-> GPL license text added in the about dialog box.

12/07/2009: HxCFloppyEmulator 1.2.1.0
-> New feature : new custom RAW floppy format loader GUI.
-> New file Support : SAP (Thomson TO8) file image support (need beta tester).
-> New file Support : JV1 (TRS-80 Model 1) file image support (need beta tester).
-> internal : binary to MFM encoder speedup (MFM converter fully rewritten).

18/05/2009: HxCFloppyEmulator 1.2.0.13
-> FAT12 filesystem generator : file time&date added. fat BPB_Media code corrected. win95 boot sector.
-> Logs : Logs dialog box added.
-> New functionality : MFM ISO Sector data extractor (Menu disk -> Write IMG file).

20/03/2009: HxCFloppyEmulator 1.2.0.12
-> New file Support : ZX Spectrum BetaDisk TRD file format.
-> New file Support : ZX Spectrum BetaDisk SCL file format.

For past release notes please read this file : hxcfloppyemulator_soft_release_notes.txt

 

How to load a floppy disk image ? :

- Fisrt method :

To load a floppy disk image, a simple drag & drop of the file over the HxC Floppy Emulalor window is enough.

The software use the plugin able to load the file image type used. The plugin extract all floppy datas and generate a true floppy disk track then start the emulating These operations take less than one second.

How to load a floppy disk image ? :

- Second method :

Under Windows you can associated your floppy image file type with the HxC Floppy Emulalor software.
This allows you to load a floppy disk image as fast as openning a text file by double-clicking on it.

The "Drive" menu are used to configure the interface:

The fisrt part allows you to choose the drive id of the emulator :

Line (ST/Amiga/CPC mode) Line (PC mode)
DS0 (Drive as A: / DF0) MOTEA (Motor A: command, do not use)
DS1 (Drive as B: / DF1) DRVSB (Drive as B:)
DS2

DRVSA (Drive as A:)

MTRON (Motors command, do not use) MOTEB (Motor B: command, do not use)

If you are using a twisted floppy cable, don't forget to select the "twisted cable" case.

Technical documentations:

For more information about Floppy disks here some interesting documents:

ST / IBM / ISO Format :

- The floppy user guide
- Un datasheet : USB 3.5" Micro Floppy Disk Drive (voir page 7-9)

Amiga Format :

- The .ADF (Amiga Disk File) format FAQ
- Les sources de WinUAE ;-)

 

Others Projects:

Semi-Virtual Diskette (SVD): Projet au principe de fonctionnement assez proche du HxCFloppyEmulator version USB mais cible les machines TRS-80, Heathkit, Apple ][ et TI99/4a.

Projet 1541-III : Solution permettant d'émuler un lecture de disquette 1541-II pour Commodore C64 à partir d'une SDCARD.

Projet 1541 Ultimate: Cette solution assure une excellente compatibitée grâce à son émulation complète du 1541.

Projet "MegaDrive" : Projet au principe de fonctionnement similaire au précédent, mais cette fois ci pour Amiga. Ce projet est en cours de développement. Pour plus d'information voir le forum d'Amiga.org

Projet SdiskEmul : Solution permettant d'émuler un lecture de disquette pour Atari/Amiga/CPC à partir d'une SDCARD. Cet emulateur affiche ses menus de contrôles sur l'écran de la machine.

Projet TFE (Tolga Floppy Emulator): Solution permettant d'émuler un lecture de disquette pour Amiga (d'autres machines sont prévues) à partir d'une SDCARD. Cet emulateur affiche ses menus de contrôles sur l'écran de la machine.

Videos / pictures:

All pictures / videos of the project can be found on this page!

Click here for pictures and videos of the project

(C) HxC2001 - jfdn