keirf / flashfloppy

Floppy drive emulator for Gotek hardware
Other
1.33k stars 193 forks source link

Support for Famicom Disk System? #332

Open philpem opened 4 years ago

philpem commented 4 years ago

I notice that Quickdisk support has been added to FlashFloppy. The Nintendo Famicom Disk System is based on QD and has a similar I/O interface.

What would be required to add .FDS image support to FlashFloppy?

keirf commented 4 years ago

You will need to add an image format codecs to src/image folder and link it into the QD build.

philpem commented 4 years ago

Adding some useful references for this...

keirf commented 4 years ago

I can't see that this would be too super tricky. The fact that FDS contains multiple disks/sides which should presumably be user-selectable presents a possible need for UI modification.

The actual framing up of blocks into the QD track looks pretty simple. None of the referenced OSS is very complex, in doing this job.

It needs someone motivated and with hardware to test against :)

chris-jh commented 3 years ago

I have a spare Sharp Twin Famicom if you want to borrow it @keirf.

keirf commented 1 year ago

Pretty sure this is fixed now by the longstanding QD support added to FlashFloppy.

philpem commented 1 year ago

Pretty sure this is fixed now by the longstanding QD support added to FlashFloppy.

Going by the documentation, only the QD image format is supported. So a tool would be needed to convert from FDS to QD -- and possibly multiple QD files, as a single FDS file may contain multiple disks.

There's an image converter for various FDS formats here: https://forums.nesdev.org/viewtopic.php?f=2&t=15895&start=15

I haven't been able to find a spec for the QD file format, but the loader code is here: https://github.com/keirf/flashfloppy/blob/master/src/image/qd.c

It looks fairly simple, but I'm not sure what the read/write window start and end are intended for, or what they'd need to be set to.

keirf commented 1 year ago

QD is a raw container format like HFE. The whole raw bitstream gets played out, but READY is only asserted in the window between start and end. You would want to place the FDS file data within that window. I don't know whether FDS or the binaries produced by the conversion software you linked to also encode the bitstream to MFM (or FM, or whatever Famicom uses). If it does, you could basically plonk the binary into the middle of a QD container.

What do you think?

keirf commented 1 year ago

By the way a blank QD is shipped with FlashFloppy and this is generated by a Python script in the FlashFloppy source tree. So you can see a typical construction with typical window bounds.