GEM S2/S3 issues

VBuckle
Posts: 11
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle »

Its a cheep unbranded low profile...
Mini Micro Small USB 2.0 Flash Memory Stick Dat 4GB Pen Drive Storage Black
Item ID: 51004694

I ordered in a few as they seem to work and are low profile 4gb, and I could not see a reason for more than 4gb.
I will replace with SANDISK Ultra Fit USB 3.1 Memory Stick - 16 GB, Black

VBuckle
Posts: 11
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle »

Another feature request for the HxCFloppyEmulator software:

In MIOS-based GEM synths, there are two distinct types of FAT12 floppies supported:

One type is what I call a "foreign" disk (as I don't know the official name). These are regular FAT floppies, with nothing "special" anywhere. Such disks are limited and (at least in GEM S2/S3) can only have certain files loaded from in the regular UI, and cannot be saved to (by using the regular UI) at all.

The other type is a "work" disk, a disk that has been formatted by the UI and where all load/save operations from the regular UI all work.

Firstly, it would be nice to allow support to toggle the work disk in an image in HxCFloppyEmulator.

Basically, Generalmusic added a small extension to the FAT12 BPB for this.
They put their own data at offset 0x20 of the BPB (normally the DWORD number of sectors, should be unused on a floppy disk anyway AFAIK).

This data looks like this:

Code: Select all

/// Floppy disk layouts.
typedef enum {
	DISK_UNKFAT  , ///< Unknown floppy, tries to read as 720KB/1440KB/1600KB/1760KB FAT. Invalid in a DISK_MIOS_HEADER
	DISK_DOSDD   , ///< DOS floppy  :  720KB FAT
	DISK_DOSHD   , ///< DOS floppy  : 1440KB FAT
	DISK_S2S3    , ///< S2/S3 floppy: 1600KB FAT
	DISK_S2S3T4  , ///< S2/S3 floppy: 1760KB FAT (cannot be formatted via edit operations, but supported by disk module)
//	DISK_AKAI    , ///< AKAI floppy : 1600KB custom (custom FS, so invalid value for a DISK_MIOS_HEADER, which implies a FAT BPB, anyway)
	
	// aliases
	DISK_S2S3HD = DISK_S2S3
} FH_DISK_LAYOUT;

/// Floppy disk categories.
typedef enum {
	DISK_NONE,    ///< No disk, or unknown type. Invalid in a DISK_MIOS_HEADER
	DISK_FOREIGN, ///< "Foreign" (non-work) disk.
	DISK_WORK     ///< Work disk.
} FH_DISK_CAT;

typedef union {
	struct {
		u8 cat; ///< #FH_DISK_CAT
		u8 layout; ///< #FH_DISK_LAYOUT
	};	
	u16 val; ///< Raw value.
} FH_DISK_TYPE_LITTLE_ENDIAN;

typedef struct {
	u8 magic[2]; ///< Must be { 0x2f, 0xf2 }, if not, MIOS floppy driver will treat this disk as foreign.
	FH_DISK_TYPE_LITTLE_ENDIAN type; ///< Disk type.
} DISK_MIOS_HEADER;
In the BPB, type.layout must match the size of the disk image. The value chosen for the DISK_MIOS_HEADER magic actually has significance: 0x2f is the MIDI manufacturer ID of ELKA (which Generalmusic had acquired by this point).

The reason why Generalmusic makes this distinction between "foreign" and "work" disks is because work disks don't follow the FAT12 standard entirely; namely, names in directory entries can be either 8.3 or 10.1, and the only disallowed characters in a dir/filename on a work disk are .*?\ (however, thanks to a custom encoding, 0xc8 = allowed '*' and 0xc9 = allowed '.'; also, space is allowed; and / is not only allowed in a directory or file name, but is actually part of the default bank names on S2/S3, so lots of S2/S3 images have this) - at least when filenames are 8.3 they appear to follow the standard for disallowed characters in filenames.

So, it would be nice to have this in the Disk Browser.

On a S2/S3 floppy, at least everything in \SETUP\SOUNDS and \BANK? folders use 10.1. (yes, that is a glob wildcard; there can be up to 10 banks folders in the FS, the first one is BANKS, then BANK1 through BANK9).

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: GEM S2/S3 issues

Post by Jeff »

mmh this appears very specific. is there no software able to deal with this ?

VBuckle
Posts: 11
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle »

Not exactly.
We have written a 3rd party work around that is quite convoluted.
We use hxc software with above xml file to create the 1.76mb image, then you need to load our custom format tool to the gem s2/3 to format the said image.
When using a real floppy disk drive, this is fine and makes perfect sense, but was hoping if you added the format to work disk, in your software it would save all the messing around at the keyboard end.


The previously mentioned file name changes (10.1) have created issues when extracting files from a gem S2/3 image when using the hxc software. Basically the gem let's you use / in a file name and the hxc software cuts the file name off.

VBuckle
Posts: 11
Joined: Mon Apr 29, 2019 9:19 pm

Re: GEM S2/S3 issues

Post by VBuckle »

Could you please add the XML file from the first post to HxCFE software, for easier creation/conversion of 1.76MB HFE files?
We released our Floppy Disk Toolkit six months back and it would be very useful if the new work disk format was included in your next update.
Thanks...

Jeff
Site Admin
Posts: 8092
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: GEM S2/S3 issues

Post by Jeff »

But why ? The firmware directly support this format, why are you converting files ?

Post Reply