Compare commits

...

6 Commits

Author SHA1 Message Date
David Given
37595bf73c Update the HP formats to not use the reserved tracks at the end of the disk. 2023-06-15 00:13:28 +02:00
David Given
952aea46ba The HP9122 format appears to be double-sided. 2023-06-13 23:00:00 +02:00
David Given
6a6536cf27 Discover that the HP9121 format is actually 70 track. Add support for the
HP9122 format.
2023-06-13 20:16:41 +02:00
David Given
696368c92a Read LIF volume size information correctly. 2023-06-13 20:08:47 +02:00
David Given
e3edc9327e Don't crash if there is no disk usage data. 2023-06-13 20:08:31 +02:00
David Given
8d2e6a664d Adjust the 264 format to have sector numbers in, hopefully, the right place. 2023-06-13 19:54:46 +02:00
5 changed files with 74 additions and 7 deletions

View File

@@ -198,6 +198,7 @@ $(call do-encodedecodetest,commodore,scripts/commodore1541_test.textpb,--192 --d
$(call do-encodedecodetest,commodore,,--800 --drive.tpi=135)
$(call do-encodedecodetest,commodore,,--1620 --drive.tpi=135)
$(call do-encodedecodetest,hplif,,--264 --drive.tpi=135)
$(call do-encodedecodetest,hplif,,--608 --drive.tpi=135)
$(call do-encodedecodetest,hplif,,--616 --drive.tpi=135)
$(call do-encodedecodetest,hplif,,--770 --drive.tpi=135)
$(call do-encodedecodetest,ibm,,--1200 --drive.tpi=96)

View File

@@ -15,6 +15,7 @@ encoding scheme.
- Format variants:
- `264`: 264kB 3.5" 66-track SSDD; HP9121 format
- `608`: 608kB 3.5" 76-track DSDD; HP9122 format
- `616`: 616kB 3.5" 77-track DSDD
- `770`: 770kB 3.5" 77-track DSDD
@@ -23,12 +24,19 @@ encoding scheme.
To read:
- `fluxengine read hplif --264 -s drive:0 -o hplif.img`
- `fluxengine read hplif --608 -s drive:0 -o hplif.img`
- `fluxengine read hplif --616 -s drive:0 -o hplif.img`
- `fluxengine read hplif --770 -s drive:0 -o hplif.img`
To write:
- `fluxengine write hplif --264 -d drive:0 -i hplif.img`
- `fluxengine write hplif --608 -d drive:0 -i hplif.img`
- `fluxengine write hplif --616 -d drive:0 -i hplif.img`
- `fluxengine write hplif --770 -d drive:0 -i hplif.img`
## References
* [A summary of the Hewlett Packard floppy disk
formats](http://www.bitsavers.org/pdf/hp/disc/912x/HP_Flexible_Disk_Formats.pdf)

View File

@@ -214,6 +214,7 @@ private:
_directoryBlock = rbr.read_be32();
rbr.skip(4);
_directorySize = rbr.read_be32();
rbr.skip(4);
unsigned tracks = rbr.read_be32();
unsigned heads = rbr.read_be32();
unsigned sectors = rbr.read_be32();

View File

@@ -14,6 +14,14 @@ Floppy-disk wise, they're yet more variations of the standard IBM floppy
encoding scheme.
>>>
documentation:
<<<
## References
* [A summary of the Hewlett Packard floppy disk
formats](http://www.bitsavers.org/pdf/hp/disc/912x/HP_Flexible_Disk_Formats.pdf)
>>>
drive {
high_density: false
}
@@ -55,10 +63,6 @@ option_group {
layoutdata {
sector_size: 256
physical {
sector: 0
sector: 4
sector: 8
sector: 12
sector: 1
sector: 5
sector: 9
@@ -71,6 +75,56 @@ option_group {
sector: 7
sector: 11
sector: 15
sector: 4
sector: 8
sector: 12
sector: 16
}
}
}
encoder {
ibm {
trackdata {
emit_iam: false
target_rotational_period_ms: 200
target_clock_period_us: 4
gap0: 80
gap2: 22
gap3: 44
}
}
}
}
}
option {
name: "608"
comment: '608kB 3.5" 76-track DSDD; HP9122 format'
config {
layout {
tracks: 76
sides: 2
layoutdata {
sector_size: 256
physical {
sector: 1
sector: 5
sector: 9
sector: 13
sector: 2
sector: 6
sector: 10
sector: 14
sector: 3
sector: 7
sector: 11
sector: 15
sector: 4
sector: 8
sector: 12
sector: 16
}
}
}

View File

@@ -244,9 +244,12 @@ private:
uint32_t usedBlocks = std::stoul(
metadata.at(Filesystem::USED_BLOCKS));
diskSpaceGauge->Enable();
diskSpaceGauge->SetRange(totalBlocks * blockSize);
diskSpaceGauge->SetValue(usedBlocks * blockSize);
if (!totalBlocks)
throw std::out_of_range("no disk usage data");
diskSpaceGauge->Enable();
diskSpaceGauge->SetRange(totalBlocks);
diskSpaceGauge->SetValue(usedBlocks);
}
catch (const std::out_of_range& e)
{