Closed barbeque closed 5 years ago
Yes, add a handler to image/img.c similar to pc98fdi but hardcoded parameters rather than reading from a header struct. You can see what to pass in to mfm_open() based on what pc98fdi_open() does with your generated header. Then add your new handler to the list in image/image.c and you're done. No need to gate on host=pc98 as this file extension is unique.
Before I go and check the patch in, I realise you could probably have just renamed your HDM file to IMG, and specified host=pc98
in FF.CFG. ie this raw format is already supported! Could you try this please?
This would allow a smaller version of your patch in which pc98hdm_open
simply contains return _img_open(im, pc98_type);
EDIT: Or I note in the Wiki (https://github.com/keirf/FlashFloppy/wiki/Host-Platforms#nec-pc-98) that raw image files HDM/HDn/DDn need to be renamed to IMG as well as host=pc98
in FF.CFG and we drop the HDM extension support entirely.... it's a small patch to accept to the firmware though.
I just did this test (renaming HDM -> IMG, setting host=pc98) and it was successful. I'll update the firmware on my Gotek and test HDM.
edit: Works with the patch I just committed. 🎉
FF has FDI support for the PC98 right now, which works great, but there are a lot of BKDSK-style disk images in circulation (e.g. the Neo-Kobe set on archive.org). BKDSK seems to be an image dumper/writer that generates raw images, and the format is popular with emulators.
I managed to work out from reading Japanese PC98 enthusiast sites that BKDSK supports creating images in these "formats," identified by their extensions:
MS-DOS disk formats:
N88-BASIC disk formats:
I have only ever seen HDM format in circulation, however, so I wrote this conversion code: https://github.com/barbeque/pc98-disk-tools/blob/master/hdm_to_fdi.py
FDI is basically the HDM raw image, with a 4096-byte header glued onto the front of it.
It seems to work really well with the FlashFloppy firmware on my 9821AP2, but it would be nice if I didn't have to convert it myself.
I looked into adding it to the code myself a few months ago, but didn't get around to it and now I've forgotten exactly what to do. From what I can remember, the steps to adding this to FlashFloppy are:
pc98
mode),If I get some time soon, I will look into doing this myself again and stand up a WIP PR for comment. Thanks!