shortname: 'N88-BASIC'
comment: 'PC8800/PC98 5.25" 77-track 26-sector DSHD'
read_support_status: UNICORN
write_support_status: UNICORN

documentation:
<<<
The N88-BASIC disk format is the one used by the operating system of the same
name for the Japanese PC8800 and PC98 computers. It is another IBM scheme
variant, and is very similar to some mixed-format CP/M disk formats, where
track 0 side 0 uses 128-byte single density sectors and the rest of the disk
uses 512-byte double density sectors. (The reason for this is that the PC8800
boot ROM could only read single density data.)
>>>

drive {
	high_density: true
}

image_reader {
	filename: "n88basic.img"
	type: IMAGETYPE_IMG
}

image_writer {
	filename: "n88basic.img"
	type: IMAGETYPE_IMG
}

layout {
	format_type: FORMATTYPE_80TRACK
	tracks: 77
	sides: 2
	layoutdata {
		sector_size: 256
		physical {
			start_sector: 1
			count: 26
		}
	}
	layoutdata {
		track: 0
		side: 0
		sector_size: 128
	}
}

encoder {
	ibm {
        trackdata {
			target_rotational_period_ms: 167
			target_clock_period_us: 2
            gap0: 0x36
            gap2: 22
            gap3: 0x36
            use_fm: false
            idam_byte: 0x5554
            dam_byte: 0x5545
            gap_fill_byte: 0x9254
		}
        trackdata {
            track: 0
            head: 0

            use_fm: true
            gap0: 0x10
            gap2: 0x09
            gap3: 0x10
            idam_byte: 0xf57e
            dam_byte: 0xf56f
            gap_fill_byte: 0xffff
		}
	}
}

decoder {
	ibm {}
}


