mirror of
				https://github.com/davidgiven/fluxengine.git
				synced 2025-10-24 11:11:02 -07:00 
			
		
		
		
	Compare commits
	
		
			6 Commits
		
	
	
		
			FluxEngine
			...
			FluxEngine
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 61ff48c005 | ||
|  | 5fc8a1e52a | ||
|  | df1ac74069 | ||
|  | 91f718bf38 | ||
|  | 46e987e393 | ||
|  | a59b4f7be7 | 
| @@ -35,4 +35,5 @@ fluxengine read adfs | ||||
| ``` | ||||
|  | ||||
| You should end up with an `adfs.img` of the appropriate size for your disk | ||||
| format. | ||||
| format. This is an alias for `fluxengine read ibm` with preconfigured | ||||
| parameters. | ||||
|   | ||||
| @@ -23,4 +23,5 @@ fluxengine read dfs | ||||
| ``` | ||||
|  | ||||
| You should end up with an `dfs.img` of the appropriate size for your disk | ||||
| format. | ||||
| format. This is an alias for `fluxengine read ibm` with preconfigured | ||||
| parameters. | ||||
|   | ||||
| @@ -23,7 +23,8 @@ fluxengine read ampro | ||||
| ``` | ||||
|  | ||||
| You should end up with an `ampro.img` which is 409600 or 819200 bytes long. | ||||
| You can pass this straight into [cpmtools](http://www.moria.de/~michael/cpmtools/): | ||||
| This is an alias for `fluxengine read ibm` with preconfigured parameters.  You | ||||
| can pass this straight into [cpmtools](http://www.moria.de/~michael/cpmtools/): | ||||
|  | ||||
| ``` | ||||
| $ cpmls -f ampdsdd ampro.img | ||||
|   | ||||
| @@ -14,7 +14,8 @@ Just do: | ||||
|     fluxengine read atarist | ||||
|  | ||||
| ...and you'll end up with an `atarist.st` file. The size of the disk image will | ||||
| vary depending on the format. | ||||
| vary depending on the format. This is an alias for `fluxengine read ibm` with | ||||
| preconfigured parameters. | ||||
|  | ||||
| Writing disks | ||||
| ------------- | ||||
| @@ -23,51 +24,39 @@ FluxEngine can also write Atari ST scheme disks. | ||||
|  | ||||
| The syntax is: | ||||
|  | ||||
|     fluxengine write atarist -i input.st <options> | ||||
|     fluxengine write ibm -i input.st <options> | ||||
|  | ||||
| The format of `input.st` will vary depending on the kind of disk you're writing, | ||||
| which is configured by the options. By default FluxEngine will write an 80 | ||||
| track, 9 sector, double-sided disk. If that doesn't match your target format you | ||||
| will need to pass some options. There are some presets, which you will almost | ||||
| certainly want to use if possible: | ||||
| The format of `input.st` will vary depending on the kind of disk you're | ||||
| writing, which is configured by the options.  You will almost certainly need to | ||||
| pass one of these: | ||||
|  | ||||
|   - `--st-preset-360`: a 360kB 3.5" disk, with 80 cylinders, | ||||
|   1 side, and 9 sectors per track. | ||||
|   - `--st-preset-370`: a 370kB 3.5" disk, with 82 cylinders, | ||||
|   1 side, and 9 sectors per track. | ||||
|   - `--st-preset-400`: a 400kB 3.5" disk, with 80 cylinders, | ||||
|   1 side, and 10 sectors per track. | ||||
|   - `--st-preset-410`: a 410kB 3.5" disk, with 82 cylinders, | ||||
|   1 side, and 10 sectors per track. | ||||
|   - `--st-preset-720`: a 720kB 3.5" disk, with 80 cylinders, | ||||
|   2 sides, and 9 sectors per track. | ||||
|   - `--st-preset-740`: a 740kB 3.5" disk, with 82 cylinders, | ||||
|   2 sides, and 9 sectors per track. | ||||
|   - `--st-preset-800`: a 800kB 3.5" disk, with 80 cylinders, | ||||
|   2 sides, and 10 sectors per track. | ||||
|   - `--st-preset-820`: a 820kB 3.5" disk, with 82 cylinders, | ||||
|   2 sides, and 10 sectors per track. | ||||
|   - `--ibm-preset-atarist-360`: a 360kB 3.5" disk, with 80 cylinders, 1 side, | ||||
| 	and 9 sectors per track. | ||||
|   - `--ibm-preset-atarist-370`: a 370kB 3.5" disk, with 82 cylinders, 1 side, | ||||
| 	and 9 sectors per track. | ||||
|   - `--ibm-preset-atarist-400`: a 400kB 3.5" disk, with 80 cylinders, 1 side, | ||||
| 	and 10 sectors per track. | ||||
|   - `--ibm-preset-atarist-410`: a 410kB 3.5" disk, with 82 cylinders, 1 side, | ||||
| 	and 10 sectors per track. | ||||
|   - `--ibm-preset-atarist-720`: a 720kB 3.5" disk, with 80 cylinders, 2 sides, | ||||
| 	and 9 sectors per track. | ||||
|   - `--ibm-preset-atarist-740`: a 740kB 3.5" disk, with 82 cylinders, 2 sides, | ||||
| 	and 9 sectors per track. | ||||
|   - `--ibm-preset-atarist-800`: a 800kB 3.5" disk, with 80 cylinders, 2 sides, | ||||
| 	and 10 sectors per track. | ||||
|   - `--ibm-preset-atarist-820`: a 820kB 3.5" disk, with 82 cylinders, 2 sides, | ||||
| 	and 10 sectors per track. | ||||
|  | ||||
| These options simply preset the output destination flag (`-d`) and the | ||||
| following, lower-level options. Note that options are processed left to right, | ||||
| so it's possible to use a preset and then change some settings. To see the | ||||
| values for a preset, simply append `--help`. | ||||
|   - `--st-sector-size=N`: the size of a sector, in bytes. Must be a power of | ||||
|   two. | ||||
|   - `--st-gap1-bytes=N`: the size of gap 1 in bytes (between the IAM record | ||||
|   and the first sector record). | ||||
|   - `--st-gap2-bytes=N`: the size of gap 2 in bytes (between each sector | ||||
|   record and the data record). | ||||
|   - `--st-gap3-bytes=N`: the size of gap 3 in bytes (between the data record | ||||
|   and the next sector record). | ||||
|   - `--st-sector-skew=0123...`: a string representing the order in which to | ||||
|   write sectors: each character represents on sector, with `0` being the | ||||
|   first. Sectors 10 and above are represented as letters from `A` up. | ||||
| See [the IBM format documentation](disk-ibm.md) for more information. | ||||
|  | ||||
|  | ||||
| Useful references | ||||
| ----------------- | ||||
|  | ||||
|   - [Atari ST Floppy Drive Hardware Information](https://info-coach.fr/atari/hardware/FD-Hard.php) by Jean Louis-Guerin | ||||
|   - [Atari ST Floppy Drive Hardware | ||||
| 	Information](https://info-coach.fr/atari/hardware/FD-Hard.php) by Jean | ||||
| 	Louis-Guerin | ||||
|  | ||||
|   - [Atari ST Floppy Drive Software Information](https://info-coach.fr/atari/software/FD-Soft.php) by Jean Louis-Guerin | ||||
|   - [Atari ST Floppy Drive Software | ||||
| 	Information](https://info-coach.fr/atari/software/FD-Soft.php) by Jean | ||||
| 	Louis-Guerin | ||||
|   | ||||
| @@ -25,8 +25,8 @@ quickly.) | ||||
|  | ||||
| A standard 1541 disk has 35 tracks of 17 to 21 sectors, each 256 bytes long. | ||||
|  | ||||
| Reading discs | ||||
| ------------- | ||||
| Reading 1541 disks | ||||
| ------------------ | ||||
|  | ||||
| Just do: | ||||
|  | ||||
| @@ -43,6 +43,24 @@ complicated due to the way the tracks are different sizes and the odd sector | ||||
| size, so you need the special D64 or LDBS output formats to represent them | ||||
| sensibly. Don't use IMG unless you know what you're doing. | ||||
|  | ||||
| Reading 1581 disks | ||||
| ------------------ | ||||
|  | ||||
| These are handled by the IBM reader. Just do: | ||||
|  | ||||
| ``` | ||||
| fluxengine read ibm | ||||
| ``` | ||||
|  | ||||
| Writing 1581 disks | ||||
| ------------------ | ||||
|  | ||||
| These are handled by the IBM writer. Just do: | ||||
|  | ||||
| ``` | ||||
| fluxengine write ibm --ibm-preset-cbm1581 -i file.img | ||||
| ``` | ||||
|  | ||||
| Useful references | ||||
| ----------------- | ||||
|  | ||||
|   | ||||
| @@ -61,7 +61,7 @@ public: | ||||
| 				break; | ||||
|  | ||||
| 			default: | ||||
| 				Error() << fmt::format("don't understant DiskCopy disks of type {}", encoding); | ||||
| 				Error() << fmt::format("don't understand DiskCopy disks of type {}", encoding); | ||||
| 		} | ||||
|  | ||||
| 		std::cout << "reading DiskCopy 4.2 image\n" | ||||
|   | ||||
| @@ -252,7 +252,6 @@ buildlibrary libfrontend.a \ | ||||
|     src/fe-testvoltages.cc \ | ||||
|     src/fe-upgradefluxfile.cc \ | ||||
|     src/fe-writeamiga.cc \ | ||||
|     src/fe-writeatarist.cc \ | ||||
|     src/fe-writebrother.cc \ | ||||
|     src/fe-writeibm.cc \ | ||||
|     src/fe-writemac.cc \ | ||||
|   | ||||
| @@ -1,29 +1,13 @@ | ||||
| #include "globals.h" | ||||
| #include "flags.h" | ||||
| #include "reader.h" | ||||
| #include "fluxmap.h" | ||||
| #include "decoders/decoders.h" | ||||
| #include "sector.h" | ||||
| #include "sectorset.h" | ||||
| #include "record.h" | ||||
| #include "ibm/ibm.h" | ||||
| #include "fmt/format.h" | ||||
|  | ||||
| static FlagGroup flags { &readerFlags }; | ||||
|  | ||||
| static IntFlag sectorIdBase( | ||||
| 	{ "--sector-id-base" }, | ||||
| 	"Sector ID of the first sector.", | ||||
| 	0); | ||||
| #include "readibm.h" | ||||
|  | ||||
| int mainReadADFS(int argc, const char* argv[]) | ||||
| { | ||||
| 	setReaderDefaultSource(":t=0-79:s=0-1"); | ||||
| 	setReaderDefaultOutput("adfs.img"); | ||||
|     flags.parseFlags(argc, argv); | ||||
|  | ||||
| 	IbmDecoder decoder(sectorIdBase); | ||||
| 	readDiskCommand(decoder); | ||||
|     return 0; | ||||
| 	sectorIdBase.setDefaultValue(0); | ||||
| 	return mainReadIBM(argc, argv); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,30 +1,15 @@ | ||||
| #include "globals.h" | ||||
| #include "flags.h" | ||||
| #include "reader.h" | ||||
| #include "fluxmap.h" | ||||
| #include "decoders/decoders.h" | ||||
| #include "sector.h" | ||||
| #include "sectorset.h" | ||||
| #include "record.h" | ||||
| #include "ibm/ibm.h" | ||||
| #include "fmt/format.h" | ||||
|  | ||||
| static FlagGroup flags { &readerFlags }; | ||||
|  | ||||
| static IntFlag sectorIdBase( | ||||
| 	{ "--sector-id-base" }, | ||||
| 	"Sector ID of the first sector.", | ||||
| 	17); | ||||
| #include "readibm.h" | ||||
|  | ||||
| int mainReadAmpro(int argc, const char* argv[]) | ||||
| { | ||||
| 	setReaderDefaultSource(":t=0-79:s=0"); | ||||
| 	setReaderDefaultOutput("ampro.adf"); | ||||
|     setReaderRevolutions(2); | ||||
|     flags.parseFlags(argc, argv); | ||||
|  | ||||
| 	IbmDecoder decoder(sectorIdBase); | ||||
| 	readDiskCommand(decoder); | ||||
|     return 0; | ||||
| 	sectorIdBase.setDefaultValue(17); | ||||
| 	return mainReadIBM(argc, argv); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,24 +1,14 @@ | ||||
| #include "globals.h" | ||||
| #include "flags.h" | ||||
| #include "reader.h" | ||||
| #include "fluxmap.h" | ||||
| #include "decoders/decoders.h" | ||||
| #include "sector.h" | ||||
| #include "sectorset.h" | ||||
| #include "record.h" | ||||
| #include "dataspec.h" | ||||
| #include "ibm/ibm.h" | ||||
| #include "fmt/format.h" | ||||
|  | ||||
| static FlagGroup flags { &readerFlags }; | ||||
| #include "readibm.h" | ||||
|  | ||||
| int mainReadAtariST(int argc, const char* argv[]) | ||||
| { | ||||
| 	setReaderDefaultSource(":t=0-79:s=0-1"); | ||||
| 	setReaderDefaultOutput("atarist.st"); | ||||
|     flags.parseFlags(argc, argv); | ||||
|  | ||||
| 	IbmDecoder decoder(1); | ||||
| 	readDiskCommand(decoder); | ||||
|     return 0; | ||||
| 	sectorIdBase.setDefaultValue(1); | ||||
| 	return mainReadIBM(argc, argv); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,30 +1,14 @@ | ||||
| #include "globals.h" | ||||
| #include "flags.h" | ||||
| #include "reader.h" | ||||
| #include "fluxmap.h" | ||||
| #include "decoders/decoders.h" | ||||
| #include "sector.h" | ||||
| #include "sectorset.h" | ||||
| #include "record.h" | ||||
| #include "ibm/ibm.h" | ||||
| #include "fmt/format.h" | ||||
|  | ||||
| static FlagGroup flags { &readerFlags }; | ||||
|  | ||||
| static IntFlag sectorIdBase( | ||||
| 	{ "--sector-id-base" }, | ||||
| 	"Sector ID of the first sector.", | ||||
| 	0); | ||||
| #include "readibm.h" | ||||
|  | ||||
| int mainReadDFS(int argc, const char* argv[]) | ||||
| { | ||||
| 	setReaderDefaultSource(":t=0-79:s=0"); | ||||
| 	setReaderDefaultOutput("dfs.img"); | ||||
| 	sectorIdBase.setDefaultValue(0); | ||||
|     setReaderRevolutions(2); | ||||
|     flags.parseFlags(argc, argv); | ||||
|  | ||||
| 	IbmDecoder decoder(sectorIdBase); | ||||
| 	readDiskCommand(decoder); | ||||
|     return 0; | ||||
| 	return mainReadIBM(argc, argv); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -12,17 +12,17 @@ | ||||
|  | ||||
| static FlagGroup flags { &readerFlags }; | ||||
|  | ||||
| static IntFlag sectorIdBase( | ||||
| IntFlag sectorIdBase( | ||||
| 	{ "--ibm-sector-id-base" }, | ||||
| 	"Sector ID of the first sector.", | ||||
| 	1); | ||||
|  | ||||
| static BoolFlag ignoreSideByte( | ||||
| BoolFlag ignoreSideByte( | ||||
| 	{ "--ibm-ignore-side-byte" }, | ||||
| 	"Ignore the side byte in the sector ID, and use the physical side instead.", | ||||
| 	false); | ||||
|  | ||||
| static RangeFlag requiredSectors( | ||||
| RangeFlag requiredSectors( | ||||
| 	{ "--ibm-required-sectors" }, | ||||
| 	"A comma seperated list or range of sectors which must be on each track.", | ||||
| 	""); | ||||
|   | ||||
| @@ -1,138 +0,0 @@ | ||||
| #include "globals.h" | ||||
| #include "flags.h" | ||||
| #include "decoders/decoders.h" | ||||
| #include "encoders/encoders.h" | ||||
| #include "ibm/ibm.h" | ||||
| #include "writer.h" | ||||
| #include "fmt/format.h" | ||||
| #include <fstream> | ||||
|  | ||||
| static FlagGroup flags { &writerFlags }; | ||||
|  | ||||
| static IntFlag sectorSize( | ||||
| 	{ "--st-sector-size" }, | ||||
| 	"Size of the sectors to write (bytes).", | ||||
| 	512); | ||||
| static IntFlag gap1( | ||||
| 	{ "--st-gap1-bytes" }, | ||||
| 	"Size of gap 1 (the post-index gap).", | ||||
| 	60); | ||||
|  | ||||
| static IntFlag gap2( | ||||
| 	{ "--st-gap2-bytes" }, | ||||
| 	"Size of gap 2 (the post-ID gap).", | ||||
| 	22); | ||||
|  | ||||
| static IntFlag gap3( | ||||
| 	{ "--st-gap3-bytes" }, | ||||
| 	"Size of gap 3 (the post-data or format gap).", | ||||
| 	40); | ||||
|  | ||||
| static StringFlag sectorSkew( | ||||
| 	{ "--st-sector-skew" }, | ||||
| 	"Order to emit sectors.", | ||||
| 	""); | ||||
|  | ||||
| static BoolFlag swapSides( | ||||
| 	{ "--ibm-swap-sides" }, | ||||
| 	"Swap sides while writing.", | ||||
| 	false); | ||||
|  | ||||
| static ActionFlag preset360( | ||||
| 	{ "--st-preset-360" }, | ||||
| 	"Preset parameters to a 3.5\" 360kB disk (1 side, 80 tracks, 9 sectors).", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0:t=0-79"); | ||||
| 		setWriterDefaultInput(":c=80:h=1:s=9:b=512"); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag preset370( | ||||
| 	{ "--st-preset-380" }, | ||||
| 	"Preset parameters to a 3.5\" 370kB disk (1 side, 82 tracks, 9 sectors).", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0:t=0-81"); | ||||
| 		setWriterDefaultInput(":c=82:h=1:s=9:b=512"); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag preset400( | ||||
| 	{ "--st-preset-400" }, | ||||
| 	"Preset parameters to a 3.5\" 400kB disk (1 side, 80 Tracks, 10 sectors).", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0:t=0-79"); | ||||
| 		setWriterDefaultInput(":c=80:h=1:s=10:b=512"); | ||||
| 		sectorSkew.setDefaultValue("0123456789"); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag preset410( | ||||
| 	{ "--st-preset-410" }, | ||||
| 	"Preset parameters to a 3.5\" 410kB disk (1 side, 82 tracks, 10 sectors).", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0:t=0-81"); | ||||
| 		setWriterDefaultInput(":c=82:h=1:s=10:b=512"); | ||||
| 		sectorSkew.setDefaultValue("0123456789"); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag preset720( | ||||
| 	{ "--st-preset-720" }, | ||||
| 	"Preset parameters to a 3.5\" 720kB disk (2 sides, 80 tracks, 9 sectors).", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0-1:t=0-79"); | ||||
| 		setWriterDefaultInput(":c=80:h=2:s=9:b=512"); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag preset740( | ||||
| 	{ "--st-preset-740" }, | ||||
| 	"Preset parameters to a 3.5\" 740kB disk (2 sides, 82 tracks, 9 sectors).", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0-1:t=0-81"); | ||||
| 		setWriterDefaultInput(":c=82:h=2:s=9:b=512"); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag preset800( | ||||
| 	{ "--st-preset-800" }, | ||||
| 	"Preset parameters to a 3.5\" 800kB disk (2 sides, 80 tracks, 10 sectors).", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0-1:t=0-79"); | ||||
| 		setWriterDefaultInput(":c=80:h=2:s=10:b=512"); | ||||
| 		sectorSkew.setDefaultValue("0123456789"); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag preset820( | ||||
| 	{ "--st-preset-820" }, | ||||
| 	"Preset parameters to a 3.5\" 820kB disk (2 sides, 82 tracks, 10 sectors).", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0-1:t=0-81"); | ||||
| 		setWriterDefaultInput(":c=82:h=2:s=10:b=512"); | ||||
| 		sectorSkew.setDefaultValue("0123456789"); | ||||
| 	}); | ||||
|  | ||||
| int mainWriteAtariST(int argc, const char* argv[]) | ||||
| { | ||||
| 	setWriterDefaultDest(":d=0:t=0-79:s=0-1"); | ||||
| 	flags.parseFlags(argc, argv); | ||||
|  | ||||
| 	IbmParameters parameters; | ||||
| 	parameters.trackLengthMs = 200; | ||||
| 	parameters.sectorSize = sectorSize; | ||||
| 	parameters.emitIam = false; | ||||
| 	parameters.startSectorId = 1; | ||||
| 	parameters.clockRateKhz = 250; | ||||
|  	parameters.useFm = false; | ||||
| 	parameters.idamByte = 0x5554; | ||||
| 	parameters.damByte = 0x5545; | ||||
| 	parameters.gap0 = 0; | ||||
| 	parameters.gap1 = gap1; | ||||
| 	parameters.gap2 = gap2; | ||||
| 	parameters.gap3 = gap3; | ||||
| 	parameters.sectorSkew = sectorSkew; | ||||
| 	parameters.swapSides = swapSides; | ||||
|  | ||||
| 	IbmEncoder encoder(parameters); | ||||
| 	writeDiskCommand(encoder); | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
| @@ -79,47 +79,47 @@ static BoolFlag swapSides( | ||||
| 	"Swap sides while writing. Needed for Commodore 1581, CMD FD-2000, Thomson TO7.", | ||||
| 	false); | ||||
|  | ||||
| /* --- IBM disks ----------------------------------------------------------- */ | ||||
|  | ||||
| static void set_ibm_defaults() | ||||
| { | ||||
| 	sectorSize.setDefaultValue(512); | ||||
| 	emitIam.setDefaultValue(true); | ||||
| 	idamByte.setDefaultValue(0x5554); | ||||
| 	damByte.setDefaultValue(0x5545); | ||||
| 	gap0.setDefaultValue(80); | ||||
| 	gap1.setDefaultValue(50); | ||||
| 	gap2.setDefaultValue(22); | ||||
| 	gap3.setDefaultValue(80); | ||||
| 	swapSides.setDefaultValue(false); | ||||
| } | ||||
|  | ||||
| static ActionFlag preset1440( | ||||
| 	{ "--ibm-preset-1440" }, | ||||
| 	"Preset parameters to a 3.5\" 1440kB disk.", | ||||
| 	"Preset parameters to a PC 3.5\" 1440kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultInput(":c=80:h=2:s=18:b=512"); | ||||
| 		trackLengthMs.setDefaultValue(200); | ||||
| 		sectorSize.setDefaultValue(512); | ||||
| 		emitIam.setDefaultValue(true); | ||||
| 		clockRateKhz.setDefaultValue(500); | ||||
| 		idamByte.setDefaultValue(0x5554); | ||||
| 		damByte.setDefaultValue(0x5545); | ||||
| 		gap0.setDefaultValue(80); | ||||
| 		gap1.setDefaultValue(50); | ||||
| 		gap2.setDefaultValue(22); | ||||
| 		gap3.setDefaultValue(80); | ||||
| 		sectorSkew.setDefaultValue("0123456789abcdefgh"); | ||||
| 		swapSides.setDefaultValue(false); | ||||
| 		set_ibm_defaults(); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag preset720( | ||||
| 	{ "--ibm-preset-720" }, | ||||
| 	"Preset parameters to a 3.5\" 720kB disk.", | ||||
| 	"Preset parameters to a PC 3.5\" 720kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultInput(":c=80:h=2:s=9:b=512"); | ||||
| 		trackLengthMs.setDefaultValue(200); | ||||
| 		sectorSize.setDefaultValue(512); | ||||
| 		emitIam.setDefaultValue(true); | ||||
| 		clockRateKhz.setDefaultValue(250); | ||||
| 		idamByte.setDefaultValue(0x5554); | ||||
| 		damByte.setDefaultValue(0x5545); | ||||
| 		gap0.setDefaultValue(80); | ||||
| 		gap1.setDefaultValue(50); | ||||
| 		gap2.setDefaultValue(22); | ||||
| 		gap3.setDefaultValue(80); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 		swapSides.setDefaultValue(false); | ||||
| 	}); | ||||
|  | ||||
| /* --- Commodore disks ----------------------------------------------------- */ | ||||
|  | ||||
| static ActionFlag presetCBM1581( | ||||
| 	{ "--ibm-preset-cbm1581" }, | ||||
| 	"Preset parameters to a 3.5\" 800kB disk.", | ||||
| 	{ "--ibm-preset-commodore-1581" }, | ||||
| 	"Preset parameters to a Commodore 3.5\" 800kB 1581 disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultInput(":c=80:h=2:s=10:b=512"); | ||||
| 		trackLengthMs.setDefaultValue(200); | ||||
| @@ -137,6 +137,104 @@ static ActionFlag presetCBM1581( | ||||
| 		swapSides.setDefaultValue(true); | ||||
| 	}); | ||||
|  | ||||
| /* --- Atari ST disks ------------------------------------------------------ */ | ||||
|  | ||||
| static void set_atari_defaults() | ||||
| { | ||||
| 		trackLengthMs.setDefaultValue(200); | ||||
| 		sectorSize.setDefaultValue(512); | ||||
| 		startSectorId.setDefaultValue(1); | ||||
| 		emitIam.setDefaultValue(false); | ||||
| 		clockRateKhz.setDefaultValue(250); | ||||
| 		idamByte.setDefaultValue(0x5554); | ||||
| 		damByte.setDefaultValue(0x5545); | ||||
| 		gap0.setDefaultValue(80); | ||||
| 		gap1.setDefaultValue(80); //as emitIam is false this value remains unused | ||||
| 		gap2.setDefaultValue(22); | ||||
| 		gap3.setDefaultValue(34); | ||||
| 		swapSides.setDefaultValue(true); | ||||
| } | ||||
|  | ||||
| static ActionFlag presetAtariST360( | ||||
| 	{ "--ibm-preset-atarist-360" }, | ||||
| 	"Preset parameters to an Atari ST 3.5\" 360kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0:t=0-79"); | ||||
| 		setWriterDefaultInput(":c=80:h=1:s=9:b=512"); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 		set_atari_defaults(); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag presetAtariST370( | ||||
| 	{ "--ibm-preset-atarist-380" }, | ||||
| 	"Preset parameters to an Atari ST 3.5\" 370kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0:t=0-81"); | ||||
| 		setWriterDefaultInput(":c=82:h=1:s=9:b=512"); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 		set_atari_defaults(); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag presetAtariST400( | ||||
| 	{ "--ibm-preset-atarist-400" }, | ||||
| 	"Preset parameters to an Atari ST 3.5\" 400kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0:t=0-79"); | ||||
| 		setWriterDefaultInput(":c=80:h=1:s=10:b=512"); | ||||
| 		sectorSkew.setDefaultValue("0123456789"); | ||||
| 		set_atari_defaults(); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag presetAtariST410( | ||||
| 	{ "--ibm-preset-atarist-410" }, | ||||
| 	"Preset parameters to an Atari ST 3.5\" 410kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0:t=0-81"); | ||||
| 		setWriterDefaultInput(":c=82:h=1:s=10:b=512"); | ||||
| 		sectorSkew.setDefaultValue("0123456789"); | ||||
| 		set_atari_defaults(); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag presetAtariST720( | ||||
| 	{ "--ibm-preset-atarist-720" }, | ||||
| 	"Preset parameters to an Atari ST 3.5\" 720kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0-1:t=0-79"); | ||||
| 		setWriterDefaultInput(":c=80:h=2:s=9:b=512"); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 		set_atari_defaults(); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag presetAtariST740( | ||||
| 	{ "--ibm-preset-atarist-740" }, | ||||
| 	"Preset parameters to an Atari ST 3.5\" 740kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0-1:t=0-81"); | ||||
| 		setWriterDefaultInput(":c=82:h=2:s=9:b=512"); | ||||
| 		sectorSkew.setDefaultValue("012345678"); | ||||
| 		set_atari_defaults(); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag presetAtariST800( | ||||
| 	{ "--ibm-preset-atarist-800" }, | ||||
| 	"Preset parameters to an Atari ST 3.5\" 800kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0-1:t=0-79"); | ||||
| 		setWriterDefaultInput(":c=80:h=2:s=10:b=512"); | ||||
| 		sectorSkew.setDefaultValue("0123456789"); | ||||
| 		set_atari_defaults(); | ||||
| 	}); | ||||
|  | ||||
| static ActionFlag presetAtariST820( | ||||
| 	{ "--ibm-preset-atarist-820" }, | ||||
| 	"Preset parameters to an Atari ST 3.5\" 820kB disk.", | ||||
| 	[] { | ||||
| 		setWriterDefaultDest(":d=0:s=0-1:t=0-81"); | ||||
| 		setWriterDefaultInput(":c=82:h=2:s=10:b=512"); | ||||
| 		sectorSkew.setDefaultValue("0123456789"); | ||||
| 		set_atari_defaults(); | ||||
| 	}); | ||||
|  | ||||
| int mainWriteIbm(int argc, const char* argv[]) | ||||
| { | ||||
| 	setWriterDefaultDest(":d=0:t=0-79:s=0-1"); | ||||
|   | ||||
| @@ -35,7 +35,6 @@ extern command_cb mainTestBandwidth; | ||||
| extern command_cb mainTestVoltages; | ||||
| extern command_cb mainUpgradeFluxFile; | ||||
| extern command_cb mainWriteAmiga; | ||||
| extern command_cb mainWriteAtariST; | ||||
| extern command_cb mainWriteBrother; | ||||
| extern command_cb mainWriteIbm; | ||||
| extern command_cb mainWriteMac; | ||||
| @@ -97,7 +96,6 @@ static std::vector<Command> readables = | ||||
| static std::vector<Command> writeables = | ||||
| { | ||||
|     { "amiga",         mainWriteAmiga,    "Writes Amiga disks.", }, | ||||
|     { "atarist",       mainWriteAtariST,  "Writes Atari ST disks.", }, | ||||
|     { "brother",       mainWriteBrother,  "Writes 120kB and 240kB Brother word processor disks.", }, | ||||
|     { "ibm",           mainWriteIbm,      "Writes the ubiquitous IBM format disks.", }, | ||||
| 	{ "mac",           mainWriteMac,      "Writes Apple Macintosh disks.", }, | ||||
|   | ||||
							
								
								
									
										14
									
								
								src/readibm.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/readibm.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| #ifndef READIBM_H | ||||
| #define READIBM_H | ||||
|  | ||||
| #include "flags.h" | ||||
| #include "dataspec.h" | ||||
|  | ||||
| extern IntFlag sectorIdBase; | ||||
| extern BoolFlag ignoreSideByte; | ||||
| extern RangeFlag requiredSectors; | ||||
|  | ||||
| extern int mainReadIBM(int argc, const char* argv[]); | ||||
|  | ||||
| #endif | ||||
|  | ||||
		Reference in New Issue
	
	Block a user