Just added the new formatting function to the FDC emulation. It now should be (theoretically) able to format the IMD tracks in a real way(changing the soft-sector format for said track).
There also was a little issue with the head selection on IMD tracks. It was assuming each track only existed once, with the head values being recorded on the head fields when using two heads. It's now corrected to actually search for a combination of the cylinder and head on the disk image, then start parsing the data within said track block(which is just for one head) when reading/writing the sectors on said head(instead of on said track in total(which included both heads)) and formatting being applied to the single head instead of the first track that appears at such an index. Also, said index was being parsed incorrectly: it would take the nth track in the disk image(which when using two heads would place the formatting/read/write operation on half of the track/head combination on a double sided disk (in effect taking the track number directly instead of the more correct (track*sides)+side approach, or even more wrongly addressed when the side number within a track wasn't in ascending order(when it uses track 0 side 0, track 0 side 1, track 1 side 0, track 1 side 1 etc.), which would mess up even more wrongly)).
Luckily I've found that out before trying to test it.
And because it can now (untested as of yet) format the tracks specified with the format command(current physical track as specified by the command and parameters and HD value), the TESTFDC utility should theoretically work.
Although the HD selection vs CHS distinction isn't applied yet currently.
Still, anyone can confirm the HD vs Head byte distinction on real hardware?
Edit: Just implemented the physical(HD) vs logical(Head) seperation in UniPCemu. So the trick said above with formatting a physical HD with a different sector ID(which has the HD reversed) should work now, both on reads, writes, Read ID(just reading on the HD-th head, ignoring Head of the sector ID) and format(which uses HD for selecting the proper track(top or bottom), then the Head in the sector ID to format a sector on the HD-th head with said Head value).
So that should make (theoretically) the TESTFDC utility an usable testsuite now?