NSI Hard Sector HxCFloppyEmulator bug(?)

HxC Floppy emulator support for all others computers...
Post Reply
ejona86
Posts: 3
Joined: Thu Aug 17, 2023 3:18 am

NSI Hard Sector HxCFloppyEmulator bug(?)

Post by ejona86 »

I'm aware of the Hard sector format thread, but I didn't want to necro it. I figure any results here could be posted back to it.

I think I found a small but important bug in HxCFloppyEmulator when converting Northstar NSI files to HFEv3 that lowers the reliability: the index is misaligned. Equivalently, there isn't enough sector preamble. I thought I would share in case it helps HxC.

When outputing HFEv3 from a (double density) NSI, HxCFloppyEmulator puts 12.5 data bytes (25 hfe bytes) between the index and start of the sector header. That's 400 µs of preamble. The Northstar Advantage Technical Manual says to use 33 data bytes when writing, which is 1ms (p 3-36, 3-37). The Northstar MDS-A-D Double Density manual says to have 32 bytes preamble (p 33). Most importantly, the Advantage manual says to wait 500 µs after the sector pulse when reading, plus 150 µs to sync the PLL.

I don't have a Northstar system, but I shared my findings and made a hacked nsi2hfe.py script. There have been two confirmations on Northstar Advantages using FlashFloppy that it is unreliable/broken with the HxCFloppyEmulator output but working with the nsi2hfe.py output. No confirmations with HxC yet.

NSI to HFE output; 8F is too close to the sector header:

Code: Select all

00000e20: 2222 2222 2222 2222 2222 2222 2222 2222  """"""""""""""""
00000e30: 2222 2222 2222 2222 2222 2222 2255 5555  """""""""""""UUU  # End of 153 bytes postamble 0x22
00000e40: 5555 5555 5555 5555 5555 5555 5555 5555  UUUUUUUUUUUUUUUU
00000e50: 5555 5555 5555 5555 5555 5555 5555 5555  UUUUUUUUUUUUUUUU
00000e60: 5555 5555 5555 5555 5555 8f55 5555 5555  UUUUUUUUUU.UUUUU  # 0x8f index op
00000e70: 5555 5555 5555 5555 5555 5555 5555 5555  UUUUUUUUUUUUUUUU
00000e80: 5555 5555 aaa2 5495 4aa5 8888 aaa8 4aa5  UUUU..T.J.....J.  # Sector header
Jeff
Site Admin
Posts: 8171
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: NSI Hard Sector HxCFloppyEmulator bug(?)

Post by Jeff »

Thanks for the report. Yes i can shift the indexes.
Can you share a working hfe image ?
ejona86
Posts: 3
Joined: Thu Aug 17, 2023 3:18 am

Re: NSI Hard Sector HxCFloppyEmulator bug(?)

Post by ejona86 »

I put a WORDSTAR.NSI and HFE at https://ejona.ersoft.org/files/floppy/for-jeff/ . I think this is the NSI that the second reproduction used. It was converted using nsi2hfe.py in the parent directory.
Jeff
Site Admin
Posts: 8171
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: NSI Hard Sector HxCFloppyEmulator bug(?)

Post by Jeff »

ejona86 wrote: Fri Aug 18, 2023 4:27 pm I put a WORDSTAR.NSI and HFE at https://ejona.ersoft.org/files/floppy/for-jeff/ . I think this is the NSI that the second reproduction used. It was converted using nsi2hfe.py in the parent directory.
Thanks.
About the indexes duration (~4mS) is it something from the specifications or is it something seen on the real hardware ?

EDIT : From these post it appears that 4mS seems better than the current index duration (2mS):
viewtopic.php?f=19&t=1777&start=75
So this is a second thing to fix.
Jeff
Site Admin
Posts: 8171
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: NSI Hard Sector HxCFloppyEmulator bug(?)

Post by Jeff »

So this is now fixed in this new version:

https://hxc2001.com/download/floppy_dri ... t_beta.zip

On point : it seems that all the sectors headers are the same in your HFE. The "Track-Sector" byte doesn't change. How is it possible ? Maybe the Northstar completely ignore the header data and just count the index pulses ?

See viewtopic.php?p=18134#p18134 for the format.
ejona86
Posts: 3
Joined: Thu Aug 17, 2023 3:18 am

Re: NSI Hard Sector HxCFloppyEmulator bug(?)

Post by ejona86 »

Jeff wrote: Fri Aug 18, 2023 9:14 pm About the indexes duration (~4mS) is it something from the specifications or is it something seen on the real hardware ?
I don't remember discussing the index duration at all. I did investigate some recordings, but FluxEngine only records the start of the index pulse, not the full duration. The testing should have been using an index time of 2ms, but I've also not seen anything that implied it would matter. 2 ms is quite a bit larger than "each byte of data" of 32 µs. For Northstar, the writing has to start within 500 µs of the index pulse, so anything larger than that seems unnecessary even without looking into the details. But that says nothing about Heathkit.
Jeff wrote: Sat Aug 19, 2023 12:16 pm On point : it seems that all the sectors headers are the same in your HFE. The "Track-Sector" byte doesn't change. How is it possible ? Maybe the Northstar completely ignore the header data and just count the index pulses ?

See viewtopic.php?p=18134#p18134 for the format.
That's actually part of the reason I dug into the recordings above. snhirsch posted that same info earlier in that "North Star / Disk Data Format / Horizon vs. Advantage" thread. But Mike claimed the Track-Sector byte is ignored. I couldn't find any reference to the Track-Head-Sector format as mentioned by snhirsch (and used by HxCFloppyEmulator). I did find the Northstar Advantage Technical Manual (p3-35) documented a simpler Track-Sector (4 bit:4 bit) format. The Northstar Micro-disk System MDS-A-D Double Density (p 33) just used 0xFB for the second byte. And when I looked at hharte's (few) recordings they had 0xFB as well. So I just did the simplest approach in my script.

In case you are interested in the SSSD format, I described its format. Ignore that nsi2hfe.py.txt though, as I don't recall if I made bug-fixes; I'd look instead at my most recent version.
EssaMattou
Posts: 2
Joined: Tue Oct 29, 2024 9:01 am

Re: NSI Hard Sector HxCFloppyEmulator bug(?)

Post by EssaMattou »

ejona86 wrote: Fri Aug 18, 2023 4:27 pm I put a WORDSTAR.NSI and HFE at https://ejona.ersoft.org/files/floppy/for-jeff/ . I think this is the NSI that the second reproduction used. It was converted using nsi2hfe.py in the parent directory.
Thank! It is very helpful.
EssaMattou
Posts: 2
Joined: Tue Oct 29, 2024 9:01 am

Re: NSI Hard Sector HxCFloppyEmulator bug(?)

Post by EssaMattou »

EssaMattou wrote: Tue Oct 29, 2024 9:09 am
ejona86 wrote: Fri Aug 18, 2023 4:27 pm I put a WORDSTAR.NSI and HFE at https://ejona.ersoft.org/files/floppy/for-jeff/Head Soccer . I think this is the NSI that the second reproduction used. It was converted using nsi2hfe.py in the parent directory.
Thank! It is very helpful.
Post Reply