5

Is there an official specification for .nib format disks for the Apple? I'm currently debugging through a CP/M boot disk for a Cirtech //e Z80 which works fine on real hardware but fails in an emulator.

I'm 99% certain that the disk has the first three tracks in ProDOS order with the rest of the system in CP/M order. My guess is the boot is in ProDOS order to support smartport devices (The first two boot sectors contain code for Disk II and ProDOS drivers), but the main CP/M area is in CP/M sector order on Disk II format disks for compatibility (for smartport I'd guess the compatibility doesn't matter as much).

CiderPress can read CPM3.SYS and that has the "correct" bytes from dumping memory on the real hard ware, but for some reason loading the .nib file in either mame or AppleWin results in a corrupted boot. The DRI CPMLDR fails after loading in the code with a crash and isn't putting the BIOS/BDOS code in the right places when running an emulator (it's in a mixed order)

I'd like to convert the NIB file into individual sectors with their headers so I'm looking for a specification for NIB file but I can't seem to find one. The NIB file was created by ADTPro.

Could someone either point me to a spec or confirm it's just a raw track of data bytes repeated 35 times.

2
  • This isn't a forum, so debugging this here is out of scope. Log an AppleWin issue and someone (maybe me) will have a look. Be sure to include or link to the NIB image. Sep 22, 2023 at 8:16
  • Yeah I was adding a bit of background as to why. I still have a long way to go on this project, but I may raise an issue (probably with a proposed PR) once I've figured out why it's not booting correctly.
    – PeterI
    Sep 22, 2023 at 11:21

2 Answers 2

4

There is no spec as such, except for the behaviour defined by what Saltine's Super Transcopy program does. (It's a great hack using the track read code from Essential Data Duplicator as mentioned here. See the "sst.readme" file for its history.)

As you guessed, the format is just the raw track data for each track. The NIB image size is usually 232960 bytes, which is 35 tracks of $1A00 nybbles each.

$1A00 should be long enough for any track. (See the 300rpm $1900 result in my answer here.)

But that fixed length buffer causes a potential problem, because although a nybble (AKA bit) copier tries to identify the length of a track, it might not succeed. The end of the track buffer might contain a partial copy of the start of the track, resulting in errors when using a NIB file.

1
  • Thanks for that, the SST readme covers enough of the background to make sense.
    – PeterI
    Sep 22, 2023 at 11:24
4

I've been generating documentation on various Apple II (and Macintosh) formats as part of the development of CiderPress II. The general layout of nibble data is described in this document, and the specifics of the .NIB format are explained in this document. In short, .NIB is 35 sets of 6656 8-bit bytes of track data, with no header or other data.

The ProDOS-vs-CP/M interleave issue is noted briefly in this document, so you can change your 99% to 100%. Only sector 0 matters to the disk hardware, so I'm not sure why this was done. This doesn't actually matter for image file conversion though; you just need to convert the physical sectors to DOS or ProDOS order, and then label the image as ".do" or ".po", so the emulator can reverse the process to recover the physical ordering.

The CiderPress II sector editor is still pre-alpha, but the latest release does allow the sector interleave to be set explicitly if you want to see the effects of changing it. It also has a disk verification function that will tell you if the nibble image has any bad sectors.

Both CiderPress and CiderPress II can convert .NIB to .DO/.PO. For CiderPress you would use Tools > Disk Image Converter. For a standard 16-sector disk you shouldn't lose any useful information.

1
  • 1
    The block editor on the new version helps here, clearly shows the first three tracks are in ProDOS order, with the later tracks in CP/M order. Very helpful, thank you
    – PeterI
    Sep 23, 2023 at 14:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .