mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Merge.
This commit is contained in:
17
.appveyor.yml
Normal file
17
.appveyor.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
environment:
|
||||
matrix:
|
||||
- CYGWIN: C:\cygwin64
|
||||
|
||||
clone_depth: 1
|
||||
|
||||
init:
|
||||
- git config --global core.autocrlf input
|
||||
|
||||
install:
|
||||
- '%CYGWIN%\bin\bash -lc "cygcheck -dc cygwin"'
|
||||
- '%CYGWIN%\setup-x86_64 -q -P libsqlite3-devel,ninja'
|
||||
|
||||
build_script:
|
||||
- 'echo building...'
|
||||
- '%CYGWIN%\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ninja"'
|
||||
|
||||
@@ -10,6 +10,7 @@ matrix:
|
||||
env: CXX=g++-8
|
||||
-
|
||||
os: osx
|
||||
osx_image: xcode10.2
|
||||
compiler: clang
|
||||
|
||||
addons:
|
||||
@@ -19,19 +20,16 @@ addons:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- ninja-build
|
||||
- meson
|
||||
- libusb-1.0-0-dev
|
||||
- libsqlite3-dev
|
||||
- g++-8
|
||||
homebrew:
|
||||
update: true
|
||||
packages:
|
||||
- ninja
|
||||
- meson
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
|
||||
script:
|
||||
- make
|
||||
- ninja
|
||||
|
||||
|
||||
9
Makefile
9
Makefile
@@ -1,9 +0,0 @@
|
||||
all: .obj/build.ninja
|
||||
@ninja -C .obj test
|
||||
|
||||
clean:
|
||||
rm -rf .obj
|
||||
|
||||
.obj/build.ninja:
|
||||
@mkdir -p .obj
|
||||
meson .obj --buildtype=debugoptimized
|
||||
230
build.ninja
Normal file
230
build.ninja
Normal file
@@ -0,0 +1,230 @@
|
||||
#############################################################################
|
||||
### THIS FILE IS AUTOGENERATED ###
|
||||
#############################################################################
|
||||
#
|
||||
# Don't edit it. Your changes will be destroyed. Instead, edit mkninja.sh
|
||||
# instead. The next time you run ninja, this file will be automatically
|
||||
# updated.
|
||||
|
||||
rule mkninja
|
||||
command = sh ./mkninja.sh > $out.new && mv -f $out.new $out
|
||||
generator = true
|
||||
build build.ninja : mkninja mkninja.sh
|
||||
|
||||
CXX = g++
|
||||
AR = ar rcs
|
||||
CFLAGS = -Og -g --std=c++14
|
||||
LDFLAGS = -Og
|
||||
|
||||
OBJDIR = .obj
|
||||
|
||||
rule cxx
|
||||
command = $CXX $CFLAGS $flags -I. -c -o $out $in -MMD -MF $out.d
|
||||
description = CXX $in
|
||||
depfile = $out.d
|
||||
deps = gcc
|
||||
|
||||
rule library
|
||||
command = $AR $out $in
|
||||
description = AR $in
|
||||
|
||||
rule link
|
||||
command = $CXX $LDFLAGS -o $out $in $flags
|
||||
description = LINK $in
|
||||
|
||||
rule test
|
||||
command = $in && touch $out
|
||||
description = TEST $in
|
||||
build $OBJDIR/dep/fmt/format.o : cxx dep/fmt/format.cc
|
||||
flags=
|
||||
build $OBJDIR/dep/fmt/posix.o : cxx dep/fmt/posix.cc
|
||||
flags=
|
||||
build $OBJDIR/libfmt.a : library $OBJDIR/dep/fmt/format.o $OBJDIR/dep/fmt/posix.o
|
||||
build $OBJDIR/lib/aeslanier/decoder.o : cxx lib/aeslanier/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/amiga/decoder.o : cxx lib/amiga/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/apple2/decoder.o : cxx lib/apple2/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/brother/decoder.o : cxx lib/brother/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/brother/encoder.o : cxx lib/brother/encoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/bytes.o : cxx lib/bytes.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/c64/decoder.o : cxx lib/c64/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/common/crunch.c.o : cxx lib/common/crunch.c
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/crc.o : cxx lib/crc.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/dataspec.o : cxx lib/dataspec.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/decoders/decoders.o : cxx lib/decoders/decoders.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/decoders/fluxmapreader.o : cxx lib/decoders/fluxmapreader.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/decoders/fmmfm.o : cxx lib/decoders/fmmfm.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/encoder.o : cxx lib/encoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/f85/decoder.o : cxx lib/f85/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fb100/decoder.o : cxx lib/fb100/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/flags.o : cxx lib/flags.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxmap.o : cxx lib/fluxmap.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxsink/fluxsink.o : cxx lib/fluxsink/fluxsink.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxsink/hardwarefluxsink.o : cxx lib/fluxsink/hardwarefluxsink.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxsink/sqlitefluxsink.o : cxx lib/fluxsink/sqlitefluxsink.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxsource/fluxsource.o : cxx lib/fluxsource/fluxsource.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxsource/hardwarefluxsource.o : cxx lib/fluxsource/hardwarefluxsource.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxsource/kryoflux.o : cxx lib/fluxsource/kryoflux.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxsource/sqlitefluxsource.o : cxx lib/fluxsource/sqlitefluxsource.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/fluxsource/streamfluxsource.o : cxx lib/fluxsource/streamfluxsource.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/globals.o : cxx lib/globals.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/hexdump.o : cxx lib/hexdump.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/ibm/decoder.o : cxx lib/ibm/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/image.o : cxx lib/image.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/macintosh/decoder.o : cxx lib/macintosh/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/mx/decoder.o : cxx lib/mx/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/reader.o : cxx lib/reader.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/sector.o : cxx lib/sector.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/sectorset.o : cxx lib/sectorset.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/sql.o : cxx lib/sql.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/usb.o : cxx lib/usb.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/victor9k/decoder.o : cxx lib/victor9k/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/writer.o : cxx lib/writer.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/lib/zilogmcz/decoder.o : cxx lib/zilogmcz/decoder.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libbackend.a : library $OBJDIR/lib/aeslanier/decoder.o $OBJDIR/lib/amiga/decoder.o $OBJDIR/lib/apple2/decoder.o $OBJDIR/lib/brother/decoder.o $OBJDIR/lib/brother/encoder.o $OBJDIR/lib/bytes.o $OBJDIR/lib/c64/decoder.o $OBJDIR/lib/common/crunch.c.o $OBJDIR/lib/crc.o $OBJDIR/lib/dataspec.o $OBJDIR/lib/decoders/decoders.o $OBJDIR/lib/decoders/fluxmapreader.o $OBJDIR/lib/decoders/fmmfm.o $OBJDIR/lib/encoder.o $OBJDIR/lib/f85/decoder.o $OBJDIR/lib/fb100/decoder.o $OBJDIR/lib/flags.o $OBJDIR/lib/fluxmap.o $OBJDIR/lib/fluxsink/fluxsink.o $OBJDIR/lib/fluxsink/hardwarefluxsink.o $OBJDIR/lib/fluxsink/sqlitefluxsink.o $OBJDIR/lib/fluxsource/fluxsource.o $OBJDIR/lib/fluxsource/hardwarefluxsource.o $OBJDIR/lib/fluxsource/kryoflux.o $OBJDIR/lib/fluxsource/sqlitefluxsource.o $OBJDIR/lib/fluxsource/streamfluxsource.o $OBJDIR/lib/globals.o $OBJDIR/lib/hexdump.o $OBJDIR/lib/ibm/decoder.o $OBJDIR/lib/image.o $OBJDIR/lib/macintosh/decoder.o $OBJDIR/lib/mx/decoder.o $OBJDIR/lib/reader.o $OBJDIR/lib/sector.o $OBJDIR/lib/sectorset.o $OBJDIR/lib/sql.o $OBJDIR/lib/usb.o $OBJDIR/lib/victor9k/decoder.o $OBJDIR/lib/writer.o $OBJDIR/lib/zilogmcz/decoder.o
|
||||
build $OBJDIR/src/fe-erase.o : cxx src/fe-erase.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-inspect.o : cxx src/fe-inspect.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readadfs.o : cxx src/fe-readadfs.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readaeslanier.o : cxx src/fe-readaeslanier.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readamiga.o : cxx src/fe-readamiga.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readampro.o : cxx src/fe-readampro.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readapple2.o : cxx src/fe-readapple2.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readbrother.o : cxx src/fe-readbrother.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readc64.o : cxx src/fe-readc64.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readdfs.o : cxx src/fe-readdfs.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readf85.o : cxx src/fe-readf85.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readfb100.o : cxx src/fe-readfb100.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readibm.o : cxx src/fe-readibm.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readmac.o : cxx src/fe-readmac.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readmx.o : cxx src/fe-readmx.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readvictor9k.o : cxx src/fe-readvictor9k.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-readzilogmcz.o : cxx src/fe-readzilogmcz.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-rpm.o : cxx src/fe-rpm.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-seek.o : cxx src/fe-seek.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-testbulktransport.o : cxx src/fe-testbulktransport.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-upgradefluxfile.o : cxx src/fe-upgradefluxfile.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-writebrother.o : cxx src/fe-writebrother.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-writeflux.o : cxx src/fe-writeflux.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fe-writetestpattern.o : cxx src/fe-writetestpattern.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/src/fluxengine.o : cxx src/fluxengine.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libfrontend.a : library $OBJDIR/src/fe-erase.o $OBJDIR/src/fe-inspect.o $OBJDIR/src/fe-readadfs.o $OBJDIR/src/fe-readaeslanier.o $OBJDIR/src/fe-readamiga.o $OBJDIR/src/fe-readampro.o $OBJDIR/src/fe-readapple2.o $OBJDIR/src/fe-readbrother.o $OBJDIR/src/fe-readc64.o $OBJDIR/src/fe-readdfs.o $OBJDIR/src/fe-readf85.o $OBJDIR/src/fe-readfb100.o $OBJDIR/src/fe-readibm.o $OBJDIR/src/fe-readmac.o $OBJDIR/src/fe-readmx.o $OBJDIR/src/fe-readvictor9k.o $OBJDIR/src/fe-readzilogmcz.o $OBJDIR/src/fe-rpm.o $OBJDIR/src/fe-seek.o $OBJDIR/src/fe-testbulktransport.o $OBJDIR/src/fe-upgradefluxfile.o $OBJDIR/src/fe-writebrother.o $OBJDIR/src/fe-writeflux.o $OBJDIR/src/fe-writetestpattern.o $OBJDIR/src/fluxengine.o
|
||||
build fluxengine : link $OBJDIR/libfrontend.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/tests/dataspec.o : cxx tests/dataspec.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libdataspec-test.a : library $OBJDIR/tests/dataspec.o
|
||||
build $OBJDIR/dataspec-test : link $OBJDIR/libdataspec-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/dataspec-test.stamp : test $OBJDIR/dataspec-test
|
||||
build $OBJDIR/tests/flags.o : cxx tests/flags.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libflags-test.a : library $OBJDIR/tests/flags.o
|
||||
build $OBJDIR/flags-test : link $OBJDIR/libflags-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/flags-test.stamp : test $OBJDIR/flags-test
|
||||
build $OBJDIR/tests/fmmfm.o : cxx tests/fmmfm.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libfmmfm-test.a : library $OBJDIR/tests/fmmfm.o
|
||||
build $OBJDIR/fmmfm-test : link $OBJDIR/libfmmfm-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/fmmfm-test.stamp : test $OBJDIR/fmmfm-test
|
||||
build $OBJDIR/tests/bitaccumulator.o : cxx tests/bitaccumulator.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libbitaccumulator-test.a : library $OBJDIR/tests/bitaccumulator.o
|
||||
build $OBJDIR/bitaccumulator-test : link $OBJDIR/libbitaccumulator-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/bitaccumulator-test.stamp : test $OBJDIR/bitaccumulator-test
|
||||
build $OBJDIR/tests/kryoflux.o : cxx tests/kryoflux.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libkryoflux-test.a : library $OBJDIR/tests/kryoflux.o
|
||||
build $OBJDIR/kryoflux-test : link $OBJDIR/libkryoflux-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/kryoflux-test.stamp : test $OBJDIR/kryoflux-test
|
||||
build $OBJDIR/tests/compression.o : cxx tests/compression.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libcompression-test.a : library $OBJDIR/tests/compression.o
|
||||
build $OBJDIR/compression-test : link $OBJDIR/libcompression-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/compression-test.stamp : test $OBJDIR/compression-test
|
||||
build $OBJDIR/tests/bytes.o : cxx tests/bytes.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libbytes-test.a : library $OBJDIR/tests/bytes.o
|
||||
build $OBJDIR/bytes-test : link $OBJDIR/libbytes-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/bytes-test.stamp : test $OBJDIR/bytes-test
|
||||
build $OBJDIR/tests/crunch.o : cxx tests/crunch.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libcrunch-test.a : library $OBJDIR/tests/crunch.o
|
||||
build $OBJDIR/crunch-test : link $OBJDIR/libcrunch-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/crunch-test.stamp : test $OBJDIR/crunch-test
|
||||
build $OBJDIR/tests/fluxpattern.o : cxx tests/fluxpattern.cc
|
||||
flags= -Ilib -I/usr/include/libusb-1.0 -Idep/fmt
|
||||
build $OBJDIR/libfluxpattern-test.a : library $OBJDIR/tests/fluxpattern.o
|
||||
build $OBJDIR/fluxpattern-test : link $OBJDIR/libfluxpattern-test.a $OBJDIR/libbackend.a $OBJDIR/libfmt.a
|
||||
flags= -lz -lsqlite3 -lusb-1.0
|
||||
build $OBJDIR/fluxpattern-test.stamp : test $OBJDIR/fluxpattern-test
|
||||
@@ -3416,7 +3416,7 @@ auto join(const Range &range, wstring_view sep)
|
||||
|
||||
**Example**::
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
|
||||
std::string answer = fmt::to_string(42);
|
||||
\endrst
|
||||
@@ -3697,7 +3697,7 @@ FMT_END_NAMESPACE
|
||||
**Example**::
|
||||
|
||||
#define FMT_STRING_ALIAS 1
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
// A compile-time error because 'd' is an invalid specifier for strings.
|
||||
std::string s = format(fmt("{:d}"), "foo");
|
||||
\endrst
|
||||
|
||||
@@ -142,15 +142,19 @@ the port and proceed normally.
|
||||
The client software is where the intelligence, such as it is, is. It's pretty
|
||||
generic libusb stuff and should build and run on Windows, Linux and OSX as
|
||||
well, although on Windows I've only ever used it with Cygwin. You'll need the
|
||||
`sqlite3`, `meson` and `ninja` packages (which should be easy to come by in
|
||||
your distribution). Just do `make` and it should build.
|
||||
`sqlite3`, `libusb-1.0` and `ninja` packages (which should be easy to come by
|
||||
in your distribution). Just do `ninja` and it should build. The result will
|
||||
be a single executable, `fluxengine`, in the current directory. It has
|
||||
minimal dependencies and can be installed anywhere.
|
||||
|
||||
If it doesn't build, please [get in
|
||||
touch](https://github.com/davidgiven/fluxengine/issues/new).
|
||||
|
||||
## Next steps
|
||||
|
||||
The board's now assembled and programmed. Plug it into your drive, strip the plastic off the little USB connector and plug that into your computer, and you're ready to start using it.
|
||||
The board's now assembled and programmed. Plug it into your drive, strip the
|
||||
plastic off the little USB connector and plug that into your computer, and
|
||||
you're ready to start using it.
|
||||
|
||||
I _do_ make updates to the firmware whenever necessary, so you may need to
|
||||
reprogram it at intervals; you may want to take this into account if you
|
||||
|
||||
@@ -31,7 +31,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readadfs
|
||||
fluxengine read adfs
|
||||
```
|
||||
|
||||
You should end up with an `adfs.img` of the appropriate size for your disk
|
||||
|
||||
@@ -19,7 +19,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readdfs
|
||||
fluxengine read dfs
|
||||
```
|
||||
|
||||
You should end up with an `dfs.img` of the appropriate size for your disk
|
||||
|
||||
@@ -33,7 +33,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readaeslanier
|
||||
fluxengine read aeslanier
|
||||
```
|
||||
|
||||
Useful references
|
||||
|
||||
@@ -16,7 +16,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readamiga
|
||||
fluxengine read amiga
|
||||
```
|
||||
|
||||
You should end up with an `amiga.adf` which is 901120 bytes long (for a
|
||||
|
||||
@@ -19,7 +19,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readampro
|
||||
fluxengine read ampro
|
||||
```
|
||||
|
||||
You should end up with an `ampro.img` which is 409600 or 819200 bytes long.
|
||||
|
||||
@@ -17,9 +17,9 @@ scheme applied to the data before it goes down on disk to speed up
|
||||
checksumming.
|
||||
|
||||
Macintosh disks come in two varieties: the newer 1440kB ones, which are
|
||||
perfectly ordinary PC disks you should use `fe-readibm` to read, and the
|
||||
older 800kB disks (and 400kB for the single sides ones). They have 80 tracks
|
||||
and up to 12 sectors per track.
|
||||
perfectly ordinary PC disks you should use `fluxengine read ibm` to read, and
|
||||
the older 800kB disks (and 400kB for the single sides ones). They have 80
|
||||
tracks and up to 12 sectors per track.
|
||||
|
||||
In addition, a lot of the behaviour of the drive was handled in software.
|
||||
This means that Apple II disks can do all kinds of weird things, including
|
||||
@@ -42,7 +42,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readapple2
|
||||
fluxengine read apple2
|
||||
```
|
||||
|
||||
You should end up with an `apple2.img` which is 143360 bytes long.
|
||||
|
||||
@@ -8,7 +8,7 @@ size.
|
||||
Different word processors use different disk formats --- the only ones
|
||||
supported by FluxEngine are the 120kB and 240kB 3.5" formats. The default
|
||||
options are for the 240kB format. For the 120kB format, which is 40 track, do
|
||||
`fe-readbrother -s :t=1-79x2`.
|
||||
`fluxengine read brother -s :t=1-79x2`.
|
||||
|
||||
Apparently about 20% of Brother word processors have alignment issues which
|
||||
means that the disks can't be read by FluxEngine (because the tracks on the
|
||||
@@ -36,7 +36,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readbrother
|
||||
fluxengine read brother
|
||||
```
|
||||
|
||||
You should end up with a `brother.img` which is 239616 bytes long.
|
||||
@@ -47,7 +47,7 @@ Writing discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-writebrother
|
||||
fluxengine write brother
|
||||
```
|
||||
|
||||
...and it'll write a `brother.img` file which is 239616 bytes long to the
|
||||
|
||||
@@ -3,8 +3,8 @@ Disk: Commodore 64
|
||||
|
||||
Commodore 64 disks come in two varieties: GCR, which are the overwhelming
|
||||
majority; and MFM, only used on the 1571 and 1581. The latter were (as far as
|
||||
I can tell) standard IBM PC format disks, so use `fe-readibm` to read them
|
||||
(and then [let me know if it
|
||||
I can tell) standard IBM PC format disks, so use `fluxengine read ibm` to
|
||||
read them (and then [let me know if it
|
||||
worked](https://github.com/davidgiven/fluxengine/issues/new).
|
||||
|
||||
The GCR disks are much more interesting. They could store 170kB on a
|
||||
@@ -31,7 +31,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readc64
|
||||
fluxengine read c64
|
||||
```
|
||||
|
||||
You should end up with an `c64.img` which is 187136 bytes long (for a normal
|
||||
|
||||
@@ -32,7 +32,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readf85
|
||||
fluxengine read f85
|
||||
```
|
||||
|
||||
You should end up with an `f85.img` which is 472064 bytes long.
|
||||
|
||||
@@ -26,7 +26,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readfb100
|
||||
fluxengine read fb100
|
||||
```
|
||||
|
||||
You should end up with an `fb100.img` of the appropriate size. It's a simple
|
||||
|
||||
@@ -2,9 +2,9 @@ Disk: Macintosh
|
||||
===============
|
||||
|
||||
Macintosh disks come in two varieties: the newer 1440kB ones, which are
|
||||
perfectly ordinary PC disks you should use `fe-readibm` to read, and the
|
||||
older 800kB disks (and 400kB for the single sides ones). They have 80 tracks
|
||||
and up to 12 sectors per track.
|
||||
perfectly ordinary PC disks you should use `fluxengine read ibm` to read, and
|
||||
the older 800kB disks (and 400kB for the single sides ones). They have 80
|
||||
tracks and up to 12 sectors per track.
|
||||
|
||||
They are also completely insane.
|
||||
|
||||
@@ -37,7 +37,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readmac
|
||||
fluxengine read mac
|
||||
```
|
||||
|
||||
You should end up with an `mac.img` which is 1001888 bytes long (for a normal
|
||||
|
||||
@@ -22,7 +22,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readibm
|
||||
fluxengine read ibm
|
||||
```
|
||||
|
||||
You should end up with an `ibm.img` of the appropriate size. It's a simple
|
||||
|
||||
@@ -16,7 +16,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readvictor9k
|
||||
fluxengine read victor9k
|
||||
```
|
||||
|
||||
You should end up with an `victor9k.img` which is 774656 bytes long.
|
||||
|
||||
@@ -30,7 +30,7 @@ Reading discs
|
||||
Just do:
|
||||
|
||||
```
|
||||
.obj/fe-readzilogmcz
|
||||
fluxengine read zilogmcz
|
||||
```
|
||||
|
||||
You should end up with an `zilogmcz.img` which is 315392 bytes long.
|
||||
|
||||
@@ -133,14 +133,14 @@ probably never need to touch them.
|
||||
Clock detection
|
||||
---------------
|
||||
|
||||
A very useful tool for examining problematic disks is `fe-inspect`. This will
|
||||
let you examine the raw flux on a disk (or flux file). It'll also guess the
|
||||
clock rate on the disk for you, using a simple statistical analysis of the
|
||||
pulse intervals on the disk. (Note that the tool only works on one track at a
|
||||
time.)
|
||||
A very useful tool for examining problematic disks is `fluxengine inspect`.
|
||||
This will let you examine the raw flux on a disk (or flux file). It'll also
|
||||
guess the clock rate on the disk for you, using a simple statistical analysis
|
||||
of the pulse intervals on the disk. (Note that the tool only works on one
|
||||
track at a time.)
|
||||
|
||||
```
|
||||
$ fe-inspect -s good.flux:t=0:s=0
|
||||
$ fluxengine inspect -s good.flux:t=0:s=0
|
||||
Clock detection histogram:
|
||||
3.58 737 ▉
|
||||
3.67 3838 ████▊
|
||||
@@ -192,7 +192,7 @@ So, what does my Victor 9000 histogram look like? Let's look at the
|
||||
histogram for a single track:
|
||||
|
||||
```
|
||||
$ fe-inspect -s dubious.flux:t=0:s=0
|
||||
$ fluxengine inspect -s dubious.flux:t=0:s=0
|
||||
Clock detection histogram:
|
||||
1.33 1904 █▉
|
||||
1.42 21669 ██████████████████████▌
|
||||
@@ -241,15 +241,15 @@ That's... not good. The disk is very noisy, and the intervals between pulses
|
||||
are horribly distributed. The detected clock from the decode is 1.45us, which
|
||||
does correspond more-or-less to a peak. You'll also notice that the
|
||||
double-clock interval is at 3.00us, which is _not_ twice 1.45us. The guessed
|
||||
clock by `fe-inspect` is 1.67us, which is clearly wrong.
|
||||
clock by `fluxengine inspect` is 1.67us, which is clearly wrong.
|
||||
|
||||
This demonstrates that the statistical clock guessing isn't brilliant, which
|
||||
is why I've just rewritten the decoder not to use it; nevertheless, it's a
|
||||
useful tool for examining disks.
|
||||
|
||||
`fe-inspect` will also dump the raw flux data in various formats, but that's
|
||||
mostly only useful to me. Try `--dump-bits` to see the raw bit pattern on the
|
||||
disk (using the guessed clock, or `--manual-clock-rate-us` to set it
|
||||
`fluxengine inspect` will also dump the raw flux data in various formats, but
|
||||
that's mostly only useful to me. Try `--dump-bits` to see the raw bit pattern
|
||||
on the disk (using the guessed clock, or `--manual-clock-rate-us` to set it
|
||||
yourself); `--dump-flux` will show you discrete pulses and the intervals
|
||||
between them.
|
||||
|
||||
|
||||
82
doc/using.md
82
doc/using.md
@@ -46,28 +46,30 @@ In order to do anything useful, you have to plug it in to a floppy disk drive (o
|
||||
5. Connect the FluxEngine to your PC via USB --- using the little socket on
|
||||
the board, not the big programmer plug.
|
||||
|
||||
6. Insert a scratch disk and do `.obj/fe-rpm` from the shell. The motor
|
||||
6. Insert a scratch disk and do `fluxengine rpm` from the shell. The motor
|
||||
should work and it'll tell you that the disk is spinning at about 300
|
||||
rpm for a 3.5" disk, or 360 rpm for a 5.25" disk. If it doesn't, please
|
||||
[get in touch](https://github.com/davidgiven/fluxengine/issues/new).
|
||||
|
||||
7. Do `.obj/fe-testbulktransport` from the shell. It'll measure your USB
|
||||
7. Do `fluxengine testbulktransport` from the shell. It'll measure your USB
|
||||
bandwidth. Ideally you should be getting above 900kB/s. FluxEngine needs
|
||||
about 850kB/s, so if you're getting less than this, try a different USB
|
||||
port.
|
||||
|
||||
8. Insert a standard PC formatted floppy disk into the drive (probably a good
|
||||
idea to remove the old disk first). Then do `.obj/fe-readibm`. It should
|
||||
read the disk, emitting copious diagnostics, and spit out an `ibm.img`
|
||||
file containing the decoded disk image (either 1440kB or 720kB depending).
|
||||
idea to remove the old disk first). Then do `fluxengine read ibm`. It
|
||||
should read the disk, emitting copious diagnostics, and spit out an
|
||||
`ibm.img` file containing the decoded disk image (either 1440kB or 720kB
|
||||
depending).
|
||||
|
||||
9. Profit!
|
||||
|
||||
## The programs
|
||||
|
||||
I'm sorry to say that the programs are very badly documented --- they're
|
||||
moving too quickly for the documentation to keep up. They do all respond to
|
||||
`--help`. There are some common properties, described below.
|
||||
I'm sorry to say that the client program is very badly documented --- it's
|
||||
moving too quickly for the documentation to keep up. It does respond to
|
||||
`--help` or `help` depending on context. There are some common properties,
|
||||
described below.
|
||||
|
||||
### Source and destination specifiers
|
||||
|
||||
@@ -76,7 +78,7 @@ use the `--source` (`-s`) and `--dest` (`-d`) options to tell FluxEngine
|
||||
which bits of the disk you want to access. These use a common syntax:
|
||||
|
||||
```
|
||||
.obj/fe-readibm -s fakedisk.flux:t=0-79:s=0
|
||||
fluxengine read ibm -s fakedisk.flux:t=0-79:s=0
|
||||
```
|
||||
|
||||
- To access a real disk, leave out the filename (so `:t=0-79:s=0`).
|
||||
@@ -136,43 +138,47 @@ You'll have to play with them. They all support `--help`. They're not
|
||||
installed anywhere and after building you'll find them in the `.obj`
|
||||
directory.
|
||||
|
||||
- `fe-erase`: wipes (all or part of) a disk --- erases it without writing
|
||||
a pulsetrain.
|
||||
- `fluxengine erase`: wipes (all or part of) a disk --- erases it without
|
||||
writing a pulsetrain.
|
||||
|
||||
- `fe-inspect`: dumps the raw pulsetrain / bitstream to stdout. Mainly useful
|
||||
for debugging.
|
||||
- `fluxengine inspect`: dumps the raw pulsetrain / bitstream to stdout.
|
||||
Mainly useful for debugging.
|
||||
|
||||
- `fe-read*`: reads various formats of disk. See the per-format documentation
|
||||
linked from the table above. These all take an optional `--write-flux`
|
||||
option which will cause the raw flux to be written to the specified file.
|
||||
- `fluxengine read*`: reads various formats of disk. See the per-format
|
||||
documentation linked from the table above. These all take an optional
|
||||
`--write-flux` option which will cause the raw flux to be written to the
|
||||
specified file.
|
||||
|
||||
- `fe-write*`: writes various formats of disk. Again, see the per-format
|
||||
documentation above.
|
||||
- `fluxengine write*`: writes various formats of disk. Again, see the
|
||||
per-format documentation above.
|
||||
|
||||
- `fe-writeflux`: writes raw flux files. This is much less useful than you
|
||||
might think: you can't write flux files read from a disk to another disk.
|
||||
(See the [FAQ](faq.md) for more information.) It's mainly useful for flux
|
||||
files synthesised by the other `fe-write*` commands.
|
||||
- `fluxengine writeflux`: writes raw flux files. This is much less useful
|
||||
than you might think: you can't write flux files read from a disk to
|
||||
another disk. (See the [FAQ](faq.md) for more information.) It's mainly
|
||||
useful for flux files synthesised by the other `fluxengine write` commands.
|
||||
|
||||
- `fe-writetestpattern`: writes regular pulses (at a configurable interval)
|
||||
to the disk. Useful for testing drive jitter, erasing disks in a more
|
||||
secure fashion, or simply debugging. Goes well with `fe-inspect`.
|
||||
- `fluxengine writetestpattern`: writes regular pulses (at a configurable
|
||||
interval) to the disk. Useful for testing drive jitter, erasing disks in a
|
||||
more secure fashion, or simply debugging. Goes well with `fluxengine
|
||||
inspect`.
|
||||
|
||||
- `fe-rpm`: measures the RPM of the drive (requires a disk in the drive).
|
||||
Mainly useful for testing.
|
||||
- `fluxengine rpm`: measures the RPM of the drive (requires a disk in the
|
||||
drive). Mainly useful for testing.
|
||||
|
||||
- `fe-seek`: moves the head. Mainly useful for finding out whether your drive
|
||||
can seek to track 82. (Mine can't.)
|
||||
- `fluxengine seek`: moves the head. Mainly useful for finding out whether
|
||||
your drive can seek to track 82. (Mine can't.)
|
||||
|
||||
- `fe-testbulktransport`: measures your USB throughput. You need about 600kB/s
|
||||
for FluxEngine to work. You don't need a disk in the drive for this one.
|
||||
- `fluxengine testbulktransport`: measures your USB throughput. You need
|
||||
about 600kB/s for FluxEngine to work. You don't need a disk in the drive
|
||||
for this one.
|
||||
|
||||
- `fe-upgradefluxfile`: occasionally I need to upgrade the flux file format in
|
||||
a non-backwards-compatible way; this tool will upgrade flux files to the new
|
||||
format.
|
||||
- `fluxengine upgradefluxfile`: occasionally I need to upgrade the flux
|
||||
file format in a non-backwards-compatible way; this tool will upgrade flux
|
||||
files to the new format.
|
||||
|
||||
Commands which normally take `--source` or `--dest` get a sensible default if left
|
||||
unspecified. `fe-readibm` on its own will read drive 0 and write an `ibm.img` file.
|
||||
Commands which normally take `--source` or `--dest` get a sensible default if
|
||||
left unspecified. `fluxengine read ibm` on its own will read drive 0 and
|
||||
write an `ibm.img` file.
|
||||
|
||||
## Extra programs
|
||||
|
||||
@@ -191,7 +197,7 @@ So you've just received, say, a huge pile of old Brother word processor disks co
|
||||
Typically I do this:
|
||||
|
||||
```
|
||||
$ fe-readbrother -s :d=0 -o brother.img --write-flux=brother.flux
|
||||
$ fluxengine read brother -s :d=0 -o brother.img --write-flux=brother.flux
|
||||
```
|
||||
|
||||
This will read the disk in drive 0 and write out a filesystem image. It'll
|
||||
@@ -199,7 +205,7 @@ also copy the flux to brother.flux. If I then need to tweak the settings, I
|
||||
can rerun the decode without having to physically touch the disk like this:
|
||||
|
||||
```
|
||||
$ fe-readbrother -s brother.flux -o brother.img
|
||||
$ fluxengine read brother -s brother.flux -o brother.img
|
||||
```
|
||||
|
||||
Apart from being drastically faster, this avoids touching the (potentially
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "aeslanier.h"
|
||||
#include "crc.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "sector.h"
|
||||
#include "bytes.h"
|
||||
#include "record.h"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "protocol.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "amiga.h"
|
||||
#include "bytes.h"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "protocol.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "apple2.h"
|
||||
#include "bytes.h"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "globals.h"
|
||||
#include "sql.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "record.h"
|
||||
#include "brother.h"
|
||||
#include "sector.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "globals.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "brother.h"
|
||||
#include "crc.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "globals.h"
|
||||
#include "bytes.h"
|
||||
#include "fmt/format.h"
|
||||
#include "crunch.h"
|
||||
#include "common/crunch.h"
|
||||
#include <zlib.h>
|
||||
|
||||
static std::shared_ptr<std::vector<uint8_t>> createVector(unsigned size)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "protocol.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "c64.h"
|
||||
#include "crc.h"
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
#include <regex>
|
||||
#include <sstream>
|
||||
|
||||
static const std::regex MOD_REGEX("([a-z]*)=([-x+0-9,]*)");
|
||||
static const std::regex DATA_REGEX("([0-9]+)(?:(?:-([0-9]+))|(?:\\+([0-9]+)))?(?:x([0-9]+))?");
|
||||
|
||||
std::vector<std::string> DataSpec::split(
|
||||
const std::string& s, const std::string& delimiter)
|
||||
{
|
||||
@@ -30,6 +27,9 @@ std::vector<std::string> DataSpec::split(
|
||||
|
||||
DataSpec::Modifier DataSpec::parseMod(const std::string& spec)
|
||||
{
|
||||
static const std::regex MOD_REGEX("([a-z]*)=([-x+0-9,]*)");
|
||||
static const std::regex DATA_REGEX("([0-9]+)(?:(?:-([0-9]+))|(?:\\+([0-9]+)))?(?:x([0-9]+))?");
|
||||
|
||||
std::smatch match;
|
||||
if (!std::regex_match(spec, match, MOD_REGEX))
|
||||
Error() << "invalid data modifier syntax '" << spec << "'";
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
unsigned revolutions;
|
||||
};
|
||||
|
||||
std::ostream& operator << (std::ostream& os, const DataSpec& dataSpec)
|
||||
static inline std::ostream& operator << (std::ostream& os, const DataSpec& dataSpec)
|
||||
{ os << (std::string)dataSpec; return os; }
|
||||
|
||||
class DataSpecFlag : public Flag
|
||||
@@ -58,15 +58,21 @@ public:
|
||||
DataSpecFlag(const std::vector<std::string>& names, const std::string helptext,
|
||||
const std::string& defaultValue):
|
||||
Flag(names, helptext),
|
||||
value(defaultValue)
|
||||
_value(defaultValue)
|
||||
{}
|
||||
|
||||
bool hasArgument() const { return true; }
|
||||
const std::string defaultValueAsString() const { return value; }
|
||||
void set(const std::string& value) { this->value.set(value); }
|
||||
const DataSpec& get() const
|
||||
{ checkInitialised(); return _value; }
|
||||
|
||||
public:
|
||||
DataSpec value;
|
||||
operator const DataSpec& () const
|
||||
{ return get(); }
|
||||
|
||||
bool hasArgument() const { return true; }
|
||||
const std::string defaultValueAsString() const { return _value; }
|
||||
void set(const std::string& value) { _value.set(value); }
|
||||
|
||||
private:
|
||||
DataSpec _value;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#include "globals.h"
|
||||
#include "flags.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "record.h"
|
||||
#include "protocol.h"
|
||||
#include "rawbits.h"
|
||||
#include "decoders/rawbits.h"
|
||||
#include "track.h"
|
||||
#include "sector.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "bytes.h"
|
||||
#include "sector.h"
|
||||
#include "record.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
|
||||
class Sector;
|
||||
class Fluxmap;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "flags.h"
|
||||
#include "protocol.h"
|
||||
#include "fmt/format.h"
|
||||
@@ -8,7 +8,9 @@
|
||||
#include <math.h>
|
||||
#include <strings.h>
|
||||
|
||||
static DoubleFlag pulseDebounceThreshold(
|
||||
FlagGroup fluxmapReaderFlags;
|
||||
|
||||
DoubleFlag pulseDebounceThreshold(
|
||||
{ "--pulse-debounce-threshold" },
|
||||
"Ignore pulses with intervals short than this, in fractions of a clock.",
|
||||
0.30);
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
#include "fluxmap.h"
|
||||
#include "protocol.h"
|
||||
#include "flags.h"
|
||||
|
||||
extern FlagGroup fluxmapReaderFlags;
|
||||
|
||||
class FluxMatcher;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "globals.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
|
||||
Bytes decodeFmMfm(
|
||||
std::vector<bool>::const_iterator ii, std::vector<bool>::const_iterator end)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "protocol.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "f85.h"
|
||||
#include "crc.h"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "protocol.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "fb100.h"
|
||||
#include "crc.h"
|
||||
#include "bytes.h"
|
||||
#include "rawbits.h"
|
||||
#include "decoders/rawbits.h"
|
||||
#include "track.h"
|
||||
#include "fmt/format.h"
|
||||
#include <string.h>
|
||||
|
||||
94
lib/flags.cc
94
lib/flags.cc
@@ -1,25 +1,71 @@
|
||||
#include "globals.h"
|
||||
#include "flags.h"
|
||||
|
||||
static FlagGroup* currentFlagGroup;
|
||||
static std::vector<Flag*> all_flags;
|
||||
static std::map<const std::string, Flag*> flags_by_name;
|
||||
|
||||
Flag::Flag(const std::vector<std::string>& names, const std::string helptext):
|
||||
_names(names),
|
||||
_helptext(helptext)
|
||||
{
|
||||
for (auto& name : names)
|
||||
{
|
||||
if (flags_by_name.find(name) != flags_by_name.end())
|
||||
Error() << "two flags use the name '" << name << "'";
|
||||
flags_by_name[name] = this;
|
||||
}
|
||||
static void doHelp();
|
||||
|
||||
all_flags.push_back(this);
|
||||
static FlagGroup helpGroup;
|
||||
static ActionFlag helpFlag = ActionFlag(
|
||||
{ "--help", "-h" },
|
||||
"Shows the help.",
|
||||
doHelp);
|
||||
|
||||
FlagGroup::FlagGroup(const std::initializer_list<FlagGroup*> groups):
|
||||
_groups(groups.begin(), groups.end())
|
||||
{
|
||||
currentFlagGroup = this;
|
||||
}
|
||||
|
||||
void Flag::parseFlags(int argc, const char* argv[])
|
||||
FlagGroup::FlagGroup()
|
||||
{
|
||||
currentFlagGroup = this;
|
||||
}
|
||||
|
||||
void FlagGroup::addFlag(Flag* flag)
|
||||
{
|
||||
_flags.push_back(flag);
|
||||
}
|
||||
|
||||
void FlagGroup::parseFlags(int argc, const char* argv[])
|
||||
{
|
||||
if (_initialised)
|
||||
throw std::runtime_error("called parseFlags() twice");
|
||||
|
||||
/* Recursively accumulate a list of all flags. */
|
||||
|
||||
all_flags.clear();
|
||||
flags_by_name.clear();
|
||||
std::function<void(FlagGroup*)> recurse;
|
||||
recurse = [&](FlagGroup* group)
|
||||
{
|
||||
if (group->_initialised)
|
||||
return;
|
||||
|
||||
for (FlagGroup* subgroup : group->_groups)
|
||||
recurse(subgroup);
|
||||
|
||||
for (Flag* flag : group->_flags)
|
||||
{
|
||||
for (const auto& name : flag->names())
|
||||
{
|
||||
if (flags_by_name.find(name) != flags_by_name.end())
|
||||
Error() << "two flags use the name '" << name << "'";
|
||||
flags_by_name[name] = flag;
|
||||
}
|
||||
|
||||
all_flags.push_back(flag);
|
||||
}
|
||||
|
||||
group->_initialised = true;
|
||||
};
|
||||
recurse(this);
|
||||
recurse(&helpGroup);
|
||||
|
||||
/* Now actually parse them. */
|
||||
|
||||
int index = 1;
|
||||
while (index < argc)
|
||||
{
|
||||
@@ -76,15 +122,28 @@ void Flag::parseFlags(int argc, const char* argv[])
|
||||
if (usesthat && flag->second->hasArgument())
|
||||
index++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FlagGroup::checkInitialised() const
|
||||
{
|
||||
if (!_initialised)
|
||||
throw std::runtime_error("Attempt to access uninitialised flag");
|
||||
}
|
||||
|
||||
Flag::Flag(const std::vector<std::string>& names, const std::string helptext):
|
||||
_group(*currentFlagGroup),
|
||||
_names(names),
|
||||
_helptext(helptext)
|
||||
{
|
||||
_group.addFlag(this);
|
||||
}
|
||||
|
||||
void BoolFlag::set(const std::string& value)
|
||||
{
|
||||
if ((value == "true") || (value == "y"))
|
||||
this->value = true;
|
||||
_value = true;
|
||||
else if ((value == "false") || (value == "n"))
|
||||
this->value = false;
|
||||
_value = false;
|
||||
else
|
||||
Error() << "can't parse '" << value << "'; try 'true' or 'false'";
|
||||
}
|
||||
@@ -110,8 +169,3 @@ static void doHelp()
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static ActionFlag helpFlag = ActionFlag(
|
||||
{ "--help", "-h" },
|
||||
"Shows the help.",
|
||||
doHelp);
|
||||
|
||||
63
lib/flags.h
63
lib/flags.h
@@ -2,15 +2,36 @@
|
||||
#define FLAGS_H
|
||||
|
||||
class DataSpec;
|
||||
class Flag;
|
||||
|
||||
class FlagGroup
|
||||
{
|
||||
private:
|
||||
FlagGroup(const FlagGroup& group);
|
||||
public:
|
||||
FlagGroup(const std::initializer_list<FlagGroup*> groups);
|
||||
FlagGroup();
|
||||
|
||||
public:
|
||||
void parseFlags(int argc, const char* argv[]);
|
||||
void addFlag(Flag* flag);
|
||||
void checkInitialised() const;
|
||||
|
||||
private:
|
||||
bool _initialised = false;
|
||||
const std::vector<FlagGroup*> _groups;
|
||||
std::vector<Flag*> _flags;
|
||||
};
|
||||
|
||||
class Flag
|
||||
{
|
||||
public:
|
||||
static void parseFlags(int argc, const char* argv[]);
|
||||
|
||||
Flag(const std::vector<std::string>& names, const std::string helptext);
|
||||
virtual ~Flag() {};
|
||||
|
||||
void checkInitialised() const
|
||||
{ _group.checkInitialised(); }
|
||||
|
||||
const std::string& name() const { return _names[0]; }
|
||||
const std::vector<std::string> names() const { return _names; }
|
||||
const std::string& helptext() const { return _helptext; }
|
||||
@@ -20,6 +41,7 @@ public:
|
||||
virtual void set(const std::string& value) = 0;
|
||||
|
||||
private:
|
||||
FlagGroup& _group;
|
||||
const std::vector<std::string> _names;
|
||||
const std::string _helptext;
|
||||
};
|
||||
@@ -48,7 +70,8 @@ public:
|
||||
Flag(names, helptext)
|
||||
{}
|
||||
|
||||
operator bool() const { return _value; }
|
||||
operator bool() const
|
||||
{ checkInitialised(); return _value; }
|
||||
|
||||
bool hasArgument() const { return false; }
|
||||
const std::string defaultValueAsString() const { return "false"; }
|
||||
@@ -65,16 +88,26 @@ public:
|
||||
ValueFlag(const std::vector<std::string>& names, const std::string helptext,
|
||||
const T defaultValue):
|
||||
Flag(names, helptext),
|
||||
defaultValue(defaultValue),
|
||||
value(defaultValue)
|
||||
_defaultValue(defaultValue),
|
||||
_value(defaultValue)
|
||||
{}
|
||||
|
||||
operator T() const { return value; }
|
||||
const T& get() const
|
||||
{ checkInitialised(); return _value; }
|
||||
|
||||
operator const T& () const
|
||||
{ return get(); }
|
||||
|
||||
void setDefaultValue(T value)
|
||||
{
|
||||
_value = _defaultValue = value;
|
||||
}
|
||||
|
||||
bool hasArgument() const { return true; }
|
||||
|
||||
T defaultValue;
|
||||
T value;
|
||||
protected:
|
||||
T _defaultValue;
|
||||
T _value;
|
||||
};
|
||||
|
||||
class StringFlag : public ValueFlag<std::string>
|
||||
@@ -85,8 +118,8 @@ public:
|
||||
ValueFlag(names, helptext, defaultValue)
|
||||
{}
|
||||
|
||||
const std::string defaultValueAsString() const { return defaultValue; }
|
||||
void set(const std::string& value) { this->value = value; }
|
||||
const std::string defaultValueAsString() const { return _defaultValue; }
|
||||
void set(const std::string& value) { _value = value; }
|
||||
};
|
||||
|
||||
class IntFlag : public ValueFlag<int>
|
||||
@@ -97,8 +130,8 @@ public:
|
||||
ValueFlag(names, helptext, defaultValue)
|
||||
{}
|
||||
|
||||
const std::string defaultValueAsString() const { return std::to_string(defaultValue); }
|
||||
void set(const std::string& value) { this->value = std::stoi(value); }
|
||||
const std::string defaultValueAsString() const { return std::to_string(_defaultValue); }
|
||||
void set(const std::string& value) { _value = std::stoi(value); }
|
||||
};
|
||||
|
||||
class DoubleFlag : public ValueFlag<double>
|
||||
@@ -109,8 +142,8 @@ public:
|
||||
ValueFlag(names, helptext, defaultValue)
|
||||
{}
|
||||
|
||||
const std::string defaultValueAsString() const { return std::to_string(defaultValue); }
|
||||
void set(const std::string& value) { this->value = std::stod(value); }
|
||||
const std::string defaultValueAsString() const { return std::to_string(_defaultValue); }
|
||||
void set(const std::string& value) { _value = std::stod(value); }
|
||||
};
|
||||
|
||||
class BoolFlag : public ValueFlag<double>
|
||||
@@ -121,7 +154,7 @@ public:
|
||||
ValueFlag(names, helptext, defaultValue)
|
||||
{}
|
||||
|
||||
const std::string defaultValueAsString() const { return defaultValue ? "true" : "false"; }
|
||||
const std::string defaultValueAsString() const { return _defaultValue ? "true" : "false"; }
|
||||
void set(const std::string& value);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "globals.h"
|
||||
#include "flags.h"
|
||||
#include "dataspec.h"
|
||||
#include "fluxsink.h"
|
||||
#include "fluxsink/fluxsink.h"
|
||||
|
||||
static bool ends_with(const std::string& value, const std::string& ending)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "flags.h"
|
||||
#include "fluxmap.h"
|
||||
#include "usb.h"
|
||||
#include "fluxsink.h"
|
||||
#include "fluxsink/fluxsink.h"
|
||||
|
||||
static bool high_density = false;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "sql.h"
|
||||
#include "fluxsink.h"
|
||||
#include "fluxsink/fluxsink.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
class SqliteFluxSink : public FluxSink
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "globals.h"
|
||||
#include "flags.h"
|
||||
#include "dataspec.h"
|
||||
#include "fluxsource.h"
|
||||
#include "fluxsource/fluxsource.h"
|
||||
|
||||
static bool ends_with(const std::string& value, const std::string& ending)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifndef FLUXSOURCE_H
|
||||
#define FLUXSOURCE_H
|
||||
|
||||
#include "flags.h"
|
||||
|
||||
extern FlagGroup hardwareFluxSourceFlags;
|
||||
|
||||
class Fluxmap;
|
||||
class DataSpec;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#include "flags.h"
|
||||
#include "fluxmap.h"
|
||||
#include "usb.h"
|
||||
#include "fluxsource.h"
|
||||
#include "fluxsource/fluxsource.h"
|
||||
|
||||
FlagGroup hardwareFluxSourceFlags;
|
||||
|
||||
static IntFlag revolutions(
|
||||
{ "--revolutions" },
|
||||
@@ -56,7 +58,7 @@ private:
|
||||
|
||||
void setHardwareFluxSourceRevolutions(int revolutions)
|
||||
{
|
||||
::revolutions.value = ::revolutions.defaultValue = revolutions;
|
||||
::revolutions.setDefaultValue(revolutions);
|
||||
}
|
||||
|
||||
std::unique_ptr<FluxSource> FluxSource::createHardwareFluxSource(unsigned drive)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "sql.h"
|
||||
#include "fluxsource.h"
|
||||
#include "fluxsource/fluxsource.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
class SqliteFluxSource : public FluxSource
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "kryoflux.h"
|
||||
#include "fluxsource.h"
|
||||
#include "fluxsource/fluxsource.h"
|
||||
|
||||
class StreamFluxSource : public FluxSource
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "ibm.h"
|
||||
#include "crc.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "sector.h"
|
||||
#include "record.h"
|
||||
#include <string.h>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef IBM_H
|
||||
#define IBM_H
|
||||
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
|
||||
/* IBM format (i.e. ordinary PC floppies). */
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "protocol.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "track.h"
|
||||
#include "macintosh.h"
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "decoders.h"
|
||||
#include "mx.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "mx/mx.h"
|
||||
#include "crc.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "sector.h"
|
||||
#include "record.h"
|
||||
#include "track.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef MX_H
|
||||
#define MX_H
|
||||
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
|
||||
class MxDecoder : public AbstractDecoder
|
||||
{
|
||||
|
||||
@@ -1,21 +1,23 @@
|
||||
#include "globals.h"
|
||||
#include "flags.h"
|
||||
#include "usb.h"
|
||||
#include "fluxsource.h"
|
||||
#include "fluxsource/fluxsource.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "sql.h"
|
||||
#include "dataspec.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include "image.h"
|
||||
#include "bytes.h"
|
||||
#include "rawbits.h"
|
||||
#include "decoders/rawbits.h"
|
||||
#include "track.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
FlagGroup readerFlags { &hardwareFluxSourceFlags, &fluxmapReaderFlags };
|
||||
|
||||
static DataSpecFlag source(
|
||||
{ "--source", "-s" },
|
||||
"source for data",
|
||||
@@ -69,16 +71,16 @@ void Track::readFluxmap()
|
||||
|
||||
std::vector<std::unique_ptr<Track>> readTracks()
|
||||
{
|
||||
const DataSpec& dataSpec = source.value;
|
||||
const DataSpec& dataSpec = source;
|
||||
|
||||
std::cout << "Reading from: " << dataSpec << std::endl;
|
||||
|
||||
setHardwareFluxSourceDensity(highDensityFlag);
|
||||
|
||||
if (!destination.value.empty())
|
||||
if (!destination.get().empty())
|
||||
{
|
||||
outdb = sqlOpen(destination, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
|
||||
std::cout << "Writing a copy of the flux to " << destination.value << std::endl;
|
||||
std::cout << "Writing a copy of the flux to " << destination.get() << std::endl;
|
||||
sqlPrepareFlux(outdb);
|
||||
sqlStmt(outdb, "BEGIN;");
|
||||
sqlWriteIntProperty(outdb, "version", FLUX_VERSION_CURRENT);
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#ifndef READER_H
|
||||
#define READER_H
|
||||
|
||||
#include "flags.h"
|
||||
|
||||
class Fluxmap;
|
||||
class FluxSource;
|
||||
class AbstractDecoder;
|
||||
class Track;
|
||||
|
||||
extern FlagGroup readerFlags;
|
||||
|
||||
extern void setReaderDefaultSource(const std::string& source);
|
||||
extern void setReaderRevolutions(int revolutions);
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
#include "protocol.h"
|
||||
#include "fluxmap.h"
|
||||
#include "bytes.h"
|
||||
#include "crunch.h"
|
||||
#include "common/crunch.h"
|
||||
#include <libusb.h>
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
|
||||
#define TIMEOUT 5000
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "protocol.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "victor9k.h"
|
||||
#include "crc.h"
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
#include "protocol.h"
|
||||
#include "usb.h"
|
||||
#include "dataspec.h"
|
||||
#include "fluxsource.h"
|
||||
#include "fluxsink.h"
|
||||
#include "fluxsource/fluxsource.h"
|
||||
#include "fluxsink/fluxsink.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
FlagGroup writerFlags { &hardwareFluxSourceFlags };
|
||||
|
||||
static DataSpecFlag dest(
|
||||
{ "--dest", "-d" },
|
||||
"destination for data",
|
||||
@@ -29,7 +31,7 @@ void setWriterDefaultDest(const std::string& dest)
|
||||
void writeTracks(
|
||||
const std::function<std::unique_ptr<Fluxmap>(int track, int side)> producer)
|
||||
{
|
||||
const auto& spec = dest.value;
|
||||
const DataSpec& spec = dest;
|
||||
|
||||
std::cout << "Writing to: " << spec << std::endl;
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#ifndef WRITER_H
|
||||
#define WRITER_H
|
||||
|
||||
#include "flags.h"
|
||||
|
||||
extern FlagGroup writerFlags;
|
||||
|
||||
class Fluxmap;
|
||||
|
||||
extern void setWriterDefaultDest(const std::string& dest);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "protocol.h"
|
||||
#include "record.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "sector.h"
|
||||
#include "zilogmcz.h"
|
||||
#include "bytes.h"
|
||||
|
||||
280
meson.build
280
meson.build
@@ -1,280 +0,0 @@
|
||||
project('fluxclient', 'c', 'cpp')
|
||||
add_global_arguments('--std=c++14', language: 'cpp')
|
||||
|
||||
libusb = dependency('libusb-1.0')
|
||||
sqlite = dependency('sqlite3')
|
||||
zlib = dependency('zlib')
|
||||
|
||||
fmtlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('fmtlib',
|
||||
[
|
||||
'dep/fmt/format.cc',
|
||||
'dep/fmt/posix.cc'
|
||||
]
|
||||
),
|
||||
include_directories:
|
||||
include_directories('dep/fmt')
|
||||
)
|
||||
|
||||
crunchlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('crunch',
|
||||
['lib/common/crunch.c']
|
||||
),
|
||||
include_directories:
|
||||
include_directories('lib/common')
|
||||
)
|
||||
|
||||
felib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('felib',
|
||||
[
|
||||
'lib/crc.cc',
|
||||
'lib/dataspec.cc',
|
||||
'lib/hexdump.cc',
|
||||
'lib/sectorset.cc',
|
||||
'lib/flags.cc',
|
||||
'lib/fluxmap.cc',
|
||||
'lib/globals.cc',
|
||||
'lib/image.cc',
|
||||
'lib/sector.cc',
|
||||
'lib/usb.cc',
|
||||
'lib/bytes.cc',
|
||||
],
|
||||
dependencies: [fmtlib, crunchlib, libusb, zlib]
|
||||
),
|
||||
include_directories:
|
||||
include_directories('lib')
|
||||
)
|
||||
|
||||
sqllib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('sqllib',
|
||||
['lib/sql.cc'],
|
||||
dependencies: [fmtlib, felib, sqlite, zlib]
|
||||
)
|
||||
)
|
||||
|
||||
fluxsourcelib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('fluxsourcelib',
|
||||
[
|
||||
'lib/fluxsource/fluxsource.cc',
|
||||
'lib/fluxsource/sqlitefluxsource.cc',
|
||||
'lib/fluxsource/hardwarefluxsource.cc',
|
||||
'lib/fluxsource/streamfluxsource.cc',
|
||||
'lib/fluxsource/kryoflux.cc',
|
||||
],
|
||||
dependencies: [fmtlib, felib, sqllib, sqlite]
|
||||
),
|
||||
include_directories:
|
||||
include_directories('lib/fluxsource')
|
||||
)
|
||||
|
||||
fluxsinklib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('fluxsinklib',
|
||||
[
|
||||
'lib/fluxsink/fluxsink.cc',
|
||||
'lib/fluxsink/sqlitefluxsink.cc',
|
||||
'lib/fluxsink/hardwarefluxsink.cc',
|
||||
],
|
||||
dependencies: [fmtlib, felib, sqllib, sqlite]
|
||||
),
|
||||
include_directories:
|
||||
include_directories('lib/fluxsink')
|
||||
)
|
||||
|
||||
decoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('decoderlib',
|
||||
[
|
||||
'lib/decoders/decoders.cc',
|
||||
'lib/decoders/fmmfm.cc',
|
||||
'lib/decoders/fluxmapreader.cc',
|
||||
],
|
||||
dependencies: [fmtlib, felib]
|
||||
),
|
||||
include_directories:
|
||||
include_directories('lib/decoders')
|
||||
)
|
||||
|
||||
readerlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('readerlib',
|
||||
[
|
||||
'lib/reader.cc'],
|
||||
dependencies: [fmtlib, felib, sqllib, decoderlib, fluxsourcelib, sqlite])
|
||||
)
|
||||
|
||||
writerlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('writerlib',
|
||||
['lib/writer.cc'],
|
||||
dependencies: [fmtlib, felib, sqllib, fluxsourcelib, fluxsinklib, sqlite]
|
||||
)
|
||||
)
|
||||
|
||||
encoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('encoderlib',
|
||||
['lib/encoder.cc'],
|
||||
dependencies: [fmtlib, felib]
|
||||
)
|
||||
)
|
||||
|
||||
aeslanierdecoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('aeslanierdecoderlib',
|
||||
[ 'lib/aeslanier/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/aeslanier')
|
||||
)
|
||||
|
||||
amigadecoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('amigadecoderlib',
|
||||
[ 'lib/amiga/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/amiga')
|
||||
)
|
||||
|
||||
apple2decoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('apple2decoderlib',
|
||||
[ 'lib/apple2/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/apple2')
|
||||
)
|
||||
|
||||
brotherdecoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('brotherdecoderlib',
|
||||
[ 'lib/brother/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib, sqlite]),
|
||||
include_directories:
|
||||
include_directories('lib/brother')
|
||||
)
|
||||
|
||||
brotherencoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('brotherencoderlib',
|
||||
[ 'lib/brother/encoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib, encoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/brother')
|
||||
)
|
||||
|
||||
c64decoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('c64decoderlib',
|
||||
[ 'lib/c64/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/c64')
|
||||
)
|
||||
|
||||
f85decoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('f85decoderlib',
|
||||
[ 'lib/f85/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/f85')
|
||||
)
|
||||
|
||||
fb100decoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('fb100decoderlib',
|
||||
[ 'lib/fb100/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/fb100')
|
||||
)
|
||||
|
||||
ibmdecoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('ibmdecoderlib',
|
||||
[ 'lib/ibm/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/ibm')
|
||||
)
|
||||
|
||||
macdecoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('macdecoderlib',
|
||||
[ 'lib/macintosh/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/macintosh')
|
||||
)
|
||||
|
||||
mxdecoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('mxdecoderlib',
|
||||
[ 'lib/mx/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/mx')
|
||||
)
|
||||
|
||||
zilogmczdecoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('zilogmczdecoderlib',
|
||||
[ 'lib/zilogmcz/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/zilogmcz')
|
||||
)
|
||||
|
||||
victor9kdecoderlib = declare_dependency(
|
||||
link_with:
|
||||
shared_library('victor9kdecoderlib',
|
||||
[ 'lib/victor9k/decoder.cc', ],
|
||||
dependencies: [fmtlib, felib, decoderlib]),
|
||||
include_directories:
|
||||
include_directories('lib/victor9k')
|
||||
)
|
||||
|
||||
executable('fe-erase', ['src/fe-erase.cc'], dependencies: [felib, writerlib])
|
||||
executable('fe-inspect', ['src/fe-inspect.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib])
|
||||
executable('fe-readadfs', ['src/fe-readadfs.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, ibmdecoderlib])
|
||||
executable('fe-readaeslanier', ['src/fe-readaeslanier.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, aeslanierdecoderlib])
|
||||
executable('fe-readamiga', ['src/fe-readamiga.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, amigadecoderlib])
|
||||
executable('fe-readampro', ['src/fe-readampro.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, ibmdecoderlib])
|
||||
executable('fe-readapple2', ['src/fe-readapple2.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, apple2decoderlib])
|
||||
executable('fe-readbrother', ['src/fe-readbrother.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, brotherdecoderlib])
|
||||
executable('fe-readc64', ['src/fe-readc64.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, c64decoderlib])
|
||||
executable('fe-readdfs', ['src/fe-readdfs.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, ibmdecoderlib])
|
||||
executable('fe-readf85', ['src/fe-readf85.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, f85decoderlib])
|
||||
executable('fe-readfb100', ['src/fe-readfb100.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, fb100decoderlib])
|
||||
executable('fe-readibm', ['src/fe-readibm.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, ibmdecoderlib])
|
||||
executable('fe-readmac', ['src/fe-readmac.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, macdecoderlib])
|
||||
executable('fe-readmx', ['src/fe-readmx.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, mxdecoderlib])
|
||||
executable('fe-readzilogmcz', ['src/fe-readzilogmcz.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, zilogmczdecoderlib])
|
||||
executable('fe-readvictor9k', ['src/fe-readvictor9k.cc'], dependencies: [fmtlib, felib, decoderlib, readerlib, victor9kdecoderlib])
|
||||
executable('fe-rpm', ['src/fe-rpm.cc'], dependencies: [fmtlib, felib])
|
||||
executable('fe-seek', ['src/fe-seek.cc'], dependencies: [fmtlib, felib])
|
||||
executable('fe-testbulktransport', ['src/fe-testbulktransport.cc'], dependencies: [fmtlib, felib])
|
||||
executable('fe-upgradefluxfile', ['src/fe-upgradefluxfile.cc'], dependencies: [fmtlib, felib, sqllib, sqlite])
|
||||
executable('fe-writebrother', ['src/fe-writebrother.cc'], dependencies: [fmtlib, felib, writerlib, decoderlib, encoderlib, brotherencoderlib])
|
||||
executable('fe-writeflux', ['src/fe-writeflux.cc'], dependencies: [fmtlib, felib, readerlib, writerlib])
|
||||
executable('fe-writetestpattern', ['src/fe-writetestpattern.cc'], dependencies: [fmtlib, felib, writerlib])
|
||||
|
||||
executable('brother120tool', ['tools/brother120tool.cc'], dependencies: [fmtlib, felib])
|
||||
executable('cwftoflux', ['tools/cwftoflux.cc'], dependencies: [fmtlib, felib, sqllib, sqlite])
|
||||
|
||||
test('DataSpec', executable('dataspec-test', ['tests/dataspec.cc'], dependencies: [felib]))
|
||||
test('Flags', executable('flags-test', ['tests/flags.cc'], dependencies: [felib]))
|
||||
test('FmMfm', executable('fmmfm-test', ['tests/fmmfm.cc'], dependencies: [felib, decoderlib]))
|
||||
test('BitAccumulator', executable('bitaccumulator-test', ['tests/bitaccumulator.cc'], dependencies: [felib]))
|
||||
test('Kryoflux', executable('kryoflux-test', ['tests/kryoflux.cc'], dependencies: [felib, decoderlib, fluxsourcelib]))
|
||||
test('Compression', executable('compression-test', ['tests/compression.cc'], dependencies: [felib, decoderlib]))
|
||||
test('Bytes', executable('bytes-test', ['tests/bytes.cc'], dependencies: [felib]))
|
||||
test('Crunch', executable('crunch-test', ['tests/crunch.cc'], dependencies: [felib, crunchlib]))
|
||||
test('FluxPattern', executable('fluxpattern-test', ['tests/fluxpattern.cc'], dependencies: [felib, decoderlib]))
|
||||
219
mkninja.sh
Normal file
219
mkninja.sh
Normal file
@@ -0,0 +1,219 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
packages="zlib sqlite3 libusb-1.0"
|
||||
pkgcflags="$(pkg-config --cflags $packages) -Idep/fmt"
|
||||
pkgldflags=$(pkg-config --libs $packages)
|
||||
|
||||
cat <<-EOF
|
||||
#############################################################################
|
||||
### THIS FILE IS AUTOGENERATED ###
|
||||
#############################################################################
|
||||
#
|
||||
# Don't edit it. Your changes will be destroyed. Instead, edit mkninja.sh
|
||||
# instead. The next time you run ninja, this file will be automatically
|
||||
# updated.
|
||||
|
||||
rule mkninja
|
||||
command = sh ./mkninja.sh > \$out.new && mv -f \$out.new \$out
|
||||
generator = true
|
||||
build build.ninja : mkninja mkninja.sh
|
||||
|
||||
CXX = g++
|
||||
AR = ar rcs
|
||||
CFLAGS = -Og -g --std=c++14
|
||||
LDFLAGS = -Og
|
||||
|
||||
OBJDIR = .obj
|
||||
|
||||
rule cxx
|
||||
command = \$CXX \$CFLAGS \$flags -I. -c -o \$out \$in -MMD -MF \$out.d
|
||||
description = CXX \$in
|
||||
depfile = \$out.d
|
||||
deps = gcc
|
||||
|
||||
rule library
|
||||
command = \$AR \$out \$in
|
||||
description = AR \$in
|
||||
|
||||
rule link
|
||||
command = \$CXX \$LDFLAGS -o \$out \$in \$flags
|
||||
description = LINK \$in
|
||||
|
||||
rule test
|
||||
command = \$in && touch \$out
|
||||
description = TEST \$in
|
||||
EOF
|
||||
|
||||
buildlibrary() {
|
||||
local lib
|
||||
lib=$1
|
||||
shift
|
||||
|
||||
local flags
|
||||
flags=
|
||||
while true; do
|
||||
case $1 in
|
||||
-*)
|
||||
flags="$flags $1"
|
||||
shift
|
||||
;;
|
||||
|
||||
*)
|
||||
break
|
||||
esac
|
||||
done
|
||||
|
||||
local objs
|
||||
objs=
|
||||
for src in "$@"; do
|
||||
local obj
|
||||
obj="\$OBJDIR/${src%%.cc}.o"
|
||||
objs="$objs $obj"
|
||||
|
||||
echo build $obj : cxx $src
|
||||
echo " flags=$flags"
|
||||
done
|
||||
|
||||
echo build \$OBJDIR/$lib : library $objs
|
||||
}
|
||||
|
||||
buildprogram() {
|
||||
local prog
|
||||
prog=$1
|
||||
shift
|
||||
|
||||
local flags
|
||||
flags=
|
||||
while true; do
|
||||
case $1 in
|
||||
-*)
|
||||
flags="$flags $1"
|
||||
shift
|
||||
;;
|
||||
|
||||
*)
|
||||
break
|
||||
esac
|
||||
done
|
||||
|
||||
local objs
|
||||
objs=
|
||||
for src in "$@"; do
|
||||
objs="$objs \$OBJDIR/$src"
|
||||
done
|
||||
|
||||
echo build $prog : link $objs
|
||||
echo " flags=$flags"
|
||||
}
|
||||
|
||||
runtest() {
|
||||
local prog
|
||||
prog=$1
|
||||
shift
|
||||
|
||||
buildlibrary lib$prog.a \
|
||||
-Ilib \
|
||||
$pkgcflags \
|
||||
"$@"
|
||||
|
||||
buildprogram \$OBJDIR/$prog \
|
||||
$pkgldflags \
|
||||
lib$prog.a \
|
||||
libbackend.a \
|
||||
libfmt.a
|
||||
|
||||
echo build \$OBJDIR/$prog.stamp : test \$OBJDIR/$prog
|
||||
}
|
||||
|
||||
buildlibrary libfmt.a \
|
||||
dep/fmt/format.cc \
|
||||
dep/fmt/posix.cc \
|
||||
|
||||
buildlibrary libbackend.a \
|
||||
-Ilib \
|
||||
$pkgcflags \
|
||||
lib/aeslanier/decoder.cc \
|
||||
lib/amiga/decoder.cc \
|
||||
lib/apple2/decoder.cc \
|
||||
lib/brother/decoder.cc \
|
||||
lib/brother/encoder.cc \
|
||||
lib/bytes.cc \
|
||||
lib/c64/decoder.cc \
|
||||
lib/common/crunch.c \
|
||||
lib/crc.cc \
|
||||
lib/dataspec.cc \
|
||||
lib/decoders/decoders.cc \
|
||||
lib/decoders/fluxmapreader.cc \
|
||||
lib/decoders/fmmfm.cc \
|
||||
lib/encoder.cc \
|
||||
lib/f85/decoder.cc \
|
||||
lib/fb100/decoder.cc \
|
||||
lib/flags.cc \
|
||||
lib/fluxmap.cc \
|
||||
lib/fluxsink/fluxsink.cc \
|
||||
lib/fluxsink/hardwarefluxsink.cc \
|
||||
lib/fluxsink/sqlitefluxsink.cc \
|
||||
lib/fluxsource/fluxsource.cc \
|
||||
lib/fluxsource/hardwarefluxsource.cc \
|
||||
lib/fluxsource/kryoflux.cc \
|
||||
lib/fluxsource/sqlitefluxsource.cc \
|
||||
lib/fluxsource/streamfluxsource.cc \
|
||||
lib/globals.cc \
|
||||
lib/hexdump.cc \
|
||||
lib/ibm/decoder.cc \
|
||||
lib/image.cc \
|
||||
lib/macintosh/decoder.cc \
|
||||
lib/mx/decoder.cc \
|
||||
lib/reader.cc \
|
||||
lib/sector.cc \
|
||||
lib/sectorset.cc \
|
||||
lib/sql.cc \
|
||||
lib/usb.cc \
|
||||
lib/victor9k/decoder.cc \
|
||||
lib/writer.cc \
|
||||
lib/zilogmcz/decoder.cc \
|
||||
|
||||
buildlibrary libfrontend.a \
|
||||
-Ilib \
|
||||
$pkgcflags \
|
||||
src/fe-erase.cc \
|
||||
src/fe-inspect.cc \
|
||||
src/fe-readadfs.cc \
|
||||
src/fe-readaeslanier.cc \
|
||||
src/fe-readamiga.cc \
|
||||
src/fe-readampro.cc \
|
||||
src/fe-readapple2.cc \
|
||||
src/fe-readbrother.cc \
|
||||
src/fe-readc64.cc \
|
||||
src/fe-readdfs.cc \
|
||||
src/fe-readf85.cc \
|
||||
src/fe-readfb100.cc \
|
||||
src/fe-readibm.cc \
|
||||
src/fe-readmac.cc \
|
||||
src/fe-readmx.cc \
|
||||
src/fe-readvictor9k.cc \
|
||||
src/fe-readzilogmcz.cc \
|
||||
src/fe-rpm.cc \
|
||||
src/fe-seek.cc \
|
||||
src/fe-testbulktransport.cc \
|
||||
src/fe-upgradefluxfile.cc \
|
||||
src/fe-writebrother.cc \
|
||||
src/fe-writeflux.cc \
|
||||
src/fe-writetestpattern.cc \
|
||||
src/fluxengine.cc \
|
||||
|
||||
buildprogram fluxengine \
|
||||
$pkgldflags \
|
||||
libfrontend.a \
|
||||
libbackend.a \
|
||||
libfmt.a \
|
||||
|
||||
runtest dataspec-test tests/dataspec.cc
|
||||
runtest flags-test tests/flags.cc
|
||||
runtest fmmfm-test tests/fmmfm.cc
|
||||
runtest bitaccumulator-test tests/bitaccumulator.cc
|
||||
runtest kryoflux-test tests/kryoflux.cc
|
||||
runtest compression-test tests/compression.cc
|
||||
runtest bytes-test tests/bytes.cc
|
||||
runtest crunch-test tests/crunch.cc
|
||||
runtest fluxpattern-test tests/fluxpattern.cc
|
||||
@@ -3,10 +3,12 @@
|
||||
#include "fluxmap.h"
|
||||
#include "writer.h"
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
static FlagGroup flags;
|
||||
|
||||
int mainErase(int argc, const char* argv[])
|
||||
{
|
||||
setWriterDefaultDest(":t=0-81:s=0-1");
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
writeTracks(
|
||||
[](int physicalTrack, int physicalSide) -> std::unique_ptr<Fluxmap>
|
||||
|
||||
@@ -2,15 +2,17 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "image.h"
|
||||
#include "protocol.h"
|
||||
#include "rawbits.h"
|
||||
#include "decoders/rawbits.h"
|
||||
#include "record.h"
|
||||
#include "sector.h"
|
||||
#include "track.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
|
||||
static FlagGroup flags;
|
||||
|
||||
static SettableFlag dumpFluxFlag(
|
||||
{ "--dump-flux", "-F" },
|
||||
@@ -51,7 +53,7 @@ static DoubleFlag signalLevelFactor(
|
||||
|
||||
void setDecoderManualClockRate(double clockrate_us)
|
||||
{
|
||||
manualClockRate.value = clockrate_us;
|
||||
manualClockRate.setDefaultValue(clockrate_us);
|
||||
}
|
||||
|
||||
static const std::string BLOCK_ELEMENTS[] =
|
||||
@@ -173,9 +175,9 @@ static nanoseconds_t guessClock(const Fluxmap& fluxmap)
|
||||
return median * NS_PER_TICK;
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainInspect(int argc, const char* argv[])
|
||||
{
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
const auto& tracks = readTracks();
|
||||
if (tracks.size() != 1)
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "image.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include "ibm.h"
|
||||
#include <fmt/format.h>
|
||||
#include "ibm/ibm.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
@@ -20,10 +22,10 @@ static IntFlag sectorIdBase(
|
||||
"Sector ID of the first sector.",
|
||||
0);
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadADFS(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0-1");
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
IbmDecoder decoder(sectorIdBase);
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,24 +2,26 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "image.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include "aeslanier.h"
|
||||
#include <fmt/format.h>
|
||||
#include "aeslanier/aeslanier.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"aeslanier.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadAESLanier(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
AesLanierDecoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "amiga.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "amiga/amiga.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "image.h"
|
||||
#include "record.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"amiga.adf");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadAmiga(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0-1");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
AmigaDecoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "image.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include "ibm.h"
|
||||
#include <fmt/format.h>
|
||||
#include "ibm/ibm.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
@@ -20,11 +22,11 @@ static IntFlag sectorIdBase(
|
||||
"Sector ID of the first sector.",
|
||||
17);
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadAmpro(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
IbmDecoder decoder(sectorIdBase);
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "apple2.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "apple2/apple2.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "image.h"
|
||||
#include "record.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"apple2.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadApple2(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
Apple2Decoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "brother.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "brother/brother.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "image.h"
|
||||
#include "record.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"brother.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadBrother(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-81:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
BrotherDecoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "c64.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "c64/c64.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "image.h"
|
||||
#include "record.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"c64.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadC64(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79x2:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
Commodore64Decoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "image.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include "ibm.h"
|
||||
#include <fmt/format.h>
|
||||
#include "ibm/ibm.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
@@ -20,11 +22,11 @@ static IntFlag sectorIdBase(
|
||||
"Sector ID of the first sector.",
|
||||
0);
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadDFS(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
IbmDecoder decoder(sectorIdBase);
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "f85.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "f85/f85.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "image.h"
|
||||
#include "record.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"f85.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadF85(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
DurangoF85Decoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,24 +2,26 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "image.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include "fb100.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fb100/fb100.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"fb100.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadFB100(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79x2:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
Fb100Decoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "image.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include "ibm.h"
|
||||
#include <fmt/format.h>
|
||||
#include "ibm/ibm.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
@@ -20,10 +22,10 @@ static IntFlag sectorIdBase(
|
||||
"Sector ID of the first sector.",
|
||||
1);
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadIBM(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0-1");
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
IbmDecoder decoder(sectorIdBase);
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "macintosh.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "macintosh/macintosh.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "image.h"
|
||||
#include "record.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"mac.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadMac(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0-1");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
MacintoshDecoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,14 +2,16 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "mx.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "mx/mx.h"
|
||||
#include "image.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
@@ -18,7 +20,7 @@ static StringFlag outputFilename(
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0-1");
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
MxDecoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "victor9k.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "victor9k/victor9k.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "image.h"
|
||||
#include "record.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"victor9k.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadVictor9K(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-79:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
Victor9kDecoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -2,24 +2,26 @@
|
||||
#include "flags.h"
|
||||
#include "reader.h"
|
||||
#include "fluxmap.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "image.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "record.h"
|
||||
#include "zilogmcz.h"
|
||||
#include <fmt/format.h>
|
||||
#include "zilogmcz/zilogmcz.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
static FlagGroup flags { &readerFlags };
|
||||
|
||||
static StringFlag outputFilename(
|
||||
{ "--output", "-o" },
|
||||
"The output image file to write to.",
|
||||
"zilogmcz.img");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainReadZilogMCZ(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-76:s=0");
|
||||
setReaderRevolutions(2);
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
ZilogMczDecoder decoder;
|
||||
readDiskCommand(decoder, outputFilename);
|
||||
|
||||
@@ -3,16 +3,18 @@
|
||||
#include "usb.h"
|
||||
#include "dataspec.h"
|
||||
|
||||
static FlagGroup flags;
|
||||
|
||||
static DataSpecFlag source(
|
||||
{ "--source", "-s" },
|
||||
"source for data",
|
||||
":d=0");
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainRpm(int argc, const char* argv[])
|
||||
{
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
usbSetDrive(source.value.drive, false);
|
||||
usbSetDrive(source.get().drive, false);
|
||||
nanoseconds_t period = usbGetRotationalPeriod();
|
||||
std::cout << "Rotational period is " << period/1000 << " ms (" << 60e6/period << " rpm)" << std::endl;
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "flags.h"
|
||||
#include "usb.h"
|
||||
|
||||
static FlagGroup flags;
|
||||
|
||||
static IntFlag drive(
|
||||
{ "--drive", "-d" },
|
||||
"drive to use",
|
||||
@@ -12,9 +14,9 @@ static IntFlag track(
|
||||
"track to seek to",
|
||||
0);
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainSeek(int argc, const char* argv[])
|
||||
{
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
usbSetDrive(drive, false);
|
||||
usbSeek(track);
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
#include "flags.h"
|
||||
#include "usb.h"
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
static FlagGroup flags;
|
||||
|
||||
int mainTestBulkTransport(int argc, const char* argv[])
|
||||
{
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
usbTestBulkTransport();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ static void update_version_1_to_2()
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainUpgradeFluxFile(int argc, const char* argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
Error() << "syntax: fe-upgradefluxfile <fluxfile>";
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
#include "fluxmap.h"
|
||||
#include "sector.h"
|
||||
#include "sectorset.h"
|
||||
#include "decoders.h"
|
||||
#include "brother.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include "brother/brother.h"
|
||||
#include "image.h"
|
||||
#include "writer.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
#include <ctype.h>
|
||||
|
||||
static FlagGroup flags { &writerFlags };
|
||||
|
||||
static StringFlag inputFilename(
|
||||
{ "--input", "-i" },
|
||||
"The input image file to read from.",
|
||||
@@ -49,10 +51,10 @@ static int charToInt(char c)
|
||||
return 10 + tolower(c) - 'a';
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainWriteBrother(int argc, const char* argv[])
|
||||
{
|
||||
setWriterDefaultDest(":d=0:t=0-77:s=0");
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
SectorSet allSectors;
|
||||
Geometry geometry = {78, 1, 12, 256};
|
||||
|
||||
@@ -6,15 +6,17 @@
|
||||
#include "record.h"
|
||||
#include "sector.h"
|
||||
#include "track.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
#include <ctype.h>
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
static FlagGroup flags { &writerFlags };
|
||||
|
||||
int mainWriteFlux(int argc, const char* argv[])
|
||||
{
|
||||
setReaderDefaultSource(":t=0-81:h=0-1");
|
||||
setWriterDefaultDest(":t=0-81:s=0-1");
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
auto tracks = readTracks();
|
||||
for (auto& track : tracks)
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
#include "fluxmap.h"
|
||||
#include "writer.h"
|
||||
#include "protocol.h"
|
||||
#include <fmt/format.h>
|
||||
#include "fmt/format.h"
|
||||
#include <fstream>
|
||||
#include <ctype.h>
|
||||
|
||||
static FlagGroup flags { &writerFlags };
|
||||
|
||||
static DoubleFlag interval(
|
||||
{ "--interval" },
|
||||
"Interval between pulses (microseconds).",
|
||||
@@ -18,10 +20,10 @@ static DoubleFlag sequenceLength(
|
||||
"Total length of test pattern (milliseconds).",
|
||||
200.0);
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
int mainWriteTestPattern(int argc, const char* argv[])
|
||||
{
|
||||
setWriterDefaultDest(":t=0-81:s=0-1");
|
||||
Flag::parseFlags(argc, argv);
|
||||
flags.parseFlags(argc, argv);
|
||||
|
||||
unsigned ticksPerInterval = (unsigned) (interval * TICKS_PER_US);
|
||||
|
||||
|
||||
141
src/fluxengine.cc
Normal file
141
src/fluxengine.cc
Normal file
@@ -0,0 +1,141 @@
|
||||
#include "globals.h"
|
||||
|
||||
typedef int command_cb(int agrc, const char* argv[]);
|
||||
|
||||
extern command_cb mainErase;
|
||||
extern command_cb mainInspect;
|
||||
extern command_cb mainReadADFS;
|
||||
extern command_cb mainReadAESLanier;
|
||||
extern command_cb mainReadAmiga;
|
||||
extern command_cb mainReadAmpro;
|
||||
extern command_cb mainReadApple2;
|
||||
extern command_cb mainReadBrother;
|
||||
extern command_cb mainReadC64;
|
||||
extern command_cb mainReadDFS;
|
||||
extern command_cb mainReadF85;
|
||||
extern command_cb mainReadFB100;
|
||||
extern command_cb mainReadIBM;
|
||||
extern command_cb mainReadVictor9K;
|
||||
extern command_cb mainReadMac;
|
||||
extern command_cb mainReadZilogMCZ;
|
||||
extern command_cb mainRpm;
|
||||
extern command_cb mainSeek;
|
||||
extern command_cb mainTestBulkTransport;
|
||||
extern command_cb mainUpgradeFluxFile;
|
||||
extern command_cb mainWriteBrother;
|
||||
extern command_cb mainWriteFlux;
|
||||
extern command_cb mainWriteTestPattern;
|
||||
|
||||
struct Command
|
||||
{
|
||||
std::string name;
|
||||
command_cb* main;
|
||||
std::string help;
|
||||
};
|
||||
|
||||
static command_cb mainRead;
|
||||
static command_cb mainWrite;
|
||||
|
||||
static std::vector<Command> commands =
|
||||
{
|
||||
{ "erase", mainErase, "Permanently but rapidly erases some or all of a disk." },
|
||||
{ "inspect", mainInspect, "Low-level analysis and inspection of a disk." },
|
||||
{ "rpm", mainRpm, "Measures the disk rotational speed.", },
|
||||
{ "seek", mainSeek, "Moves the disk head.", },
|
||||
{ "testbulktransport", mainTestBulkTransport, "Measures your USB bandwidth.", },
|
||||
{ "upgradefluxfile", mainUpgradeFluxFile, "Upgrades a flux file from a previous version of this software.", },
|
||||
{ "read", mainRead, "Reads a disk, producing a sector image.", },
|
||||
{ "write", mainWrite, "Writes a sector image to a disk.", },
|
||||
{ "writeflux", mainWriteFlux, "Writes a raw flux file. Warning: you can't use this to copy disks.", },
|
||||
{ "writetestpattern", mainWriteTestPattern, "Writes a machine-generated test pattern to a disk.", },
|
||||
};
|
||||
|
||||
static std::vector<Command> readables =
|
||||
{
|
||||
{ "adfs", mainReadADFS, "Reads Acorn ADFS disks.", },
|
||||
{ "aeslanier", mainReadAESLanier, "Reads AES Lanier disks.", },
|
||||
{ "amiga", mainReadAmiga, "Reads Commodore Amiga disks.", },
|
||||
{ "ampro", mainReadAmpro, "Reads Ampro disks.", },
|
||||
{ "apple2", mainReadApple2, "Reads Apple II disks.", },
|
||||
{ "brother", mainReadBrother, "Reads 120kB and 240kB Brother word processor disks.", },
|
||||
{ "c64", mainReadC64, "Reads Commodore 64 disks.", },
|
||||
{ "dfs", mainReadDFS, "Reads Acorn DFS disks.", },
|
||||
{ "f85", mainReadF85, "Reads Durango F85 disks.", },
|
||||
{ "fb100", mainReadFB100, "Reads FB100 disks.", },
|
||||
{ "ibm", mainReadIBM, "Reads the ubiquitous IBM format disks.", },
|
||||
{ "mac", mainReadMac, "Reads Apple Macintosh disks.", },
|
||||
{ "victor9k", mainReadVictor9K, "Reads Victor 9000 disks.", },
|
||||
{ "zilogmcz", mainReadZilogMCZ, "Reads Zilog MCZ disks.", },
|
||||
};
|
||||
|
||||
static std::vector<Command> writeables =
|
||||
{
|
||||
{ "brother", mainWriteBrother, "Writes 120kB and 240kB Brother word processor disks.", },
|
||||
};
|
||||
|
||||
static void readWriteHelp(std::vector<Command>& subcommands, const std::string& command)
|
||||
{
|
||||
std::cout << "fluxengine: syntax: fluxengine " << command << " <format> [<flags>...]\n"
|
||||
"These formats are supported:\n";
|
||||
|
||||
for (Command& c : subcommands)
|
||||
std::cout << " " << c.name << ": " << c.help << "\n";
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
static int mainReadWrite(std::vector<Command>& subcommands, const std::string& command,
|
||||
int argc, const char* argv[])
|
||||
{
|
||||
if (argc == 1)
|
||||
readWriteHelp(subcommands, command);
|
||||
|
||||
std::string format = argv[1];
|
||||
if (format == "help")
|
||||
readWriteHelp(subcommands, command);
|
||||
|
||||
for (Command& c : subcommands)
|
||||
{
|
||||
if (format == c.name)
|
||||
return c.main(argc-1, argv+1);
|
||||
}
|
||||
|
||||
std::cerr << "fluxengine: unrecognised format (try help)\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int mainRead(int argc, const char* argv[])
|
||||
{ return mainReadWrite(readables, "read", argc, argv); }
|
||||
|
||||
static int mainWrite(int argc, const char* argv[])
|
||||
{ return mainReadWrite(writeables, "write", argc, argv); }
|
||||
|
||||
static void help()
|
||||
{
|
||||
std::cout << "fluxengine: syntax: fluxengine <command> [<flags>...]\n"
|
||||
"Try one of these commands:\n";
|
||||
|
||||
for (Command& c : commands)
|
||||
std::cout << " " << c.name << ": " << c.help << "\n";
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
if (argc == 1)
|
||||
help();
|
||||
|
||||
std::string command = argv[1];
|
||||
if (command == "help")
|
||||
help();
|
||||
|
||||
for (Command& c : commands)
|
||||
{
|
||||
if (command == c.name)
|
||||
return c.main(argc-1, argv+1);
|
||||
}
|
||||
|
||||
std::cerr << "fluxengine: unrecognised command (try help)\n";
|
||||
return 1;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "globals.h"
|
||||
#include "bytes.h"
|
||||
#include "crunch.h"
|
||||
#include "common/crunch.h"
|
||||
|
||||
static uint8_t outputbuffer[64];
|
||||
|
||||
|
||||
@@ -2,22 +2,40 @@
|
||||
#include "flags.h"
|
||||
#include <assert.h>
|
||||
|
||||
static IntFlag intFlag(
|
||||
{ "--intFlag" },
|
||||
"a global integer flag",
|
||||
1);
|
||||
|
||||
static void testDefaultIntValue()
|
||||
{
|
||||
intFlag.value = intFlag.defaultValue = 2;
|
||||
FlagGroup flags;
|
||||
|
||||
IntFlag intFlag(
|
||||
{ "--intFlag" },
|
||||
"a global integer flag",
|
||||
1);
|
||||
|
||||
intFlag.setDefaultValue(2);
|
||||
const char* argv[] = { "prog", NULL };
|
||||
Flag::parseFlags(1, argv);
|
||||
assert(intFlag.value == 2);
|
||||
flags.parseFlags(1, argv);
|
||||
assert(intFlag.get() == 2);
|
||||
}
|
||||
|
||||
static void testOverriddenIntValue()
|
||||
{
|
||||
FlagGroup flags;
|
||||
|
||||
IntFlag intFlag(
|
||||
{ "--intFlag" },
|
||||
"a global integer flag",
|
||||
1);
|
||||
|
||||
intFlag.setDefaultValue(2);
|
||||
const char* argv[] = { "prog", "--intFlag=3" };
|
||||
flags.parseFlags(2, argv);
|
||||
assert(intFlag.get() == 3);
|
||||
}
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
testDefaultIntValue();
|
||||
testOverriddenIntValue();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#include "globals.h"
|
||||
#include "flags.h"
|
||||
#include "fluxmap.h"
|
||||
#include "fluxmapreader.h"
|
||||
#include "decoders/fluxmapreader.h"
|
||||
#include <sstream>
|
||||
|
||||
FlagGroup flags { &fluxmapReaderFlags };
|
||||
|
||||
typedef std::vector<unsigned> ivector;
|
||||
|
||||
namespace std {
|
||||
@@ -124,6 +127,8 @@ void test_patternmatchingwithtrailingzeros()
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
flags.parseFlags(0, NULL);
|
||||
|
||||
test_patternconstruction();
|
||||
test_patternmatchingwithouttrailingzeros();
|
||||
test_patternmatchingwithtrailingzeros();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "globals.h"
|
||||
#include "decoders.h"
|
||||
#include "decoders/decoders.h"
|
||||
#include <assert.h>
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <stdlib.h>
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "kryoflux.h"
|
||||
#include "fluxsource/kryoflux.h"
|
||||
|
||||
static Bytes operator + (const Bytes& left, const Bytes& right)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user