Fix IBM sector base default; convert the ampro configuration.

This commit is contained in:
David Given
2021-05-15 13:47:34 +02:00
parent 509217606c
commit ebe678b18b
7 changed files with 40 additions and 21 deletions

View File

@@ -138,7 +138,7 @@ void IbmDecoder::decodeSectorRecord()
br.read_8(); /* skip ID byte */
_sector->logicalTrack = br.read_8();
_sector->logicalSide = br.read_8();
_sector->logicalSector = br.read_8() - _config.sector_base();
_sector->logicalSector = br.read_8() - _config.sector_id_base();
_currentSectorSize = 1 << (br.read_8() + 7);
uint16_t wantCrc = br.read_be16();
uint16_t gotCrc = crc16(CCITT_POLY, bytes.slice(0, _currentHeaderLength + 5));

View File

@@ -3,9 +3,12 @@ syntax = "proto2";
import "lib/common.proto";
message IBMInputProto {
optional int32 sector_base = 1 [default=0];
optional bool ignore_side_byte = 2 [default=false];
optional RangeProto required_sectors = 3;
optional int32 sector_id_base = 1 [default = 1,
(help) = "ID of first sector"];
optional bool ignore_side_byte = 2 [default = false,
(help) = "ignore side byte in sector header"];
optional RangeProto required_sectors = 3 [
(help) = "require these sectors to exist for a good read"];
}
message IBMOutputProto {

View File

@@ -346,6 +346,7 @@ READABLES="\
acornadfs \
acorndfs \
aeslanier \
ampro \
amiga \
brother \
c64 \

View File

@@ -1,15 +0,0 @@
#include "globals.h"
#include "reader.h"
#include "ibm/ibm.h"
#include "fmt/format.h"
#include "readibm.h"
int mainReadAmpro(int argc, const char* argv[])
{
setReaderDefaultSource(":t=0-79:s=0");
setReaderDefaultOutput("ampro.adf");
setReaderRevolutions(2);
sectorIdBase.setDefaultValue(17);
return mainReadIBM(argc, argv);
}

View File

@@ -13,7 +13,7 @@ output {
decoder {
ibm {
sector_base: 0
sector_id_base: 0
}
}

View File

@@ -13,7 +13,7 @@ output {
decoder {
ibm {
sector_base: 0
sector_id_base: 0
}
}

View File

@@ -0,0 +1,30 @@
input {
disk {
drive {}
}
}
output {
file {
filename: "ampro.img"
img {}
}
}
decoder {
ibm {
sector_id_base: 17
}
}
cylinders {
start: 0
end: 79
}
heads {
start: 0
end: 0
}