Merge pull request #364 from davidgiven/scp

Improve SCP handling.
This commit is contained in:
David Given
2021-12-03 21:28:43 +00:00
committed by GitHub
3 changed files with 13 additions and 7 deletions

View File

@@ -47,7 +47,6 @@ public:
_fileheader.file_id[2] = 'P';
_fileheader.version = 0x18; /* Version 1.8 of the spec */
_fileheader.type = _config.type_byte();
_fileheader.revolutions = 5;
_fileheader.start_track = strackno(config.cylinders().start(), config.heads().start());
_fileheader.end_track = strackno(config.cylinders().end(), config.heads().end());
_fileheader.flags = (_config.align_with_index() ? SCP_FLAG_INDEXED : 0)
@@ -55,7 +54,7 @@ public:
_fileheader.cell_width = 0;
_fileheader.heads = singlesided;
std::cout << fmt::format("Writing 96 tpi {} SCP file containing {} SCP tracks\n",
std::cout << fmt::format("SCP: writing 96 tpi {} file containing {} tracks\n",
singlesided ? "single sided" : "double sided",
_fileheader.end_track - _fileheader.start_track + 1
);
@@ -71,7 +70,7 @@ public:
appendChecksum(checksum, _trackdata);
write_le32(_fileheader.checksum, checksum);
std::cout << "Writing output file...\n";
std::cout << "SCP: writing output file...\n";
std::ofstream of(_config.filename(), std::ios::out | std::ios::binary);
if (!of.is_open())
Error() << "cannot open output file";
@@ -138,6 +137,7 @@ public:
}
}
_fileheader.revolutions = revolution - 1;
write_le32(_fileheader.track[strack], trackdataWriter.pos + sizeof(ScpHeader));
trackdataWriter += Bytes((uint8_t*)&trackheader, sizeof(trackheader));
trackdataWriter += fluxdata;

View File

@@ -36,8 +36,8 @@ rule test
description = TEST \$in
rule encodedecode
command = sh scripts/encodedecodetest.sh \$format \$configs > \$out
description = ENCODEDECODE \$format
command = sh scripts/encodedecodetest.sh \$format \$fluxx \$configs > \$out
description = ENCODEDECODE \$fluxx \$format
rule strip
command = cp -f \$in \$out && $STRIP \$out
@@ -264,9 +264,14 @@ encodedecodetest() {
format=$1
shift
echo "build $OBJDIR/$format.encodedecode.stamp : encodedecode | fluxengine$EXTENSION scripts/encodedecodetest.sh $*"
echo "build $OBJDIR/$format.encodedecode.flux.stamp : encodedecode | fluxengine$EXTENSION scripts/encodedecodetest.sh $*"
echo " format=$format"
echo " configs=$*"
echo " fluxx=flux"
echo "build $OBJDIR/$format.encodedecode.scp.stamp : encodedecode | fluxengine$EXTENSION scripts/encodedecodetest.sh $*"
echo " format=$format"
echo " configs=$*"
echo " fluxx=scp"
}
buildlibrary libagg.a \

View File

@@ -8,10 +8,11 @@ fi
tmp=/tmp/$$
srcfile=$tmp.src.img
fluxfile=$tmp.flux
fluxfile=$tmp.$2
destfile=$tmp.dest.img
format=$1
shift
shift
trap "rm -f $srcfile $fluxfile $destfile" EXIT