production

HxC Manager V5.0

Credits

  • Code — NoRecess
  • Original code — Jean-François Del Nero

Credits as they appear in the release.

HxC Floppy Emulator’s quick over-view from official website :

HxC Floppy Emulator (Rev. C)

The aim of this project is to replace the floppy disk drive by an electronic device emulating the floppy disk drive.

Since the beginning of the project (2006), the HxC Floppy emulators were designed to be very versatile and to support a large variety of computers / keyboards / samplers / CNC machines at a low cost. Thanks to its versability the HxC Floppy Emulator supports most existing floppy formats. Today the HxC Floppy Emulator is a well established floppy disk drive replacement solution present into the Retro-Computing domain, the Music domain and the Industrial domain.

HxC Floppy Emulator Manager V5.0

hxc manager v5 list
HxC Manager V5.0: next to each file, the slot that holds it

This program is designed to run on Amstrad CPC/Plus computers. Its main purpose is to select disc images to be used by the HxC Floppy Emulator. It is also compatible with the Gotek drives running the FlashFloppy firmware.

This fifth major version is once again a complete rewrite. The most noticeable improvements are:

  • 100% Z80 assembly: there is no C code left (no more SDCC). The whole manager fits in a 12 KB ROM.
  • New FAT32 driver: the FAT File IO Library (11 KB of compiled C) is replaced by minifat, a FAT32 driver written for the manager in 1.5 KB of Z80. Folder names of any length, at any depth.
  • A ROM version that respects the system: it runs from the ROM itself and only borrows a 4.6 KB workspace, which it gives back. The BASIC program in memory and its variables survive |HXC, even when it is called from inside a running program, and you are back to BASIC without a reset, with the screen mode, inks, border, keyboard repeat and DOS settings as they were. The ROM reserves no memory at power on.
  • Much faster: a whole session keeps the CPC 3 times less busy than before. Starting and leaving take about 2.5 seconds less each, text is drawn 40% quicker, and the list is redrawn from memory instead of being read from the card again.
  • Automatic switch to DFA: or DFB: under UniDOS: when the active drive is not on a floppy drive (SD:, UMS:, PI:…), the manager puts it on the HxC/Gotek it found when leaving, so that CAT and RUN" reach the image you have just chosen. AMSDOS works in any ROM slot.
  • Device found on drive A, then on drive B; when none answers, a plain message lets you try again (R) or go back to BASIC (ESC).
  • A real slot editor (S): move, swap, insert, clear, undo, empty all. The file list shows which slot holds each file, and a * in the top bar shows unsaved changes.
  • Device settings (O): beeps, display backlight, standby, LCD scroll speed, reload of the last image at power up.
  • A default HXCSDFE.CFG is created, after asking, on a card that has none (a fresh Gotek key).
  • Many bugs fixed, some of them serious: memory corruption with more than 21 slots, a crash in folders of more than about 620 entries, writes landing on the wrong sector of the card after a failed command, folders with long names that could not be opened, long file names that disappeared from the list… The full list is in the changelog below.
hxc manager v5 help
The help page shows the firmware, the drive used and every key

To use the software, launch it with RUN”HXC” (disc version) or |HXC (ROM version). The manager looks for the HxC Floppy Emulator/Gotek device on drive A, then on drive B (|HXC,0 and |HXC,1 force drive A or drive B). If no device is found, please refer to official documentation reference (suggestion: have a look on jumper settings). When a device is found, the root directory of the FAT32-formatted storage (SD card, USB key…) is listed; FAT16 and exFAT cards are refused with a message.

Once the device is detected, the user can navigate and edit slots through the folders by using the following keys:

  • Up/Down/Left/Right: navigate through folders (Left/Right also change page)
  • Shift+Up/Shift+Down: previous/next page
  • Ctrl+Up/Ctrl+Down: first/last entry of the folder
  • DEL: go back to parent directory (the cursor comes back on the folder you came from)
  • CLR: go to root folder
  • C: clear current slot
  • U: undo the last clear
  • Shift+Left/Shift+Right or Ctrl+Left/Ctrl+Right: select previous/next slot
  • Return/Enter/Copy/Space:
    • if the selection is a folder => it is entered and its content shown
    • if the selection is a file => the file is assigned to the current slot, and the next slot is selected
hxc manager v5 slots
The slot list has become a slot editor

Alternatively, there are also other keys available:

  • S: the slot editor. Shift+Up/Down move a slot, X on two slots swaps them, I inserts an empty slot, C clears, U undoes, E empties every slot, Return makes the slot under the cursor the current one
  • O (or B): the device settings: beeps on button presses and on disc access, display backlight, standby, LCD scroll speed, reload of the last image at power up
  • H: displays Help
  • ESC: quit. Y saves, N leaves without saving, ESC goes back to the manager. Saving is only asked when something changed

When saving, the drive is set to start on the last slot assigned (it follows that slot when the slot editor moves it); when nothing was assigned, on the slot it was already using. Empty slots between used ones are removed when saving, and the manager tells you so beforehand. A card holding more than 20 slots is shown but never written, so the other slots stay safe.

hxc manager v5 settings
The device settings, under the O key
hxc manager v5 unidos
With UniDOS, leaving the manager puts the active drive on the HxC/Gotek
Old photo of one of my CPC having a Ramcard and a HxC Floppy Emulator

With some dedicated hardware (X-MEM, M4, ULIfAC, USIFAC, Bryce’s MegaFlash, or even the original Ramcard…), it’s possible to extend original Amstrad CPC/Plus’s features with ROMs. ROMs are embedded programs that are always available into separate read-only memory locations. They can be accessed at (almost ;-) speed of light, directly from the BASIC prompt without any disc loading.

One of the nice feature of the manager is to be also available as a ROM version. Using such hardware, user can type |HXC at any time (instead of selecting AUTOBOOT.HFE disc image and typing RUN”HXC”). The ROM image is HXC50.ROM, on the AUTOBOOT.HFE disc image and on the HxC_Manager_V50.dsk image of the release. It needs about 4.6 KB of free BASIC memory for its workspace: when a program leaves less, |HXC says so and changes nothing (CLEAR or NEW frees memory). It works on the CPC 464, 664, 6128 and Plus.

Note on the file sorting unavailable in the manager:

There is a reason if the manager does not support alphabetical sorting: this would require first to completely parse a folder (could take minutes in worst cases), then sort all of its entries. This approach is not be adapted to a Z80 3Mhz-based computer with 64KB of RAM, that’s why unsorted paging has been applied instead (ordered by file write on the SDCard/USB storage).

A work-around for this is to sort the files directly on the SD Card/USB key. Such programs exist for all the operating systems, for example Debian Linux has the fatsort program for this purpose.

Finally, if you have issues with the device itself, please ask your question in the dedicated HxC Floppy Emulator’s forum. This also includes connection issues with the computer. If you experience issues with the manager, then feel free to contact me.

Changelog

Version 5.0:

100% assembly, a ROM respectful of the system

  • the whole manager is now Z80 assembly (no more C, no more SDCC): 12 KB of ROM for everything
  • the ROM version runs from the ROM itself: only a 4.6 KB workspace is borrowed in RAM, and given back. The BASIC program in memory, its variables and arrays survive |HXC, even called from inside a running program, on the CPC 464, 664, 6128 and Plus
  • no reset when leaving: back to BASIC with the screen mode, inks, border, keyboard repeat and DOS settings of before (disc parameters included, with AMSDOS and UniDOS)
  • the ROM reserves no memory at power on

Faster

  • a whole session (start, folder, pages, help, slots, save) keeps the CPC busy 3 times less (312 frames instead of 890, measured in the emulator on a fragmented card)
  • starting and leaving: about 2.5 s less each (3 ms steps instead of 10 ms to reach the Direct Access track, 200 ms motor delay instead of 700 ms)
  • text drawn 40% quicker; assigning or clearing a slot only redraws the slot numbers that changed
  • back from the help, the slots, the settings or a cancelled quit: the list is redrawn from memory, without reading the card
  • long names decoded 2.4 times quicker; fewer card accesses when saving and when going back to the parent folder

New

  • the HxC/Gotek is looked for on drive A, then on drive B; when none answers, a plain message offers to try again (R) or to go back to BASIC (ESC). |HXC,0 and |HXC,1 still force a drive
  • works with UniDOS and with AMSDOS in any ROM slot (the disc BIOS is found through KL FIND COMMAND)
  • UniDOS: when the active drive (A: or B:) is not on a floppy drive (SD:, UMS:, PI:…), leaving puts it on the HxC/Gotek found (DFA: or DFB:), with a line saying so
  • creates a default HXCSDFE.CFG when the card has none (fresh Gotek key), after asking
  • the slot list (S) became a slot editor: move (Shift+Up/Down), swap (X), insert (I), clear (C), undo (U), empty all (E)
  • U undoes the last slot clear
  • the file list shows, next to each file, the slot that holds it
  • device settings (O, B still works): beeps, display backlight, standby, LCD scroll speed, reload of the last image at power up
  • Shift+Up/Down: previous/next page; Ctrl+Up/Down: first/last entry
  • going back to the parent folder puts the cursor back on the folder you came from
  • the drive starts on the last slot assigned, and that slot is followed through the slot editor
  • when HXCSDFE.CFG cannot be written, the changes are kept (ESC then Y tries again)
  • |HXC with a wrong parameter shows how to use it instead of starting
  • quitting only asks to save when something changed; a * in the top bar shows unsaved changes
  • the help page shows the drive used and the full list of keys

Fixed

  • a failed LBA command made the next write land on another sector of the SD card
  • a card with more than 21 slots overflowed the slot table (memory corruption), and saving dropped every slot after the 20th: such a card is now shown but never written
  • HXCSDFE.CFG files of another format were read as V1.0 and rewritten
  • the selected slot was not clamped (memory corruption)
  • a folder with more than about 620 entries overwrote the program (crash)
  • folders whose name is longer than 16 characters could not be opened; a path longer than 128 characters corrupted the configuration in memory
  • file names longer than 65 characters lost their extension and disappeared from the list
  • macOS ._ files, hidden and system entries were listed; names such as game.hfe.bak were taken for HFE images
  • short (8.3) names are shown without their padding spaces
  • Up on the first entry left the folder; DEL at the root and empty folders left the list in a wrong state
  • HXCSDFE.CFG stayed open after a read/write error; writes did not follow a fragmented file
  • every ROM was re-initialised when the manager started
  • the help said “DSK only” for the HxC SD/Slim, which reads HFE only
  • C only worked in lower case; the ROM header said version 4.0
  • an error froze the computer, and the messages were internal codes
  • update_cnt was not incremented when saving
  • the screen colours depended on the inks set before starting

FAT32 driver

  • the FAT File IO Library (11 KB of code compiled by SDCC) is replaced by minifat, a FAT32 driver written for the manager (1.5 KB of Z80)
  • folders are opened by their first cluster instead of a path: folder names of any length, any depth
  • FAT16 and exFAT cards are refused with a clear message; cards without partition table still work
  • accented letters of long names are shown as the closest plain letter; short names written in lower case by Windows are shown in lower case
  • a damaged FAT cannot send the reads past the volume or loop for ever

Build

  • ./make.sh (macOS and Linux) replaces the C# / .NET + wine build: RASM is the only tool
  • automated tests (21 cases) in the CDS Amstrad Emulator harness, on host folders and real FAT32 card images, and a benchmark of a whole session
  • the ROM is now HXC50.ROM; the release zip also holds the DSK image and the changelog

Version 4.2:

  • CLR key added to move back to root folder while navigating
  • C key added to clear current slot (that was removed since version V3.0 and +)
  • ROM version can be launched with |HXC,0 or |HXC,1 to force physical drive 0 or 1
  • upgraded from SDCC 4.3 to SDCC 4.4

Version 4.1:

  • crash-fix + new keys for the Amstrad CPC 464 users: Shift+LEFT/RIGHT to select slot, COPY key to assign to current slot
  • upgraded from SDCC 4.2 to SDCC 4.3 (provides slightly better ASM code for faster FAT32 parsing)
  • does not assume anymore that AMSDOS ROM is at ROM 7

Version 4.0:

  • User can now edit up to 20 slots (previous version: 15 slots was the max.)
  • New UI, removed old “demomaker style” presentation, now displaying more files on screen (with longer filenames)
  • DEL key added to move back to parent folder while navigating
  • The manager now skips DSK files when using a HxC SD/Slim device
  • The Help page now reports the firmware version + build date of the Manager
  • Switched compilation to SDCC 4.2.0 (resulting better Z80 implementation)
  • Now compiled using RASM from roudoudou (previous version: Pasmo)
  • Now compressed using ZX0 packer (previous version: the good old Bitbuster)
  • Smaller binary (11KB) resulting a faster load from BASIC prompt (previous version: 16KB)

Version 3.0:

  • completely rewritten using Phactory IDE
  • compiled against latest SDCC 3.X (was 2.X)
  • new “demomaker-style” user interface (thanks Ced!)
  • added better support of HxC device (detection, release..)
  • returns to BASIC instead of resetting the machine

Version 2.4:

  • HxC Floppy Emulator device is now detected if configured as drive B:

Version 2.3:

  • faster launch
  • fixed bug dealing with spaces in directory names
  • new user interface using system font

Version 2.2:

  • fixed continuous reading (folders with 100+ files does not slowdown anymore)
  • added minor enhancements to user interface
  • fixed navigation problems
  • buzzer can now be deactivated
  • fixed garbage displayed on screen at startup

Version 2.0:

  • fast text output
  • new user interface

Version 1.0:

  • Initial revision. Thanks Jeff !!!!!!!!!!