Support Micropolis variations and prefer VGI extension

This commit is contained in:
Eric Anderson
2021-11-07 14:13:18 -08:00
parent ce5fcaf172
commit 3b95e56418
8 changed files with 249 additions and 21 deletions

View File

@@ -1,10 +1,11 @@
Disk: Micropolis
================
Micropolis MetaFloppy disks use MFM and hard sectors. They were 100 TPI and
stored 315k per side. Each of the 16 sectors contains 266 bytes of "user data,"
allowing 10 bytes of metadata for use by the operating system. Micropolis DOS
(MDOS) used the metadata bytes, but CP/M did not.
Micropolis MetaFloppy disks use MFM and hard sectors. Mod I was 48 TPI and
stored 143k per side. Mod II was 100 TPI and stored 315k per side. Each of the
16 sectors contains 266 bytes of "user data," allowing 10 bytes of metadata for
use by the operating system. Micropolis DOS (MDOS) used the metadata bytes, but
CP/M did not.
Some later systems were Micropolis-compatible and so were also 100 TPI, like
the Vector Graphic Dual-Mode Disk Controller which was paired with a Tandon
@@ -19,31 +20,56 @@ pinout as a 96tpi PC 5.25" drive. In use they should be identical.
Reading disks
-------------
Just do:
Based on your floppy drive, just do one of:
```
fluxengine read micropolis
fluxengine read micropolis143 # single-sided Mod I
fluxengine read micropolis287 # double-sided Mod I
fluxengine read micropolis315 # single-sided Mod II
fluxengine read micropolis630 # double-sided Mod II
```
You should end up with a `micropolis.img` which is 630784 bytes long (for a
normal DD disk). The image is written in CHS order, but HCS is generally used
by CP/M tools so the image needs to be post-processed. For only half-full disks
or single-sided disks, you can use `--heads 0` to read only one side of the
disk which works around the problem.
You should end up with a `micropolis.vgi` which is 198000, 396000, 338800, or
677600 bytes. Each sector in VGI consumes 275 bytes, to retain the full
information stored on disk.
It's also possible to output to IMG, which is more suitable for generic tooling
than emulation or preservation:
```
fluxengine read micropolis -c 0-34 --image_writer.img.tracks=35 -h 0 --image_writer.img.sides=1 # single-sided Mod I
fluxengine read micropolis -c 0-34 --image_writer.img.tracks=35 # double-sided Mod I
fluxengine read micropolis -h 0 --image_writer.img.sides=1 # single-sided Mod II
fluxengine read micropolis # double-sided Mod II
```
You should end up with a `micropolis.img` which is 143360, 286720, 315392, or
630784 bytes long. The image is written in CHS order, but HCS is generally used
by CP/M tools so double-sided disk images may need to be post-processed.
Half-full double-sided disks can be read as single-sided disks to work around
the problem.
The [CP/M BIOS](https://www.seasip.info/Cpm/bios.html) defined SELDSK, SETTRK,
and SETSEC, but no function to select the head/side. Double-sided floppies
could be represented as having either twice the number of sectors, for CHS, or
twice the number of tracks, HCS; the second side's tracks logically followed
the first side (e.g., tracks 77-153). Micropolis disks tended to be the latter.
twice the number of tracks, HCS; the second side's tracks in opposite order
logically followed the first side (e.g., tracks 77-153). Micropolis disks
tended to be the latter.
Writing disks
-------------
Just do:
Just do one of:
```
fluxengine write micropolis -i micropolis.img
fluxengine write micropolis143 # single-sided Mod I
fluxengine write micropolis287 # double-sided Mod I
fluxengine write micropolis315 # single-sided Mod II
fluxengine write micropolis630 # double-sided Mod II
fluxengine write micropolis -c 0-34 --image_reader.img.tracks=35 -h 0 --image_reader.img.sides=1 # single-sided Mod I
fluxengine write micropolis -c 0-34 --image_reader.img.tracks=35 # double-sided Mod I
fluxengine write micropolis -h 0 --image_reader.img.sides=1 # single-sided Mod II
fluxengine write micropolis # double-sided Mod II using IMG
```
Useful references

View File

@@ -50,6 +50,7 @@ void ImageReader::updateConfigForFilename(ImageReaderProto* proto, const std::st
{".img", [&]() { proto->mutable_img(); }},
{".st", [&]() { proto->mutable_img(); }},
{".nsi", [&]() { proto->mutable_nsi(); }},
{".vgi", [&]() { proto->mutable_img(); }},
};
for (const auto& it : formats)

View File

@@ -422,7 +422,10 @@ FORMATS="\
mac400 \
mac800 \
micropolis \
micropolis275 \
micropolis143 \
micropolis287 \
micropolis315 \
micropolis630 \
mx \
northstar175 \
northstar350 \

View File

@@ -1,4 +1,4 @@
comment: 'Micropolis MetaFloppy 630kB 5.25" DSDD hard-sectored'
comment: 'Micropolis MetaFloppy 630kB 5.25" DSDD hard-sectored IMG data-only'
flux_source {
drive {

View File

@@ -0,0 +1,63 @@
comment: 'Micropolis MetaFloppy Mod I 143kB 5.25" SSDD hard-sectored'
flux_source {
drive {
hard_sector_count: 16
}
}
flux_sink {
drive {
hard_sector_count: 16
}
}
image_reader {
filename: "micropolis.vgi"
img {
tracks: 35
sides: 1
trackdata {
sector_size: 275
sector_range {
start_sector: 0
sector_count: 16
}
}
}
}
image_writer {
filename: "micropolis.vgi"
img {
tracks: 35
trackdata {
sector_size: 275
sector_range {
start_sector: 0
sector_count: 16
}
}
}
}
encoder {
micropolis {}
}
decoder {
micropolis {
sector_output_size: 275
}
}
cylinders {
start: 0
end: 34
}
heads {
start: 0
end: 0
}

View File

@@ -0,0 +1,63 @@
comment: 'Micropolis MetaFloppy Mod I 287kB 5.25" DSDD hard-sectored'
flux_source {
drive {
hard_sector_count: 16
}
}
flux_sink {
drive {
hard_sector_count: 16
}
}
image_reader {
filename: "micropolis.vgi"
img {
tracks: 35
sides: 2
trackdata {
sector_size: 275
sector_range {
start_sector: 0
sector_count: 16
}
}
}
}
image_writer {
filename: "micropolis.vgi"
img {
tracks: 35
trackdata {
sector_size: 275
sector_range {
start_sector: 0
sector_count: 16
}
}
}
}
encoder {
micropolis {}
}
decoder {
micropolis {
sector_output_size: 275
}
}
cylinders {
start: 0
end: 34
}
heads {
start: 0
end: 1
}

View File

@@ -0,0 +1,63 @@
comment: 'Micropolis MetaFloppy Mod II 315kB 5.25" SSDD hard-sectored'
flux_source {
drive {
hard_sector_count: 16
}
}
flux_sink {
drive {
hard_sector_count: 16
}
}
image_reader {
filename: "micropolis.vgi"
img {
tracks: 77
sides: 1
trackdata {
sector_size: 275
sector_range {
start_sector: 0
sector_count: 16
}
}
}
}
image_writer {
filename: "micropolis.vgi"
img {
tracks: 77
trackdata {
sector_size: 275
sector_range {
start_sector: 0
sector_count: 16
}
}
}
}
encoder {
micropolis {}
}
decoder {
micropolis {
sector_output_size: 275
}
}
cylinders {
start: 0
end: 76
}
heads {
start: 0
end: 0
}

View File

@@ -1,4 +1,4 @@
comment: 'Micropolis MetaFloppy 630kB 5.25" DSDD hard-sectored'
comment: 'Micropolis MetaFloppy Mod II 630kB 5.25" DSDD hard-sectored'
flux_source {
drive {
@@ -13,7 +13,7 @@ flux_sink {
}
image_reader {
filename: "micropolis.img"
filename: "micropolis.vgi"
img {
tracks: 77
sides: 2
@@ -28,8 +28,17 @@ image_reader {
}
image_writer {
filename: "micropolis.img"
img {}
filename: "micropolis.vgi"
img {
tracks: 77
trackdata {
sector_size: 275
sector_range {
start_sector: 0
sector_count: 16
}
}
}
}
encoder {