diff --git a/README.md b/README.md index da2361f..5fd7e09 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,11 @@ Directory | Contents ---- | ---- asc | Convert ASCII file line endings decsys | Convert decimal listing file to a DECtape file -dtos8cvt | Convert a PDP-8 DECtape image from OS/8 format to simulator format. +dtos8cvt | Convert a PDP-8 DECtape image from OS/8 format to simulator format gt7cvt | Convert a gt7 magtape dump to a SIMH magtape hpconvert | Convert an HP disc image between SIMH and HPDrive formats indent | Convert simulator sources to 4-column tabs +lbn2pbn | Logical-to-physical converter for single-sided floppy disk images littcvt | Remove density maker from litt format tapes m8376 | Assembles 8 PROM files into a 32bit binary file mt2tpc | Convert a simh simulated magtape to TPC format diff --git a/converters/lbn2pbn/lbn2pbn.c b/converters/lbn2pbn/lbn2pbn.c index 20be5b7..3215d32 100644 --- a/converters/lbn2pbn/lbn2pbn.c +++ b/converters/lbn2pbn/lbn2pbn.c @@ -58,6 +58,7 @@ static int sector_size = 0; static int interleave = 0; static int track_skew = 0; +static int track0 = 0; static int round = 0; @@ -98,7 +99,8 @@ static int lbn2pbn(int lbn) /* PBN */ sector %= sectors; - track++; + if (!track0) + ++track; track %= tracks; return track * sectors + sector; @@ -111,14 +113,18 @@ __attribute__((noreturn)) static void usage(const char* prog) { fprintf(stderr, "%s -T tracks -S sectors -B sector_size" - " -i interleave -k track_skew [-r] infile outfile\n", prog); + " -i interleave -k track_skew [-0] [-r] infile outfile\n", + prog); fprintf(stderr, "\nTypical parameters:\n" "RX01: -T 77 -S 26 -B 128 -i 2 -k 6\n" "RX02 (single density): -T 77 -S 26 -B 128 -i 2 -k 6\n" "RX02 (double density): -T 77 -S 26 -B 256 -i 2 -k 6\n" "RX50: -T 80 -S 10 -B 512 -i 2 -k 2\n" - "\nSupported sector sizes (in bytes): 128, 256, 512\n"); + "\nSupported sector sizes (in bytes): 128, 256, 512\n\n"); + + fprintf(stderr, "-0 = To leave track 0 in place (else, wrapped around)\n" + "-r = To do a reverse (PBN to LBN) conversion\n"); exit(2); } @@ -146,7 +152,7 @@ int main(int argc, char* argv[]) int p, q; p = optind; - while ((q = getopt(argc, argv, "T:S:B:i:k:r")) != EOF) { + while ((q = getopt(argc, argv, "T:S:B:i:k:0r")) != EOF) { switch (q) { case 'T': tracks = atoi(optarg); @@ -167,6 +173,9 @@ int main(int argc, char* argv[]) case 'k': track_skew = atoi(optarg); break; + case '0': + track0 = 1; + break; case 'r': if (!reverse) { reverse = 1;