mame icon indicating copy to clipboard operation
mame copied to clipboard

bus/s100/vectordualmode.cpp: Added Micropolis MFM HDD support

Open ejona86 opened this issue 1 year ago • 6 comments

ejona86 avatar Feb 28 '23 06:02 ejona86

@galibert can you please check the formats and MFM hard disk changes on this PR?

cuavas avatar Mar 03 '23 16:03 cuavas

I think the intertwining of hd and floppy makes the code rather hard to follow though. Also, since hdd and floppy support are effectively two different devices (I mean, needing a soldering iron to switch is quite an hint), I'd probably like more a base class with everything that's common and two derived classes with device names and virtual methods to implement what isn't.

I suspect the sector placement is incorrect. All index hole maps I've seen of hard-sectored floppies have the main index in the middle between two sector indexes. So that would put them at 200m*(0.5+sectnum)/sectcount and not 200m*sectnum/sectcount. With the annoyance that the format needs to cope with the last sector going over the index.

Also, the sector placement code is not going to survive to my future changes to floppy.h to handle random variations in floppy rotation speed (needed for the ftl protection used in dungeon master and oids). Not a problem though, since I'll know it's there I'll fix it along the way.

galibert avatar Mar 10 '23 17:03 galibert

Also, since hdd and floppy support are effectively two different devices

A single device supports 1 HDD+3 FDD or 4 FDD, depending on the "jumpers." The only difference is whether "device 0" is FDD or HDD. So even though it is annoying to reconfigure, the device needs to simultaneously support HDD and FDD at runtime.

I mean, needing a soldering iron to switch is quite an hint

Yeah, a while ago I thought the same. But that is a pretty easy change for the S100 ecosystem, where users were commonly assembling boards and soldering to fix errata. As an example of soldering jumpers being common, see Micropolis's S100 controller manual, page 2-4/pdf page 32. (FWIW, that controller was the one used in Vector systems prior to the controller in this PR, and Vector's docs for the controller on page 6 instructs changing the jumpers to adjust to the Vector system in use.) For the Vector 4 itself, things like the 128 KB RAM expansion also required the same type of "jumper" changes. The expansion itself appears to have been easily inserted onto the motherboard, but you need to adjust "jumpers" to address it.

The Vector 4 (not this board alone) is a premium business-class product and I believe the approach was that a Vector distributor/technician would do the modifications in the rarer cases they were necessary. I doubt this particular disk jumper was often changed for the Vector 4, as you wouldn't buy a system with a HDD to then not use the HDD.

I suspect the sector placement is incorrect. All index hole maps I've seen of hard-sectored floppies have the main index in the middle between two sector indexes.

I think that may be arguing semantics. I agree that the index hole is halfway between two sector holes. But the index hole has a different meaning and only signals that the next sector hole is the start of sector 0. It doesn't mean "this is the start of the track." Sector hole 0 does that. The nomenclature gets confusing for that reason, because it still signals where the start of the track is, but indirectly. The controller uses the sector pulses for timing, and the index pulse just resets a counter. Thus sector hole 0 is in the equivalent of the soft-sectored index hole. Treating sector 0 pulse as the start of track is the same approach I took with Fluxengine and FlashFloppy, and that I've seen taken with HxC HFEv3 hard-sector images.

ejona86 avatar Mar 11 '23 20:03 ejona86

Also, the sector placement code is not going to survive to my future changes to floppy.h to handle random variations in floppy rotation speed

@galibert, I think I could help with that with proper hard-sector IDX plumbing in the floppy subsystem. That would provide accurate machine emulation. I've prepared a follow-up to this PR to do so: https://github.com/ejona86/mame/compare/vector4-hdd...vector4-idx-handling . There's a few different ways to do it but I'm less concerned about that. The main thing is how few changes to floppy.cpp and floppyimg.cpp are needed, which makes it is easy to try alternatives. (I'm most doubtful of the create() method, myself.)

ejona86 avatar Mar 16 '23 06:03 ejona86

@galibert

simzy39 avatar Mar 26 '24 16:03 simzy39

@galibert

Stop that habit please. If you did this once per month, ok, but you do it too often At the least, say something when you post an @

happppp avatar Mar 26 '24 16:03 happppp