From e6bb0cb463d5cdc7cf58ab3d7874c653e64642b0 Mon Sep 17 00:00:00 2001 From: "K. M" Date: Wed, 27 Sep 2023 01:11:12 +0200 Subject: [PATCH 01/49] Fix const-correct/discards qualifiers error. --- lib/sector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sector.h b/lib/sector.h index c50d5cc1..f310f2d0 100644 --- a/lib/sector.h +++ b/lib/sector.h @@ -93,7 +93,7 @@ struct Sector : public LogicalLocation template <> struct fmt::formatter : formatter { - auto format(Sector::Status status, format_context& ctx) const + auto format(Sector::Status status, format_context& ctx) { return formatter::format( Sector::statusToString(status), ctx); From f5f223f62210bcf30d9148b87f41a1c0c56ea72c Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 21 Oct 2023 23:02:46 +0200 Subject: [PATCH 02/49] First steps towards reworking the build system... again. --- Makefile | 310 +-------------- arch/aeslanier/decoder.cc | 14 +- arch/agat/agat.cc | 6 +- arch/agat/decoder.cc | 14 +- arch/amiga/amiga.cc | 6 +- arch/amiga/amiga.h | 2 +- arch/amiga/decoder.cc | 12 +- arch/amiga/encoder.cc | 12 +- arch/apple2/apple2.h | 4 +- arch/apple2/decoder.cc | 12 +- arch/apple2/encoder.cc | 14 +- arch/brother/decoder.cc | 16 +- arch/brother/encoder.cc | 12 +- arch/build.py | 25 ++ arch/c64/c64.cc | 2 +- arch/c64/c64.h | 4 +- arch/c64/decoder.cc | 14 +- arch/c64/encoder.cc | 16 +- arch/f85/decoder.cc | 14 +- arch/fb100/decoder.cc | 16 +- arch/ibm/decoder.cc | 14 +- arch/ibm/encoder.cc | 12 +- arch/macintosh/decoder.cc | 12 +- arch/macintosh/encoder.cc | 12 +- arch/micropolis/decoder.cc | 12 +- arch/micropolis/encoder.cc | 10 +- arch/mx/decoder.cc | 12 +- arch/mx/mx.h | 2 +- arch/northstar/decoder.cc | 12 +- arch/northstar/encoder.cc | 12 +- arch/smaky6/decoder.cc | 14 +- arch/tids990/decoder.cc | 14 +- arch/tids990/encoder.cc | 12 +- arch/victor9k/decoder.cc | 14 +- arch/victor9k/encoder.cc | 16 +- arch/zilogmcz/decoder.cc | 14 +- build.py | 10 + build/ab.mk | 33 ++ build/ab.py | 487 ++++++++++++++++++++++++ build/c.py | 243 ++++++++++++ build/pkg.py | 38 ++ build/protobuf.py | 65 ++++ config.py | 0 dep/adflib/build.mk | 24 +- dep/adflib/build.py | 46 +++ dep/agg/build.py | 164 ++++++++ dep/fatfs/build.py | 18 + dep/hfsutils/build.py | 25 ++ dep/libusbp/build.py | 24 ++ dep/stb/build.py | 7 + lib/bitmap.cc | 8 +- lib/build.py | 156 ++++++++ lib/bytes.cc | 4 +- lib/crc.cc | 6 +- lib/csvreader.cc | 2 +- lib/decoders/decoders.cc | 20 +- lib/decoders/decoders.h | 10 +- lib/decoders/fluxdecoder.cc | 8 +- lib/decoders/fluxmapreader.cc | 10 +- lib/decoders/fluxmapreader.h | 4 +- lib/decoders/fmmfm.cc | 4 +- lib/encoders/encoders.cc | 8 +- lib/fl2.cc | 6 +- lib/flux.h | 2 +- lib/fluxmap.cc | 6 +- lib/fluxmap.h | 2 +- lib/fluxsink/a2rfluxsink.cc | 18 +- lib/fluxsink/aufluxsink.cc | 14 +- lib/fluxsink/fl2fluxsink.cc | 16 +- lib/fluxsink/fluxsink.cc | 10 +- lib/fluxsink/fluxsink.h | 2 +- lib/fluxsink/hardwarefluxsink.cc | 14 +- lib/fluxsink/scpfluxsink.cc | 20 +- lib/fluxsink/vcdfluxsink.cc | 14 +- lib/fluxsource/a2rfluxsource.cc | 8 +- lib/fluxsource/cwffluxsource.cc | 8 +- lib/fluxsource/erasefluxsource.cc | 6 +- lib/fluxsource/fl2fluxsource.cc | 12 +- lib/fluxsource/fluxsource.cc | 12 +- lib/fluxsource/fluxsource.h | 2 +- lib/fluxsource/flx.cc | 4 +- lib/fluxsource/hardwarefluxsource.cc | 14 +- lib/fluxsource/kryoflux.cc | 4 +- lib/fluxsource/kryofluxfluxsource.cc | 6 +- lib/fluxsource/scpfluxsource.cc | 10 +- lib/fluxsource/testpatternfluxsource.cc | 6 +- lib/hexdump.cc | 4 +- lib/imagereader/d64imagereader.cc | 14 +- lib/imagereader/d88imagereader.cc | 14 +- lib/imagereader/dimimagereader.cc | 14 +- lib/imagereader/diskcopyimagereader.cc | 12 +- lib/imagereader/fdiimagereader.cc | 14 +- lib/imagereader/imagereader.cc | 14 +- lib/imagereader/imagereader.h | 2 +- lib/imagereader/imdimagereader.cc | 16 +- lib/imagereader/imgimagereader.cc | 12 +- lib/imagereader/jv3imagereader.cc | 12 +- lib/imagereader/nfdimagereader.cc | 14 +- lib/imagereader/nsiimagereader.cc | 12 +- lib/imagereader/td0imagereader.cc | 14 +- lib/imagewriter/d64imagewriter.cc | 14 +- lib/imagewriter/d88imagewriter.cc | 12 +- lib/imagewriter/diskcopyimagewriter.cc | 14 +- lib/imagewriter/imagewriter.cc | 14 +- lib/imagewriter/imdimagewriter.cc | 12 +- lib/imagewriter/imgimagewriter.cc | 12 +- lib/imagewriter/ldbsimagewriter.cc | 14 +- lib/imagewriter/nsiimagewriter.cc | 14 +- lib/imagewriter/rawimagewriter.cc | 14 +- lib/ldbs.cc | 6 +- lib/logger.cc | 12 +- lib/proto.cc | 4 +- lib/readerwriter.cc | 34 +- lib/sector.cc | 8 +- lib/sector.h | 4 +- lib/usb/fluxengineusb.cc | 6 +- lib/usb/greaseweazle.cc | 4 +- lib/usb/serial.cc | 6 +- lib/usb/usb.cc | 12 +- lib/usb/usb.h | 4 +- lib/usb/usbfinder.cc | 6 +- lib/utils.cc | 4 +- lib/vfs/vfs.cc | 2 +- scripts/analysedriveresponse.py | 15 +- src/build.py | 43 +++ src/fe-analysedriveresponse.cc | 22 +- src/fe-analyselayout.cc | 20 +- src/fe-format.cc | 16 +- src/fe-getdiskinfo.cc | 16 +- src/fe-getfile.cc | 16 +- src/fe-getfileinfo.cc | 16 +- src/fe-inspect.cc | 22 +- src/fe-ls.cc | 12 +- src/fe-merge.cc | 18 +- src/fe-mkdir.cc | 6 +- src/fe-mv.cc | 6 +- src/fe-putfile.cc | 16 +- src/fe-rawread.cc | 23 +- src/fe-rawwrite.cc | 12 +- src/fe-read.cc | 23 +- src/fe-rm.cc | 6 +- src/fe-rpm.cc | 10 +- src/fe-seek.cc | 10 +- src/fe-testbandwidth.cc | 6 +- src/fe-testvoltages.cc | 6 +- src/fe-write.cc | 22 +- src/fileutils.cc | 12 +- src/fluxengine.cc | 4 +- src/gui/browserpanel.cc | 4 +- src/gui/explorerpanel.cc | 2 +- src/gui/fileviewerwindow.cc | 2 +- src/gui/fileviewerwindow.h | 2 +- src/gui/fluxviewercontrol.cc | 2 +- src/gui/fluxviewerwindow.cc | 4 +- src/gui/fluxviewerwindow.h | 2 +- src/gui/idlepanel.cc | 2 +- src/gui/imagerpanel.cc | 2 +- src/gui/layout.cpp | 2 +- src/gui/main.cc | 2 +- src/gui/mainwindow.cc | 22 +- src/gui/texteditorwindow.cc | 4 +- src/gui/texteditorwindow.h | 2 +- src/gui/textviewerwindow.cc | 4 +- src/gui/textviewerwindow.h | 2 +- src/gui/visualisationcontrol.cc | 10 +- src/readibm.h | 2 +- tests/agg.cc | 2 +- tests/amiga.cc | 2 +- tests/bitaccumulator.cc | 2 +- tests/bytes.cc | 2 +- tests/compression.cc | 2 +- tests/csvreader.cc | 2 +- tests/ldbs.cc | 2 +- tests/options.cc | 2 +- tests/proto.cc | 2 +- 175 files changed, 2159 insertions(+), 1068 deletions(-) create mode 100644 arch/build.py create mode 100644 build.py create mode 100644 build/ab.mk create mode 100644 build/ab.py create mode 100644 build/c.py create mode 100644 build/pkg.py create mode 100644 build/protobuf.py create mode 100644 config.py create mode 100644 dep/adflib/build.py create mode 100644 dep/agg/build.py create mode 100644 dep/fatfs/build.py create mode 100644 dep/hfsutils/build.py create mode 100644 dep/libusbp/build.py create mode 100644 dep/stb/build.py create mode 100644 lib/build.py create mode 100644 src/build.py diff --git a/Makefile b/Makefile index 5adfb4b5..6e324e1c 100644 --- a/Makefile +++ b/Makefile @@ -1,305 +1,9 @@ -#Special Windows settings. +CC = gcc +CXX = g++ -ifeq ($(OS), Windows_NT) - MINGWBIN = /mingw32/bin - CCPREFIX = $(MINGWBIN)/ - LUA = $(MINGWBIN)/lua - PKG_CONFIG = $(MINGWBIN)/pkg-config - WX_CONFIG = /usr/bin/sh $(MINGWBIN)/wx-config --static=yes - PROTOC = $(MINGWBIN)/protoc - PLATFORM = WINDOWS - LDFLAGS += \ - -static - CXXFLAGS += \ - -std=c++17 \ - -fext-numeric-literals \ - -Wno-deprecated-enum-float-conversion \ - -Wno-deprecated-enum-enum-conversion +OBJ = .obj -#Required to get the gcc run - time libraries on the path. - export PATH := $(PATH):$(MINGWBIN) - EXT ?= .exe -endif - -#Special OSX settings. - -ifeq ($(shell uname),Darwin) - PLATFORM = OSX - LDFLAGS += \ - -framework IOKit \ - -framework Foundation -endif - -ifeq ($(shell uname),FreeBSD) - PLATFORM = FreeBSD - CFLAGS += -I/usr/local/include -endif - -#Check the Make version. - - -ifeq ($(findstring 4.,$(MAKE_VERSION)),) -$(error You need GNU Make 4.x for this (if you're on OSX, use gmake).) -endif - -#Normal settings. - -OBJDIR ?= .obj -CCPREFIX ?= -LUA ?= lua -CC ?= $(CCPREFIX)gcc -CXX ?= $(CCPREFIX)g++ -AR ?= $(CCPREFIX)ar -PKG_CONFIG ?= pkg-config -WX_CONFIG ?= wx-config -PROTOC ?= protoc -CFLAGS ?= -g -O3 -CXXFLAGS += -std=c++17 -LDFLAGS ?= -PLATFORM ?= UNIX -TESTS ?= yes -EXT ?= -DESTDIR ?= -PREFIX ?= /usr/local -BINDIR ?= $(PREFIX)/bin - -CFLAGS += \ - -Iarch \ - -Ilib \ - -I. \ - -I$(OBJDIR)/arch \ - -I$(OBJDIR)/lib \ - -I$(OBJDIR) \ - -Wno-deprecated-declarations \ - -LDFLAGS += \ - -lz \ - -lfmt - -.SUFFIXES: -.DELETE_ON_ERROR: - -define nl - -endef - -empty := -space := $(empty) $(empty) - -use-library = $(eval $(use-library-impl)) -define use-library-impl -$1: $(call $3_LIB) -$1: private LDFLAGS += $(call $3_LDFLAGS) -$2: private CFLAGS += $(call $3_CFLAGS) -endef - -use-pkgconfig = $(eval $(use-pkgconfig-impl)) -define use-pkgconfig-impl -ifneq ($(strip $(shell $(PKG_CONFIG) $3; echo $$?)),0) -$$(error Missing required pkg-config dependency: $3) -endif - -$(1): private LDFLAGS += $(shell $(PKG_CONFIG) --libs $(3)) -$(2): private CFLAGS += $(shell $(PKG_CONFIG) --cflags $(3)) -endef - -.PHONY: all binaries tests clean install install-bin -all: binaries tests docs - -PROTOS = \ - arch/aeslanier/aeslanier.proto \ - arch/agat/agat.proto \ - arch/amiga/amiga.proto \ - arch/apple2/apple2.proto \ - arch/brother/brother.proto \ - arch/c64/c64.proto \ - arch/f85/f85.proto \ - arch/fb100/fb100.proto \ - arch/ibm/ibm.proto \ - arch/macintosh/macintosh.proto \ - arch/micropolis/micropolis.proto \ - arch/mx/mx.proto \ - arch/northstar/northstar.proto \ - arch/rolandd20/rolandd20.proto \ - arch/smaky6/smaky6.proto \ - arch/tids990/tids990.proto \ - arch/victor9k/victor9k.proto \ - arch/zilogmcz/zilogmcz.proto \ - lib/common.proto \ - lib/config.proto \ - lib/decoders/decoders.proto \ - lib/drive.proto \ - lib/encoders/encoders.proto \ - lib/fl2.proto \ - lib/fluxsink/fluxsink.proto \ - lib/fluxsource/fluxsource.proto \ - lib/imagereader/imagereader.proto \ - lib/imagewriter/imagewriter.proto \ - lib/layout.proto \ - lib/usb/usb.proto \ - lib/vfs/vfs.proto \ - tests/testproto.proto \ - -PROTO_HDRS = $(patsubst %.proto, $(OBJDIR)/%.pb.h, $(PROTOS)) -PROTO_SRCS = $(patsubst %.proto, $(OBJDIR)/%.pb.cc, $(PROTOS)) -PROTO_OBJS = $(patsubst %.cc, %.o, $(PROTO_SRCS)) -PROTO_CFLAGS := $(shell $(PKG_CONFIG) --cflags protobuf) -$(PROTO_SRCS): | $(PROTO_HDRS) -$(PROTO_OBJS): CFLAGS += $(PROTO_CFLAGS) -PROTO_LIB = $(OBJDIR)/libproto.a -$(PROTO_LIB): $(PROTO_OBJS) -PROTO_LDFLAGS := $(shell $(PKG_CONFIG) --libs protobuf) -pthread -.PRECIOUS: $(PROTO_HDRS) $(PROTO_SRCS) - -include dep/agg/build.mk -include dep/libusbp/build.mk -include dep/stb/build.mk -include dep/emu/build.mk -include dep/fatfs/build.mk -include dep/adflib/build.mk -include dep/hfsutils/build.mk -include scripts/build.mk - -include lib/build.mk -include arch/build.mk -include src/build.mk -include src/gui/build.mk -include tools/build.mk -include tests/build.mk - -do-encodedecodetest = $(eval $(do-encodedecodetest-impl)) -define do-encodedecodetest-impl - -tests: $(OBJDIR)/$1$$(subst $$(space),_,$3).flux.encodedecode -$(OBJDIR)/$1$$(subst $$(space),_,$3).flux.encodedecode: scripts/encodedecodetest.sh $(FLUXENGINE_BIN) $2 - @mkdir -p $(dir $$@) - @echo ENCODEDECODETEST $1 flux $(FLUXENGINE_BIN) $2 $3 - @scripts/encodedecodetest.sh $1 flux $(FLUXENGINE_BIN) $2 $3 > $$@ - -tests: $(OBJDIR)/$1$$(subst $$(space),_,$3).scp.encodedecode -$(OBJDIR)/$1$$(subst $$(space),_,$3).scp.encodedecode: scripts/encodedecodetest.sh $(FLUXENGINE_BIN) $2 - @mkdir -p $(dir $$@) - @echo ENCODEDECODETEST $1 scp $(FLUXENGINE_BIN) $2 $3 - @scripts/encodedecodetest.sh $1 scp $(FLUXENGINE_BIN) $2 $3 > $$@ - -endef - -$(call do-encodedecodetest,agat,,--drive.tpi=96) -$(call do-encodedecodetest,amiga,,--drive.tpi=135) -$(call do-encodedecodetest,apple2,,--140 --drive.tpi=96) -$(call do-encodedecodetest,atarist,,--360 --drive.tpi=135) -$(call do-encodedecodetest,atarist,,--370 --drive.tpi=135) -$(call do-encodedecodetest,atarist,,--400 --drive.tpi=135) -$(call do-encodedecodetest,atarist,,--410 --drive.tpi=135) -$(call do-encodedecodetest,atarist,,--720 --drive.tpi=135) -$(call do-encodedecodetest,atarist,,--740 --drive.tpi=135) -$(call do-encodedecodetest,atarist,,--800 --drive.tpi=135) -$(call do-encodedecodetest,atarist,,--820 --drive.tpi=135) -$(call do-encodedecodetest,bk) -$(call do-encodedecodetest,brother,,--120 --drive.tpi=135) -$(call do-encodedecodetest,brother,,--240 --drive.tpi=135) -$(call do-encodedecodetest,commodore,scripts/commodore1541_test.textpb,--171 --drive.tpi=96) -$(call do-encodedecodetest,commodore,scripts/commodore1541_test.textpb,--192 --drive.tpi=96) -$(call do-encodedecodetest,commodore,,--800 --drive.tpi=135) -$(call do-encodedecodetest,commodore,,--1620 --drive.tpi=135) -$(call do-encodedecodetest,hplif,,--264 --drive.tpi=135) -$(call do-encodedecodetest,hplif,,--608 --drive.tpi=135) -$(call do-encodedecodetest,hplif,,--616 --drive.tpi=135) -$(call do-encodedecodetest,hplif,,--770 --drive.tpi=135) -$(call do-encodedecodetest,ibm,,--1200 --drive.tpi=96) -$(call do-encodedecodetest,ibm,,--1232 --drive.tpi=96) -$(call do-encodedecodetest,ibm,,--1440 --drive.tpi=135) -$(call do-encodedecodetest,ibm,,--1680 --drive.tpi=135) -$(call do-encodedecodetest,ibm,,--180 --drive.tpi=96) -$(call do-encodedecodetest,ibm,,--160 --drive.tpi=96) -$(call do-encodedecodetest,ibm,,--320 --drive.tpi=96) -$(call do-encodedecodetest,ibm,,--360 --drive.tpi=96) -$(call do-encodedecodetest,ibm,,--720_96 --drive.tpi=96) -$(call do-encodedecodetest,ibm,,--720_135 --drive.tpi=135) -$(call do-encodedecodetest,mac,scripts/mac400_test.textpb,--400 --drive.tpi=135) -$(call do-encodedecodetest,mac,scripts/mac800_test.textpb,--800 --drive.tpi=135) -$(call do-encodedecodetest,n88basic,,--drive.tpi=96) -$(call do-encodedecodetest,rx50,,--drive.tpi=96) -$(call do-encodedecodetest,tids990,,--drive.tpi=48) -$(call do-encodedecodetest,victor9k,,--612 --drive.tpi=96) -$(call do-encodedecodetest,victor9k,,--1224 --drive.tpi=96) - -do-corpustest = $(eval $(do-corpustest-impl)) -define do-corpustest-impl - -tests: $(OBJDIR)/corpustest/$2 -$(OBJDIR)/corpustest/$2: $(FLUXENGINE_BIN) \ - ../fluxengine-testdata/data/$1 ../fluxengine-testdata/data/$2 - @mkdir -p $(OBJDIR)/corpustest - @echo CORPUSTEST $1 $2 $3 - @$(FLUXENGINE_BIN) read $3 -s ../fluxengine-testdata/data/$1 -o $$@ > $$@.log - @cmp $$@ ../fluxengine-testdata/data/$2 - -endef - -ifneq ($(wildcard ../fluxengine-testdata/data),) - -$(call do-corpustest,amiga.flux,amiga.adf,amiga --drive.tpi=135) -$(call do-corpustest,atarist360.flux,atarist360.st,atarist --360 --drive.tpi=135) -$(call do-corpustest,atarist720.flux,atarist720.st,atarist --720 --drive.tpi=135) -$(call do-corpustest,brother120.flux,brother120.img,brother --120 --drive.tpi=135) -$(call do-corpustest,cmd-fd2000.flux,cmd-fd2000.img,commodore --1620 --drive.tpi=135) -$(call do-corpustest,ibm1232.flux,ibm1232.img,ibm --1232 --drive.tpi=96) -$(call do-corpustest,ibm1440.flux,ibm1440.img,ibm --1440 --drive.tpi=135) -$(call do-corpustest,mac800.flux,mac800.dsk,mac --800 --drive.tpi=135) -$(call do-corpustest,micropolis315.flux,micropolis315.img,micropolis --315 --drive.tpi=100) -$(call do-corpustest,northstar87-synthetic.flux,northstar87-synthetic.nsi,northstar --87 --drive.tpi=48) -$(call do-corpustest,northstar175-synthetic.flux,northstar175-synthetic.nsi,northstar --175 --drive.tpi=48) -$(call do-corpustest,northstar350-synthetic.flux,northstar350-synthetic.nsi,northstar --350 --drive.tpi=48) -$(call do-corpustest,victor9k_ss.flux,victor9k_ss.img,victor9k --612 --drive.tpi=96) -$(call do-corpustest,victor9k_ds.flux,victor9k_ds.img,victor9k --1224 --drive.tpi=96) - -endif - -$(OBJDIR)/%.a: - @mkdir -p $(dir $@) - @echo AR $@ - @$(AR) rc $@ $^ - -%.exe: - @mkdir -p $(dir $@) - @echo LINK $@ - @$(CXX) -o $@ $(filter %.o,$^) $(filter %.a,$^) $(LDFLAGS) $(filter %.a,$^) $(LDFLAGS) - -$(OBJDIR)/%.o: %.cpp - @mkdir -p $(dir $@) - @echo CXX $< - @$(CXX) $(CFLAGS) $(CXXFLAGS) -MMD -MP -MF $(@:.o=.d) -c -o $@ $< - -$(OBJDIR)/%.o: %.cc - @mkdir -p $(dir $@) - @echo CXX $< - @$(CXX) $(CFLAGS) $(CXXFLAGS) -MMD -MP -MF $(@:.o=.d) -c -o $@ $< - -$(OBJDIR)/%.o: $(OBJDIR)/%.cc - @mkdir -p $(dir $@) - @echo CXX $< - @$(CXX) $(CFLAGS) $(CXXFLAGS) -MMD -MP -MF $(@:.o=.d) -c -o $@ $< - -$(OBJDIR)/%.o: %.c - @mkdir -p $(dir $@) - @echo CC $< - @$(CC) $(CFLAGS) $(CFLAGS) -MMD -MP -MF $(@:.o=.d) -c -o $@ $< - -$(OBJDIR)/%.pb.h: %.proto - @mkdir -p $(dir $@) - @echo PROTOC $@ - @$(PROTOC) -I. --cpp_out=$(OBJDIR) $< - -clean: - rm -rf $(OBJDIR) - -install: install-bin # install-man install-docs ... - -install-bin: fluxengine$(EXT) fluxengine-gui$(EXT) brother120tool$(EXT) brother240tool$(EXT) upgrade-flux-file$(EXT) - install -d "$(DESTDIR)$(BINDIR)" - for target in $^; do \ - install $$target "$(DESTDIR)$(BINDIR)/$$target"; \ - done - --include $(OBJS:%.o=%.d) +.PHONY: all +all: +all + +include build/ab.mk diff --git a/arch/aeslanier/decoder.cc b/arch/aeslanier/decoder.cc index f79a25bf..7cca2e3b 100644 --- a/arch/aeslanier/decoder.cc +++ b/arch/aeslanier/decoder.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "decoders/decoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" #include "aeslanier.h" -#include "crc.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "sector.h" -#include "bytes.h" +#include "lib/crc.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/sector.h" +#include "lib/bytes.h" #include "fmt/format.h" #include diff --git a/arch/agat/agat.cc b/arch/agat/agat.cc index 870f9021..7cfadf19 100644 --- a/arch/agat/agat.cc +++ b/arch/agat/agat.cc @@ -1,7 +1,7 @@ -#include "globals.h" -#include "decoders/decoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" #include "agat.h" -#include "bytes.h" +#include "lib/bytes.h" #include "fmt/format.h" uint8_t agatChecksum(const Bytes& bytes) diff --git a/arch/agat/decoder.cc b/arch/agat/decoder.cc index d0d592c9..413e7467 100644 --- a/arch/agat/decoder.cc +++ b/arch/agat/decoder.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "decoders/decoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" #include "agat.h" -#include "crc.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "sector.h" -#include "bytes.h" +#include "lib/crc.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/sector.h" +#include "lib/bytes.h" #include "fmt/format.h" #include diff --git a/arch/amiga/amiga.cc b/arch/amiga/amiga.cc index d2e95079..569e6b90 100644 --- a/arch/amiga/amiga.cc +++ b/arch/amiga/amiga.cc @@ -1,7 +1,7 @@ -#include "globals.h" -#include "decoders/decoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" #include "amiga.h" -#include "bytes.h" +#include "lib/bytes.h" #include "fmt/format.h" uint32_t amigaChecksum(const Bytes& bytes) diff --git a/arch/amiga/amiga.h b/arch/amiga/amiga.h index da705bed..838691f9 100644 --- a/arch/amiga/amiga.h +++ b/arch/amiga/amiga.h @@ -1,7 +1,7 @@ #ifndef AMIGA_H #define AMIGA_H -#include "encoders/encoders.h" +#include "lib/encoders/encoders.h" #define AMIGA_SECTOR_RECORD 0xaaaa44894489LL diff --git a/arch/amiga/decoder.cc b/arch/amiga/decoder.cc index e4117cfa..52406019 100644 --- a/arch/amiga/decoder.cc +++ b/arch/amiga/decoder.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "amiga.h" -#include "bytes.h" +#include "lib/bytes.h" #include "fmt/format.h" #include "lib/decoders/decoders.pb.h" #include diff --git a/arch/amiga/encoder.cc b/arch/amiga/encoder.cc index 0d49382f..93af788b 100644 --- a/arch/amiga/encoder.cc +++ b/arch/amiga/encoder.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "amiga.h" -#include "crc.h" -#include "readerwriter.h" -#include "image.h" +#include "lib/crc.h" +#include "lib/readerwriter.h" +#include "lib/image.h" #include "arch/amiga/amiga.pb.h" #include "lib/encoders/encoders.pb.h" diff --git a/arch/apple2/apple2.h b/arch/apple2/apple2.h index 861ad865..a7eec2a6 100644 --- a/arch/apple2/apple2.h +++ b/arch/apple2/apple2.h @@ -2,8 +2,8 @@ #define APPLE2_H #include -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #define APPLE2_SECTOR_RECORD 0xd5aa96 #define APPLE2_DATA_RECORD 0xd5aaad diff --git a/arch/apple2/decoder.cc b/arch/apple2/decoder.cc index ce1e5b28..0a8cfbd5 100644 --- a/arch/apple2/decoder.cc +++ b/arch/apple2/decoder.cc @@ -1,13 +1,13 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "apple2.h" #include "arch/apple2/apple2.pb.h" #include "lib/decoders/decoders.pb.h" -#include "bytes.h" +#include "lib/bytes.h" #include "fmt/format.h" #include #include diff --git a/arch/apple2/encoder.cc b/arch/apple2/encoder.cc index 3f5eff33..f67c3301 100644 --- a/arch/apple2/encoder.cc +++ b/arch/apple2/encoder.cc @@ -1,14 +1,14 @@ -#include "globals.h" +#include "lib/globals.h" #include "arch/apple2/apple2.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" -#include "sector.h" -#include "readerwriter.h" -#include "image.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" +#include "lib/sector.h" +#include "lib/readerwriter.h" +#include "lib/image.h" #include "fmt/format.h" #include "lib/encoders/encoders.pb.h" #include -#include "bytes.h" +#include "lib/bytes.h" static int encode_data_gcr(uint8_t data) { diff --git a/arch/brother/decoder.cc b/arch/brother/decoder.cc index 6adcc682..b1921cee 100644 --- a/arch/brother/decoder.cc +++ b/arch/brother/decoder.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "brother.h" -#include "sector.h" -#include "bytes.h" -#include "crc.h" +#include "lib/sector.h" +#include "lib/bytes.h" +#include "lib/crc.h" #include const FluxPattern SECTOR_RECORD_PATTERN(32, BROTHER_SECTOR_RECORD); diff --git a/arch/brother/encoder.cc b/arch/brother/encoder.cc index d69158ea..9a2699ea 100644 --- a/arch/brother/encoder.cc +++ b/arch/brother/encoder.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "brother.h" -#include "crc.h" -#include "readerwriter.h" -#include "image.h" +#include "lib/crc.h" +#include "lib/readerwriter.h" +#include "lib/image.h" #include "arch/brother/brother.pb.h" #include "lib/encoders/encoders.pb.h" diff --git a/arch/build.py b/arch/build.py new file mode 100644 index 00000000..426b90a8 --- /dev/null +++ b/arch/build.py @@ -0,0 +1,25 @@ +from build.protobuf import proto, protocc + +proto( + name="arch_proto", + srcs=[ + "./aeslanier/aeslanier.proto", + "./agat/agat.proto", + "./amiga/amiga.proto", + "./apple2/apple2.proto", + "./brother/brother.proto", + "./c64/c64.proto", + "./f85/f85.proto", + "./fb100/fb100.proto", + "./ibm/ibm.proto", + "./macintosh/macintosh.proto", + "./micropolis/micropolis.proto", + "./mx/mx.proto", + "./northstar/northstar.proto", + "./rolandd20/rolandd20.proto", + "./smaky6/smaky6.proto", + "./tids990/tids990.proto", + "./victor9k/victor9k.proto", + "./zilogmcz/zilogmcz.proto", + ], +) diff --git a/arch/c64/c64.cc b/arch/c64/c64.cc index 6d78a861..a1c1a6eb 100644 --- a/arch/c64/c64.cc +++ b/arch/c64/c64.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "c64.h" /* diff --git a/arch/c64/c64.h b/arch/c64/c64.h index 968af367..32033632 100644 --- a/arch/c64/c64.h +++ b/arch/c64/c64.h @@ -1,8 +1,8 @@ #ifndef C64_H #define C64_H -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #define C64_SECTOR_RECORD 0xffd49 #define C64_DATA_RECORD 0xffd57 diff --git a/arch/c64/decoder.cc b/arch/c64/decoder.cc index a64b699d..39f039f6 100644 --- a/arch/c64/decoder.cc +++ b/arch/c64/decoder.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "c64.h" -#include "crc.h" -#include "bytes.h" +#include "lib/crc.h" +#include "lib/bytes.h" #include "fmt/format.h" #include #include diff --git a/arch/c64/encoder.cc b/arch/c64/encoder.cc index 2ca81e2a..0028effd 100644 --- a/arch/c64/encoder.cc +++ b/arch/c64/encoder.cc @@ -1,17 +1,17 @@ -#include "globals.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "c64.h" -#include "crc.h" -#include "sector.h" -#include "readerwriter.h" -#include "image.h" +#include "lib/crc.h" +#include "lib/sector.h" +#include "lib/readerwriter.h" +#include "lib/image.h" #include "fmt/format.h" #include "arch/c64/c64.pb.h" #include "lib/encoders/encoders.pb.h" #include "lib/layout.h" #include -#include "bytes.h" +#include "lib/bytes.h" static bool lastBit; diff --git a/arch/f85/decoder.cc b/arch/f85/decoder.cc index 78b54e50..646e053f 100644 --- a/arch/f85/decoder.cc +++ b/arch/f85/decoder.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "f85.h" -#include "crc.h" -#include "bytes.h" +#include "lib/crc.h" +#include "lib/bytes.h" #include "fmt/format.h" #include #include diff --git a/arch/fb100/decoder.cc b/arch/fb100/decoder.cc index db231be0..aa1cee57 100644 --- a/arch/fb100/decoder.cc +++ b/arch/fb100/decoder.cc @@ -1,13 +1,13 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "fb100.h" -#include "crc.h" -#include "bytes.h" -#include "decoders/rawbits.h" +#include "lib/crc.h" +#include "lib/bytes.h" +#include "lib/decoders/rawbits.h" #include "fmt/format.h" #include #include diff --git a/arch/ibm/decoder.cc b/arch/ibm/decoder.cc index cd6709f6..86f77bf2 100644 --- a/arch/ibm/decoder.cc +++ b/arch/ibm/decoder.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "decoders/decoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" #include "ibm.h" -#include "crc.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "sector.h" +#include "lib/crc.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/sector.h" #include "arch/ibm/ibm.pb.h" -#include "proto.h" +#include "lib/proto.h" #include "lib/layout.h" #include diff --git a/arch/ibm/encoder.cc b/arch/ibm/encoder.cc index 231d78f0..dad5cad1 100644 --- a/arch/ibm/encoder.cc +++ b/arch/ibm/encoder.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "ibm.h" -#include "crc.h" -#include "readerwriter.h" -#include "image.h" +#include "lib/crc.h" +#include "lib/readerwriter.h" +#include "lib/image.h" #include "arch/ibm/ibm.pb.h" #include "lib/encoders/encoders.pb.h" #include "fmt/format.h" diff --git a/arch/macintosh/decoder.cc b/arch/macintosh/decoder.cc index 76eaf9bb..78b0ad7a 100644 --- a/arch/macintosh/decoder.cc +++ b/arch/macintosh/decoder.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "macintosh.h" -#include "bytes.h" +#include "lib/bytes.h" #include "fmt/format.h" #include #include diff --git a/arch/macintosh/encoder.cc b/arch/macintosh/encoder.cc index 38ce3c78..ba06cb79 100644 --- a/arch/macintosh/encoder.cc +++ b/arch/macintosh/encoder.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "macintosh.h" -#include "crc.h" -#include "readerwriter.h" -#include "image.h" +#include "lib/crc.h" +#include "lib/readerwriter.h" +#include "lib/image.h" #include "fmt/format.h" #include "lib/encoders/encoders.pb.h" #include "lib/layout.h" diff --git a/arch/micropolis/decoder.cc b/arch/micropolis/decoder.cc index 508fc2ef..8acd2f58 100644 --- a/arch/micropolis/decoder.cc +++ b/arch/micropolis/decoder.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "micropolis.h" -#include "bytes.h" +#include "lib/bytes.h" #include "fmt/format.h" #include "lib/decoders/decoders.pb.h" diff --git a/arch/micropolis/encoder.cc b/arch/micropolis/encoder.cc index 6a44b2c7..309e33ff 100644 --- a/arch/micropolis/encoder.cc +++ b/arch/micropolis/encoder.cc @@ -1,9 +1,9 @@ -#include "globals.h" +#include "lib/globals.h" #include "micropolis.h" -#include "sector.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" -#include "image.h" +#include "lib/sector.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" +#include "lib/image.h" #include "lib/encoders/encoders.pb.h" static void write_sector(std::vector& bits, diff --git a/arch/mx/decoder.cc b/arch/mx/decoder.cc index 1768eaab..daec99fa 100644 --- a/arch/mx/decoder.cc +++ b/arch/mx/decoder.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "decoders/decoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" #include "mx/mx.h" -#include "crc.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "sector.h" +#include "lib/crc.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/sector.h" #include const int SECTOR_SIZE = 256; diff --git a/arch/mx/mx.h b/arch/mx/mx.h index 1aae9d0e..b773ec98 100644 --- a/arch/mx/mx.h +++ b/arch/mx/mx.h @@ -1,7 +1,7 @@ #ifndef MX_H #define MX_H -#include "decoders/decoders.h" +#include "lib/decoders/decoders.h" extern std::unique_ptr createMxDecoder(const DecoderProto& config); diff --git a/arch/northstar/decoder.cc b/arch/northstar/decoder.cc index 4a2d2253..31e10c08 100644 --- a/arch/northstar/decoder.cc +++ b/arch/northstar/decoder.cc @@ -11,13 +11,13 @@ * sure that the hardSectorId is correct. */ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "northstar.h" -#include "bytes.h" +#include "lib/bytes.h" #include "lib/decoders/decoders.pb.h" #include "fmt/format.h" diff --git a/arch/northstar/encoder.cc b/arch/northstar/encoder.cc index 2be6dc39..6d20e9c6 100644 --- a/arch/northstar/encoder.cc +++ b/arch/northstar/encoder.cc @@ -1,10 +1,10 @@ -#include "globals.h" +#include "lib/globals.h" #include "northstar.h" -#include "sector.h" -#include "bytes.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" -#include "image.h" +#include "lib/sector.h" +#include "lib/bytes.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" +#include "lib/image.h" #include "lib/encoders/encoders.pb.h" #define GAP_FILL_SIZE_SD 30 diff --git a/arch/smaky6/decoder.cc b/arch/smaky6/decoder.cc index 476afcb3..ebe45256 100644 --- a/arch/smaky6/decoder.cc +++ b/arch/smaky6/decoder.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "smaky6.h" -#include "bytes.h" -#include "crc.h" +#include "lib/bytes.h" +#include "lib/crc.h" #include "fmt/format.h" #include "lib/decoders/decoders.pb.h" #include diff --git a/arch/tids990/decoder.cc b/arch/tids990/decoder.cc index 49753f61..5baddc66 100644 --- a/arch/tids990/decoder.cc +++ b/arch/tids990/decoder.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "tids990/tids990.h" -#include "crc.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "sector.h" +#include "lib/crc.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/sector.h" #include #include diff --git a/arch/tids990/encoder.cc b/arch/tids990/encoder.cc index 7b43cfcf..3531a17c 100644 --- a/arch/tids990/encoder.cc +++ b/arch/tids990/encoder.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "tids990.h" -#include "crc.h" -#include "readerwriter.h" -#include "image.h" +#include "lib/crc.h" +#include "lib/readerwriter.h" +#include "lib/image.h" #include "arch/tids990/tids990.pb.h" #include "lib/encoders/encoders.pb.h" #include diff --git a/arch/victor9k/decoder.cc b/arch/victor9k/decoder.cc index 77af32e4..cc823306 100644 --- a/arch/victor9k/decoder.cc +++ b/arch/victor9k/decoder.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "victor9k.h" -#include "crc.h" -#include "bytes.h" +#include "lib/crc.h" +#include "lib/bytes.h" #include "fmt/format.h" #include #include diff --git a/arch/victor9k/encoder.cc b/arch/victor9k/encoder.cc index c00ee592..dcaa7066 100644 --- a/arch/victor9k/encoder.cc +++ b/arch/victor9k/encoder.cc @@ -1,17 +1,17 @@ -#include "globals.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "victor9k.h" -#include "crc.h" -#include "sector.h" -#include "readerwriter.h" -#include "image.h" +#include "lib/crc.h" +#include "lib/sector.h" +#include "lib/readerwriter.h" +#include "lib/image.h" #include "fmt/format.h" #include "arch/victor9k/victor9k.pb.h" #include "lib/encoders/encoders.pb.h" #include "lib/layout.h" #include -#include "bytes.h" +#include "lib/bytes.h" static bool lastBit; diff --git a/arch/zilogmcz/decoder.cc b/arch/zilogmcz/decoder.cc index c1541e59..8af6dea6 100644 --- a/arch/zilogmcz/decoder.cc +++ b/arch/zilogmcz/decoder.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" -#include "decoders/decoders.h" -#include "sector.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" #include "zilogmcz.h" -#include "bytes.h" -#include "crc.h" +#include "lib/bytes.h" +#include "lib/crc.h" #include "fmt/format.h" #include #include diff --git a/build.py b/build.py new file mode 100644 index 00000000..fc82e3b5 --- /dev/null +++ b/build.py @@ -0,0 +1,10 @@ +from build.ab import export +from build.c import clibrary +from build.protobuf import proto, protocc + +clibrary(name="protocol", hdrs={"protocol.h": "./protocol.h"}) + +proto(name="fl2_proto", srcs=["lib/fl2.proto"]) +protocc(name="fl2_proto_lib", srcs=["+fl2_proto"]) + +export(name="all", items={"fluxengine": "src+fluxengine"}, deps=["+protocol"]) diff --git a/build/ab.mk b/build/ab.mk new file mode 100644 index 00000000..7a38ee16 --- /dev/null +++ b/build/ab.mk @@ -0,0 +1,33 @@ +OBJ ?= .obj +PYTHON ?= python3 +CC ?= gcc +CXX ?= g++ +AR ?= ar +CFLAGS ?= -g -Og +LDFLAGS ?= -g +hide = @ +PKG_CONFIG ?= pkg-config +ECHO ?= echo + +include $(OBJ)/build.mk + +.PHONY: update-ab +update-ab: + @echo "Press RETURN to update ab from the repository, or CTRL+C to cancel." \ + && read a \ + && (curl -L https://github.com/davidgiven/ab/releases/download/dev/distribution.tar.xz | tar xvJf -) \ + && echo "Done." + +.PHONY: clean +clean:: + @echo [-/-] CLEAN + $(hide) rm -rf $(OBJ) bin + +export PYTHONHASHSEED = 1 +build-files = $(shell find . -name 'build.py') build/*.py config.py +$(OBJ)/build.mk: Makefile $(build-files) + @echo "AB" + @mkdir -p $(OBJ) + $(hide) $(PYTHON) -X pycache_prefix=$(OBJ) build/ab.py -t +all -o $@ \ + build.py || rm -f $@ + diff --git a/build/ab.py b/build/ab.py new file mode 100644 index 00000000..70e85c13 --- /dev/null +++ b/build/ab.py @@ -0,0 +1,487 @@ +from collections.abc import Iterable, Sequence +from os.path import * +from types import SimpleNamespace +import argparse +import copy +import functools +import importlib +import importlib.abc +import importlib.util +import inspect +import re +import sys +import types +import pathlib +import builtins +import os + +defaultGlobals = {} +targets = {} +unmaterialisedTargets = set() +materialisingStack = [] +outputFp = None +cwdStack = [""] + +sys.path += ["."] +old_import = builtins.__import__ + + +def new_import(name, *args, **kwargs): + if name not in sys.modules: + path = name.replace(".", "/") + ".py" + if isfile(path): + sys.stderr.write(f"loading {path}\n") + loader = importlib.machinery.SourceFileLoader(name, path) + + spec = importlib.util.spec_from_loader( + name, loader, origin="built-in" + ) + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + cwdStack.append(dirname(path)) + spec.loader.exec_module(module) + cwdStack.pop() + + return old_import(name, *args, **kwargs) + + +builtins.__import__ = new_import + + +class ABException(BaseException): + pass + + +class ParameterList(Sequence): + def __init__(self, parent=[]): + self.data = parent + + def __getitem__(self, i): + return self.data[i] + + def __len__(self): + return len(self.data) + + def __str__(self): + return " ".join(self.data) + + def __add__(self, other): + newdata = self.data.copy() + other + return ParameterList(newdata) + + def __repr__(self): + return f"" + + +class Invocation: + name = None + callback = None + types = None + ins = None + outs = None + binding = None + + def materialise(self, replacing=False): + if self in unmaterialisedTargets: + if not replacing and (self in materialisingStack): + print("Found dependency cycle:") + for i in materialisingStack: + print(f" {i.name}") + print(f" {self.name}") + sys.exit(1) + + materialisingStack.append(self) + + # Perform type conversion to the declared rule parameter types. + + try: + self.args = {} + for k, v in self.binding.arguments.items(): + if k != "kwargs": + t = self.types.get(k, None) + if t: + v = t(v).convert(self) + self.args[k] = v + else: + for kk, vv in v.items(): + t = self.types.get(kk, None) + if t: + vv = t(vv).convert(self) + self.args[kk] = vv + + # Actually call the callback. + + cwdStack.append(self.cwd) + self.callback(**self.args) + cwdStack.pop() + except BaseException as e: + print( + f"Error materialising {self} ({id(self)}): {self.callback}" + ) + print(f"Arguments: {self.args}") + raise e + + if self.outs is None: + raise ABException(f"{self.name} didn't set self.outs") + + if self in unmaterialisedTargets: + unmaterialisedTargets.remove(self) + + materialisingStack.pop() + + def __repr__(self): + return "" % self.name + + +def Rule(func): + sig = inspect.signature(func) + + @functools.wraps(func) + def wrapper(*, name=None, replaces=None, **kwargs): + cwd = None + if name: + if ("+" in name) and not name.startswith("+"): + (cwd, _) = name.split("+", 1) + if not cwd: + cwd = cwdStack[-1] + + if name: + i = Invocation() + if name.startswith("./"): + name = join(cwd, name) + elif "+" not in name: + name = cwd + "+" + name + + i.name = name + i.localname = name.split("+")[-1] + + if name in targets: + raise ABException(f"target {i.name} has already been defined") + targets[name] = i + elif replaces: + i = replaces + name = i.name + else: + raise ABException("you must supply either name or replaces") + + i.cwd = cwd + i.types = func.__annotations__ + i.callback = func + setattr(i, func.__name__, SimpleNamespace()) + + i.binding = sig.bind(name=name, self=i, **kwargs) + i.binding.apply_defaults() + + unmaterialisedTargets.add(i) + if replaces: + i.materialise(replacing=True) + return i + + defaultGlobals[func.__name__] = wrapper + return wrapper + + +class Type: + def __init__(self, value): + self.value = value + + +class Targets(Type): + def convert(self, invocation): + value = self.value + if type(value) is str: + value = [value] + if type(value) is list: + value = targetsof(value, cwd=invocation.cwd) + return value + + +class Target(Type): + def convert(self, invocation): + value = self.value + if not value: + return None + return targetof(value, cwd=invocation.cwd) + + +class TargetsMap(Type): + def convert(self, invocation): + value = self.value + if type(value) is dict: + return { + k: targetof(v, cwd=invocation.cwd) for k, v in value.items() + } + raise ABException(f"wanted a dict of targets, got a {type(value)}") + + +def flatten(*xs): + def recurse(xs): + for x in xs: + if isinstance(x, Iterable) and not isinstance(x, (str, bytes)): + yield from recurse(x) + else: + yield x + + return list(recurse(xs)) + + +def fileinvocation(s): + i = Invocation() + i.name = s + i.outs = [s] + targets[s] = i + return i + + +def targetof(s, cwd): + if isinstance(s, Invocation): + s.materialise() + return s + + if s in targets: + t = targets[s] + t.materialise() + return t + + if s.startswith("+"): + s = cwd + s + if s.startswith("./"): + s = normpath(join(cwd, s)) + if s.startswith("$"): + return fileinvocation(s) + + if "+" not in s: + if isdir(s): + s = s + "+" + basename(s) + else: + return fileinvocation(s) + + (path, target) = s.split("+", 2) + loadbuildfile(join(path, "build.py")) + if not s in targets: + raise ABException(f"build file at {path} doesn't contain +{target}") + i = targets[s] + i.materialise() + return i + + +def targetsof(*xs, cwd): + return flatten([targetof(x, cwd) for x in flatten(xs)]) + + +def filenamesof(*xs): + s = [] + for t in flatten(xs): + if type(t) == str: + t = normpath(t) + if t not in s: + s += [t] + else: + for f in [normpath(f) for f in filenamesof(t.outs)]: + if f not in s: + s += [f] + return s + + +def targetnamesof(*xs): + s = [] + for x in flatten(xs): + if type(x) == str: + x = normpath(x) + if x not in s: + s += [x] + else: + if x.name not in s: + s += [x.name] + return s + + +def filenameof(x): + xs = filenamesof(x) + if len(xs) != 1: + raise ABException("expected a single item") + return xs[0] + + +def stripext(path): + return splitext(path)[0] + + +def emit(*args): + outputFp.write(" ".join(flatten(args))) + outputFp.write("\n") + + +def templateexpand(s, invocation): + class Converter: + def __getitem__(self, key): + if key == "self": + return invocation + f = filenamesof(invocation.args[key]) + if isinstance(f, Sequence): + f = ParameterList(f) + return f + + return eval("f%r" % s, invocation.callback.__globals__, Converter()) + + +def emitter_rule(name, ins, outs, deps=[]): + emit("") + emit(".PHONY:", name) + if outs: + emit(name, ":", filenamesof(outs), ";") + emit(filenamesof(outs), "&:", filenamesof(ins), filenamesof(deps)) + else: + emit(name, "&:", filenamesof(ins), filenamesof(deps)) + + +def emitter_endrule(name): + pass + + +def emitter_label(s): + emit("\t$(hide)", "$(ECHO)", s) + + +def emitter_exec(cs): + for c in cs: + emit("\t$(hide)", c) + + +def unmake(*ss): + return [ + re.sub(r"\$\(([^)]*)\)", r"$\1", s) for s in flatten(filenamesof(ss)) + ] + + +@Rule +def simplerule( + self, + name, + ins: Targets = [], + outs=[], + deps: Targets = [], + commands=[], + label="RULE", + **kwargs, +): + self.ins = ins + self.outs = outs + self.deps = deps + emitter_rule(self.name, ins + deps, outs) + emitter_label(templateexpand("{label} {name}", self)) + + dirs = [] + for out in filenamesof(outs): + dir = dirname(out) + if dir and dir not in dirs: + dirs += [dir] + + cs = [("mkdir -p %s" % dir) for dir in dirs] + for c in commands: + cs += [templateexpand(c, self)] + emitter_exec(cs) + emitter_endrule(self.name) + + +@Rule +def normalrule( + self, + name=None, + ins: Targets = [], + deps: Targets = [], + outs=[], + label="RULE", + objdir=None, + commands=[], + **kwargs, +): + objdir = objdir or join("$(OBJ)", name) + + self.normalrule.objdir = objdir + simplerule( + replaces=self, + ins=ins, + deps=deps, + outs=[join(objdir, f) for f in outs], + label=label, + commands=commands, + **kwargs, + ) + + +@Rule +def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): + cs = [] + self.ins = items.values() + self.outs = [] + for dest, src in items.items(): + destf = filenameof(dest) + dir = dirname(destf) + if dir: + cs += ["mkdir -p " + dir] + + srcs = filenamesof(src) + if len(srcs) != 1: + raise ABException( + "a dependency of an export must have exactly one output file" + ) + + cs += ["cp %s %s" % (srcs[0], destf)] + self.outs += [destf] + + emitter_rule(self.name, items.values(), self.outs, deps) + emitter_label(f"EXPORT {self.name}") + + emitter_exec(cs) + + if self.outs: + emit("clean::") + emit("\t$(hide) rm -f " + (" ".join(filenamesof(self.outs)))) + self.outs += deps + + emitter_endrule(self.name) + + +def loadbuildfile(filename): + filename = filename.replace("/", ".").removesuffix(".py") + builtins.__import__(filename) + + +def load(filename): + loadbuildfile(filename) + callerglobals = inspect.stack()[1][0].f_globals + for k, v in defaultGlobals.items(): + callerglobals[k] = v + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("-o", "--output") + parser.add_argument("files", nargs="+") + parser.add_argument("-t", "--targets", action="append") + args = parser.parse_args() + if not args.targets: + raise ABException("no targets supplied") + + global outputFp + outputFp = open(args.output, "wt") + + for k in ("Rule", "Targets", "load", "filenamesof", "stripext"): + defaultGlobals[k] = globals()[k] + + global __name__ + sys.modules["build.ab"] = sys.modules[__name__] + __name__ = "build.ab" + + for f in args.files: + loadbuildfile(f) + + for t in flatten([a.split(",") for a in args.targets]): + if t not in targets: + raise ABException("target %s is not defined" % t) + targets[t].materialise() + emit("AB_LOADED = 1\n") + + +main() diff --git a/build/c.py b/build/c.py new file mode 100644 index 00000000..0bd2995a --- /dev/null +++ b/build/c.py @@ -0,0 +1,243 @@ +from os.path import basename, join +from build.ab import ( + ABException, + Rule, + Targets, + TargetsMap, + filenameof, + flatten, + filenamesof, + normalrule, + stripext, +) +from os.path import * + + +def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, cflags): + outleaf = stripext(basename(filenameof(srcs[0]))) + suffix + + normalrule( + replaces=self, + ins=srcs, + deps=deps, + outs=[outleaf], + label=label, + commands=commands, + cflags=cflags, + ) + + +@Rule +def cfile( + self, + name, + srcs: Targets = [], + deps: Targets = [], + cflags=[], + suffix=".o", + commands=["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], + label="CC", +): + cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", cflags) + + +@Rule +def cxxfile( + self, + name, + srcs: Targets = [], + deps: Targets = [], + cflags=[], + suffix=".o", + commands=["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], + label="CXX", +): + cfileimpl( + self, name, srcs, deps, suffix, commands, label, "cxxfile", cflags + ) + + +def findsources(name, srcs, deps, cflags, filerule): + objs = [] + for s in flatten(srcs): + ff = [ + f + for f in filenamesof(s) + if f.endswith(".c") or f.endswith(".cc") or f.endswith(".cpp") + ] + if ff: + for f in ff: + objs += [ + filerule( + name=join(name, f.removeprefix("$(OBJ)/")), + srcs=[f], + deps=deps, + cflags=cflags, + ) + ] + else: + if s not in objs: + objs += [s] + return objs + + +@Rule +def clibrary( + self, + name, + srcs: Targets = [], + deps: Targets = [], + hdrs: TargetsMap = {}, + cflags=[], + commands=["$(AR) cqs {outs[0]} {ins}"], + label="LIB", +): + if not srcs and not hdrs: + raise ABException( + "clibrary contains no sources and no exported headers" + ) + + libraries = [d for d in deps if hasattr(d, "clibrary")] + for library in libraries: + if library.clibrary.cflags: + cflags += library.clibrary.cflags + if library.clibrary.ldflags: + ldflags += library.clibrary.ldflags + + for f in filenamesof(srcs): + if f.endswith(".h"): + deps += [f] + + hdrcs = [] + hdrins = list(hdrs.values()) + hdrouts = [] + i = 0 + for dest, src in hdrs.items(): + s = filenamesof(src) + if len(s) != 1: + raise ABException( + "a dependency of an export must have exactly one output file" + ) + + hdrcs += ["cp {ins[" + str(i) + "]} {outs[" + str(i) + "]}"] + hdrouts += [dest] + i = i + 1 + + if srcs: + nr = None + if hdrcs: + hr = normalrule( + name=f"{name}_hdrs", + ins=hdrins, + outs=hdrouts, + label="HEADERS", + commands=hdrcs, + ) + hr.materialise() + + actualsrcs = findsources( + name, + srcs, + deps + ([f"{name}_hdrs"] if hr else []), + cflags + ([f"-I{hr.normalrule.objdir}"] if hr else []), + cfile, + ) + + normalrule( + replaces=self, + ins=actualsrcs, + outs=[basename(name) + ".a"], + label=label, + commands=commands if actualsrcs else [], + ) + + self.clibrary.ldflags = [] + self.clibrary.cflags = ["-I" + hr.normalrule.objdir] if hr else [] + else: + r = normalrule( + replaces=self, + ins=hdrins, + outs=hdrouts, + label="HEADERS", + commands=hdrcs, + ) + r.materialise() + + self.clibrary.ldflags = [] + self.clibrary.cflags = ["-I" + r.normalrule.objdir] + + +def programimpl( + self, name, srcs, deps, cflags, ldflags, commands, label, filerule, kind +): + libraries = [d for d in deps if hasattr(d, "clibrary")] + for library in libraries: + if library.clibrary.cflags: + cflags += library.clibrary.cflags + if library.clibrary.ldflags: + ldflags += library.clibrary.ldflags + + deps += [f for f in filenamesof(srcs) if f.endswith(".h")] + + normalrule( + replaces=self, + ins=( + findsources(name, srcs, deps, cflags, filerule) + + [f for f in filenamesof(libraries) if f.endswith(".a")] + ), + outs=[basename(name)], + deps=deps, + label=label, + commands=commands, + ldflags=ldflags, + ) + + +@Rule +def cprogram( + self, + name, + srcs: Targets = [], + deps: Targets = [], + cflags=[], + ldflags=[], + commands=["$(CC) -o {outs[0]} {ins} {ldflags}"], + label="CLINK", +): + programimpl( + self, + name, + srcs, + deps, + cflags, + ldflags, + commands, + label, + cfile, + "cprogram", + ) + + +@Rule +def cxxprogram( + self, + name, + srcs: Targets = [], + deps: Targets = [], + cflags=[], + ldflags=[], + commands=["$(CXX) -o {outs[0]} {ins} {ldflags}"], + label="CXXLINK", +): + programimpl( + self, + name, + srcs, + deps, + cflags, + ldflags, + commands, + label, + cxxfile, + "cxxprogram", + ) diff --git a/build/pkg.py b/build/pkg.py new file mode 100644 index 00000000..0da471e8 --- /dev/null +++ b/build/pkg.py @@ -0,0 +1,38 @@ +from build.ab import Rule, emit, Target +from types import SimpleNamespace +import os +import subprocess + +emit( + """ +PKG_CONFIG ?= pkg-config +PACKAGES := $(shell $(PKG_CONFIG) --list-package-names) +""" +) + + +@Rule +def package(self, name, package=None, fallback: Target = None): + emit("ifeq ($(filter %s, $(PACKAGES)),)" % package) + if fallback: + emit(f"PACKAGE_CFLAGS_{package} :=", fallback.clibrary.cflags) + emit(f"PACKAGE_LDFLAGS_{package} := ", fallback.clibrary.ldflags) + emit(f"PACKAGE_DEP_{package} := ", fallback.name) + else: + emit(f"$(error Required package '{package}' not installed.)") + emit("else") + emit( + f"PACKAGE_CFLAGS_{package} := $(shell $(PKG_CONFIG) --cflags {package}" + ) + emit( + f"PACKAGE_LDFLAGS_{package} := $(shell $(PKG_CONFIG) --ldflags {package}" + ) + emit(f"PACKAGE_DEP_{package} := ") + emit("endif") + + self.clibrary = SimpleNamespace() + self.clibrary.cflags = [f"$(PACKAGE_CFLAGS_{package})"] + self.clibrary.ldflags = [f"$(PACKAGE_LDFLAGS_{package})"] + + self.ins = [] + self.outs = [f"$(PACKAGE_DEP_{package})"] diff --git a/build/protobuf.py b/build/protobuf.py new file mode 100644 index 00000000..ce8fd3d0 --- /dev/null +++ b/build/protobuf.py @@ -0,0 +1,65 @@ +from os.path import join +from build.ab import Rule, Targets, emit, normalrule, filenamesof, flatten +from build.c import clibrary +import build.pkg +from types import SimpleNamespace + +emit( + """ +PROTOC ?= protoc +ifeq ($(filter protobuf, $(PACKAGES)),) +$(error Required package 'protobuf' not installed.)" +endif +""" +) + + +@Rule +def proto(self, name, srcs: Targets = [], deps: Targets = []): + normalrule( + replaces=self, + ins=srcs, + outs=[f"{name}.descriptor"], + deps=deps, + commands=[ + "$(PROTOC) --include_source_info --descriptor_set_out={outs[0]} {ins}" + ], + label="PROTO", + ) + self.proto.srcs = filenamesof(srcs) + flatten( + [s.proto.srcs for s in flatten(deps)] + ) + + +@Rule +def protocc(self, name, srcs: Targets = [], deps: Targets = []): + outs = [] + protos = [] + for f in flatten([s.proto.srcs for s in flatten(srcs + deps)]): + if f.endswith(".proto"): + cc = f.replace(".proto", ".pb.cc") + h = f.replace(".proto", ".pb.h") + protos += [f] + srcs += [f] + outs += [cc, h] + + r = normalrule( + name=f"{name}_srcs", + ins=protos, + outs=outs, + deps=deps, + commands=["$(PROTOC) --cpp_out={self.normalrule.objdir} {ins}"], + label="PROTOCC", + ) + + r.materialise() + headers = { + f: join(r.normalrule.objdir, f) for f in outs if f.endswith(".pb.h") + } + + clibrary( + replaces=self, + srcs=[f"{name}_srcs"], + hdrs=headers, + cflags=[f"-I{r.normalrule.objdir}"], + ) diff --git a/config.py b/config.py new file mode 100644 index 00000000..e69de29b diff --git a/dep/adflib/build.mk b/dep/adflib/build.mk index 8ccff26e..f3471f13 100644 --- a/dep/adflib/build.mk +++ b/dep/adflib/build.mk @@ -1,16 +1,16 @@ ADFLIB_SRCS = \ - dep/adflib/src/adf_bitm.c \ - dep/adflib/src/adf_cache.c \ - dep/adflib/src/adf_dir.c \ - dep/adflib/src/adf_disk.c \ - dep/adflib/src/adf_dump.c \ - dep/adflib/src/adf_env.c \ - dep/adflib/src/adf_file.c \ - dep/adflib/src/adf_hd.c \ - dep/adflib/src/adf_link.c \ - dep/adflib/src/adf_raw.c \ - dep/adflib/src/adf_salv.c \ - dep/adflib/src/adf_util.c \ + DEP/ADFLIB/SRC/ADF_BITM.C \ + DEP/ADFLIB/SRC/ADF_CACHE.C \ + DEP/ADFLIB/SRC/ADF_DIR.C \ + DEP/ADFLIB/SRC/ADF_DISK.C \ + DEP/ADFLIB/SRC/ADF_DUMP.C \ + DEP/ADFLIB/SRC/ADF_ENV.C \ + DEP/ADFLIB/SRC/ADF_FILE.C \ + DEP/ADFLIB/SRC/ADF_HD.C \ + DEP/ADFLIB/SRC/ADF_LINK.C \ + DEP/ADFLIB/SRC/ADF_RAW.C \ + DEP/ADFLIB/SRC/ADF_SALV.C \ + DEP/ADFLIB/SRC/ADF_UTIL.C \ ADFLIB_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(ADFLIB_SRCS)) $(ADFLIB_OBJS): CFLAGS += -Idep/adflib/src -Idep/adflib diff --git a/dep/adflib/build.py b/dep/adflib/build.py new file mode 100644 index 00000000..d938d379 --- /dev/null +++ b/dep/adflib/build.py @@ -0,0 +1,46 @@ +from build.c import clibrary + +clibrary( + name="adflib", + srcs=[ + "./src/adf_bitm.c", + "./src/adf_bitm.h", + "./src/adf_cache.c", + "./src/adf_cache.h", + "./src/adf_dir.c", + "./src/adf_dir.h", + "./src/adf_disk.c", + "./src/adf_disk.h", + "./src/adf_dump.c", + "./src/adf_dump.h", + "./src/adf_env.c", + "./src/adf_env.h", + "./src/adf_file.c", + "./src/adf_file.h", + "./src/adf_hd.c", + "./src/adf_hd.h", + "./src/adf_link.c", + "./src/adf_link.h", + "./src/adf_raw.c", + "./src/adf_raw.h", + "./src/adf_salv.c", + "./src/adf_salv.h", + "./src/adf_str.h", + "./src/adf_util.c", + "./src/adf_util.h", + "./src/defendian.h", + "./src/hd_blk.h", + "./src/prefix.h", + "./adf_nativ.h", + "./config.h", + "./src/adflib.h", + ], + cflags=["-Idep/adflib", "-Idep/adflib/src"], + hdrs={ + "adflib.h": "./src/adflib.h", + "adf_defs.h": "./src/adf_defs.h", + "adf_str.h": "./src/adf_str.h", + "adf_blk.h": "./src/adf_blk.h", + "adf_err.h": "./src/adf_err.h", + }, +) diff --git a/dep/agg/build.py b/dep/agg/build.py new file mode 100644 index 00000000..b0818ce6 --- /dev/null +++ b/dep/agg/build.py @@ -0,0 +1,164 @@ +from build.c import clibrary + +clibrary( + name="agg", + srcs=[ + "./src/agg_arrowhead.cpp", + "./src/agg_line_aa_basics.cpp", + "./src/agg_vcgen_bspline.cpp", + "./src/agg_vpgen_segmentator.cpp", + "./src/agg_color_rgba.cpp", + "./src/agg_sqrt_tables.cpp", + "./src/agg_bspline.cpp", + "./src/agg_curves.cpp", + "./src/agg_rounded_rect.cpp", + "./src/agg_vcgen_markers_term.cpp", + "./src/agg_vcgen_dash.cpp", + "./src/agg2d.cpp", + "./src/agg_trans_affine.cpp", + "./src/agg_gsv_text.cpp", + "./src/agg_vcgen_smooth_poly1.cpp", + "./src/agg_trans_single_path.cpp", + "./src/agg_vpgen_clip_polygon.cpp", + "./src/agg_embedded_raster_fonts.cpp", + "./src/agg_trans_double_path.cpp", + "./src/agg_vcgen_stroke.cpp", + "./src/agg_arc.cpp", + "./src/agg_image_filters.cpp", + "./src/agg_trans_warp_magnifier.cpp", + "./src/agg_vpgen_clip_polyline.cpp", + "./src/agg_bezier_arc.cpp", + "./src/agg_line_profile_aa.cpp", + "./src/agg_vcgen_contour.cpp", + ], + hdrs={ + "agg2d.h": "./include/agg2d.h", + "agg_alpha_mask_u8.h": "./include/agg_alpha_mask_u8.h", + "agg_arc.h": "./include/agg_arc.h", + "agg_array.h": "./include/agg_array.h", + "agg_arrowhead.h": "./include/agg_arrowhead.h", + "agg_basics.h": "./include/agg_basics.h", + "agg_bezier_arc.h": "./include/agg_bezier_arc.h", + "agg_bitset_iterator.h": "./include/agg_bitset_iterator.h", + "agg_blur.h": "./include/agg_blur.h", + "agg_bounding_rect.h": "./include/agg_bounding_rect.h", + "agg_bspline.h": "./include/agg_bspline.h", + "agg_clip_liang_barsky.h": "./include/agg_clip_liang_barsky.h", + "agg_color_gray.h": "./include/agg_color_gray.h", + "agg_color_rgba.h": "./include/agg_color_rgba.h", + "agg_config.h": "./include/agg_config.h", + "agg_conv_adaptor_vcgen.h": "./include/agg_conv_adaptor_vcgen.h", + "agg_conv_adaptor_vpgen.h": "./include/agg_conv_adaptor_vpgen.h", + "agg_conv_bspline.h": "./include/agg_conv_bspline.h", + "agg_conv_clip_polygon.h": "./include/agg_conv_clip_polygon.h", + "agg_conv_clip_polyline.h": "./include/agg_conv_clip_polyline.h", + "agg_conv_close_polygon.h": "./include/agg_conv_close_polygon.h", + "agg_conv_concat.h": "./include/agg_conv_concat.h", + "agg_conv_contour.h": "./include/agg_conv_contour.h", + "agg_conv_curve.h": "./include/agg_conv_curve.h", + "agg_conv_dash.h": "./include/agg_conv_dash.h", + "agg_conv_gpc.h": "./include/agg_conv_gpc.h", + "agg_conv_marker_adaptor.h": "./include/agg_conv_marker_adaptor.h", + "agg_conv_marker.h": "./include/agg_conv_marker.h", + "agg_conv_segmentator.h": "./include/agg_conv_segmentator.h", + "agg_conv_shorten_path.h": "./include/agg_conv_shorten_path.h", + "agg_conv_smooth_poly1.h": "./include/agg_conv_smooth_poly1.h", + "agg_conv_stroke.h": "./include/agg_conv_stroke.h", + "agg_conv_transform.h": "./include/agg_conv_transform.h", + "agg_conv_unclose_polygon.h": "./include/agg_conv_unclose_polygon.h", + "agg_curves.h": "./include/agg_curves.h", + "agg_dda_line.h": "./include/agg_dda_line.h", + "agg_ellipse_bresenham.h": "./include/agg_ellipse_bresenham.h", + "agg_ellipse.h": "./include/agg_ellipse.h", + "agg_embedded_raster_fonts.h": "./include/agg_embedded_raster_fonts.h", + "agg_font_cache_manager2.h": "./include/agg_font_cache_manager2.h", + "agg_font_cache_manager.h": "./include/agg_font_cache_manager.h", + "agg_gamma_functions.h": "./include/agg_gamma_functions.h", + "agg_gamma_lut.h": "./include/agg_gamma_lut.h", + "agg_glyph_raster_bin.h": "./include/agg_glyph_raster_bin.h", + "agg_gradient_lut.h": "./include/agg_gradient_lut.h", + "agg_gsv_text.h": "./include/agg_gsv_text.h", + "agg_image_accessors.h": "./include/agg_image_accessors.h", + "agg_image_filters.h": "./include/agg_image_filters.h", + "agg_line_aa_basics.h": "./include/agg_line_aa_basics.h", + "agg_math.h": "./include/agg_math.h", + "agg_math_stroke.h": "./include/agg_math_stroke.h", + "agg_path_length.h": "./include/agg_path_length.h", + "agg_path_storage.h": "./include/agg_path_storage.h", + "agg_path_storage_integer.h": "./include/agg_path_storage_integer.h", + "agg_pattern_filters_rgba.h": "./include/agg_pattern_filters_rgba.h", + "agg_pixfmt_amask_adaptor.h": "./include/agg_pixfmt_amask_adaptor.h", + "agg_pixfmt_base.h": "./include/agg_pixfmt_base.h", + "agg_pixfmt_gray.h": "./include/agg_pixfmt_gray.h", + "agg_pixfmt_rgba.h": "./include/agg_pixfmt_rgba.h", + "agg_pixfmt_rgb.h": "./include/agg_pixfmt_rgb.h", + "agg_pixfmt_rgb_packed.h": "./include/agg_pixfmt_rgb_packed.h", + "agg_pixfmt_transposer.h": "./include/agg_pixfmt_transposer.h", + "agg_rasterizer_cells_aa.h": "./include/agg_rasterizer_cells_aa.h", + "agg_rasterizer_compound_aa.h": "./include/agg_rasterizer_compound_aa.h", + "agg_rasterizer_outline_aa.h": "./include/agg_rasterizer_outline_aa.h", + "agg_rasterizer_outline.h": "./include/agg_rasterizer_outline.h", + "agg_rasterizer_scanline_aa.h": "./include/agg_rasterizer_scanline_aa.h", + "agg_rasterizer_scanline_aa_nogamma.h": "./include/agg_rasterizer_scanline_aa_nogamma.h", + "agg_rasterizer_sl_clip.h": "./include/agg_rasterizer_sl_clip.h", + "agg_renderer_base.h": "./include/agg_renderer_base.h", + "agg_renderer_markers.h": "./include/agg_renderer_markers.h", + "agg_renderer_mclip.h": "./include/agg_renderer_mclip.h", + "agg_renderer_outline_aa.h": "./include/agg_renderer_outline_aa.h", + "agg_renderer_outline_image.h": "./include/agg_renderer_outline_image.h", + "agg_renderer_primitives.h": "./include/agg_renderer_primitives.h", + "agg_renderer_raster_text.h": "./include/agg_renderer_raster_text.h", + "agg_renderer_scanline.h": "./include/agg_renderer_scanline.h", + "agg_rendering_buffer_dynarow.h": "./include/agg_rendering_buffer_dynarow.h", + "agg_rendering_buffer.h": "./include/agg_rendering_buffer.h", + "agg_rounded_rect.h": "./include/agg_rounded_rect.h", + "agg_scanline_bin.h": "./include/agg_scanline_bin.h", + "agg_scanline_boolean_algebra.h": "./include/agg_scanline_boolean_algebra.h", + "agg_scanline_p.h": "./include/agg_scanline_p.h", + "agg_scanline_storage_aa.h": "./include/agg_scanline_storage_aa.h", + "agg_scanline_storage_bin.h": "./include/agg_scanline_storage_bin.h", + "agg_scanline_u.h": "./include/agg_scanline_u.h", + "agg_shorten_path.h": "./include/agg_shorten_path.h", + "agg_simul_eq.h": "./include/agg_simul_eq.h", + "agg_span_allocator.h": "./include/agg_span_allocator.h", + "agg_span_converter.h": "./include/agg_span_converter.h", + "agg_span_gouraud_gray.h": "./include/agg_span_gouraud_gray.h", + "agg_span_gouraud.h": "./include/agg_span_gouraud.h", + "agg_span_gouraud_rgba.h": "./include/agg_span_gouraud_rgba.h", + "agg_span_gradient_alpha.h": "./include/agg_span_gradient_alpha.h", + "agg_span_gradient_contour.h": "./include/agg_span_gradient_contour.h", + "agg_span_gradient.h": "./include/agg_span_gradient.h", + "agg_span_gradient_image.h": "./include/agg_span_gradient_image.h", + "agg_span_image_filter_gray.h": "./include/agg_span_image_filter_gray.h", + "agg_span_image_filter.h": "./include/agg_span_image_filter.h", + "agg_span_image_filter_rgba.h": "./include/agg_span_image_filter_rgba.h", + "agg_span_image_filter_rgb.h": "./include/agg_span_image_filter_rgb.h", + "agg_span_interpolator_adaptor.h": "./include/agg_span_interpolator_adaptor.h", + "agg_span_interpolator_linear.h": "./include/agg_span_interpolator_linear.h", + "agg_span_interpolator_persp.h": "./include/agg_span_interpolator_persp.h", + "agg_span_interpolator_trans.h": "./include/agg_span_interpolator_trans.h", + "agg_span_pattern_gray.h": "./include/agg_span_pattern_gray.h", + "agg_span_pattern_rgba.h": "./include/agg_span_pattern_rgba.h", + "agg_span_pattern_rgb.h": "./include/agg_span_pattern_rgb.h", + "agg_span_solid.h": "./include/agg_span_solid.h", + "agg_span_subdiv_adaptor.h": "./include/agg_span_subdiv_adaptor.h", + "agg_trans_affine.h": "./include/agg_trans_affine.h", + "agg_trans_bilinear.h": "./include/agg_trans_bilinear.h", + "agg_trans_double_path.h": "./include/agg_trans_double_path.h", + "agg_trans_perspective.h": "./include/agg_trans_perspective.h", + "agg_trans_single_path.h": "./include/agg_trans_single_path.h", + "agg_trans_viewport.h": "./include/agg_trans_viewport.h", + "agg_trans_warp_magnifier.h": "./include/agg_trans_warp_magnifier.h", + "agg_vcgen_bspline.h": "./include/agg_vcgen_bspline.h", + "agg_vcgen_contour.h": "./include/agg_vcgen_contour.h", + "agg_vcgen_dash.h": "./include/agg_vcgen_dash.h", + "agg_vcgen_markers_term.h": "./include/agg_vcgen_markers_term.h", + "agg_vcgen_smooth_poly1.h": "./include/agg_vcgen_smooth_poly1.h", + "agg_vcgen_stroke.h": "./include/agg_vcgen_stroke.h", + "agg_vcgen_vertex_sequence.h": "./include/agg_vcgen_vertex_sequence.h", + "agg_vertex_sequence.h": "./include/agg_vertex_sequence.h", + "agg_vpgen_clip_polygon.h": "./include/agg_vpgen_clip_polygon.h", + "agg_vpgen_clip_polyline.h": "./include/agg_vpgen_clip_polyline.h", + "agg_vpgen_segmentator.h": "./include/agg_vpgen_segmentator.h", + }, +) diff --git a/dep/fatfs/build.py b/dep/fatfs/build.py new file mode 100644 index 00000000..31a74596 --- /dev/null +++ b/dep/fatfs/build.py @@ -0,0 +1,18 @@ +from build.c import clibrary + +clibrary( + name="fatfs", + srcs=[ + "./source/ff.c", + "./source/ffsystem.c", + "./source/ffunicode.c", + "./source/ff.h", + "./source/ffconf.h", + "./source/diskio.h", + ], + hdrs={ + "ff.h": "./source/ff.h", + "ffconf.h": "./source/ffconf.h", + "diskio.h": "./source/diskio.h", + }, +) diff --git a/dep/hfsutils/build.py b/dep/hfsutils/build.py new file mode 100644 index 00000000..b040ffe1 --- /dev/null +++ b/dep/hfsutils/build.py @@ -0,0 +1,25 @@ +from build.c import clibrary + +clibrary( + name="hfsutils", + srcs=[ + "./libhfs/block.c", + "./libhfs/btree.c", + "./libhfs/data.c", + "./libhfs/file.c", + "./libhfs/hfs.c", + "./libhfs/low.c", + "./libhfs/medium.c", + "./libhfs/memcmp.c", + "./libhfs/node.c", + "./libhfs/record.c", + "./libhfs/version.c", + "./libhfs/volume.c", + ], + hdrs={ + "apple.h": "./libhfs/apple.h", + "hfs.h": "./libhfs/hfs.h", + "libhfs.h": "./libhfs/libhfs.h", + "os.h": "./libhfs/os.h", + }, +) diff --git a/dep/libusbp/build.py b/dep/libusbp/build.py new file mode 100644 index 00000000..c37e076e --- /dev/null +++ b/dep/libusbp/build.py @@ -0,0 +1,24 @@ +from build.c import clibrary + +clibrary( + name="libusbp", + srcs=[ + "./src/async_in_pipe.c", + "./src/error.c", + "./src/error_hresult.c", + "./src/find_device.c", + "./src/list.c", + "./src/pipe_id.c", + "./src/string.c", + "./src/libusbp_internal.h", + "./include/libusbp_config.h", + "./include/libusbp.h", + ], + cflags=["-Idep/libusbp/include", "-Idep/libusbp/src"], + hdrs={ + "libusbp_internal.h": "./src/libusbp_internal.h", + "libusbp_config.h": "./include/libusbp_config.h", + "libusbp.hpp": "./include/libusbp.hpp", + "libusbp.h": "./include/libusbp.h", + }, +) diff --git a/dep/stb/build.py b/dep/stb/build.py new file mode 100644 index 00000000..9ae15fab --- /dev/null +++ b/dep/stb/build.py @@ -0,0 +1,7 @@ +from build.c import clibrary + +clibrary( + name="stb", + srcs=["./stb_image_write.c"], + hdrs={"stb_image_write.h": "./stb_image_write.h"}, +) diff --git a/lib/bitmap.cc b/lib/bitmap.cc index 7e0a2256..ac27ec33 100644 --- a/lib/bitmap.cc +++ b/lib/bitmap.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" +#include "lib/globals.h" +#include "lib/flags.h" #include "dep/agg/include/agg2d.h" #include "dep/stb/stb_image_write.h" -#include "utils.h" -#include "bitmap.h" +#include "lib/utils.h" +#include "lib/bitmap.h" #include #include diff --git a/lib/build.py b/lib/build.py new file mode 100644 index 00000000..1317d403 --- /dev/null +++ b/lib/build.py @@ -0,0 +1,156 @@ +from build.c import clibrary +from build.protobuf import proto, protocc + +clibrary( + name="lib", + cflags=["-I."], + srcs=[ + "./bitmap.cc", + "./bytes.cc", + "./config.cc", + "./crc.cc", + "./csvreader.cc", + "./decoders/decoders.cc", + "./decoders/fluxdecoder.cc", + "./decoders/fluxmapreader.cc", + "./decoders/fmmfm.cc", + "./encoders/encoders.cc", + "./fl2.cc", + "./flags.cc", + "./fluxmap.cc", + "./fluxsink/a2rfluxsink.cc", + "./fluxsink/aufluxsink.cc", + "./fluxsink/fl2fluxsink.cc", + "./fluxsink/fluxsink.cc", + "./fluxsink/hardwarefluxsink.cc", + "./fluxsink/scpfluxsink.cc", + "./fluxsink/vcdfluxsink.cc", + "./fluxsource/a2rfluxsource.cc", + "./fluxsource/cwffluxsource.cc", + "./fluxsource/erasefluxsource.cc", + "./fluxsource/fl2fluxsource.cc", + "./fluxsource/fluxsource.cc", + "./fluxsource/flx.cc", + "./fluxsource/flxfluxsource.cc", + "./fluxsource/hardwarefluxsource.cc", + "./fluxsource/kryoflux.cc", + "./fluxsource/kryofluxfluxsource.cc", + "./fluxsource/memoryfluxsource.cc", + "./fluxsource/scpfluxsource.cc", + "./fluxsource/testpatternfluxsource.cc", + "./globals.cc", + "./hexdump.cc", + "./image.cc", + "./imagereader/d64imagereader.cc", + "./imagereader/d88imagereader.cc", + "./imagereader/dimimagereader.cc", + "./imagereader/diskcopyimagereader.cc", + "./imagereader/fdiimagereader.cc", + "./imagereader/imagereader.cc", + "./imagereader/imdimagereader.cc", + "./imagereader/imgimagereader.cc", + "./imagereader/jv3imagereader.cc", + "./imagereader/nfdimagereader.cc", + "./imagereader/nsiimagereader.cc", + "./imagereader/td0imagereader.cc", + "./imagewriter/d64imagewriter.cc", + "./imagewriter/d88imagewriter.cc", + "./imagewriter/diskcopyimagewriter.cc", + "./imagewriter/imagewriter.cc", + "./imagewriter/imdimagewriter.cc", + "./imagewriter/imgimagewriter.cc", + "./imagewriter/ldbsimagewriter.cc", + "./imagewriter/nsiimagewriter.cc", + "./imagewriter/rawimagewriter.cc", + "./layout.cc", + "./ldbs.cc", + "./logger.cc", + "./proto.cc", + "./readerwriter.cc", + "./sector.cc", + "./usb/fluxengineusb.cc", + "./usb/greaseweazle.cc", + "./usb/greaseweazleusb.cc", + "./usb/serial.cc", + "./usb/usb.cc", + "./usb/usbfinder.cc", + "./utils.cc", + "./vfs/acorndfs.cc", + "./vfs/amigaffs.cc", + "./vfs/appledos.cc", + "./vfs/applesingle.cc", + "./vfs/brother120fs.cc", + "./vfs/cbmfs.cc", + "./vfs/cpmfs.cc", + "./vfs/fatfs.cc", + "./vfs/fluxsectorinterface.cc", + "./vfs/imagesectorinterface.cc", + "./vfs/lif.cc", + "./vfs/machfs.cc", + "./vfs/microdos.cc", + "./vfs/philefs.cc", + "./vfs/prodos.cc", + "./vfs/roland.cc", + "./vfs/smaky6fs.cc", + "./vfs/vfs.cc", + "./vfs/zdos.cc", + ], + hdrs={ + "lib/bitmap.h": "./bitmap.h", + "lib/bytes.h": "./bytes.h", + "lib/config.h": "./config.h", + "lib/csvreader.h": "./csvreader.h", + "lib/decoders/decoders.h": "./decoders/decoders.h", + "lib/decoders/fluxdecoder.h": "./decoders/fluxdecoder.h", + "lib/decoders/fluxmapreader.h": "./decoders/fluxmapreader.h", + "lib/decoders/rawbits.h": "./decoders/rawbits.h", + "lib/encoders/encoders.h": "./encoders/encoders.h", + "lib/fl2.h": "./fl2.h", + "lib/flags.h": "./flags.h", + "lib/flux.h": "./flux.h", + "lib/fluxmap.h": "./fluxmap.h", + "lib/fluxsink/fluxsink.h": "./fluxsink/fluxsink.h", + "lib/fluxsource/fluxsource.h": "lib/fluxsource/fluxsource.h", + "lib/globals.h": "./globals.h", + "lib/image.h": "./image.h", + "lib/imagereader/imagereader.h": "./imagereader/imagereader.h", + "lib/imagewriter/imagewriter.h": "./imagewriter/imagewriter.h", + "lib/proto.h": "./proto.h", + "lib/readerwriter.h": "./readerwriter.h", + "lib/sector.h": "./sector.h", + "lib/usb/usb.h": "./usb/usb.h", + "lib/utils.h": "./utils.h", + "lib/vfs/sectorinterface.h": "./vfs/sectorinterface.h", + "lib/vfs/vfs.h": "./vfs/vfs.h", + }, + deps=[ + "+fl2_proto_lib", + "+config_proto_lib", + "dep/libusbp", + "dep/adflib", + "dep/fatfs", + "dep/hfsutils", + ], +) + +proto(name="common_proto", srcs=["./common.proto"]) + +proto( + name="config_proto", + srcs=[ + "./config.proto", + "./layout.proto", + "./drive.proto", + "./decoders/decoders.proto", + "./encoders/encoders.proto", + "./fluxsink/fluxsink.proto", + "./fluxsource/fluxsource.proto", + "./imagereader/imagereader.proto", + "./imagewriter/imagewriter.proto", + "./usb/usb.proto", + "./vfs/vfs.proto", + ], + deps=["+common_proto"], +) + +protocc(name="config_proto_lib", srcs=["+config_proto", "arch+arch_proto"]) diff --git a/lib/bytes.cc b/lib/bytes.cc index addfc073..28432cd3 100644 --- a/lib/bytes.cc +++ b/lib/bytes.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/bytes.h" #include #include diff --git a/lib/crc.cc b/lib/crc.cc index 3cea8ecd..71719f29 100644 --- a/lib/crc.cc +++ b/lib/crc.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "bytes.h" -#include "crc.h" +#include "lib/globals.h" +#include "lib/bytes.h" +#include "lib/crc.h" template T reflect(T bin, unsigned width = sizeof(T) * 8) diff --git a/lib/csvreader.cc b/lib/csvreader.cc index 057d45cd..b87b1bc0 100644 --- a/lib/csvreader.cc +++ b/lib/csvreader.cc @@ -1,6 +1,6 @@ #include #include -#include "csvreader.h" +#include "lib/csvreader.h" std::vector CsvReader::readLine() { diff --git a/lib/decoders/decoders.cc b/lib/decoders/decoders.cc index b66766ef..446f438c 100644 --- a/lib/decoders/decoders.cc +++ b/lib/decoders/decoders.cc @@ -1,8 +1,8 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "arch/agat/agat.h" #include "arch/aeslanier/aeslanier.h" #include "arch/amiga/amiga.h" @@ -21,12 +21,12 @@ #include "arch/tids990/tids990.h" #include "arch/victor9k/victor9k.h" #include "arch/zilogmcz/zilogmcz.h" -#include "decoders/fluxmapreader.h" -#include "flux.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/flux.h" #include "protocol.h" -#include "decoders/rawbits.h" -#include "sector.h" -#include "image.h" +#include "lib/decoders/rawbits.h" +#include "lib/sector.h" +#include "lib/image.h" #include "lib/decoders/decoders.pb.h" #include "lib/layout.h" #include diff --git a/lib/decoders/decoders.h b/lib/decoders/decoders.h index 2be8d76a..4b0b72f5 100644 --- a/lib/decoders/decoders.h +++ b/lib/decoders/decoders.h @@ -1,10 +1,10 @@ #ifndef DECODERS_H #define DECODERS_H -#include "bytes.h" -#include "sector.h" -#include "decoders/fluxmapreader.h" -#include "decoders/fluxdecoder.h" +#include "lib/bytes.h" +#include "lib/sector.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/decoders/fluxdecoder.h" class Sector; class Fluxmap; @@ -12,7 +12,7 @@ class FluxmapReader; class RawBits; class DecoderProto; -#include "flux.h" +#include "lib/flux.h" extern void setDecoderManualClockRate(double clockrate_us); diff --git a/lib/decoders/fluxdecoder.cc b/lib/decoders/fluxdecoder.cc index a3c1439d..bb35da58 100644 --- a/lib/decoders/fluxdecoder.cc +++ b/lib/decoders/fluxdecoder.cc @@ -1,7 +1,7 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "decoders/fluxdecoder.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/decoders/fluxdecoder.h" #include "lib/decoders/decoders.pb.h" /* This is a port of the samdisk code: diff --git a/lib/decoders/fluxmapreader.cc b/lib/decoders/fluxmapreader.cc index 49d38016..4ce8f7c8 100644 --- a/lib/decoders/fluxmapreader.cc +++ b/lib/decoders/fluxmapreader.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "flags.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/flags.h" +#include "lib/proto.h" #include "protocol.h" -#include "proto.h" #include #include #include diff --git a/lib/decoders/fluxmapreader.h b/lib/decoders/fluxmapreader.h index 35036eda..e154b8f0 100644 --- a/lib/decoders/fluxmapreader.h +++ b/lib/decoders/fluxmapreader.h @@ -1,9 +1,9 @@ #ifndef FLUXMAPREADER_H #define FLUXMAPREADER_H -#include "fluxmap.h" +#include "lib/fluxmap.h" +#include "lib/flags.h" #include "protocol.h" -#include "flags.h" class FluxMatcher; class DecoderProto; diff --git a/lib/decoders/fmmfm.cc b/lib/decoders/fmmfm.cc index 3a4135b8..8ae7d955 100644 --- a/lib/decoders/fmmfm.cc +++ b/lib/decoders/fmmfm.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "decoders/decoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" Bytes decodeFmMfm( std::vector::const_iterator ii, std::vector::const_iterator end) diff --git a/lib/encoders/encoders.cc b/lib/encoders/encoders.cc index 41c786f1..6126d663 100644 --- a/lib/encoders/encoders.cc +++ b/lib/encoders/encoders.cc @@ -1,7 +1,7 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" #include "arch/agat/agat.h" #include "arch/amiga/amiga.h" #include "arch/apple2/apple2.h" diff --git a/lib/fl2.cc b/lib/fl2.cc index abf2f57c..5f97c428 100644 --- a/lib/fl2.cc +++ b/lib/fl2.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "proto.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/proto.h" +#include "lib/fluxmap.h" #include "lib/fl2.pb.h" #include diff --git a/lib/flux.h b/lib/flux.h index f958c71e..eed9365e 100644 --- a/lib/flux.h +++ b/lib/flux.h @@ -1,7 +1,7 @@ #ifndef FLUX_H #define FLUX_H -#include "bytes.h" +#include "lib/bytes.h" class Fluxmap; class Sector; diff --git a/lib/fluxmap.cc b/lib/fluxmap.cc index 766d1f16..8c7b1463 100644 --- a/lib/fluxmap.cc +++ b/lib/fluxmap.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" Fluxmap& Fluxmap::appendBytes(const Bytes& bytes) diff --git a/lib/fluxmap.h b/lib/fluxmap.h index 69367f77..15b6e27c 100644 --- a/lib/fluxmap.h +++ b/lib/fluxmap.h @@ -1,7 +1,7 @@ #ifndef FLUXMAP_H #define FLUXMAP_H -#include "bytes.h" +#include "lib/bytes.h" #include "protocol.h" #include "fmt/format.h" diff --git a/lib/fluxsink/a2rfluxsink.cc b/lib/fluxsink/a2rfluxsink.cc index 7953c0bb..37d1cf58 100644 --- a/lib/fluxsink/a2rfluxsink.cc +++ b/lib/fluxsink/a2rfluxsink.cc @@ -1,15 +1,15 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/bytes.h" #include "protocol.h" -#include "fluxsink/fluxsink.h" -#include "decoders/fluxmapreader.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/decoders/fluxmapreader.h" #include "lib/fluxsink/fluxsink.pb.h" #include "lib/logger.h" -#include "proto.h" -#include "fluxmap.h" -#include "a2r.h" +#include "lib/proto.h" +#include "lib/fluxmap.h" +#include "lib/a2r.h" #include #include #include diff --git a/lib/fluxsink/aufluxsink.cc b/lib/fluxsink/aufluxsink.cc index 6c970a72..996f6f2f 100644 --- a/lib/fluxsink/aufluxsink.cc +++ b/lib/fluxsink/aufluxsink.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/bytes.h" #include "protocol.h" -#include "fluxsink/fluxsink.h" -#include "decoders/fluxmapreader.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/decoders/fluxmapreader.h" #include "lib/fluxsink/fluxsink.pb.h" -#include "proto.h" +#include "lib/proto.h" #include #include #include diff --git a/lib/fluxsink/fl2fluxsink.cc b/lib/fluxsink/fl2fluxsink.cc index 8a0491ec..d4223956 100644 --- a/lib/fluxsink/fl2fluxsink.cc +++ b/lib/fluxsink/fl2fluxsink.cc @@ -1,14 +1,14 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/bytes.h" #include "protocol.h" -#include "fluxsink/fluxsink.h" -#include "decoders/fluxmapreader.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/decoders/fluxmapreader.h" #include "lib/fluxsink/fluxsink.pb.h" -#include "proto.h" +#include "lib/proto.h" #include "lib/fl2.pb.h" -#include "fl2.h" +#include "lib/fl2.h" #include #include #include diff --git a/lib/fluxsink/fluxsink.cc b/lib/fluxsink/fluxsink.cc index 6aa47e30..69673bdf 100644 --- a/lib/fluxsink/fluxsink.cc +++ b/lib/fluxsink/fluxsink.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" -#include "fluxsink/fluxsink.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxsink/fluxsink.h" #include "lib/config.pb.h" -#include "proto.h" -#include "utils.h" +#include "lib/proto.h" +#include "lib/utils.h" #include std::unique_ptr FluxSink::create(const FluxSinkProto& config) diff --git a/lib/fluxsink/fluxsink.h b/lib/fluxsink/fluxsink.h index 8ffb7616..8f3b4260 100644 --- a/lib/fluxsink/fluxsink.h +++ b/lib/fluxsink/fluxsink.h @@ -1,7 +1,7 @@ #ifndef FLUXSINK_H #define FLUXSINK_H -#include "flags.h" +#include "lib/flags.h" #include class Fluxmap; diff --git a/lib/fluxsink/hardwarefluxsink.cc b/lib/fluxsink/hardwarefluxsink.cc index 54f81112..faaa23ef 100644 --- a/lib/fluxsink/hardwarefluxsink.cc +++ b/lib/fluxsink/hardwarefluxsink.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "logger.h" -#include "proto.h" -#include "usb/usb.h" -#include "fluxsink/fluxsink.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/logger.h" +#include "lib/proto.h" +#include "lib/usb/usb.h" +#include "lib/fluxsink/fluxsink.h" #include "lib/fluxsink/fluxsink.pb.h" #include "lib/readerwriter.h" diff --git a/lib/fluxsink/scpfluxsink.cc b/lib/fluxsink/scpfluxsink.cc index a08e7c56..9fe519e6 100644 --- a/lib/fluxsink/scpfluxsink.cc +++ b/lib/fluxsink/scpfluxsink.cc @@ -1,15 +1,15 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/bytes.h" #include "protocol.h" -#include "fluxsink/fluxsink.h" -#include "decoders/fluxmapreader.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/decoders/fluxmapreader.h" #include "lib/fluxsink/fluxsink.pb.h" -#include "proto.h" -#include "fluxmap.h" -#include "layout.h" -#include "scp.h" +#include "lib/proto.h" +#include "lib/fluxmap.h" +#include "lib/layout.h" +#include "lib/scp.h" #include "lib/logger.h" #include #include diff --git a/lib/fluxsink/vcdfluxsink.cc b/lib/fluxsink/vcdfluxsink.cc index 0ba83a64..a52bf987 100644 --- a/lib/fluxsink/vcdfluxsink.cc +++ b/lib/fluxsink/vcdfluxsink.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/bytes.h" #include "protocol.h" -#include "fluxsink/fluxsink.h" -#include "decoders/fluxmapreader.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/decoders/fluxmapreader.h" #include "lib/fluxsink/fluxsink.pb.h" -#include "proto.h" +#include "lib/proto.h" #include #include #include diff --git a/lib/fluxsource/a2rfluxsource.cc b/lib/fluxsource/a2rfluxsource.cc index b189fd99..45feed14 100644 --- a/lib/fluxsource/a2rfluxsource.cc +++ b/lib/fluxsource/a2rfluxsource.cc @@ -1,8 +1,8 @@ -#include "globals.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" #include "lib/fluxsource/fluxsource.pb.h" -#include "fluxsource/fluxsource.h" -#include "proto.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/proto.h" #include struct A2Rv2Flux diff --git a/lib/fluxsource/cwffluxsource.cc b/lib/fluxsource/cwffluxsource.cc index 12a63063..0157f93e 100644 --- a/lib/fluxsource/cwffluxsource.cc +++ b/lib/fluxsource/cwffluxsource.cc @@ -1,8 +1,8 @@ -#include "globals.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" #include "lib/fluxsource/fluxsource.pb.h" -#include "fluxsource/fluxsource.h" -#include "proto.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/proto.h" #include struct CwfHeader diff --git a/lib/fluxsource/erasefluxsource.cc b/lib/fluxsource/erasefluxsource.cc index 4ac3de59..87bd2d74 100644 --- a/lib/fluxsource/erasefluxsource.cc +++ b/lib/fluxsource/erasefluxsource.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "fluxmap.h" -#include "fluxsource/fluxsource.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/fluxsource/fluxsource.h" #include "lib/fluxsource/fluxsource.pb.h" class EraseFluxSource : public TrivialFluxSource diff --git a/lib/fluxsource/fl2fluxsource.cc b/lib/fluxsource/fl2fluxsource.cc index 2e02a71c..c51c63f2 100644 --- a/lib/fluxsource/fl2fluxsource.cc +++ b/lib/fluxsource/fl2fluxsource.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" #include "lib/fluxsource/fluxsource.pb.h" #include "lib/fl2.pb.h" -#include "fluxsource/fluxsource.h" -#include "proto.h" -#include "fl2.h" -#include "fluxmap.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/proto.h" +#include "lib/fl2.h" +#include "lib/fluxmap.h" #include class Fl2FluxSourceIterator : public FluxSourceIterator diff --git a/lib/fluxsource/fluxsource.cc b/lib/fluxsource/fluxsource.cc index e5870d32..4b0a9bc0 100644 --- a/lib/fluxsource/fluxsource.cc +++ b/lib/fluxsource/fluxsource.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "fluxsource/fluxsource.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/fluxmap.h" #include "lib/config.pb.h" -#include "proto.h" -#include "utils.h" +#include "lib/proto.h" +#include "lib/utils.h" std::unique_ptr FluxSource::create(const FluxSourceProto& config) { diff --git a/lib/fluxsource/fluxsource.h b/lib/fluxsource/fluxsource.h index 3bcddf77..b7c0b1c8 100644 --- a/lib/fluxsource/fluxsource.h +++ b/lib/fluxsource/fluxsource.h @@ -1,7 +1,7 @@ #ifndef FLUXSOURCE_H #define FLUXSOURCE_H -#include "flags.h" +#include "lib/flags.h" #include "lib/config.pb.h" class A2rFluxSourceProto; diff --git a/lib/fluxsource/flx.cc b/lib/fluxsource/flx.cc index d1296cf9..4022a6a3 100644 --- a/lib/fluxsource/flx.cc +++ b/lib/fluxsource/flx.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" #include "kryoflux.h" #include "protocol.h" #include "lib/fluxsource/flx.h" diff --git a/lib/fluxsource/hardwarefluxsource.cc b/lib/fluxsource/hardwarefluxsource.cc index 2e0d41a2..df0081a0 100644 --- a/lib/fluxsource/hardwarefluxsource.cc +++ b/lib/fluxsource/hardwarefluxsource.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "logger.h" -#include "proto.h" -#include "usb/usb.h" -#include "fluxsource/fluxsource.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/logger.h" +#include "lib/proto.h" +#include "lib/usb/usb.h" +#include "lib/fluxsource/fluxsource.h" #include "lib/fluxsource/fluxsource.pb.h" #include "lib/readerwriter.h" diff --git a/lib/fluxsource/kryoflux.cc b/lib/fluxsource/kryoflux.cc index 2b054d37..41a0d868 100644 --- a/lib/fluxsource/kryoflux.cc +++ b/lib/fluxsource/kryoflux.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" #include "kryoflux.h" #include "protocol.h" #include diff --git a/lib/fluxsource/kryofluxfluxsource.cc b/lib/fluxsource/kryofluxfluxsource.cc index b924846f..e483f020 100644 --- a/lib/fluxsource/kryofluxfluxsource.cc +++ b/lib/fluxsource/kryofluxfluxsource.cc @@ -1,8 +1,8 @@ -#include "globals.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" #include "kryoflux.h" #include "lib/fluxsource/fluxsource.pb.h" -#include "fluxsource/fluxsource.h" +#include "lib/fluxsource/fluxsource.h" class KryofluxFluxSource : public TrivialFluxSource { diff --git a/lib/fluxsource/scpfluxsource.cc b/lib/fluxsource/scpfluxsource.cc index cb92846b..17855470 100644 --- a/lib/fluxsource/scpfluxsource.cc +++ b/lib/fluxsource/scpfluxsource.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" #include "kryoflux.h" #include "lib/fluxsource/fluxsource.pb.h" #include "lib/utils.h" -#include "fluxsource/fluxsource.h" -#include "scp.h" -#include "proto.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/scp.h" +#include "lib/proto.h" #include "lib/logger.h" #include diff --git a/lib/fluxsource/testpatternfluxsource.cc b/lib/fluxsource/testpatternfluxsource.cc index 2dc6ff13..0b3a0da1 100644 --- a/lib/fluxsource/testpatternfluxsource.cc +++ b/lib/fluxsource/testpatternfluxsource.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "fluxmap.h" -#include "fluxsource/fluxsource.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/fluxsource/fluxsource.h" #include "lib/fluxsource/fluxsource.pb.h" class TestPatternFluxSource : public TrivialFluxSource diff --git a/lib/hexdump.cc b/lib/hexdump.cc index ed6242fd..5c120d9b 100644 --- a/lib/hexdump.cc +++ b/lib/hexdump.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/bytes.h" void hexdump(std::ostream& stream, const Bytes& buffer) { diff --git a/lib/imagereader/d64imagereader.cc b/lib/imagereader/d64imagereader.cc index 20d1381e..ad3756b6 100644 --- a/lib/imagereader/d64imagereader.cc +++ b/lib/imagereader/d64imagereader.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "logger.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/logger.h" +#include "lib/proto.h" #include #include #include diff --git a/lib/imagereader/d88imagereader.cc b/lib/imagereader/d88imagereader.cc index c5ce3783..5708e70b 100644 --- a/lib/imagereader/d88imagereader.cc +++ b/lib/imagereader/d88imagereader.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "proto.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/proto.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagereader/dimimagereader.cc b/lib/imagereader/dimimagereader.cc index d8f5e027..8410a9b6 100644 --- a/lib/imagereader/dimimagereader.cc +++ b/lib/imagereader/dimimagereader.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "logger.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/logger.h" +#include "lib/proto.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagereader/diskcopyimagereader.cc b/lib/imagereader/diskcopyimagereader.cc index 4f952ea2..d6c85a79 100644 --- a/lib/imagereader/diskcopyimagereader.cc +++ b/lib/imagereader/diskcopyimagereader.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagereader/fdiimagereader.cc b/lib/imagereader/fdiimagereader.cc index 8c0813cb..f7317320 100644 --- a/lib/imagereader/fdiimagereader.cc +++ b/lib/imagereader/fdiimagereader.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "proto.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/proto.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagereader/imagereader.cc b/lib/imagereader/imagereader.cc index b5fc7469..b5d7da28 100644 --- a/lib/imagereader/imagereader.cc +++ b/lib/imagereader/imagereader.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "utils.h" -#include "proto.h" -#include "image.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/utils.h" +#include "lib/proto.h" +#include "lib/image.h" #include "lib/layout.h" #include "lib/config.pb.h" #include "lib/logger.h" diff --git a/lib/imagereader/imagereader.h b/lib/imagereader/imagereader.h index 0ae0225e..3baa8283 100644 --- a/lib/imagereader/imagereader.h +++ b/lib/imagereader/imagereader.h @@ -1,7 +1,7 @@ #ifndef IMAGEREADER_H #define IMAGEREADER_H -#include "image.h" +#include "lib/image.h" #include "lib/config.pb.h" class ImageSpec; diff --git a/lib/imagereader/imdimagereader.cc b/lib/imagereader/imdimagereader.cc index 855455b6..ab868b26 100644 --- a/lib/imagereader/imdimagereader.cc +++ b/lib/imagereader/imdimagereader.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "proto.h" -#include "logger.h" -#include "layout.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/proto.h" +#include "lib/logger.h" +#include "lib/layout.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagereader/imgimagereader.cc b/lib/imagereader/imgimagereader.cc index 5644a9a3..8ae3a108 100644 --- a/lib/imagereader/imgimagereader.cc +++ b/lib/imagereader/imgimagereader.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include "lib/layout.pb.h" #include "lib/proto.h" diff --git a/lib/imagereader/jv3imagereader.cc b/lib/imagereader/jv3imagereader.cc index 5af47920..15bc5123 100644 --- a/lib/imagereader/jv3imagereader.cc +++ b/lib/imagereader/jv3imagereader.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagereader/nfdimagereader.cc b/lib/imagereader/nfdimagereader.cc index 489eb2e0..3dd2495b 100644 --- a/lib/imagereader/nfdimagereader.cc +++ b/lib/imagereader/nfdimagereader.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "proto.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/proto.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagereader/nsiimagereader.cc b/lib/imagereader/nsiimagereader.cc index e1fc3308..0101c656 100644 --- a/lib/imagereader/nsiimagereader.cc +++ b/lib/imagereader/nsiimagereader.cc @@ -1,11 +1,11 @@ /* Image reader for Northstar floppy disk images */ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/logger.h" #include "lib/imagereader/imagereader.pb.h" #include #include diff --git a/lib/imagereader/td0imagereader.cc b/lib/imagereader/td0imagereader.cc index ed99b253..30ee7c70 100644 --- a/lib/imagereader/td0imagereader.cc +++ b/lib/imagereader/td0imagereader.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagereader/imagereader.h" -#include "image.h" -#include "crc.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagereader/imagereader.h" +#include "lib/image.h" +#include "lib/crc.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagewriter/d64imagewriter.cc b/lib/imagewriter/d64imagewriter.cc index 7501d787..74990a18 100644 --- a/lib/imagewriter/d64imagewriter.cc +++ b/lib/imagewriter/d64imagewriter.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "image.h" -#include "ldbs.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/image.h" +#include "lib/ldbs.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagewriter/d88imagewriter.cc b/lib/imagewriter/d88imagewriter.cc index 0494f6b6..75d24e2d 100644 --- a/lib/imagewriter/d88imagewriter.cc +++ b/lib/imagewriter/d88imagewriter.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "image.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/image.h" #include "lib/config.pb.h" #include "lib/layout.h" -#include "logger.h" +#include "lib/logger.h" #include #include #include diff --git a/lib/imagewriter/diskcopyimagewriter.cc b/lib/imagewriter/diskcopyimagewriter.cc index 256d7184..d98b44fe 100644 --- a/lib/imagewriter/diskcopyimagewriter.cc +++ b/lib/imagewriter/diskcopyimagewriter.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "ldbs.h" -#include "image.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/ldbs.h" +#include "lib/image.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagewriter/imagewriter.cc b/lib/imagewriter/imagewriter.cc index 9b2ec35a..17b9a3a7 100644 --- a/lib/imagewriter/imagewriter.cc +++ b/lib/imagewriter/imagewriter.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "image.h" -#include "utils.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/image.h" +#include "lib/utils.h" #include "lib/config.pb.h" -#include "proto.h" +#include "lib/proto.h" #include "lib/layout.h" #include "lib/logger.h" #include diff --git a/lib/imagewriter/imdimagewriter.cc b/lib/imagewriter/imdimagewriter.cc index 4d00b20f..3e1e5d78 100644 --- a/lib/imagewriter/imdimagewriter.cc +++ b/lib/imagewriter/imdimagewriter.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "image.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/image.h" #include "lib/config.pb.h" #include "lib/layout.h" -#include "logger.h" +#include "lib/logger.h" #include #include #include diff --git a/lib/imagewriter/imgimagewriter.cc b/lib/imagewriter/imgimagewriter.cc index 33099776..698c1059 100644 --- a/lib/imagewriter/imgimagewriter.cc +++ b/lib/imagewriter/imgimagewriter.cc @@ -1,13 +1,13 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "image.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/image.h" #include "lib/proto.h" #include "lib/config.pb.h" #include "lib/layout.h" #include "lib/layout.pb.h" -#include "logger.h" +#include "lib/logger.h" #include #include #include diff --git a/lib/imagewriter/ldbsimagewriter.cc b/lib/imagewriter/ldbsimagewriter.cc index 54e3a3a0..89f36a1f 100644 --- a/lib/imagewriter/ldbsimagewriter.cc +++ b/lib/imagewriter/ldbsimagewriter.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "ldbs.h" -#include "image.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/ldbs.h" +#include "lib/image.h" +#include "lib/logger.h" #include "lib/config.pb.h" #include #include diff --git a/lib/imagewriter/nsiimagewriter.cc b/lib/imagewriter/nsiimagewriter.cc index 06d1d915..6c002af4 100644 --- a/lib/imagewriter/nsiimagewriter.cc +++ b/lib/imagewriter/nsiimagewriter.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "decoders/decoders.h" -#include "image.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/decoders/decoders.h" +#include "lib/image.h" +#include "lib/logger.h" #include "arch/northstar/northstar.h" #include "lib/imagewriter/imagewriter.pb.h" #include diff --git a/lib/imagewriter/rawimagewriter.cc b/lib/imagewriter/rawimagewriter.cc index 1b01547a..ebe8c228 100644 --- a/lib/imagewriter/rawimagewriter.cc +++ b/lib/imagewriter/rawimagewriter.cc @@ -1,10 +1,10 @@ -#include "globals.h" -#include "flags.h" -#include "sector.h" -#include "imagewriter/imagewriter.h" -#include "decoders/decoders.h" -#include "image.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/sector.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/decoders/decoders.h" +#include "lib/image.h" +#include "lib/logger.h" #include "arch/northstar/northstar.h" #include "lib/imagewriter/imagewriter.pb.h" #include diff --git a/lib/ldbs.cc b/lib/ldbs.cc index f7ae8ee0..dacde544 100644 --- a/lib/ldbs.cc +++ b/lib/ldbs.cc @@ -1,7 +1,7 @@ -#include "globals.h" +#include "lib/globals.h" #include -#include "bytes.h" -#include "ldbs.h" +#include "lib/bytes.h" +#include "lib/ldbs.h" LDBS::LDBS() {} diff --git a/lib/logger.cc b/lib/logger.cc index c12d4d47..6a23cd82 100644 --- a/lib/logger.cc +++ b/lib/logger.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "bytes.h" -#include "fluxmap.h" -#include "sector.h" -#include "flux.h" -#include "logger.h" +#include "lib/globals.h" +#include "lib/bytes.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/flux.h" +#include "lib/logger.h" static bool indented = false; diff --git a/lib/proto.cc b/lib/proto.cc index 61e39a2c..32a1213f 100644 --- a/lib/proto.cc +++ b/lib/proto.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/proto.h" #include "lib/common.pb.h" #include diff --git a/lib/readerwriter.cc b/lib/readerwriter.cc index 2f8b0a65..9d3bd4e5 100644 --- a/lib/readerwriter.cc +++ b/lib/readerwriter.cc @@ -1,22 +1,22 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "readerwriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/readerwriter.h" #include "protocol.h" -#include "usb/usb.h" -#include "encoders/encoders.h" -#include "decoders/decoders.h" -#include "fluxsource/fluxsource.h" -#include "fluxsink/fluxsink.h" -#include "imagereader/imagereader.h" -#include "imagewriter/imagewriter.h" -#include "sector.h" -#include "image.h" -#include "logger.h" -#include "layout.h" -#include "utils.h" +#include "lib/usb/usb.h" +#include "lib/encoders/encoders.h" +#include "lib/decoders/decoders.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/imagereader/imagereader.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/sector.h" +#include "lib/image.h" +#include "lib/logger.h" +#include "lib/layout.h" +#include "lib/utils.h" #include "lib/config.pb.h" -#include "proto.h" +#include "lib/proto.h" #include enum ReadResult diff --git a/lib/sector.cc b/lib/sector.cc index 4053fb3c..40f024a7 100644 --- a/lib/sector.cc +++ b/lib/sector.cc @@ -1,7 +1,7 @@ -#include "globals.h" -#include "flux.h" -#include "sector.h" -#include "layout.h" +#include "lib/globals.h" +#include "lib/flux.h" +#include "lib/sector.h" +#include "lib/layout.h" Sector::Sector(const LogicalLocation& location): LogicalLocation(location), diff --git a/lib/sector.h b/lib/sector.h index f310f2d0..a9c34ee2 100644 --- a/lib/sector.h +++ b/lib/sector.h @@ -1,8 +1,8 @@ #ifndef SECTOR_H #define SECTOR_H -#include "bytes.h" -#include "fluxmap.h" +#include "lib/bytes.h" +#include "lib/fluxmap.h" class Record; class TrackInfo; diff --git a/lib/usb/fluxengineusb.cc b/lib/usb/fluxengineusb.cc index 3c856f9e..9b4459a8 100644 --- a/lib/usb/fluxengineusb.cc +++ b/lib/usb/fluxengineusb.cc @@ -1,8 +1,8 @@ -#include "globals.h" +#include "lib/globals.h" #include "usb.h" #include "protocol.h" -#include "fluxmap.h" -#include "bytes.h" +#include "lib/fluxmap.h" +#include "lib/bytes.h" #include "libusbp_config.h" #include "libusbp.hpp" diff --git a/lib/usb/greaseweazle.cc b/lib/usb/greaseweazle.cc index d96d8743..8b418e4f 100644 --- a/lib/usb/greaseweazle.cc +++ b/lib/usb/greaseweazle.cc @@ -1,7 +1,7 @@ -#include "globals.h" +#include "lib/globals.h" #include "usb.h" #include "protocol.h" -#include "bytes.h" +#include "lib/bytes.h" #include "greaseweazle.h" Bytes fluxEngineToGreaseweazle(const Bytes& fldata, nanoseconds_t clock) diff --git a/lib/usb/serial.cc b/lib/usb/serial.cc index 2e22b0f0..047bbe35 100644 --- a/lib/usb/serial.cc +++ b/lib/usb/serial.cc @@ -1,8 +1,8 @@ -#include "globals.h" +#include "lib/globals.h" #include "usb.h" #include "protocol.h" -#include "fluxmap.h" -#include "bytes.h" +#include "lib/fluxmap.h" +#include "lib/bytes.h" #include "serial.h" #include #include diff --git a/lib/usb/usb.cc b/lib/usb/usb.cc index a93aa036..a6654796 100644 --- a/lib/usb/usb.cc +++ b/lib/usb/usb.cc @@ -1,14 +1,14 @@ -#include "globals.h" -#include "flags.h" +#include "lib/globals.h" +#include "lib/flags.h" #include "usb.h" #include "libusbp_config.h" #include "libusbp.hpp" #include "protocol.h" -#include "fluxmap.h" -#include "bytes.h" -#include "proto.h" +#include "lib/fluxmap.h" +#include "lib/bytes.h" +#include "lib/proto.h" #include "usbfinder.h" -#include "logger.h" +#include "lib/logger.h" #include "greaseweazle.h" static USB* usb = NULL; diff --git a/lib/usb/usb.h b/lib/usb/usb.h index c77b2636..7686ad07 100644 --- a/lib/usb/usb.h +++ b/lib/usb/usb.h @@ -1,8 +1,8 @@ #ifndef USB_H #define USB_H -#include "bytes.h" -#include "flags.h" +#include "lib/bytes.h" +#include "lib/flags.h" class Fluxmap; class GreaseweazleProto; diff --git a/lib/usb/usbfinder.cc b/lib/usb/usbfinder.cc index a1a6d1aa..d3a87003 100644 --- a/lib/usb/usbfinder.cc +++ b/lib/usb/usbfinder.cc @@ -1,7 +1,7 @@ -#include "globals.h" -#include "flags.h" +#include "lib/globals.h" +#include "lib/flags.h" #include "usb.h" -#include "bytes.h" +#include "lib/bytes.h" #include "usbfinder.h" #include "greaseweazle.h" #include "protocol.h" diff --git a/lib/utils.cc b/lib/utils.cc index 29d1f8a8..09b4ba7b 100644 --- a/lib/utils.cc +++ b/lib/utils.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "utils.h" +#include "lib/globals.h" +#include "lib/utils.h" #include "lib/bytes.h" #include #include diff --git a/lib/vfs/vfs.cc b/lib/vfs/vfs.cc index 0de71064..b9496d7d 100644 --- a/lib/vfs/vfs.cc +++ b/lib/vfs/vfs.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "vfs.h" #include "lib/proto.h" #include "lib/layout.pb.h" diff --git a/scripts/analysedriveresponse.py b/scripts/analysedriveresponse.py index ed4383e4..69d3cd8b 100644 --- a/scripts/analysedriveresponse.py +++ b/scripts/analysedriveresponse.py @@ -12,6 +12,7 @@ data = numpy.loadtxt(open("driveresponse.csv", "rb"), delimiter=",", skiprows=1) labels = data[:, 0] frequencies = data[:, 1:] + # Scale the frequencies. def scaled(row): m = row.mean() @@ -20,13 +21,21 @@ def scaled(row): else: return row + scaledfreq = numpy.array([scaled(row) for row in frequencies]) # Create new Figure with black background -fig = plt.figure(figsize=(8, 8), facecolor='#aaa') +fig = plt.figure(figsize=(8, 8), facecolor="#aaa") -plt.imshow(scaledfreq, extent=[0, 512/TICKS_PER_US, labels[0], labels[-1]], cmap='jet', - vmin=0, vmax=1, origin='lower', aspect='auto') +plt.imshow( + scaledfreq, + extent=[0, 512 / TICKS_PER_US, labels[0], labels[-1]], + cmap="jet", + vmin=0, + vmax=1, + origin="lower", + aspect="auto", +) plt.colorbar() plt.ylabel("Interval period (us)") plt.xlabel("Response (us)") diff --git a/src/build.py b/src/build.py new file mode 100644 index 00000000..21a4832b --- /dev/null +++ b/src/build.py @@ -0,0 +1,43 @@ +from build.c import cxxprogram + +cxxprogram( + name="fluxengine", + srcs=[ + "./fluxengine.cc", + "./fe-analysedriveresponse.cc", + "./fe-analyselayout.cc", + "./fe-format.cc", + "./fe-getdiskinfo.cc", + "./fe-getfile.cc", + "./fe-getfileinfo.cc", + "./fe-inspect.cc", + "./fe-ls.cc", + "./fe-merge.cc", + "./fe-mkdir.cc", + "./fe-mv.cc", + "./fe-putfile.cc", + "./fe-rawread.cc", + "./fe-rawwrite.cc", + "./fe-read.cc", + "./fe-rm.cc", + "./fe-rpm.cc", + "./fe-seek.cc", + "./fe-testbandwidth.cc", + "./fe-testvoltages.cc", + "./fe-write.cc", + "./fileutils.cc", + ], + cflags=["-I."], + deps=[ + "+fl2_proto_lib", + "+protocol", + "dep/adflib", + "dep/agg", + "dep/fatfs", + "dep/hfsutils", + "dep/libusbp", + "dep/stb", + "lib", + "lib+config_proto_lib", + ], +) diff --git a/src/fe-analysedriveresponse.cc b/src/fe-analysedriveresponse.cc index a5ca645a..8587978f 100644 --- a/src/fe-analysedriveresponse.cc +++ b/src/fe-analysedriveresponse.cc @@ -1,15 +1,15 @@ -#include "globals.h" -#include "flags.h" -#include "usb/usb.h" -#include "bitmap.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "readerwriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/usb/usb.h" +#include "lib/bitmap.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/readerwriter.h" #include "protocol.h" -#include "proto.h" -#include "fluxsink/fluxsink.h" -#include "dep/agg/include/agg2d.h" -#include "dep/stb/stb_image_write.h" +#include "lib/proto.h" +#include "lib/fluxsink/fluxsink.h" +#include "agg2d.h" +#include "stb_image_write.h" #include static FlagGroup flags; diff --git a/src/fe-analyselayout.cc b/src/fe-analyselayout.cc index c36d2fca..f7a95a5f 100644 --- a/src/fe-analyselayout.cc +++ b/src/fe-analyselayout.cc @@ -1,14 +1,14 @@ #define _USE_MATH_DEFINES -#include "globals.h" -#include "flags.h" -#include "bitmap.h" -#include "fluxmap.h" -#include "sector.h" -#include "csvreader.h" -#include "image.h" -#include "decoders/fluxmapreader.h" -#include "dep/agg/include/agg2d.h" -#include "dep/stb/stb_image_write.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/bitmap.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/csvreader.h" +#include "lib/image.h" +#include "lib/decoders/fluxmapreader.h" +#include "agg2d.h" +#include "stb_image_write.h" #include #include diff --git a/src/fe-format.cc b/src/fe-format.cc index 0c744b5a..076f64b3 100644 --- a/src/fe-format.cc +++ b/src/fe-format.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" -#include "readerwriter.h" -#include "imagereader/imagereader.h" -#include "imagewriter/imagewriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/readerwriter.h" +#include "lib/imagereader/imagereader.h" +#include "lib/imagewriter/imagewriter.h" #include "lib/fluxsource/fluxsource.h" #include "lib/decoders/decoders.h" #include "fluxengine.h" diff --git a/src/fe-getdiskinfo.cc b/src/fe-getdiskinfo.cc index eba202f7..09f9ea6a 100644 --- a/src/fe-getdiskinfo.cc +++ b/src/fe-getdiskinfo.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" -#include "readerwriter.h" -#include "imagereader/imagereader.h" -#include "imagewriter/imagewriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/readerwriter.h" +#include "lib/imagereader/imagereader.h" +#include "lib/imagewriter/imagewriter.h" #include "lib/fluxsource/fluxsource.h" #include "lib/decoders/decoders.h" #include "fluxengine.h" diff --git a/src/fe-getfile.cc b/src/fe-getfile.cc index 8e480a81..9627f4ee 100644 --- a/src/fe-getfile.cc +++ b/src/fe-getfile.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" -#include "readerwriter.h" -#include "imagereader/imagereader.h" -#include "imagewriter/imagewriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/readerwriter.h" +#include "lib/imagereader/imagereader.h" +#include "lib/imagewriter/imagewriter.h" #include "lib/fluxsource/fluxsource.h" #include "lib/decoders/decoders.h" #include "fluxengine.h" diff --git a/src/fe-getfileinfo.cc b/src/fe-getfileinfo.cc index b5cb02ad..3dabbc7b 100644 --- a/src/fe-getfileinfo.cc +++ b/src/fe-getfileinfo.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" -#include "readerwriter.h" -#include "imagereader/imagereader.h" -#include "imagewriter/imagewriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/readerwriter.h" +#include "lib/imagereader/imagereader.h" +#include "lib/imagewriter/imagewriter.h" #include "lib/fluxsource/fluxsource.h" #include "lib/decoders/decoders.h" #include "fluxengine.h" diff --git a/src/fe-inspect.cc b/src/fe-inspect.cc index d9847719..f244d496 100644 --- a/src/fe-inspect.cc +++ b/src/fe-inspect.cc @@ -1,15 +1,15 @@ -#include "globals.h" -#include "flags.h" -#include "readerwriter.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" -#include "decoders/fluxdecoder.h" -#include "decoders/decoders.h" -#include "fluxsource/fluxsource.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/readerwriter.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" +#include "lib/decoders/fluxdecoder.h" +#include "lib/decoders/decoders.h" +#include "lib/fluxsource/fluxsource.h" #include "protocol.h" -#include "decoders/rawbits.h" -#include "sector.h" -#include "proto.h" +#include "lib/decoders/rawbits.h" +#include "lib/sector.h" +#include "lib/proto.h" static FlagGroup flags; diff --git a/src/fe-ls.cc b/src/fe-ls.cc index d6d9a2cf..29208936 100644 --- a/src/fe-ls.cc +++ b/src/fe-ls.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" -#include "readerwriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/readerwriter.h" #include "lib/decoders/decoders.h" #include "lib/fluxsource/fluxsource.h" #include "lib/imagereader/imagereader.h" diff --git a/src/fe-merge.cc b/src/fe-merge.cc index 2430f879..4afc1bff 100644 --- a/src/fe-merge.cc +++ b/src/fe-merge.cc @@ -1,12 +1,12 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" -#include "flux.h" -#include "fl2.h" -#include "fl2.pb.h" -#include "fluxengine.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/flux.h" +#include "lib/fl2.h" +#include "lib/fl2.pb.h" +#include "src/fluxengine.h" #include static FlagGroup flags; diff --git a/src/fe-mkdir.cc b/src/fe-mkdir.cc index 1db49266..bb2f08ee 100644 --- a/src/fe-mkdir.cc +++ b/src/fe-mkdir.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "flags.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/proto.h" #include "fluxengine.h" #include "lib/vfs/vfs.h" #include "lib/utils.h" diff --git a/src/fe-mv.cc b/src/fe-mv.cc index 8f13efa8..e61658f1 100644 --- a/src/fe-mv.cc +++ b/src/fe-mv.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "flags.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/proto.h" #include "fluxengine.h" #include "lib/vfs/vfs.h" #include "lib/utils.h" diff --git a/src/fe-putfile.cc b/src/fe-putfile.cc index 0712bdcf..0f161e37 100644 --- a/src/fe-putfile.cc +++ b/src/fe-putfile.cc @@ -1,11 +1,11 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" -#include "readerwriter.h" -#include "imagereader/imagereader.h" -#include "imagewriter/imagewriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/readerwriter.h" +#include "lib/imagereader/imagereader.h" +#include "lib/imagewriter/imagewriter.h" #include "lib/fluxsource/fluxsource.h" #include "lib/decoders/decoders.h" #include "fluxengine.h" diff --git a/src/fe-rawread.cc b/src/fe-rawread.cc index 618425c9..23818629 100644 --- a/src/fe-rawread.cc +++ b/src/fe-rawread.cc @@ -1,16 +1,13 @@ -#include "globals.h" -#include "flags.h" -#include "readerwriter.h" -#include "fluxmap.h" -#include "decoders/decoders.h" -#include "macintosh/macintosh.h" -#include "sector.h" -#include "proto.h" -#include "fluxsink/fluxsink.h" -#include "fluxsource/fluxsource.h" -#include "arch/brother/brother.h" -#include "arch/ibm/ibm.h" -#include "imagewriter/imagewriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/readerwriter.h" +#include "lib/fluxmap.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/imagewriter/imagewriter.h" #include "fluxengine.h" #include #include diff --git a/src/fe-rawwrite.cc b/src/fe-rawwrite.cc index 4731d756..e456b3b6 100644 --- a/src/fe-rawwrite.cc +++ b/src/fe-rawwrite.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" -#include "readerwriter.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/readerwriter.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" #include "lib/fluxsource/fluxsource.h" #include "lib/fluxsink/fluxsink.h" #include "fluxengine.h" diff --git a/src/fe-read.cc b/src/fe-read.cc index d0024ad6..15651387 100644 --- a/src/fe-read.cc +++ b/src/fe-read.cc @@ -1,16 +1,13 @@ -#include "globals.h" -#include "flags.h" -#include "readerwriter.h" -#include "fluxmap.h" -#include "decoders/decoders.h" -#include "macintosh/macintosh.h" -#include "sector.h" -#include "proto.h" -#include "fluxsource/fluxsource.h" -#include "fluxsink/fluxsink.h" -#include "arch/brother/brother.h" -#include "arch/ibm/ibm.h" -#include "imagewriter/imagewriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/readerwriter.h" +#include "lib/fluxmap.h" +#include "lib/decoders/decoders.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/imagewriter/imagewriter.h" #include "fluxengine.h" #include #include diff --git a/src/fe-rm.cc b/src/fe-rm.cc index cb63e495..e02322a4 100644 --- a/src/fe-rm.cc +++ b/src/fe-rm.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "flags.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/proto.h" #include "fluxengine.h" #include "lib/vfs/vfs.h" #include "lib/utils.h" diff --git a/src/fe-rpm.cc b/src/fe-rpm.cc index eac151e4..7e430457 100644 --- a/src/fe-rpm.cc +++ b/src/fe-rpm.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" -#include "usb/usb.h" -#include "fluxsource/fluxsource.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/usb/usb.h" +#include "lib/fluxsource/fluxsource.h" #include "protocol.h" -#include "proto.h" +#include "lib/proto.h" static FlagGroup flags; diff --git a/src/fe-seek.cc b/src/fe-seek.cc index 2f6b2df0..aebad132 100644 --- a/src/fe-seek.cc +++ b/src/fe-seek.cc @@ -1,8 +1,8 @@ -#include "globals.h" -#include "flags.h" -#include "usb/usb.h" -#include "fluxsource/fluxsource.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/usb/usb.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/proto.h" #include "protocol.h" static FlagGroup flags; diff --git a/src/fe-testbandwidth.cc b/src/fe-testbandwidth.cc index 3059f381..0f723b73 100644 --- a/src/fe-testbandwidth.cc +++ b/src/fe-testbandwidth.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "flags.h" -#include "usb/usb.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/usb/usb.h" static FlagGroup flags; diff --git a/src/fe-testvoltages.cc b/src/fe-testvoltages.cc index 6a7d56fb..9f7c3857 100644 --- a/src/fe-testvoltages.cc +++ b/src/fe-testvoltages.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "flags.h" -#include "usb/usb.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/usb/usb.h" #include "protocol.h" static FlagGroup flags; diff --git a/src/fe-write.cc b/src/fe-write.cc index cf199c85..3221c42b 100644 --- a/src/fe-write.cc +++ b/src/fe-write.cc @@ -1,16 +1,16 @@ -#include "globals.h" -#include "flags.h" -#include "readerwriter.h" -#include "fluxmap.h" -#include "decoders/decoders.h" -#include "encoders/encoders.h" -#include "sector.h" -#include "proto.h" -#include "fluxsink/fluxsink.h" -#include "fluxsource/fluxsource.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/readerwriter.h" +#include "lib/fluxmap.h" +#include "lib/decoders/decoders.h" +#include "lib/encoders/encoders.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/fluxsource/fluxsource.h" #include "arch/brother/brother.h" #include "arch/ibm/ibm.h" -#include "imagereader/imagereader.h" +#include "lib/imagereader/imagereader.h" #include "fluxengine.h" #include #include diff --git a/src/fileutils.cc b/src/fileutils.cc index 79c12f6f..1ca1640a 100644 --- a/src/fileutils.cc +++ b/src/fileutils.cc @@ -1,9 +1,9 @@ -#include "globals.h" -#include "flags.h" -#include "fluxmap.h" -#include "sector.h" -#include "proto.h" -#include "readerwriter.h" +#include "lib/globals.h" +#include "lib/flags.h" +#include "lib/fluxmap.h" +#include "lib/sector.h" +#include "lib/proto.h" +#include "lib/readerwriter.h" #include "lib/fluxsource/fluxsource.h" #include "lib/fluxsink/fluxsink.h" #include "lib/imagereader/imagereader.h" diff --git a/src/fluxengine.cc b/src/fluxengine.cc index 4cce1a77..392dea5f 100644 --- a/src/fluxengine.cc +++ b/src/fluxengine.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/proto.h" #include typedef int command_cb(int agrc, const char* argv[]); diff --git a/src/gui/browserpanel.cc b/src/gui/browserpanel.cc index 8e8e9821..cf151c04 100644 --- a/src/gui/browserpanel.cc +++ b/src/gui/browserpanel.cc @@ -1,9 +1,9 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/fluxmap.h" #include "lib/vfs/vfs.h" #include "lib/utils.h" #include "gui.h" -#include "layout.h" +#include "lib/layout.h" #include "filesystemmodel.h" #include "fileviewerwindow.h" #include "textviewerwindow.h" diff --git a/src/gui/explorerpanel.cc b/src/gui/explorerpanel.cc index c3b7e8c6..1275537d 100644 --- a/src/gui/explorerpanel.cc +++ b/src/gui/explorerpanel.cc @@ -4,7 +4,7 @@ #include "lib/decoders/decoders.h" #include "lib/proto.h" #include "gui.h" -#include "layout.h" +#include "lib/layout.h" #include "jobqueue.h" static Bytes fakeBits(const std::vector& bits) diff --git a/src/gui/fileviewerwindow.cc b/src/gui/fileviewerwindow.cc index 59694401..e0d2b687 100644 --- a/src/gui/fileviewerwindow.cc +++ b/src/gui/fileviewerwindow.cc @@ -2,7 +2,7 @@ #include "lib/utils.h" #include "lib/bytes.h" #include "gui.h" -#include "layout.h" +#include "lib/layout.h" #include "fileviewerwindow.h" FileViewerWindow::FileViewerWindow( diff --git a/src/gui/fileviewerwindow.h b/src/gui/fileviewerwindow.h index 7de91268..a5dce046 100644 --- a/src/gui/fileviewerwindow.h +++ b/src/gui/fileviewerwindow.h @@ -1,7 +1,7 @@ #ifndef FILEVIEWERWINDOW_H #define FILEVIEWERWINDOW_H -#include "layout.h" +#include "lib/layout.h" class FileViewerWindow : public FileViewerWindowGen { diff --git a/src/gui/fluxviewercontrol.cc b/src/gui/fluxviewercontrol.cc index 77fb28c9..cd548add 100644 --- a/src/gui/fluxviewercontrol.cc +++ b/src/gui/fluxviewercontrol.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "gui.h" #include "fluxviewercontrol.h" #include "textviewerwindow.h" diff --git a/src/gui/fluxviewerwindow.cc b/src/gui/fluxviewerwindow.cc index 7b113581..1fcdbee2 100644 --- a/src/gui/fluxviewerwindow.cc +++ b/src/gui/fluxviewerwindow.cc @@ -1,6 +1,6 @@ -#include "globals.h" +#include "lib/globals.h" #include "gui.h" -#include "layout.h" +#include "lib/layout.h" #include "fluxviewerwindow.h" #include "fluxviewercontrol.h" #include "lib/flux.h" diff --git a/src/gui/fluxviewerwindow.h b/src/gui/fluxviewerwindow.h index 61c39df2..9416fa9d 100644 --- a/src/gui/fluxviewerwindow.h +++ b/src/gui/fluxviewerwindow.h @@ -1,7 +1,7 @@ #ifndef FLUXVIEWERWINDOW_H #define FLUXVIEWERWINDOW_H -#include "layout.h" +#include "lib/layout.h" class TrackFlux; diff --git a/src/gui/idlepanel.cc b/src/gui/idlepanel.cc index 0161fb13..bbaa67fb 100644 --- a/src/gui/idlepanel.cc +++ b/src/gui/idlepanel.cc @@ -9,7 +9,7 @@ #include "lib/fluxsink/fluxsink.h" #include "lib/imagereader/imagereader.h" #include "lib/imagewriter/imagewriter.h" -#include "layout.h" +#include "lib/layout.h" #include "texteditorwindow.h" #include "iconbutton.h" #include diff --git a/src/gui/imagerpanel.cc b/src/gui/imagerpanel.cc index dd3cc5b1..79e7c452 100644 --- a/src/gui/imagerpanel.cc +++ b/src/gui/imagerpanel.cc @@ -9,7 +9,7 @@ #include "lib/proto.h" #include "lib/readerwriter.h" #include "gui.h" -#include "layout.h" +#include "lib/layout.h" #include "fluxviewerwindow.h" #include "jobqueue.h" diff --git a/src/gui/layout.cpp b/src/gui/layout.cpp index e8d495d9..06d58d68 100644 --- a/src/gui/layout.cpp +++ b/src/gui/layout.cpp @@ -5,7 +5,7 @@ // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "layout.h" +#include "lib/layout.h" #include "icon.png.h" diff --git a/src/gui/main.cc b/src/gui/main.cc index f4817631..9e4425ac 100644 --- a/src/gui/main.cc +++ b/src/gui/main.cc @@ -1,7 +1,7 @@ #include "lib/globals.h" #include "lib/logger.h" #include "gui.h" -#include "utils.h" +#include "lib/utils.h" class FluxEngineApp; class ExecEvent; diff --git a/src/gui/mainwindow.cc b/src/gui/mainwindow.cc index 0865358e..ef2464be 100644 --- a/src/gui/mainwindow.cc +++ b/src/gui/mainwindow.cc @@ -1,15 +1,15 @@ -#include "globals.h" -#include "proto.h" +#include "lib/globals.h" +#include "lib/proto.h" #include "gui.h" -#include "logger.h" -#include "readerwriter.h" -#include "fluxsource/fluxsource.h" -#include "fluxsink/fluxsink.h" -#include "imagereader/imagereader.h" -#include "imagewriter/imagewriter.h" -#include "encoders/encoders.h" -#include "decoders/decoders.h" -#include "utils.h" +#include "lib/logger.h" +#include "lib/readerwriter.h" +#include "lib/fluxsource/fluxsource.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/imagereader/imagereader.h" +#include "lib/imagewriter/imagewriter.h" +#include "lib/encoders/encoders.h" +#include "lib/decoders/decoders.h" +#include "lib/utils.h" #include "fluxviewerwindow.h" #include "textviewerwindow.h" #include "fileviewerwindow.h" diff --git a/src/gui/texteditorwindow.cc b/src/gui/texteditorwindow.cc index 92e7ef51..082a0b7f 100644 --- a/src/gui/texteditorwindow.cc +++ b/src/gui/texteditorwindow.cc @@ -1,6 +1,6 @@ -#include "globals.h" +#include "lib/globals.h" #include "gui.h" -#include "layout.h" +#include "lib/layout.h" #include "texteditorwindow.h" wxDEFINE_EVENT(EDITOR_SAVE_EVENT, EditorSaveEvent); diff --git a/src/gui/texteditorwindow.h b/src/gui/texteditorwindow.h index f150cb36..4f990881 100644 --- a/src/gui/texteditorwindow.h +++ b/src/gui/texteditorwindow.h @@ -1,7 +1,7 @@ #ifndef TEXTEDITORWINDOW_H #define TEXTEDITORWINDOW_H -#include "layout.h" +#include "lib/layout.h" class EditorSaveEvent : public wxEvent { diff --git a/src/gui/textviewerwindow.cc b/src/gui/textviewerwindow.cc index 98187eba..e0a0da2a 100644 --- a/src/gui/textviewerwindow.cc +++ b/src/gui/textviewerwindow.cc @@ -1,6 +1,6 @@ -#include "globals.h" +#include "lib/globals.h" #include "gui.h" -#include "layout.h" +#include "lib/layout.h" #include "textviewerwindow.h" TextViewerWindow::TextViewerWindow(wxWindow* parent, diff --git a/src/gui/textviewerwindow.h b/src/gui/textviewerwindow.h index ee2624fc..e03d6c58 100644 --- a/src/gui/textviewerwindow.h +++ b/src/gui/textviewerwindow.h @@ -1,7 +1,7 @@ #ifndef TEXTVIEWERWINDOW_H #define TEXTVIEWERWINDOW_H -#include "layout.h" +#include "lib/layout.h" class TextViewerWindow : public TextViewerWindowGen { diff --git a/src/gui/visualisationcontrol.cc b/src/gui/visualisationcontrol.cc index 1aa7a24f..24e2e795 100644 --- a/src/gui/visualisationcontrol.cc +++ b/src/gui/visualisationcontrol.cc @@ -1,10 +1,10 @@ -#include "globals.h" +#include "lib/globals.h" #include "gui.h" #include "visualisationcontrol.h" -#include "fluxmap.h" -#include "flux.h" -#include "sector.h" -#include "image.h" +#include "lib/fluxmap.h" +#include "lib/flux.h" +#include "lib/sector.h" +#include "lib/image.h" #include "lib/layout.h" #define BORDER 20 diff --git a/src/readibm.h b/src/readibm.h index 0d42ef8e..9bdfb33f 100644 --- a/src/readibm.h +++ b/src/readibm.h @@ -1,7 +1,7 @@ #ifndef READIBM_H #define READIBM_H -#include "flags.h" +#include "lib/flags.h" #include "dataspec.h" extern IntFlag sectorIdBase; diff --git a/tests/agg.cc b/tests/agg.cc index f6b78041..f6afe2ac 100644 --- a/tests/agg.cc +++ b/tests/agg.cc @@ -1,5 +1,5 @@ #include "globals.h" -#include "bytes.h" +#include "lib/bytes.h" #include "dep/agg/include/agg2d.h" #include "dep/stb/stb_image_write.h" #include diff --git a/tests/amiga.cc b/tests/amiga.cc index 163a9ffe..1e5ea32e 100644 --- a/tests/amiga.cc +++ b/tests/amiga.cc @@ -1,5 +1,5 @@ #include "globals.h" -#include "bytes.h" +#include "lib/bytes.h" #include "decoders/decoders.h" #include "arch/amiga/amiga.h" #include diff --git a/tests/bitaccumulator.cc b/tests/bitaccumulator.cc index 83788ac2..694bf0b6 100644 --- a/tests/bitaccumulator.cc +++ b/tests/bitaccumulator.cc @@ -1,5 +1,5 @@ #include "globals.h" -#include "bytes.h" +#include "lib/bytes.h" #include int main(int argc, const char* argv[]) diff --git a/tests/bytes.cc b/tests/bytes.cc index b572792e..caf53f40 100644 --- a/tests/bytes.cc +++ b/tests/bytes.cc @@ -1,5 +1,5 @@ #include "globals.h" -#include "bytes.h" +#include "lib/bytes.h" #include "snowhouse/snowhouse.h" using namespace snowhouse; diff --git a/tests/compression.cc b/tests/compression.cc index ba1d1f56..2d97123b 100644 --- a/tests/compression.cc +++ b/tests/compression.cc @@ -1,5 +1,5 @@ #include "globals.h" -#include "bytes.h" +#include "lib/bytes.h" static void test_roundtrip() { diff --git a/tests/csvreader.cc b/tests/csvreader.cc index 3ed7ff3c..fb97033a 100644 --- a/tests/csvreader.cc +++ b/tests/csvreader.cc @@ -1,5 +1,5 @@ #include "globals.h" -#include "csvreader.h" +#include "lib/csvreader.h" #include typedef std::vector strings; diff --git a/tests/ldbs.cc b/tests/ldbs.cc index 9c295702..3934e8fd 100644 --- a/tests/ldbs.cc +++ b/tests/ldbs.cc @@ -2,7 +2,7 @@ #include #include #include "globals.h" -#include "bytes.h" +#include "lib/bytes.h" #include "ldbs.h" static Bytes testdata{ diff --git a/tests/options.cc b/tests/options.cc index 4d712326..75e91c19 100644 --- a/tests/options.cc +++ b/tests/options.cc @@ -1,5 +1,5 @@ #include "globals.h" -#include "bytes.h" +#include "lib/bytes.h" #include "tests/testproto.pb.h" #include "lib/config.pb.h" #include "proto.h" diff --git a/tests/proto.cc b/tests/proto.cc index 04850bc7..a0f2d46b 100644 --- a/tests/proto.cc +++ b/tests/proto.cc @@ -1,5 +1,5 @@ #include "globals.h" -#include "bytes.h" +#include "lib/bytes.h" #include "tests/testproto.pb.h" #include "lib/config.pb.h" #include "proto.h" From 986be921f4095362831f1ddcd7e4543a856d5f90 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 22 Oct 2023 19:18:14 +0200 Subject: [PATCH 03/49] First working command-line executable. --- arch/build.py | 67 ++++++++++++++++++++++++++++++++++++++++ arch/mx/decoder.cc | 2 +- arch/tids990/decoder.cc | 2 +- build.py | 5 +++ build/ab.py | 8 ++--- build/c.py | 15 ++++++--- build/pkg.py | 4 +-- config.py | 5 +++ dep/libusbp/build.py | 68 +++++++++++++++++++++++++++++++++-------- lib/build.py | 8 +++-- src/build.py | 5 +++ 11 files changed, 161 insertions(+), 28 deletions(-) diff --git a/arch/build.py b/arch/build.py index 426b90a8..6ef55eed 100644 --- a/arch/build.py +++ b/arch/build.py @@ -1,3 +1,4 @@ +from build.c import clibrary from build.protobuf import proto, protocc proto( @@ -23,3 +24,69 @@ proto( "./zilogmcz/zilogmcz.proto", ], ) + +clibrary( + name="arch", + srcs=[ + "./aeslanier/decoder.cc", + "./agat/agat.cc", + "./agat/decoder.cc", + "./agat/encoder.cc", + "./amiga/amiga.cc", + "./amiga/decoder.cc", + "./amiga/encoder.cc", + "./apple2/decoder.cc", + "./apple2/encoder.cc", + "./brother/decoder.cc", + "./brother/encoder.cc", + "./c64/c64.cc", + "./c64/decoder.cc", + "./c64/encoder.cc", + "./f85/decoder.cc", + "./fb100/decoder.cc", + "./ibm/decoder.cc", + "./ibm/encoder.cc", + "./macintosh/decoder.cc", + "./macintosh/encoder.cc", + "./micropolis/decoder.cc", + "./micropolis/encoder.cc", + "./mx/decoder.cc", + "./northstar/decoder.cc", + "./northstar/encoder.cc", + "./rolandd20/decoder.cc", + "./smaky6/decoder.cc", + "./tids990/decoder.cc", + "./tids990/encoder.cc", + "./victor9k/decoder.cc", + "./victor9k/encoder.cc", + "./zilogmcz/decoder.cc", + ], + hdrs={ + "arch/ibm/ibm.h": "./ibm/ibm.h", + "arch/apple2/data_gcr.h": "./apple2/data_gcr.h", + "arch/apple2/apple2.h": "./apple2/apple2.h", + "arch/smaky6/smaky6.h": "./smaky6/smaky6.h", + "arch/tids990/tids990.h": "./tids990/tids990.h", + "arch/zilogmcz/zilogmcz.h": "./zilogmcz/zilogmcz.h", + "arch/amiga/amiga.h": "./amiga/amiga.h", + "arch/f85/data_gcr.h": "./f85/data_gcr.h", + "arch/f85/f85.h": "./f85/f85.h", + "arch/mx/mx.h": "./mx/mx.h", + "arch/aeslanier/aeslanier.h": "./aeslanier/aeslanier.h", + "arch/northstar/northstar.h": "./northstar/northstar.h", + "arch/brother/data_gcr.h": "./brother/data_gcr.h", + "arch/brother/brother.h": "./brother/brother.h", + "arch/brother/header_gcr.h": "./brother/header_gcr.h", + "arch/macintosh/data_gcr.h": "./macintosh/data_gcr.h", + "arch/macintosh/macintosh.h": "./macintosh/macintosh.h", + "arch/agat/agat.h": "./agat/agat.h", + "arch/fb100/fb100.h": "./fb100/fb100.h", + "arch/victor9k/data_gcr.h": "./victor9k/data_gcr.h", + "arch/victor9k/victor9k.h": "./victor9k/victor9k.h", + "arch/rolandd20/rolandd20.h": "./rolandd20/rolandd20.h", + "arch/micropolis/micropolis.h": "./micropolis/micropolis.h", + "arch/c64/data_gcr.h": "./c64/data_gcr.h", + "arch/c64/c64.h": "./c64/c64.h", + }, + deps=["lib", "lib+config_proto_lib", "+protocol"], +) diff --git a/arch/mx/decoder.cc b/arch/mx/decoder.cc index daec99fa..1404f0bf 100644 --- a/arch/mx/decoder.cc +++ b/arch/mx/decoder.cc @@ -1,6 +1,6 @@ #include "lib/globals.h" #include "lib/decoders/decoders.h" -#include "mx/mx.h" +#include "arch/mx/mx.h" #include "lib/crc.h" #include "lib/fluxmap.h" #include "lib/decoders/fluxmapreader.h" diff --git a/arch/tids990/decoder.cc b/arch/tids990/decoder.cc index 5baddc66..5653f475 100644 --- a/arch/tids990/decoder.cc +++ b/arch/tids990/decoder.cc @@ -1,7 +1,7 @@ #include "lib/globals.h" #include "lib/decoders/decoders.h" #include "lib/encoders/encoders.h" -#include "tids990/tids990.h" +#include "arch/tids990/tids990.h" #include "lib/crc.h" #include "lib/fluxmap.h" #include "lib/decoders/fluxmapreader.h" diff --git a/build.py b/build.py index fc82e3b5..d862396b 100644 --- a/build.py +++ b/build.py @@ -1,6 +1,11 @@ from build.ab import export from build.c import clibrary from build.protobuf import proto, protocc +from build.pkg import package + +package(name="protobuf_lib", package="protobuf") +package(name="z_lib", package="zlib") +package(name="fmt_lib", package="fmt") clibrary(name="protocol", hdrs={"protocol.h": "./protocol.h"}) diff --git a/build/ab.py b/build/ab.py index 70e85c13..40572ab7 100644 --- a/build/ab.py +++ b/build/ab.py @@ -243,11 +243,11 @@ def targetof(s, cwd): t.materialise() return t - if s.startswith("+"): - s = cwd + s - if s.startswith("./"): + if s.startswith(".+"): + s = cwd + s[1:] + elif s.startswith("./"): s = normpath(join(cwd, s)) - if s.startswith("$"): + elif s.startswith("$"): return fileinvocation(s) if "+" not in s: diff --git a/build/c.py b/build/c.py index 0bd2995a..57e4eb4a 100644 --- a/build/c.py +++ b/build/c.py @@ -97,6 +97,7 @@ def clibrary( "clibrary contains no sources and no exported headers" ) + ldflags = [] libraries = [d for d in deps if hasattr(d, "clibrary")] for library in libraries: if library.clibrary.cflags: @@ -124,7 +125,7 @@ def clibrary( i = i + 1 if srcs: - nr = None + hr = None if hdrcs: hr = normalrule( name=f"{name}_hdrs", @@ -151,7 +152,7 @@ def clibrary( commands=commands if actualsrcs else [], ) - self.clibrary.ldflags = [] + self.clibrary.ldflags = ldflags self.clibrary.cflags = ["-I" + hr.normalrule.objdir] if hr else [] else: r = normalrule( @@ -163,7 +164,7 @@ def clibrary( ) r.materialise() - self.clibrary.ldflags = [] + self.clibrary.ldflags = ldflags self.clibrary.cflags = ["-I" + r.normalrule.objdir] @@ -201,7 +202,9 @@ def cprogram( deps: Targets = [], cflags=[], ldflags=[], - commands=["$(CC) -o {outs[0]} {ins} {ldflags}"], + commands=[ + "$(CC) -o {outs[0]} -Wl,--start-group {ins} -Wl,--end-group {ldflags}" + ], label="CLINK", ): programimpl( @@ -226,7 +229,9 @@ def cxxprogram( deps: Targets = [], cflags=[], ldflags=[], - commands=["$(CXX) -o {outs[0]} {ins} {ldflags}"], + commands=[ + "$(CXX) -o {outs[0]} -Wl,--start-group {ins} -Wl,--end-group {ldflags}" + ], label="CXXLINK", ): programimpl( diff --git a/build/pkg.py b/build/pkg.py index 0da471e8..598a532e 100644 --- a/build/pkg.py +++ b/build/pkg.py @@ -22,10 +22,10 @@ def package(self, name, package=None, fallback: Target = None): emit(f"$(error Required package '{package}' not installed.)") emit("else") emit( - f"PACKAGE_CFLAGS_{package} := $(shell $(PKG_CONFIG) --cflags {package}" + f"PACKAGE_CFLAGS_{package} := $(shell $(PKG_CONFIG) --cflags {package})" ) emit( - f"PACKAGE_LDFLAGS_{package} := $(shell $(PKG_CONFIG) --ldflags {package}" + f"PACKAGE_LDFLAGS_{package} := $(shell $(PKG_CONFIG) --libs {package})" ) emit(f"PACKAGE_DEP_{package} := ") emit("endif") diff --git a/config.py b/config.py index e69de29b..08073692 100644 --- a/config.py +++ b/config.py @@ -0,0 +1,5 @@ +import platform + +windows = platform.system() == "Windows" +osx = platform.system() == "Darwin" +unix = not windows diff --git a/dep/libusbp/build.py b/dep/libusbp/build.py index c37e076e..5305c8f0 100644 --- a/dep/libusbp/build.py +++ b/dep/libusbp/build.py @@ -1,20 +1,64 @@ from build.c import clibrary +from build.pkg import package +from config import windows, osx, unix + +srcs = [ + "./src/async_in_pipe.c", + "./src/error.c", + "./src/error_hresult.c", + "./src/find_device.c", + "./src/list.c", + "./src/pipe_id.c", + "./src/string.c", + "./src/libusbp_internal.h", + "./include/libusbp_config.h", + "./include/libusbp.h", +] +deps = [] + +if windows: + srcs += [ + "./src/windows/async_in_transfer_windows.c", + "./src/windows/device_instance_id_windows.c", + "./src/windows/device_windows.c", + "./src/windows/error_windows.c", + "./src/windows/generic_handle_windows.c", + "./src/windows/generic_interface_windows.c", + "./src/windows/interface_windows.c", + "./src/windows/list_windows.c", + "./src/windows/serial_port_windows.c", + ] +elif osx: + srcs += [ + "./src/mac/async_in_transfer_mac.c", + "./src/mac/device_mac.c", + "./src/mac/error_mac.c", + "./src/mac/generic_handle_mac.c", + "./src/mac/generic_interface_mac.c", + "./src/mac/iokit_mac.c", + "./src/mac/list_mac.c", + "./src/mac/serial_port_mac.c", + ] +else: + package(name="udev_lib", package="libudev") + srcs += [ + "./src/linux/async_in_transfer_linux.c", + "./src/linux/device_linux.c", + "./src/linux/error_linux.c", + "./src/linux/generic_handle_linux.c", + "./src/linux/generic_interface_linux.c", + "./src/linux/list_linux.c", + "./src/linux/serial_port_linux.c", + "./src/linux/udev_linux.c", + "./src/linux/usbfd_linux.c", + ] + deps += [".+udev_lib"] clibrary( name="libusbp", - srcs=[ - "./src/async_in_pipe.c", - "./src/error.c", - "./src/error_hresult.c", - "./src/find_device.c", - "./src/list.c", - "./src/pipe_id.c", - "./src/string.c", - "./src/libusbp_internal.h", - "./include/libusbp_config.h", - "./include/libusbp.h", - ], + srcs=srcs, cflags=["-Idep/libusbp/include", "-Idep/libusbp/src"], + deps=deps, hdrs={ "libusbp_internal.h": "./src/libusbp_internal.h", "libusbp_config.h": "./include/libusbp_config.h", diff --git a/lib/build.py b/lib/build.py index 1317d403..743d8442 100644 --- a/lib/build.py +++ b/lib/build.py @@ -99,6 +99,7 @@ clibrary( "lib/bitmap.h": "./bitmap.h", "lib/bytes.h": "./bytes.h", "lib/config.h": "./config.h", + "lib/crc.h": "./crc.h", "lib/csvreader.h": "./csvreader.h", "lib/decoders/decoders.h": "./decoders/decoders.h", "lib/decoders/fluxdecoder.h": "./decoders/fluxdecoder.h", @@ -115,6 +116,7 @@ clibrary( "lib/image.h": "./image.h", "lib/imagereader/imagereader.h": "./imagereader/imagereader.h", "lib/imagewriter/imagewriter.h": "./imagewriter/imagewriter.h", + "lib/layout.h": "./layout.h", "lib/proto.h": "./proto.h", "lib/readerwriter.h": "./readerwriter.h", "lib/sector.h": "./sector.h", @@ -125,7 +127,7 @@ clibrary( }, deps=[ "+fl2_proto_lib", - "+config_proto_lib", + ".+config_proto_lib", "dep/libusbp", "dep/adflib", "dep/fatfs", @@ -150,7 +152,7 @@ proto( "./usb/usb.proto", "./vfs/vfs.proto", ], - deps=["+common_proto"], + deps=[".+common_proto"], ) -protocc(name="config_proto_lib", srcs=["+config_proto", "arch+arch_proto"]) +protocc(name="config_proto_lib", srcs=[".+config_proto", "arch+arch_proto"]) diff --git a/src/build.py b/src/build.py index 21a4832b..58742bec 100644 --- a/src/build.py +++ b/src/build.py @@ -30,7 +30,11 @@ cxxprogram( cflags=["-I."], deps=[ "+fl2_proto_lib", + "+fmt_lib", + "+protobuf_lib", "+protocol", + "+z_lib", + "arch", "dep/adflib", "dep/agg", "dep/fatfs", @@ -39,5 +43,6 @@ cxxprogram( "dep/stb", "lib", "lib+config_proto_lib", + "src/formats", ], ) From a24fe420c46ccd2043b98209ccb457d1ee9f632d Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 22 Oct 2023 21:20:47 +0200 Subject: [PATCH 04/49] We can now build both the CLI and GUI binaries! --- build.py | 6 +++- build/utils.py | 13 ++++++++ extras/build.py | 14 ++++++++ lib/build.py | 2 ++ scripts/build.py | 33 +++++++++++++++++++ src/formats/build.py | 64 +++++++++++++++++++++++++++++++++++++ src/gui/build.py | 57 +++++++++++++++++++++++++++++++++ src/gui/drivetypes/build.py | 40 +++++++++++++++++++++++ src/gui/explorerpanel.cc | 2 +- src/gui/fileviewerwindow.h | 2 +- src/gui/fluxviewerwindow.h | 2 +- src/gui/idlepanel.cc | 12 +++---- src/gui/layout.cpp | 2 +- src/gui/texteditorwindow.h | 2 +- src/gui/textviewerwindow.h | 2 +- tests/build.py | 16 ++++++++++ 16 files changed, 256 insertions(+), 13 deletions(-) create mode 100644 build/utils.py create mode 100644 extras/build.py create mode 100644 scripts/build.py create mode 100644 src/formats/build.py create mode 100644 src/gui/build.py create mode 100644 src/gui/drivetypes/build.py create mode 100644 tests/build.py diff --git a/build.py b/build.py index d862396b..f017100e 100644 --- a/build.py +++ b/build.py @@ -12,4 +12,8 @@ clibrary(name="protocol", hdrs={"protocol.h": "./protocol.h"}) proto(name="fl2_proto", srcs=["lib/fl2.proto"]) protocc(name="fl2_proto_lib", srcs=["+fl2_proto"]) -export(name="all", items={"fluxengine": "src+fluxengine"}, deps=["+protocol"]) +export( + name="all", + items={"fluxengine": "src+fluxengine", "fluxengine-gui": "src/gui"}, + deps=["+protocol"], +) diff --git a/build/utils.py b/build/utils.py new file mode 100644 index 00000000..05283194 --- /dev/null +++ b/build/utils.py @@ -0,0 +1,13 @@ +from build.ab import Rule, normalrule, Target, filenameof +from os.path import basename + + +@Rule +def objectify(self, name, src: Target, symbol): + normalrule( + replaces=self, + ins=[src], + outs=[basename(filenameof(src)) + ".h"], + commands=["xxd -i -n " + symbol + " {ins} > {outs}"], + label="OBJECTIFY", + ) diff --git a/extras/build.py b/extras/build.py new file mode 100644 index 00000000..14c3045e --- /dev/null +++ b/extras/build.py @@ -0,0 +1,14 @@ +from build.utils import objectify +from build.c import clibrary + +icons = ["fluxfile", "hardware", "icon", "imagefile"] + +clibrary( + name="icons", + hdrs={ + f"icons/{n}.h": objectify( + name=n + "_h", src=f"./{n}.png", symbol=f"icon_{n}_png" + ) + for n in icons + }, +) diff --git a/lib/build.py b/lib/build.py index 743d8442..e57e2faf 100644 --- a/lib/build.py +++ b/lib/build.py @@ -117,10 +117,12 @@ clibrary( "lib/imagereader/imagereader.h": "./imagereader/imagereader.h", "lib/imagewriter/imagewriter.h": "./imagewriter/imagewriter.h", "lib/layout.h": "./layout.h", + "lib/logger.h": "./logger.h", "lib/proto.h": "./proto.h", "lib/readerwriter.h": "./readerwriter.h", "lib/sector.h": "./sector.h", "lib/usb/usb.h": "./usb/usb.h", + "lib/usb/usbfinder.h": "./usb/usbfinder.h", "lib/utils.h": "./utils.h", "lib/vfs/sectorinterface.h": "./vfs/sectorinterface.h", "lib/vfs/vfs.h": "./vfs/vfs.h", diff --git a/scripts/build.py b/scripts/build.py new file mode 100644 index 00000000..893bab7a --- /dev/null +++ b/scripts/build.py @@ -0,0 +1,33 @@ +from build.ab import Rule, normalrule, Targets +from build.c import cxxprogram + +encoders = {} + + +@Rule +def protoencode(self, name, srcs: Targets, proto, symbol): + if proto not in encoders: + r = cxxprogram( + name="protoencode_" + proto, + srcs=["scripts/protoencode.cc"], + cflags=["-DPROTO=" + proto], + deps=[ + "lib+config_proto_lib", + "tests+test_proto_lib", + "+protobuf_lib", + "+fmt_lib", + ], + ) + encoders[proto] = r + else: + r = encoders[proto] + r.materialise() + + normalrule( + replaces=self, + ins=srcs, + outs=[f"{name}.cc"], + deps=[r], + commands=["{deps[0]} {ins} {outs} " + symbol], + label="PROTOENCODE", + ) diff --git a/src/formats/build.py b/src/formats/build.py new file mode 100644 index 00000000..ea2937a8 --- /dev/null +++ b/src/formats/build.py @@ -0,0 +1,64 @@ +from build.ab import normalrule +from build.c import clibrary +from scripts.build import protoencode + +formats = [ + "40track_drive", + "acornadfs", + "acorndfs", + "aeslanier", + "agat", + "amiga", + "ampro", + "apple2_drive", + "apple2", + "atarist", + "bk", + "brother", + "commodore", + "eco1", + "epsonpf10", + "f85", + "fb100", + "hplif", + "ibm", + "icl30", + "mac", + "micropolis", + "ms2000", + "mx", + "n88basic", + "northstar", + "psos", + "rolandd20", + "rx50", + "shugart_drive", + "smaky6", + "tids990", + "tiki", + "victor9k", + "zilogmcz", +] + +normalrule( + name="table_cc", + ins=[f"./{name}.textpb" for name in formats], + deps=["scripts/mktable.sh"], + outs=["table.cc"], + commands=[ + "sh scripts/mktable.sh formats " + (" ".join(formats)) + " > {outs}" + ], + label="MKTABLE", +) + +encoded = [ + protoencode( + name=f"{name}_cc", + srcs=[f"./{name}.textpb"], + proto="ConfigProto", + symbol=f"formats_{name}_pb", + ) + for name in formats +] + +clibrary(name="formats", srcs=[".+table_cc"] + encoded) diff --git a/src/gui/build.py b/src/gui/build.py new file mode 100644 index 00000000..011b8942 --- /dev/null +++ b/src/gui/build.py @@ -0,0 +1,57 @@ +from build.ab import emit +from build.c import cxxprogram + +emit( + """ +WX_CONFIG ?= wx-config +ifneq ($(strip $(shell command -v $(WX_CONFIG) >/dev/null 2>&1; echo $$?)),0) +$(error Required binary 'wx-config' not found.) +endif + +WX_CFLAGS := $(shell $(WX_CONFIG) --cxxflags core base adv aui richtext) +WX_LDFLAGS := $(shell $(WX_CONFIG) --libs core base adv aui richtext) +""" +) + +cxxprogram( + name="gui", + srcs=[ + "./browserpanel.cc", + "./customstatusbar.cc", + "./explorerpanel.cc", + "./filesystemmodel.cc", + "./fileviewerwindow.cc", + "./fluxviewercontrol.cc", + "./fluxviewerwindow.cc", + "./histogramviewer.cc", + "./iconbutton.cc", + "./idlepanel.cc", + "./imagerpanel.cc", + "./jobqueue.cc", + "./main.cc", + "./mainwindow.cc", + "./texteditorwindow.cc", + "./textviewerwindow.cc", + "./visualisationcontrol.cc", + "./layout.cpp", + ], + cflags=["$(WX_CFLAGS)"], + ldflags=["$(WX_LDFLAGS)"], + deps=[ + "+fl2_proto_lib", + "+protocol", + "arch", + "dep/adflib", + "dep/fatfs", + "dep/hfsutils", + "dep/libusbp", + "extras+icons", + "lib", + "lib+config_proto_lib", + "src/formats", + "src/gui/drivetypes", + "+z_lib", + "+fmt_lib", + "+protobuf_lib", + ], +) diff --git a/src/gui/drivetypes/build.py b/src/gui/drivetypes/build.py new file mode 100644 index 00000000..9ad17710 --- /dev/null +++ b/src/gui/drivetypes/build.py @@ -0,0 +1,40 @@ +from build.ab import normalrule +from build.c import clibrary +from scripts.build import protoencode + +drivetypes = [ + "35_40", + "35_80", + "525_40M", + "525_40", + "525_80M", + "525_80", + "8_38", + "8_77", + "apple2", +] + +normalrule( + name="drivetypes_cc", + ins=[f"./{name}.textpb" for name in drivetypes], + deps=["scripts/mktable.sh"], + outs=["table.cc"], + commands=[ + "sh scripts/mktable.sh drivetypes " + + (" ".join(drivetypes)) + + " > {outs}" + ], + label="MKTABLE", +) + +encoded = [ + protoencode( + name=f"{name}_cc", + srcs=[f"./{name}.textpb"], + proto="ConfigProto", + symbol=f"drivetypes_{name}_pb", + ) + for name in drivetypes +] + +clibrary(name="drivetypes", srcs=[".+drivetypes_cc"] + encoded) diff --git a/src/gui/explorerpanel.cc b/src/gui/explorerpanel.cc index 1275537d..c3b7e8c6 100644 --- a/src/gui/explorerpanel.cc +++ b/src/gui/explorerpanel.cc @@ -4,7 +4,7 @@ #include "lib/decoders/decoders.h" #include "lib/proto.h" #include "gui.h" -#include "lib/layout.h" +#include "layout.h" #include "jobqueue.h" static Bytes fakeBits(const std::vector& bits) diff --git a/src/gui/fileviewerwindow.h b/src/gui/fileviewerwindow.h index a5dce046..7de91268 100644 --- a/src/gui/fileviewerwindow.h +++ b/src/gui/fileviewerwindow.h @@ -1,7 +1,7 @@ #ifndef FILEVIEWERWINDOW_H #define FILEVIEWERWINDOW_H -#include "lib/layout.h" +#include "layout.h" class FileViewerWindow : public FileViewerWindowGen { diff --git a/src/gui/fluxviewerwindow.h b/src/gui/fluxviewerwindow.h index 9416fa9d..61c39df2 100644 --- a/src/gui/fluxviewerwindow.h +++ b/src/gui/fluxviewerwindow.h @@ -1,7 +1,7 @@ #ifndef FLUXVIEWERWINDOW_H #define FLUXVIEWERWINDOW_H -#include "lib/layout.h" +#include "layout.h" class TrackFlux; diff --git a/src/gui/idlepanel.cc b/src/gui/idlepanel.cc index bbaa67fb..e4f5f3dd 100644 --- a/src/gui/idlepanel.cc +++ b/src/gui/idlepanel.cc @@ -16,9 +16,9 @@ #include #include #include -#include ".obj/extras/hardware.h" -#include ".obj/extras/fluxfile.h" -#include ".obj/extras/imagefile.h" +#include "icons/hardware.h" +#include "icons/fluxfile.h" +#include "icons/imagefile.h" #define CONFIG_SELECTEDSOURCE "SelectedSource" #define CONFIG_DEVICE "Device" @@ -103,11 +103,11 @@ public: parent->AddPage(this, "idle"); _imageList.Add( - createBitmap(extras_hardware_png, sizeof(extras_hardware_png))); + createBitmap(icon_hardware_png, sizeof(icon_hardware_png))); _imageList.Add( - createBitmap(extras_fluxfile_png, sizeof(extras_fluxfile_png))); + createBitmap(icon_fluxfile_png, sizeof(icon_fluxfile_png))); _imageList.Add( - createBitmap(extras_imagefile_png, sizeof(extras_imagefile_png))); + createBitmap(icon_imagefile_png, sizeof(icon_imagefile_png))); UpdateSources(); } diff --git a/src/gui/layout.cpp b/src/gui/layout.cpp index 06d58d68..e8d495d9 100644 --- a/src/gui/layout.cpp +++ b/src/gui/layout.cpp @@ -5,7 +5,7 @@ // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "lib/layout.h" +#include "layout.h" #include "icon.png.h" diff --git a/src/gui/texteditorwindow.h b/src/gui/texteditorwindow.h index 4f990881..f150cb36 100644 --- a/src/gui/texteditorwindow.h +++ b/src/gui/texteditorwindow.h @@ -1,7 +1,7 @@ #ifndef TEXTEDITORWINDOW_H #define TEXTEDITORWINDOW_H -#include "lib/layout.h" +#include "layout.h" class EditorSaveEvent : public wxEvent { diff --git a/src/gui/textviewerwindow.h b/src/gui/textviewerwindow.h index e03d6c58..ee2624fc 100644 --- a/src/gui/textviewerwindow.h +++ b/src/gui/textviewerwindow.h @@ -1,7 +1,7 @@ #ifndef TEXTVIEWERWINDOW_H #define TEXTVIEWERWINDOW_H -#include "lib/layout.h" +#include "layout.h" class TextViewerWindow : public TextViewerWindowGen { diff --git a/tests/build.py b/tests/build.py new file mode 100644 index 00000000..e39ebca7 --- /dev/null +++ b/tests/build.py @@ -0,0 +1,16 @@ +from build.c import clibrary +from build.protobuf import proto, protocc + + +proto( + name="test_proto", + srcs=[ + "./testproto.proto", + ], +) + +protocc( + name="test_proto_lib", + srcs=[".+test_proto"], + deps=["lib+config_proto", "arch+arch_proto"], +) From 627820cddc85392e09f8db67564aeb57228771d3 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 22 Oct 2023 21:35:27 +0200 Subject: [PATCH 05/49] Build the utilities. --- build.py | 9 ++++++++- tools/brother120tool.cc | 6 +++--- tools/brother240tool.cc | 2 +- tools/upgrade-flux-file.cc | 8 ++++---- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index f017100e..de2dde30 100644 --- a/build.py +++ b/build.py @@ -6,6 +6,7 @@ from build.pkg import package package(name="protobuf_lib", package="protobuf") package(name="z_lib", package="zlib") package(name="fmt_lib", package="fmt") +package(name="sqlite3_lib", package="sqlite3") clibrary(name="protocol", hdrs={"protocol.h": "./protocol.h"}) @@ -14,6 +15,12 @@ protocc(name="fl2_proto_lib", srcs=["+fl2_proto"]) export( name="all", - items={"fluxengine": "src+fluxengine", "fluxengine-gui": "src/gui"}, + items={ + "fluxengine": "src+fluxengine", + "fluxengine-gui": "src/gui", + "brother120tool": "tools+brother120tool", + "brother240tool": "tools+brother240tool", + "upgrade-flux-file": "tools+upgrade-flux-file", + }, deps=["+protocol"], ) diff --git a/tools/brother120tool.cc b/tools/brother120tool.cc index a124842b..ccec94f2 100644 --- a/tools/brother120tool.cc +++ b/tools/brother120tool.cc @@ -1,7 +1,7 @@ -#include "globals.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/bytes.h" #include "fmt/format.h" -#include "utils.h" +#include "lib/utils.h" #include #include "fnmatch.h" diff --git a/tools/brother240tool.cc b/tools/brother240tool.cc index 18195683..9cfbcac6 100644 --- a/tools/brother240tool.cc +++ b/tools/brother240tool.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "fmt/format.h" #include diff --git a/tools/upgrade-flux-file.cc b/tools/upgrade-flux-file.cc index 6c49eaff..9aaa8589 100644 --- a/tools/upgrade-flux-file.cc +++ b/tools/upgrade-flux-file.cc @@ -1,7 +1,7 @@ -#include "globals.h" -#include "fluxmap.h" -#include "fluxsink/fluxsink.h" -#include "bytes.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/fluxsink/fluxsink.h" +#include "lib/bytes.h" #include "fmt/format.h" #include #include From 07aa416975255cb1855dede153735eb7c04110a0 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 22 Oct 2023 22:57:54 +0200 Subject: [PATCH 06/49] Make the tests work. --- Makefile | 1 + arch/build.py | 66 ------------- build.py | 204 +++++++++++++++++++++++++++++++++++++++- build/utils.py | 11 +++ dep/adflib/build.py | 7 +- dep/snowhouse/build.py | 49 ++++++++++ lib/bitmap.cc | 4 +- lib/build.py | 135 -------------------------- lib/vfs/amigaffs.cc | 2 +- src/build.py | 3 +- src/formats/build.py | 2 +- src/gui/build.py | 3 +- tests/agg.cc | 6 +- tests/amiga.cc | 4 +- tests/bitaccumulator.cc | 2 +- tests/build.py | 89 +++++++++++++++++- tests/bytes.cc | 2 +- tests/compression.cc | 2 +- tests/cpmfs.cc | 2 +- tests/csvreader.cc | 2 +- tests/flags.cc | 4 +- tests/fluxmapreader.cc | 6 +- tests/fluxpattern.cc | 6 +- tests/flx.cc | 2 +- tests/fmmfm.cc | 4 +- tests/greaseweazle.cc | 4 +- tests/kryoflux.cc | 6 +- tests/ldbs.cc | 4 +- tests/options.cc | 4 +- tests/proto.cc | 4 +- tests/utils.cc | 4 +- tests/vfs.cc | 2 +- tools/build.py | 27 ++++++ 33 files changed, 424 insertions(+), 249 deletions(-) create mode 100644 dep/snowhouse/build.py create mode 100644 tools/build.py diff --git a/Makefile b/Makefile index 6e324e1c..2affa6a7 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CC = gcc CXX = g++ +CFLAGS = -g -Os OBJ = .obj diff --git a/arch/build.py b/arch/build.py index 6ef55eed..6fbd27e0 100644 --- a/arch/build.py +++ b/arch/build.py @@ -24,69 +24,3 @@ proto( "./zilogmcz/zilogmcz.proto", ], ) - -clibrary( - name="arch", - srcs=[ - "./aeslanier/decoder.cc", - "./agat/agat.cc", - "./agat/decoder.cc", - "./agat/encoder.cc", - "./amiga/amiga.cc", - "./amiga/decoder.cc", - "./amiga/encoder.cc", - "./apple2/decoder.cc", - "./apple2/encoder.cc", - "./brother/decoder.cc", - "./brother/encoder.cc", - "./c64/c64.cc", - "./c64/decoder.cc", - "./c64/encoder.cc", - "./f85/decoder.cc", - "./fb100/decoder.cc", - "./ibm/decoder.cc", - "./ibm/encoder.cc", - "./macintosh/decoder.cc", - "./macintosh/encoder.cc", - "./micropolis/decoder.cc", - "./micropolis/encoder.cc", - "./mx/decoder.cc", - "./northstar/decoder.cc", - "./northstar/encoder.cc", - "./rolandd20/decoder.cc", - "./smaky6/decoder.cc", - "./tids990/decoder.cc", - "./tids990/encoder.cc", - "./victor9k/decoder.cc", - "./victor9k/encoder.cc", - "./zilogmcz/decoder.cc", - ], - hdrs={ - "arch/ibm/ibm.h": "./ibm/ibm.h", - "arch/apple2/data_gcr.h": "./apple2/data_gcr.h", - "arch/apple2/apple2.h": "./apple2/apple2.h", - "arch/smaky6/smaky6.h": "./smaky6/smaky6.h", - "arch/tids990/tids990.h": "./tids990/tids990.h", - "arch/zilogmcz/zilogmcz.h": "./zilogmcz/zilogmcz.h", - "arch/amiga/amiga.h": "./amiga/amiga.h", - "arch/f85/data_gcr.h": "./f85/data_gcr.h", - "arch/f85/f85.h": "./f85/f85.h", - "arch/mx/mx.h": "./mx/mx.h", - "arch/aeslanier/aeslanier.h": "./aeslanier/aeslanier.h", - "arch/northstar/northstar.h": "./northstar/northstar.h", - "arch/brother/data_gcr.h": "./brother/data_gcr.h", - "arch/brother/brother.h": "./brother/brother.h", - "arch/brother/header_gcr.h": "./brother/header_gcr.h", - "arch/macintosh/data_gcr.h": "./macintosh/data_gcr.h", - "arch/macintosh/macintosh.h": "./macintosh/macintosh.h", - "arch/agat/agat.h": "./agat/agat.h", - "arch/fb100/fb100.h": "./fb100/fb100.h", - "arch/victor9k/data_gcr.h": "./victor9k/data_gcr.h", - "arch/victor9k/victor9k.h": "./victor9k/victor9k.h", - "arch/rolandd20/rolandd20.h": "./rolandd20/rolandd20.h", - "arch/micropolis/micropolis.h": "./micropolis/micropolis.h", - "arch/c64/data_gcr.h": "./c64/data_gcr.h", - "arch/c64/c64.h": "./c64/c64.h", - }, - deps=["lib", "lib+config_proto_lib", "+protocol"], -) diff --git a/build.py b/build.py index de2dde30..f6a80510 100644 --- a/build.py +++ b/build.py @@ -13,6 +13,208 @@ clibrary(name="protocol", hdrs={"protocol.h": "./protocol.h"}) proto(name="fl2_proto", srcs=["lib/fl2.proto"]) protocc(name="fl2_proto_lib", srcs=["+fl2_proto"]) +clibrary( + name="lib", + srcs=[ + "./lib/bitmap.cc", + "./lib/bytes.cc", + "./lib/config.cc", + "./lib/crc.cc", + "./lib/csvreader.cc", + "./lib/decoders/decoders.cc", + "./lib/decoders/fluxdecoder.cc", + "./lib/decoders/fluxmapreader.cc", + "./lib/decoders/fmmfm.cc", + "./lib/encoders/encoders.cc", + "./lib/fl2.cc", + "./lib/flags.cc", + "./lib/fluxmap.cc", + "./lib/fluxsink/a2rfluxsink.cc", + "./lib/fluxsink/aufluxsink.cc", + "./lib/fluxsink/fl2fluxsink.cc", + "./lib/fluxsink/fluxsink.cc", + "./lib/fluxsink/hardwarefluxsink.cc", + "./lib/fluxsink/scpfluxsink.cc", + "./lib/fluxsink/vcdfluxsink.cc", + "./lib/fluxsource/a2rfluxsource.cc", + "./lib/fluxsource/cwffluxsource.cc", + "./lib/fluxsource/erasefluxsource.cc", + "./lib/fluxsource/fl2fluxsource.cc", + "./lib/fluxsource/fluxsource.cc", + "./lib/fluxsource/flx.cc", + "./lib/fluxsource/flxfluxsource.cc", + "./lib/fluxsource/hardwarefluxsource.cc", + "./lib/fluxsource/kryoflux.cc", + "./lib/fluxsource/kryofluxfluxsource.cc", + "./lib/fluxsource/memoryfluxsource.cc", + "./lib/fluxsource/scpfluxsource.cc", + "./lib/fluxsource/testpatternfluxsource.cc", + "./lib/globals.cc", + "./lib/hexdump.cc", + "./lib/image.cc", + "./lib/imagereader/d64imagereader.cc", + "./lib/imagereader/d88imagereader.cc", + "./lib/imagereader/dimimagereader.cc", + "./lib/imagereader/diskcopyimagereader.cc", + "./lib/imagereader/fdiimagereader.cc", + "./lib/imagereader/imagereader.cc", + "./lib/imagereader/imdimagereader.cc", + "./lib/imagereader/imgimagereader.cc", + "./lib/imagereader/jv3imagereader.cc", + "./lib/imagereader/nfdimagereader.cc", + "./lib/imagereader/nsiimagereader.cc", + "./lib/imagereader/td0imagereader.cc", + "./lib/imagewriter/d64imagewriter.cc", + "./lib/imagewriter/d88imagewriter.cc", + "./lib/imagewriter/diskcopyimagewriter.cc", + "./lib/imagewriter/imagewriter.cc", + "./lib/imagewriter/imdimagewriter.cc", + "./lib/imagewriter/imgimagewriter.cc", + "./lib/imagewriter/ldbsimagewriter.cc", + "./lib/imagewriter/nsiimagewriter.cc", + "./lib/imagewriter/rawimagewriter.cc", + "./lib/layout.cc", + "./lib/ldbs.cc", + "./lib/logger.cc", + "./lib/proto.cc", + "./lib/readerwriter.cc", + "./lib/sector.cc", + "./lib/usb/fluxengineusb.cc", + "./lib/usb/greaseweazle.cc", + "./lib/usb/greaseweazleusb.cc", + "./lib/usb/serial.cc", + "./lib/usb/usb.cc", + "./lib/usb/usbfinder.cc", + "./lib/utils.cc", + "./lib/vfs/acorndfs.cc", + "./lib/vfs/amigaffs.cc", + "./lib/vfs/appledos.cc", + "./lib/vfs/applesingle.cc", + "./lib/vfs/brother120fs.cc", + "./lib/vfs/cbmfs.cc", + "./lib/vfs/cpmfs.cc", + "./lib/vfs/fatfs.cc", + "./lib/vfs/fluxsectorinterface.cc", + "./lib/vfs/imagesectorinterface.cc", + "./lib/vfs/lif.cc", + "./lib/vfs/machfs.cc", + "./lib/vfs/microdos.cc", + "./lib/vfs/philefs.cc", + "./lib/vfs/prodos.cc", + "./lib/vfs/roland.cc", + "./lib/vfs/smaky6fs.cc", + "./lib/vfs/vfs.cc", + "./lib/vfs/zdos.cc", + "./arch/aeslanier/decoder.cc", + "./arch/agat/agat.cc", + "./arch/agat/decoder.cc", + "./arch/agat/encoder.cc", + "./arch/amiga/amiga.cc", + "./arch/amiga/decoder.cc", + "./arch/amiga/encoder.cc", + "./arch/apple2/decoder.cc", + "./arch/apple2/encoder.cc", + "./arch/brother/decoder.cc", + "./arch/brother/encoder.cc", + "./arch/c64/c64.cc", + "./arch/c64/decoder.cc", + "./arch/c64/encoder.cc", + "./arch/f85/decoder.cc", + "./arch/fb100/decoder.cc", + "./arch/ibm/decoder.cc", + "./arch/ibm/encoder.cc", + "./arch/macintosh/decoder.cc", + "./arch/macintosh/encoder.cc", + "./arch/micropolis/decoder.cc", + "./arch/micropolis/encoder.cc", + "./arch/mx/decoder.cc", + "./arch/northstar/decoder.cc", + "./arch/northstar/encoder.cc", + "./arch/rolandd20/decoder.cc", + "./arch/smaky6/decoder.cc", + "./arch/tids990/decoder.cc", + "./arch/tids990/encoder.cc", + "./arch/victor9k/decoder.cc", + "./arch/victor9k/encoder.cc", + "./arch/zilogmcz/decoder.cc", + ], + hdrs={ + "arch/ibm/ibm.h": "./arch/ibm/ibm.h", + "arch/apple2/data_gcr.h": "./arch/apple2/data_gcr.h", + "arch/apple2/apple2.h": "./arch/apple2/apple2.h", + "arch/smaky6/smaky6.h": "./arch/smaky6/smaky6.h", + "arch/tids990/tids990.h": "./arch/tids990/tids990.h", + "arch/zilogmcz/zilogmcz.h": "./arch/zilogmcz/zilogmcz.h", + "arch/amiga/amiga.h": "./arch/amiga/amiga.h", + "arch/f85/data_gcr.h": "./arch/f85/data_gcr.h", + "arch/f85/f85.h": "./arch/f85/f85.h", + "arch/mx/mx.h": "./arch/mx/mx.h", + "arch/aeslanier/aeslanier.h": "./arch/aeslanier/aeslanier.h", + "arch/northstar/northstar.h": "./arch/northstar/northstar.h", + "arch/brother/data_gcr.h": "./arch/brother/data_gcr.h", + "arch/brother/brother.h": "./arch/brother/brother.h", + "arch/brother/header_gcr.h": "./arch/brother/header_gcr.h", + "arch/macintosh/data_gcr.h": "./arch/macintosh/data_gcr.h", + "arch/macintosh/macintosh.h": "./arch/macintosh/macintosh.h", + "arch/agat/agat.h": "./arch/agat/agat.h", + "arch/fb100/fb100.h": "./arch/fb100/fb100.h", + "arch/victor9k/data_gcr.h": "./arch/victor9k/data_gcr.h", + "arch/victor9k/victor9k.h": "./arch/victor9k/victor9k.h", + "arch/rolandd20/rolandd20.h": "./arch/rolandd20/rolandd20.h", + "arch/micropolis/micropolis.h": "./arch/micropolis/micropolis.h", + "arch/c64/data_gcr.h": "./arch/c64/data_gcr.h", + "arch/c64/c64.h": "./arch/c64/c64.h", + "lib/a2r.h": "./lib/a2r.h", + "lib/bitmap.h": "./lib/bitmap.h", + "lib/bytes.h": "./lib/bytes.h", + "lib/config.h": "./lib/config.h", + "lib/crc.h": "./lib/crc.h", + "lib/csvreader.h": "./lib/csvreader.h", + "lib/decoders/decoders.h": "./lib/decoders/decoders.h", + "lib/decoders/fluxdecoder.h": "./lib/decoders/fluxdecoder.h", + "lib/decoders/fluxmapreader.h": "./lib/decoders/fluxmapreader.h", + "lib/decoders/rawbits.h": "./lib/decoders/rawbits.h", + "lib/encoders/encoders.h": "./lib/encoders/encoders.h", + "lib/scp.h": "./lib/scp.h", + "lib/fl2.h": "./lib/fl2.h", + "lib/flags.h": "./lib/flags.h", + "lib/flux.h": "./lib/flux.h", + "lib/fluxmap.h": "./lib/fluxmap.h", + "lib/fluxsink/fluxsink.h": "./lib/fluxsink/fluxsink.h", + "lib/fluxsource/fluxsource.h": "lib/fluxsource/fluxsource.h", + "lib/fluxsource/flx.h": "lib/fluxsource/flx.h", + "lib/fluxsource/kryoflux.h": "lib/fluxsource/kryoflux.h", + "lib/globals.h": "./lib/globals.h", + "lib/image.h": "./lib/image.h", + "lib/imagereader/imagereader.h": "./lib/imagereader/imagereader.h", + "lib/imagewriter/imagewriter.h": "./lib/imagewriter/imagewriter.h", + "lib/layout.h": "./lib/layout.h", + "lib/ldbs.h": "./lib/ldbs.h", + "lib/logger.h": "./lib/logger.h", + "lib/proto.h": "./lib/proto.h", + "lib/readerwriter.h": "./lib/readerwriter.h", + "lib/sector.h": "./lib/sector.h", + "lib/usb/greaseweazle.h": "./lib/usb/greaseweazle.h", + "lib/usb/usb.h": "./lib/usb/usb.h", + "lib/usb/usbfinder.h": "./lib/usb/usbfinder.h", + "lib/utils.h": "./lib/utils.h", + "lib/vfs/applesingle.h": "./lib/vfs/applesingle.h", + "lib/vfs/sectorinterface.h": "./lib/vfs/sectorinterface.h", + "lib/vfs/vfs.h": "./lib/vfs/vfs.h", + }, + deps=[ + "+fl2_proto_lib", + "+protocol", + "lib+config_proto_lib", + "dep/adflib", + "dep/agg", + "dep/fatfs", + "dep/hfsutils", + "dep/libusbp", + "dep/stb", + ], +) + export( name="all", items={ @@ -22,5 +224,5 @@ export( "brother240tool": "tools+brother240tool", "upgrade-flux-file": "tools+upgrade-flux-file", }, - deps=["+protocol"], + deps=["tests"], ) diff --git a/build/utils.py b/build/utils.py index 05283194..5f8a50ec 100644 --- a/build/utils.py +++ b/build/utils.py @@ -11,3 +11,14 @@ def objectify(self, name, src: Target, symbol): commands=["xxd -i -n " + symbol + " {ins} > {outs}"], label="OBJECTIFY", ) + + +@Rule +def test(self, name, command: Target): + normalrule( + replaces=self, + ins=[command], + outs=["sentinel"], + commands=["{ins[0]}", "touch {outs}"], + label="TEST", + ) diff --git a/dep/adflib/build.py b/dep/adflib/build.py index d938d379..9b93510e 100644 --- a/dep/adflib/build.py +++ b/dep/adflib/build.py @@ -37,10 +37,11 @@ clibrary( ], cflags=["-Idep/adflib", "-Idep/adflib/src"], hdrs={ - "adflib.h": "./src/adflib.h", - "adf_defs.h": "./src/adf_defs.h", - "adf_str.h": "./src/adf_str.h", "adf_blk.h": "./src/adf_blk.h", + "adf_defs.h": "./src/adf_defs.h", "adf_err.h": "./src/adf_err.h", + "adf_nativ.h": "./adf_nativ.h", + "adf_str.h": "./src/adf_str.h", + "adflib.h": "./src/adflib.h", }, ) diff --git a/dep/snowhouse/build.py b/dep/snowhouse/build.py new file mode 100644 index 00000000..87ddd6ec --- /dev/null +++ b/dep/snowhouse/build.py @@ -0,0 +1,49 @@ +from build.c import clibrary + +clibrary( + name="snowhouse", + hdrs={ + "snowhouse/snowhouse.h": "./include/snowhouse/snowhouse.h", + "snowhouse/assert.h": "./include/snowhouse/assert.h", + "snowhouse/fluent/fluent.h": "./include/snowhouse/fluent/fluent.h", + "snowhouse/fluent/constraintadapter.h": "./include/snowhouse/fluent/constraintadapter.h", + "snowhouse/fluent/constraintlist.h": "./include/snowhouse/fluent/constraintlist.h", + "snowhouse/fluent/operators/andoperator.h": "./include/snowhouse/fluent/operators/andoperator.h", + "snowhouse/fluent/operators/invalidexpressionexception.h": "./include/snowhouse/fluent/operators/invalidexpressionexception.h", + "snowhouse/fluent/operators/collections/collectionoperator.h": "./include/snowhouse/fluent/operators/collections/collectionoperator.h", + "snowhouse/fluent/operators/collections/collectionconstraintevaluator.h": "./include/snowhouse/fluent/operators/collections/collectionconstraintevaluator.h", + "snowhouse/fluent/operators/collections/atleastoperator.h": "./include/snowhouse/fluent/operators/collections/atleastoperator.h", + "snowhouse/fluent/operators/collections/noneoperator.h": "./include/snowhouse/fluent/operators/collections/noneoperator.h", + "snowhouse/fluent/operators/collections/atmostoperator.h": "./include/snowhouse/fluent/operators/collections/atmostoperator.h", + "snowhouse/fluent/operators/collections/alloperator.h": "./include/snowhouse/fluent/operators/collections/alloperator.h", + "snowhouse/fluent/operators/collections/exactlyoperator.h": "./include/snowhouse/fluent/operators/collections/exactlyoperator.h", + "snowhouse/fluent/operators/notoperator.h": "./include/snowhouse/fluent/operators/notoperator.h", + "snowhouse/fluent/operators/constraintoperator.h": "./include/snowhouse/fluent/operators/constraintoperator.h", + "snowhouse/fluent/operators/oroperator.h": "./include/snowhouse/fluent/operators/oroperator.h", + "snowhouse/fluent/expressionbuilder.h": "./include/snowhouse/fluent/expressionbuilder.h", + "snowhouse/assertionexception.h": "./include/snowhouse/assertionexception.h", + "snowhouse/exceptions.h": "./include/snowhouse/exceptions.h", + "snowhouse/stringizers.h": "./include/snowhouse/stringizers.h", + "snowhouse/macros.h": "./include/snowhouse/macros.h", + "snowhouse/constraints/equalscontainerconstraint.h": "./include/snowhouse/constraints/equalscontainerconstraint.h", + "snowhouse/constraints/islessthanorequaltoconstraint.h": "./include/snowhouse/constraints/islessthanorequaltoconstraint.h", + "snowhouse/constraints/equalsconstraint.h": "./include/snowhouse/constraints/equalsconstraint.h", + "snowhouse/constraints/isgreaterthanconstraint.h": "./include/snowhouse/constraints/isgreaterthanconstraint.h", + "snowhouse/constraints/fulfillsconstraint.h": "./include/snowhouse/constraints/fulfillsconstraint.h", + "snowhouse/constraints/endswithconstraint.h": "./include/snowhouse/constraints/endswithconstraint.h", + "snowhouse/constraints/constraints.h": "./include/snowhouse/constraints/constraints.h", + "snowhouse/constraints/haslengthconstraint.h": "./include/snowhouse/constraints/haslengthconstraint.h", + "snowhouse/constraints/startswithconstraint.h": "./include/snowhouse/constraints/startswithconstraint.h", + "snowhouse/constraints/equalswithdeltaconstraint.h": "./include/snowhouse/constraints/equalswithdeltaconstraint.h", + "snowhouse/constraints/isgreaterthanorequaltoconstraint.h": "./include/snowhouse/constraints/isgreaterthanorequaltoconstraint.h", + "snowhouse/constraints/containsconstraint.h": "./include/snowhouse/constraints/containsconstraint.h", + "snowhouse/constraints/islessthanconstraint.h": "./include/snowhouse/constraints/islessthanconstraint.h", + "snowhouse/constraints/isemptyconstraint.h": "./include/snowhouse/constraints/isemptyconstraint.h", + "snowhouse/constraints/expressions/andexpression.h": "./include/snowhouse/constraints/expressions/andexpression.h", + "snowhouse/constraints/expressions/orexpression.h": "./include/snowhouse/constraints/expressions/orexpression.h", + "snowhouse/constraints/expressions/expression_fwd.h": "./include/snowhouse/constraints/expressions/expression_fwd.h", + "snowhouse/constraints/expressions/notexpression.h": "./include/snowhouse/constraints/expressions/notexpression.h", + "snowhouse/constraints/expressions/expression.h": "./include/snowhouse/constraints/expressions/expression.h", + "snowhouse/stringize.h": "./include/snowhouse/stringize.h", + }, +) diff --git a/lib/bitmap.cc b/lib/bitmap.cc index ac27ec33..4c4a9919 100644 --- a/lib/bitmap.cc +++ b/lib/bitmap.cc @@ -1,7 +1,7 @@ #include "lib/globals.h" #include "lib/flags.h" -#include "dep/agg/include/agg2d.h" -#include "dep/stb/stb_image_write.h" +#include "agg2d.h" +#include "stb_image_write.h" #include "lib/utils.h" #include "lib/bitmap.h" #include diff --git a/lib/build.py b/lib/build.py index e57e2faf..9f4ff979 100644 --- a/lib/build.py +++ b/lib/build.py @@ -1,141 +1,6 @@ from build.c import clibrary from build.protobuf import proto, protocc -clibrary( - name="lib", - cflags=["-I."], - srcs=[ - "./bitmap.cc", - "./bytes.cc", - "./config.cc", - "./crc.cc", - "./csvreader.cc", - "./decoders/decoders.cc", - "./decoders/fluxdecoder.cc", - "./decoders/fluxmapreader.cc", - "./decoders/fmmfm.cc", - "./encoders/encoders.cc", - "./fl2.cc", - "./flags.cc", - "./fluxmap.cc", - "./fluxsink/a2rfluxsink.cc", - "./fluxsink/aufluxsink.cc", - "./fluxsink/fl2fluxsink.cc", - "./fluxsink/fluxsink.cc", - "./fluxsink/hardwarefluxsink.cc", - "./fluxsink/scpfluxsink.cc", - "./fluxsink/vcdfluxsink.cc", - "./fluxsource/a2rfluxsource.cc", - "./fluxsource/cwffluxsource.cc", - "./fluxsource/erasefluxsource.cc", - "./fluxsource/fl2fluxsource.cc", - "./fluxsource/fluxsource.cc", - "./fluxsource/flx.cc", - "./fluxsource/flxfluxsource.cc", - "./fluxsource/hardwarefluxsource.cc", - "./fluxsource/kryoflux.cc", - "./fluxsource/kryofluxfluxsource.cc", - "./fluxsource/memoryfluxsource.cc", - "./fluxsource/scpfluxsource.cc", - "./fluxsource/testpatternfluxsource.cc", - "./globals.cc", - "./hexdump.cc", - "./image.cc", - "./imagereader/d64imagereader.cc", - "./imagereader/d88imagereader.cc", - "./imagereader/dimimagereader.cc", - "./imagereader/diskcopyimagereader.cc", - "./imagereader/fdiimagereader.cc", - "./imagereader/imagereader.cc", - "./imagereader/imdimagereader.cc", - "./imagereader/imgimagereader.cc", - "./imagereader/jv3imagereader.cc", - "./imagereader/nfdimagereader.cc", - "./imagereader/nsiimagereader.cc", - "./imagereader/td0imagereader.cc", - "./imagewriter/d64imagewriter.cc", - "./imagewriter/d88imagewriter.cc", - "./imagewriter/diskcopyimagewriter.cc", - "./imagewriter/imagewriter.cc", - "./imagewriter/imdimagewriter.cc", - "./imagewriter/imgimagewriter.cc", - "./imagewriter/ldbsimagewriter.cc", - "./imagewriter/nsiimagewriter.cc", - "./imagewriter/rawimagewriter.cc", - "./layout.cc", - "./ldbs.cc", - "./logger.cc", - "./proto.cc", - "./readerwriter.cc", - "./sector.cc", - "./usb/fluxengineusb.cc", - "./usb/greaseweazle.cc", - "./usb/greaseweazleusb.cc", - "./usb/serial.cc", - "./usb/usb.cc", - "./usb/usbfinder.cc", - "./utils.cc", - "./vfs/acorndfs.cc", - "./vfs/amigaffs.cc", - "./vfs/appledos.cc", - "./vfs/applesingle.cc", - "./vfs/brother120fs.cc", - "./vfs/cbmfs.cc", - "./vfs/cpmfs.cc", - "./vfs/fatfs.cc", - "./vfs/fluxsectorinterface.cc", - "./vfs/imagesectorinterface.cc", - "./vfs/lif.cc", - "./vfs/machfs.cc", - "./vfs/microdos.cc", - "./vfs/philefs.cc", - "./vfs/prodos.cc", - "./vfs/roland.cc", - "./vfs/smaky6fs.cc", - "./vfs/vfs.cc", - "./vfs/zdos.cc", - ], - hdrs={ - "lib/bitmap.h": "./bitmap.h", - "lib/bytes.h": "./bytes.h", - "lib/config.h": "./config.h", - "lib/crc.h": "./crc.h", - "lib/csvreader.h": "./csvreader.h", - "lib/decoders/decoders.h": "./decoders/decoders.h", - "lib/decoders/fluxdecoder.h": "./decoders/fluxdecoder.h", - "lib/decoders/fluxmapreader.h": "./decoders/fluxmapreader.h", - "lib/decoders/rawbits.h": "./decoders/rawbits.h", - "lib/encoders/encoders.h": "./encoders/encoders.h", - "lib/fl2.h": "./fl2.h", - "lib/flags.h": "./flags.h", - "lib/flux.h": "./flux.h", - "lib/fluxmap.h": "./fluxmap.h", - "lib/fluxsink/fluxsink.h": "./fluxsink/fluxsink.h", - "lib/fluxsource/fluxsource.h": "lib/fluxsource/fluxsource.h", - "lib/globals.h": "./globals.h", - "lib/image.h": "./image.h", - "lib/imagereader/imagereader.h": "./imagereader/imagereader.h", - "lib/imagewriter/imagewriter.h": "./imagewriter/imagewriter.h", - "lib/layout.h": "./layout.h", - "lib/logger.h": "./logger.h", - "lib/proto.h": "./proto.h", - "lib/readerwriter.h": "./readerwriter.h", - "lib/sector.h": "./sector.h", - "lib/usb/usb.h": "./usb/usb.h", - "lib/usb/usbfinder.h": "./usb/usbfinder.h", - "lib/utils.h": "./utils.h", - "lib/vfs/sectorinterface.h": "./vfs/sectorinterface.h", - "lib/vfs/vfs.h": "./vfs/vfs.h", - }, - deps=[ - "+fl2_proto_lib", - ".+config_proto_lib", - "dep/libusbp", - "dep/adflib", - "dep/fatfs", - "dep/hfsutils", - ], -) proto(name="common_proto", srcs=["./common.proto"]) diff --git a/lib/vfs/amigaffs.cc b/lib/vfs/amigaffs.cc index ef18f203..d2e22791 100644 --- a/lib/vfs/amigaffs.cc +++ b/lib/vfs/amigaffs.cc @@ -7,7 +7,7 @@ #include "adflib.h" #include "adf_blk.h" -#include "dep/adflib/adf_nativ.h" +#include "adf_nativ.h" #undef min #include diff --git a/src/build.py b/src/build.py index 58742bec..ae33ae74 100644 --- a/src/build.py +++ b/src/build.py @@ -34,14 +34,13 @@ cxxprogram( "+protobuf_lib", "+protocol", "+z_lib", - "arch", "dep/adflib", "dep/agg", "dep/fatfs", "dep/hfsutils", "dep/libusbp", "dep/stb", - "lib", + "+lib", "lib+config_proto_lib", "src/formats", ], diff --git a/src/formats/build.py b/src/formats/build.py index ea2937a8..d5a54d0b 100644 --- a/src/formats/build.py +++ b/src/formats/build.py @@ -61,4 +61,4 @@ encoded = [ for name in formats ] -clibrary(name="formats", srcs=[".+table_cc"] + encoded) +clibrary(name="formats", srcs=[".+table_cc"] + encoded, deps=["+lib"]) diff --git a/src/gui/build.py b/src/gui/build.py index 011b8942..ba58f1d7 100644 --- a/src/gui/build.py +++ b/src/gui/build.py @@ -40,13 +40,12 @@ cxxprogram( deps=[ "+fl2_proto_lib", "+protocol", - "arch", "dep/adflib", "dep/fatfs", "dep/hfsutils", "dep/libusbp", "extras+icons", - "lib", + "+lib", "lib+config_proto_lib", "src/formats", "src/gui/drivetypes", diff --git a/tests/agg.cc b/tests/agg.cc index f6afe2ac..442bf4a0 100644 --- a/tests/agg.cc +++ b/tests/agg.cc @@ -1,7 +1,7 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/bytes.h" -#include "dep/agg/include/agg2d.h" -#include "dep/stb/stb_image_write.h" +#include "agg2d.h" +#include "stb_image_write.h" #include static void test_agg(void) diff --git a/tests/amiga.cc b/tests/amiga.cc index 1e5ea32e..4fa0c88f 100644 --- a/tests/amiga.cc +++ b/tests/amiga.cc @@ -1,6 +1,6 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/bytes.h" -#include "decoders/decoders.h" +#include "lib/decoders/decoders.h" #include "arch/amiga/amiga.h" #include diff --git a/tests/bitaccumulator.cc b/tests/bitaccumulator.cc index 694bf0b6..0321155a 100644 --- a/tests/bitaccumulator.cc +++ b/tests/bitaccumulator.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/bytes.h" #include diff --git a/tests/build.py b/tests/build.py index e39ebca7..8a704d04 100644 --- a/tests/build.py +++ b/tests/build.py @@ -1,5 +1,8 @@ -from build.c import clibrary +from build.ab import export +from build.c import cxxprogram from build.protobuf import proto, protocc +from build.utils import test +from scripts.build import protoencode proto( @@ -14,3 +17,87 @@ protocc( srcs=[".+test_proto"], deps=["lib+config_proto", "arch+arch_proto"], ) + +tests = [ + "agg", + "amiga", + "applesingle", + "bitaccumulator", + "bytes", + "compression", + "configs", + "cpmfs", + "csvreader", + "flags", + "fluxmapreader", + "fluxpattern", + "flx", + "fmmfm", + "greaseweazle", + "kryoflux", + "layout", + "ldbs", + "options", + "utils", + "vfs", +] + +export( + name="tests", + deps=[ + test( + name="proto_test", + command=cxxprogram( + name="proto_test_exe", + srcs=[ + "./proto.cc", + protoencode( + name="testproto_cc", + srcs=["./testproto.textpb"], + proto="TestProto", + symbol="testproto_pb", + ), + ], + deps=[ + "+fl2_proto_lib", + "+protocol", + ".+test_proto_lib", + "dep/adflib", + "dep/agg", + "dep/fatfs", + "dep/hfsutils", + "dep/libusbp", + "dep/snowhouse", + "dep/stb", + "+lib", + "lib+config_proto_lib", + "src/formats", + ], + ), + ), + ] + + [ + test( + name=f"{n}_test", + command=cxxprogram( + name=f"{n}_test_exe", + srcs=[f"./{n}.cc"], + deps=[ + "+fl2_proto_lib", + "+protocol", + "dep/adflib", + "dep/agg", + "dep/fatfs", + "dep/hfsutils", + "dep/libusbp", + "dep/snowhouse", + "dep/stb", + "+lib", + "lib+config_proto_lib", + "src/formats", + ], + ), + ) + for n in tests + ], +) diff --git a/tests/bytes.cc b/tests/bytes.cc index caf53f40..539e5b46 100644 --- a/tests/bytes.cc +++ b/tests/bytes.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/bytes.h" #include "snowhouse/snowhouse.h" diff --git a/tests/compression.cc b/tests/compression.cc index 2d97123b..102788a3 100644 --- a/tests/compression.cc +++ b/tests/compression.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/bytes.h" static void test_roundtrip() diff --git a/tests/cpmfs.cc b/tests/cpmfs.cc index dfe53dc9..84b9efb6 100644 --- a/tests/cpmfs.cc +++ b/tests/cpmfs.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/vfs/vfs.h" #include "lib/vfs/sectorinterface.h" #include "lib/vfs/vfs.pb.h" diff --git a/tests/csvreader.cc b/tests/csvreader.cc index fb97033a..57bc365d 100644 --- a/tests/csvreader.cc +++ b/tests/csvreader.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/csvreader.h" #include diff --git a/tests/flags.cc b/tests/flags.cc index 79e19735..89ed0989 100644 --- a/tests/flags.cc +++ b/tests/flags.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "flags.h" +#include "lib/globals.h" +#include "lib/flags.h" #include static void testDefaultIntValue() diff --git a/tests/fluxmapreader.cc b/tests/fluxmapreader.cc index be090e7c..996ab85b 100644 --- a/tests/fluxmapreader.cc +++ b/tests/fluxmapreader.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include "protocol.h" #include "fmt/format.h" #include "tests.h" diff --git a/tests/fluxpattern.cc b/tests/fluxpattern.cc index 013ede65..3dcdcb13 100644 --- a/tests/fluxpattern.cc +++ b/tests/fluxpattern.cc @@ -1,6 +1,6 @@ -#include "globals.h" -#include "fluxmap.h" -#include "decoders/fluxmapreader.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/decoders/fluxmapreader.h" #include typedef std::vector ivector; diff --git a/tests/flx.cc b/tests/flx.cc index 85b0f045..bc26e65d 100644 --- a/tests/flx.cc +++ b/tests/flx.cc @@ -1,7 +1,7 @@ #include #include #include -#include "globals.h" +#include "lib/globals.h" #include "lib/fluxmap.h" #include "lib/fluxsource/flx.h" diff --git a/tests/fmmfm.cc b/tests/fmmfm.cc index ed105e03..f5a4c29a 100644 --- a/tests/fmmfm.cc +++ b/tests/fmmfm.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "decoders/decoders.h" +#include "lib/globals.h" +#include "lib/decoders/decoders.h" #include static void testDecode(void) diff --git a/tests/greaseweazle.cc b/tests/greaseweazle.cc index 9a57832d..8ddbc8dd 100644 --- a/tests/greaseweazle.cc +++ b/tests/greaseweazle.cc @@ -1,8 +1,8 @@ #include #include #include -#include "globals.h" -#include "fluxmap.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" #include "lib/usb/greaseweazle.h" #define E28(val) \ diff --git a/tests/kryoflux.cc b/tests/kryoflux.cc index 8361a82d..175a5411 100644 --- a/tests/kryoflux.cc +++ b/tests/kryoflux.cc @@ -1,9 +1,9 @@ #include #include #include -#include "globals.h" -#include "fluxmap.h" -#include "fluxsource/kryoflux.h" +#include "lib/globals.h" +#include "lib/fluxmap.h" +#include "lib/fluxsource/kryoflux.h" static void test_convert(const Bytes& kryofluxbytes, const Bytes& fluxmapbytes) { diff --git a/tests/ldbs.cc b/tests/ldbs.cc index 3934e8fd..af97933b 100644 --- a/tests/ldbs.cc +++ b/tests/ldbs.cc @@ -1,9 +1,9 @@ #include #include #include -#include "globals.h" +#include "lib/globals.h" #include "lib/bytes.h" -#include "ldbs.h" +#include "lib/ldbs.h" static Bytes testdata{ // clang-format off diff --git a/tests/options.cc b/tests/options.cc index 75e91c19..12837966 100644 --- a/tests/options.cc +++ b/tests/options.cc @@ -1,8 +1,8 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/bytes.h" #include "tests/testproto.pb.h" #include "lib/config.pb.h" -#include "proto.h" +#include "lib/proto.h" #include "snowhouse/snowhouse.h" #include #include diff --git a/tests/proto.cc b/tests/proto.cc index a0f2d46b..1386f689 100644 --- a/tests/proto.cc +++ b/tests/proto.cc @@ -1,8 +1,8 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/bytes.h" #include "tests/testproto.pb.h" #include "lib/config.pb.h" -#include "proto.h" +#include "lib/proto.h" #include "snowhouse/snowhouse.h" #include #include diff --git a/tests/utils.cc b/tests/utils.cc index 5ff64b03..b98901de 100644 --- a/tests/utils.cc +++ b/tests/utils.cc @@ -1,5 +1,5 @@ -#include "globals.h" -#include "utils.h" +#include "lib/globals.h" +#include "lib/utils.h" #include "snowhouse/snowhouse.h" using namespace snowhouse; diff --git a/tests/vfs.cc b/tests/vfs.cc index 158c9524..523355ce 100644 --- a/tests/vfs.cc +++ b/tests/vfs.cc @@ -1,4 +1,4 @@ -#include "globals.h" +#include "lib/globals.h" #include "lib/vfs/vfs.h" #include "snowhouse/snowhouse.h" diff --git a/tools/build.py b/tools/build.py new file mode 100644 index 00000000..1faeee19 --- /dev/null +++ b/tools/build.py @@ -0,0 +1,27 @@ +from build.c import cxxprogram + +cxxprogram( + name="brother120tool", + srcs=["./brother120tool.cc"], + deps=["+lib", "lib+config_proto_lib"], +) + +cxxprogram( + name="brother240tool", + srcs=["./brother240tool.cc"], + deps=["+lib", "lib+config_proto_lib"], +) + +cxxprogram( + name="upgrade-flux-file", + srcs=["./upgrade-flux-file.cc"], + deps=[ + "+lib", + "src/formats", + "lib+config_proto_lib", + "+protocol", + "+fl2_proto_lib", + "+sqlite3_lib", + "dep/libusbp", + ], +) From c81dc166bc0a3b5891b617c844f90767132991ee Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 22 Oct 2023 23:03:44 +0200 Subject: [PATCH 07/49] Adjust dependencies. --- .github/workflows/ccpp.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index e5682830..d092b972 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -18,8 +18,9 @@ jobs: with: repository: 'davidgiven/fluxengine-testdata' path: 'fluxengine-testdata' - - name: apt - run: sudo apt update && sudo apt install libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-gtk3-dev libfmt-dev + - uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-gtk3-dev libfmt-dev libprotobuf-dev - name: make run: CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" make -j2 -C fluxengine From db420b34951048e792f707acc1a7e90a5da37f8a Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 22 Oct 2023 23:07:20 +0200 Subject: [PATCH 08/49] Adjust the way packages are detected. --- build/pkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/pkg.py b/build/pkg.py index 598a532e..c1c98f47 100644 --- a/build/pkg.py +++ b/build/pkg.py @@ -6,7 +6,7 @@ import subprocess emit( """ PKG_CONFIG ?= pkg-config -PACKAGES := $(shell $(PKG_CONFIG) --list-package-names) +PACKAGES := $(shell $(PKG_CONFIG) --list-all | cut -d' ' -f1) """ ) From 4a31046c9c3eea20ea7f7dfca5e18e14479770a7 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 22 Oct 2023 23:09:52 +0200 Subject: [PATCH 09/49] Adjust dependencies, again... --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index d092b972..b09e20f6 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -20,7 +20,7 @@ jobs: path: 'fluxengine-testdata' - uses: awalsh128/cache-apt-pkgs-action@latest with: - packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-gtk3-dev libfmt-dev libprotobuf-dev + packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.2-dev libfmt-dev libprotobuf-dev - name: make run: CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" make -j2 -C fluxengine From 87e978c8172f4d2879027e7e259215dc936a808e Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 22 Oct 2023 23:10:52 +0200 Subject: [PATCH 10/49] And again. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index b09e20f6..a6038cdb 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -20,7 +20,7 @@ jobs: path: 'fluxengine-testdata' - uses: awalsh128/cache-apt-pkgs-action@latest with: - packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.2-dev libfmt-dev libprotobuf-dev + packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-dev libfmt-dev libprotobuf-dev - name: make run: CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" make -j2 -C fluxengine From 8fb786094f66aca898437c130b98e3a0f33457a7 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 23 Oct 2023 00:00:29 +0200 Subject: [PATCH 11/49] Something's wrong with Ubuntu's wx-config setup. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index a6038cdb..93c7e37e 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -20,7 +20,7 @@ jobs: path: 'fluxengine-testdata' - uses: awalsh128/cache-apt-pkgs-action@latest with: - packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-dev libfmt-dev libprotobuf-dev + packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-gtk3-dev libfmt-dev libprotobuf-dev wx-common - name: make run: CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" make -j2 -C fluxengine From 6a00653d1e78bb432e687f8f11d66a32edc90306 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 23 Oct 2023 01:03:28 +0200 Subject: [PATCH 12/49] Don't use xxd to objectify files. --- build/_objectify.py | 19 +++++++++++++++++++ build/utils.py | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 build/_objectify.py diff --git a/build/_objectify.py b/build/_objectify.py new file mode 100644 index 00000000..17148954 --- /dev/null +++ b/build/_objectify.py @@ -0,0 +1,19 @@ +import sys +from functools import partial + +if len(sys.argv) != 3: + sys.exit("Usage: %s " % sys.argv[0]) +filename = sys.argv[1] +symbol = sys.argv[2] + +print("const uint8_t " + symbol + "[] = {") +n = 0 +with open(filename, "rb") as in_file: + for c in iter(partial(in_file.read, 1), b""): + print("0x%02X," % ord(c), end="") + n += 1 + if n % 16 == 0: + print() +print("};") + +print("const size_t " + symbol + "_len = sizeof(" + symbol + ");") diff --git a/build/utils.py b/build/utils.py index 5f8a50ec..cd51676b 100644 --- a/build/utils.py +++ b/build/utils.py @@ -6,9 +6,9 @@ from os.path import basename def objectify(self, name, src: Target, symbol): normalrule( replaces=self, - ins=[src], + ins=["build/_objectify.py", src], outs=[basename(filenameof(src)) + ".h"], - commands=["xxd -i -n " + symbol + " {ins} > {outs}"], + commands=["$(PYTHON) {ins[0]} {ins[1]} " + symbol + " > {outs}"], label="OBJECTIFY", ) From dabdfec3e7f7fbdb5089bfb0ac7d83bf8e360799 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 23 Oct 2023 01:11:15 +0200 Subject: [PATCH 13/49] Try more setup. --- .github/workflows/ccpp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 93c7e37e..8e21333b 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -21,6 +21,9 @@ jobs: - uses: awalsh128/cache-apt-pkgs-action@latest with: packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-gtk3-dev libfmt-dev libprotobuf-dev wx-common + - name: setup + run: | + sudo update-alternatives --auto wx-config - name: make run: CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" make -j2 -C fluxengine From 9d8e3b21ba9008c2442912af6b59053c69e55675 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 23 Oct 2023 01:12:50 +0200 Subject: [PATCH 14/49] I think something's wrong with the apt installer. --- .github/workflows/ccpp.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 8e21333b..7ebc2b31 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -18,12 +18,9 @@ jobs: with: repository: 'davidgiven/fluxengine-testdata' path: 'fluxengine-testdata' - - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-gtk3-dev libfmt-dev libprotobuf-dev wx-common - - name: setup + - name: apt run: | - sudo update-alternatives --auto wx-config + sudo apt install libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-gtk3-dev libfmt-dev libprotobuf-dev wx-common - name: make run: CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" make -j2 -C fluxengine From d769f9070454d4850166256662a9b702bcf4ce38 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 23 Oct 2023 01:18:33 +0200 Subject: [PATCH 15/49] Increase processor count. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 7ebc2b31..13ff16d8 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -22,7 +22,7 @@ jobs: run: | sudo apt install libudev-dev libsqlite3-dev protobuf-compiler libwxgtk3.0-gtk3-dev libfmt-dev libprotobuf-dev wx-common - name: make - run: CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" make -j2 -C fluxengine + run: CXXFLAGS="-Wp,-D_GLIBCXX_ASSERTIONS" make -j`nproc` -C fluxengine build-macos-current: runs-on: macos-latest From 6a6cd025c0f205e9f26c9849a79d3a9006474ab0 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 24 Oct 2023 00:27:04 +0200 Subject: [PATCH 16/49] Install Python on Windows. --- .github/workflows/ccpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 13ff16d8..1bbe22ea 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -68,6 +68,7 @@ jobs: mingw-w64-i686-wxWidgets mingw-w64-i686-zlib mingw-w64-i686-nsis + python zip vim - name: update-protobuf From 44fc532d634130009201b49d1409b0625f14b014 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 24 Oct 2023 00:49:05 +0200 Subject: [PATCH 17/49] Build the documentation. --- Makefile | 7 ++++++- build.py | 2 +- build/ab.mk | 4 ++++ scripts/build.py | 13 +++++++++++++ src/formats/build.py | 16 +++++++++++++++- 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2affa6a7..ea328b46 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,11 @@ CFLAGS = -g -Os OBJ = .obj .PHONY: all -all: +all +all: +all README.md +README.md: $(OBJ)/scripts+mkdocindex/scripts+mkdocindex + @echo MKDOC $@ + @csplit -s -f$(OBJ)/README. README.md '//' '%%' + @(cat $(OBJ)/README.00 && $< && cat $(OBJ)/README.01) > README.md + include build/ab.mk diff --git a/build.py b/build.py index f6a80510..c6092b1f 100644 --- a/build.py +++ b/build.py @@ -224,5 +224,5 @@ export( "brother240tool": "tools+brother240tool", "upgrade-flux-file": "tools+upgrade-flux-file", }, - deps=["tests"], + deps=["tests", "src/formats+docs", "scripts+mkdocindex"], ) diff --git a/build/ab.mk b/build/ab.mk index 7a38ee16..e59e2dcd 100644 --- a/build/ab.mk +++ b/build/ab.mk @@ -1,3 +1,7 @@ +ifeq ($(findstring 4.,$(MAKE_VERSION)),) +$(error You need GNU Make 4.x for this (if you're on OSX, use gmake).) +endif + OBJ ?= .obj PYTHON ?= python3 CC ?= gcc diff --git a/scripts/build.py b/scripts/build.py index 893bab7a..ec053834 100644 --- a/scripts/build.py +++ b/scripts/build.py @@ -31,3 +31,16 @@ def protoencode(self, name, srcs: Targets, proto, symbol): commands=["{deps[0]} {ins} {outs} " + symbol], label="PROTOENCODE", ) + + +cxxprogram( + name="mkdoc", + srcs=["./mkdoc.cc"], + deps=["src/formats", "lib+config_proto_lib", "+lib"], +) + +cxxprogram( + name="mkdocindex", + srcs=["./mkdocindex.cc"], + deps=["src/formats", "lib+config_proto_lib", "+lib"], +) diff --git a/src/formats/build.py b/src/formats/build.py index d5a54d0b..04888fa4 100644 --- a/src/formats/build.py +++ b/src/formats/build.py @@ -1,4 +1,4 @@ -from build.ab import normalrule +from build.ab import normalrule, export from build.c import clibrary from scripts.build import protoencode @@ -62,3 +62,17 @@ encoded = [ ] clibrary(name="formats", srcs=[".+table_cc"] + encoded, deps=["+lib"]) + +export( + name="docs", + items={ + f"doc/disk-{f}.md": normalrule( + name=f"{f}_doc", + ins=["scripts+mkdoc"], + outs=[f"disk-{f}.md"], + commands=["{ins[0]} " + f + " > {outs[0]}"], + label="MKDOC", + ) + for f in formats + }, +) From ca6b90f8c10fdf7a28e0c28c2f09daf66705a342 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 24 Oct 2023 22:00:09 +0200 Subject: [PATCH 18/49] Split C and C++ libraries, so that you can use C++ compiler flags. Build with C++17. --- Makefile | 2 +- arch/build.py | 2 +- build/c.py | 49 ++++++++++++++++++++++++++++--------- build/protobuf.py | 4 +-- dep/agg/build.py | 4 +-- dep/snowhouse/build.py | 4 +-- lib/build.py | 2 +- src/formats/build.py | 8 ++++-- src/gui/drivetypes/build.py | 4 +-- 9 files changed, 54 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index ea328b46..64fd02ea 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC = gcc -CXX = g++ +CXX = g++ -std=c++17 CFLAGS = -g -Os OBJ = .obj diff --git a/arch/build.py b/arch/build.py index 6fbd27e0..5e901433 100644 --- a/arch/build.py +++ b/arch/build.py @@ -1,4 +1,4 @@ -from build.c import clibrary +from build.c import cxxlibrary from build.protobuf import proto, protocc proto( diff --git a/build/c.py b/build/c.py index 57e4eb4a..6f23d435 100644 --- a/build/c.py +++ b/build/c.py @@ -11,6 +11,7 @@ from build.ab import ( stripext, ) from os.path import * +from types import SimpleNamespace def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, cflags): @@ -81,17 +82,7 @@ def findsources(name, srcs, deps, cflags, filerule): return objs -@Rule -def clibrary( - self, - name, - srcs: Targets = [], - deps: Targets = [], - hdrs: TargetsMap = {}, - cflags=[], - commands=["$(AR) cqs {outs[0]} {ins}"], - label="LIB", -): +def libraryimpl(self, name, srcs, deps, hdrs, cflags, commands, label, kind): if not srcs and not hdrs: raise ABException( "clibrary contains no sources and no exported headers" @@ -124,6 +115,8 @@ def clibrary( hdrouts += [dest] i = i + 1 + if not hasattr(self, "clibrary"): + self.clibrary = SimpleNamespace() if srcs: hr = None if hdrcs: @@ -141,7 +134,7 @@ def clibrary( srcs, deps + ([f"{name}_hdrs"] if hr else []), cflags + ([f"-I{hr.normalrule.objdir}"] if hr else []), - cfile, + kind, ) normalrule( @@ -168,6 +161,38 @@ def clibrary( self.clibrary.cflags = ["-I" + r.normalrule.objdir] +@Rule +def clibrary( + self, + name, + srcs: Targets = [], + deps: Targets = [], + hdrs: TargetsMap = {}, + cflags=[], + commands=["$(AR) cqs {outs[0]} {ins}"], + label="LIB", +): + return libraryimpl( + self, name, srcs, deps, hdrs, cflags, commands, label, cfile + ) + + +@Rule +def cxxlibrary( + self, + name, + srcs: Targets = [], + deps: Targets = [], + hdrs: TargetsMap = {}, + cflags=[], + commands=["$(AR) cqs {outs[0]} {ins}"], + label="LIB", +): + return libraryimpl( + self, name, srcs, deps, hdrs, cflags, commands, label, cxxfile + ) + + def programimpl( self, name, srcs, deps, cflags, ldflags, commands, label, filerule, kind ): diff --git a/build/protobuf.py b/build/protobuf.py index ce8fd3d0..8dc7337b 100644 --- a/build/protobuf.py +++ b/build/protobuf.py @@ -1,6 +1,6 @@ from os.path import join from build.ab import Rule, Targets, emit, normalrule, filenamesof, flatten -from build.c import clibrary +from build.c import cxxlibrary import build.pkg from types import SimpleNamespace @@ -57,7 +57,7 @@ def protocc(self, name, srcs: Targets = [], deps: Targets = []): f: join(r.normalrule.objdir, f) for f in outs if f.endswith(".pb.h") } - clibrary( + cxxlibrary( replaces=self, srcs=[f"{name}_srcs"], hdrs=headers, diff --git a/dep/agg/build.py b/dep/agg/build.py index b0818ce6..67387558 100644 --- a/dep/agg/build.py +++ b/dep/agg/build.py @@ -1,6 +1,6 @@ -from build.c import clibrary +from build.c import cxxlibrary -clibrary( +cxxlibrary( name="agg", srcs=[ "./src/agg_arrowhead.cpp", diff --git a/dep/snowhouse/build.py b/dep/snowhouse/build.py index 87ddd6ec..bc36f53d 100644 --- a/dep/snowhouse/build.py +++ b/dep/snowhouse/build.py @@ -1,6 +1,6 @@ -from build.c import clibrary +from build.c import cxxlibrary -clibrary( +cxxlibrary( name="snowhouse", hdrs={ "snowhouse/snowhouse.h": "./include/snowhouse/snowhouse.h", diff --git a/lib/build.py b/lib/build.py index 9f4ff979..6aa2a7df 100644 --- a/lib/build.py +++ b/lib/build.py @@ -1,4 +1,4 @@ -from build.c import clibrary +from build.c import cxxlibrary from build.protobuf import proto, protocc diff --git a/src/formats/build.py b/src/formats/build.py index 04888fa4..7f7dba4e 100644 --- a/src/formats/build.py +++ b/src/formats/build.py @@ -1,5 +1,5 @@ from build.ab import normalrule, export -from build.c import clibrary +from build.c import cxxlibrary from scripts.build import protoencode formats = [ @@ -61,7 +61,11 @@ encoded = [ for name in formats ] -clibrary(name="formats", srcs=[".+table_cc"] + encoded, deps=["+lib"]) +cxxlibrary( + name="formats", + srcs=[".+table_cc"] + encoded, + deps=["+lib", "lib+config_proto_lib"], +) export( name="docs", diff --git a/src/gui/drivetypes/build.py b/src/gui/drivetypes/build.py index 9ad17710..4a69fdbd 100644 --- a/src/gui/drivetypes/build.py +++ b/src/gui/drivetypes/build.py @@ -1,5 +1,5 @@ from build.ab import normalrule -from build.c import clibrary +from build.c import cxxlibrary from scripts.build import protoencode drivetypes = [ @@ -37,4 +37,4 @@ encoded = [ for name in drivetypes ] -clibrary(name="drivetypes", srcs=[".+drivetypes_cc"] + encoded) +cxxlibrary(name="drivetypes", srcs=[".+drivetypes_cc"] + encoded) From 1a519bf8371c37c5b6e5c5d52a87655c4eda7482 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 25 Oct 2023 00:49:39 +0200 Subject: [PATCH 19/49] Attempt to make build on OSX. --- Makefile | 9 +++++++++ build.py | 4 ++-- build/ab.py | 7 ++----- build/c.py | 37 ++++++++++++------------------------- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 64fd02ea..f4fbb998 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,18 @@ CC = gcc CXX = g++ -std=c++17 CFLAGS = -g -Os +LDFLAGS = OBJ = .obj +# Special OSX settings. + +ifeq ($(shell uname),Darwin) + LDFLAGS += \ + -framework IOKit \ + -framework Foundation +endif + .PHONY: all all: +all README.md diff --git a/build.py b/build.py index c6092b1f..506b1b34 100644 --- a/build.py +++ b/build.py @@ -1,5 +1,5 @@ from build.ab import export -from build.c import clibrary +from build.c import clibrary, cxxlibrary from build.protobuf import proto, protocc from build.pkg import package @@ -13,7 +13,7 @@ clibrary(name="protocol", hdrs={"protocol.h": "./protocol.h"}) proto(name="fl2_proto", srcs=["lib/fl2.proto"]) protocc(name="fl2_proto_lib", srcs=["+fl2_proto"]) -clibrary( +cxxlibrary( name="lib", srcs=[ "./lib/bitmap.cc", diff --git a/build/ab.py b/build/ab.py index 40572ab7..b5dfdf2a 100644 --- a/build/ab.py +++ b/build/ab.py @@ -274,12 +274,9 @@ def filenamesof(*xs): for t in flatten(xs): if type(t) == str: t = normpath(t) - if t not in s: - s += [t] + s += [t] else: - for f in [normpath(f) for f in filenamesof(t.outs)]: - if f not in s: - s += [f] + s += [f for f in [normpath(f) for f in filenamesof(t.outs)]] return s diff --git a/build/c.py b/build/c.py index 6f23d435..0b1ac12f 100644 --- a/build/c.py +++ b/build/c.py @@ -61,24 +61,17 @@ def cxxfile( def findsources(name, srcs, deps, cflags, filerule): objs = [] for s in flatten(srcs): - ff = [ - f + objs += [ + filerule( + name=join(name, f.removeprefix("$(OBJ)/")), + srcs=[f], + deps=deps, + cflags=cflags, + ) for f in filenamesof(s) if f.endswith(".c") or f.endswith(".cc") or f.endswith(".cpp") ] - if ff: - for f in ff: - objs += [ - filerule( - name=join(name, f.removeprefix("$(OBJ)/")), - srcs=[f], - deps=deps, - cflags=cflags, - ) - ] - else: - if s not in objs: - objs += [s] + return objs @@ -205,12 +198,10 @@ def programimpl( deps += [f for f in filenamesof(srcs) if f.endswith(".h")] + ars = [f for f in filenamesof(libraries) if f.endswith(".a")] normalrule( replaces=self, - ins=( - findsources(name, srcs, deps, cflags, filerule) - + [f for f in filenamesof(libraries) if f.endswith(".a")] - ), + ins=(findsources(name, srcs, deps, cflags, filerule) + ars + ars), outs=[basename(name)], deps=deps, label=label, @@ -227,9 +218,7 @@ def cprogram( deps: Targets = [], cflags=[], ldflags=[], - commands=[ - "$(CC) -o {outs[0]} -Wl,--start-group {ins} -Wl,--end-group {ldflags}" - ], + commands=["$(CC) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"], label="CLINK", ): programimpl( @@ -254,9 +243,7 @@ def cxxprogram( deps: Targets = [], cflags=[], ldflags=[], - commands=[ - "$(CXX) -o {outs[0]} -Wl,--start-group {ins} -Wl,--end-group {ldflags}" - ], + commands=["$(CXX) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"], label="CXXLINK", ): programimpl( From 9143f477b28a8cd6e0aba0e461fa2060ec51443e Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 25 Oct 2023 00:56:45 +0200 Subject: [PATCH 20/49] Build OSX with all CPUs. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 1bbe22ea..5dc75bff 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -38,7 +38,7 @@ jobs: - name: brew run: brew install sqlite pkg-config libusb protobuf wxwidgets fmt make coreutils dylibbundler libjpeg - name: make - run: gmake -j2 -C fluxengine + run: gmake -j`nproc` -C fluxengine - name: Upload build artifacts uses: actions/upload-artifact@v2 From 92d44f6ae3c0dfdf1d38bbd471808990a28e53fd Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 25 Oct 2023 22:15:09 +0200 Subject: [PATCH 21/49] Add missing file. --- doc/disk-ms2000.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 doc/disk-ms2000.md diff --git a/doc/disk-ms2000.md b/doc/disk-ms2000.md new file mode 100644 index 00000000..71f144e9 --- /dev/null +++ b/doc/disk-ms2000.md @@ -0,0 +1,33 @@ +ms2000 +==== +## MS2000 Microdisk Development System + + +The RCA MicroDisk Development System MS2000 is a highly obscure (i.e. I gather +that single digit numbers of original machines exist) development system for the +RCA1802 series of CPUs, as made famous by the Cosmac ELF. It was a fairly +straightforward big bag o'RAM system with a 2kB boot ROM, 62kB of RAM, twin +floppy drives and a serial terminal --- CP/M users will find it very familiar. + +Read and writing disks is currently not supported by FluxEngine, but there is +basic support for the MicroDisk operating system's file system. This should +allow files to be read from MS2000 disk images. + +The disks are normal DD 3.5" disks, using a 70-track, single sided variation of +the venerable IBM floppy disk scheme, so allowing 315kB of storage per disk. + +If you have access to flux files for MS2000 disks, please [get in +touch](https://github.com/davidgiven/cpm65/issues/new) --- I would like to add +better support for these. + +## Options + +(no options) + +## Examples + +## References + + - [The EMMA-02 emulator](https://www.emma02.hobby-site.com/ms2000.html), which + supports the MS2000 and provides information on it. + From c7f22c0dab0d338c97e67f1ee46a165700f40289 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 25 Oct 2023 22:15:32 +0200 Subject: [PATCH 22/49] Build the GUI on OSX. --- Makefile | 3 ++- build.py | 6 +++++- build/ab.mk | 2 +- build/ab.py | 2 ++ extras/build.py | 20 ++++++++++++++++++++ src/gui/build.py | 42 +++++++++++++++++++++++++++++++++++++++++- 6 files changed, 71 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f4fbb998..877b02f6 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,8 @@ OBJ = .obj ifeq ($(shell uname),Darwin) LDFLAGS += \ -framework IOKit \ - -framework Foundation + -framework Foundation \ + -Wl,-no_warn_duplicate_libraries endif .PHONY: all diff --git a/build.py b/build.py index 506b1b34..0d7a8d44 100644 --- a/build.py +++ b/build.py @@ -2,6 +2,7 @@ from build.ab import export from build.c import clibrary, cxxlibrary from build.protobuf import proto, protocc from build.pkg import package +import config package(name="protobuf_lib", package="protobuf") package(name="z_lib", package="zlib") @@ -223,6 +224,9 @@ export( "brother120tool": "tools+brother120tool", "brother240tool": "tools+brother240tool", "upgrade-flux-file": "tools+upgrade-flux-file", - }, + } + | {"FluxEngine.pkg": "src/gui+fluxengine_pkg"} + if config.osx + else {}, deps=["tests", "src/formats+docs", "scripts+mkdocindex"], ) diff --git a/build/ab.mk b/build/ab.mk index e59e2dcd..28e77fe4 100644 --- a/build/ab.mk +++ b/build/ab.mk @@ -24,7 +24,7 @@ update-ab: .PHONY: clean clean:: - @echo [-/-] CLEAN + @echo CLEAN $(hide) rm -rf $(OBJ) bin export PYTHONHASHSEED = 1 diff --git a/build/ab.py b/build/ab.py index b5dfdf2a..27654568 100644 --- a/build/ab.py +++ b/build/ab.py @@ -247,6 +247,8 @@ def targetof(s, cwd): s = cwd + s[1:] elif s.startswith("./"): s = normpath(join(cwd, s)) + elif s.endswith("/"): + return fileinvocation(s) elif s.startswith("$"): return fileinvocation(s) diff --git a/extras/build.py b/extras/build.py index 14c3045e..69f76583 100644 --- a/extras/build.py +++ b/extras/build.py @@ -1,3 +1,4 @@ +from build.ab import normalrule, simplerule from build.utils import objectify from build.c import clibrary @@ -12,3 +13,22 @@ clibrary( for n in icons }, ) + +normalrule( + name="fluxengine_iconset", + ins=["./icon.png"], + outs=["fluxengine.iconset"], + commands=[ + "mkdir -p {outs[0]}", + "sips -z 64 64 {ins[0]} --out {outs[0]}/icon_32x32@2x.png > /dev/null", + ], + label="ICONSET", +) + +normalrule( + name="fluxengine_icns", + ins=[".+fluxengine_iconset"], + outs=["fluxengine.icns"], + commands=["iconutil -c icns -o {outs[0]} {ins[0]}"], + label="ICONUTIL", +) diff --git a/src/gui/build.py b/src/gui/build.py index ba58f1d7..31edbccf 100644 --- a/src/gui/build.py +++ b/src/gui/build.py @@ -1,5 +1,6 @@ -from build.ab import emit +from build.ab import emit, normalrule from build.c import cxxprogram +import config emit( """ @@ -54,3 +55,42 @@ cxxprogram( "+protobuf_lib", ], ) + +if config.osx: + normalrule( + name="fluxengine_pkg", + ins=[".+fluxengine_app"], + outs=["FluxEngine.pkg"], + commands=[ + "pkgbuild --quiet --install-location /Applications --component {ins[0]} {outs[0]}" + ], + label="PKGBUILD", + ) + + normalrule( + name="fluxengine_app", + ins=[ + ".+gui", + "extras+fluxengine_icns", + "extras/FluxEngine.app.template/", + ], + outs=["FluxEngine.app"], + commands=[ + "rm -rf {outs[0]}", + "cp -a {ins[2]} {outs[0]}", + "touch {outs[0]}", + "cp {ins[0]} {outs[0]}/Contents/MacOS/fluxengine-gui", + "mkdir -p {outs[0]}/Contents/Resources", + "cp {ins[1]} {outs[0]}/Contents/Resources/FluxEngine.icns", + "dylibbundler -of -x {outs[0]}/Contents/MacOS/fluxengine-gui -b -d {outs[0]}/Contents/libs -cd > /dev/null", + "cp $$(brew --prefix wxwidgets)/README.md $@/Contents/libs/wxWidgets.md", + "cp $$(brew --prefix protobuf)/LICENSE $@/Contents/libs/protobuf.txt", + "cp $$(brew --prefix fmt)/LICENSE.rst $@/Contents/libs/fmt.rst", + "cp $$(brew --prefix libpng)/LICENSE $@/Contents/libs/libpng.txt", + "cp $$(brew --prefix libjpeg)/README $@/Contents/libs/libjpeg.txt", + "cp $$(brew --prefix abseil)/LICENSE $@/Contents/libs/abseil.txt", + "cp $$(brew --prefix libtiff)/LICENSE.md $@/Contents/libs/libtiff.txt", + "cp $$(brew --prefix zstd)/LICENSE $@/Contents/libs/zstd.txt", + ], + label="MKAPP", + ) From 26bd467f7953fea1f21df8e8e275e5e188796778 Mon Sep 17 00:00:00 2001 From: dg Date: Wed, 25 Oct 2023 21:55:40 +0000 Subject: [PATCH 23/49] Make the Windows binaries build. --- Makefile | 20 ++++++++++++++++++++ build/ab.mk | 5 +++++ build/c.py | 11 ++++++----- dep/emu/build.py | 9 +++++++++ dep/libusbp/build.py | 6 +++++- 5 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 dep/emu/build.py diff --git a/Makefile b/Makefile index 877b02f6..e4be9230 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,26 @@ LDFLAGS = OBJ = .obj +# Special Windows settings. + +ifeq ($(OS), Windows_NT) + MINGWBIN = /mingw32/bin + CCPREFIX = $(MINGWBIN)/ + PKG_CONFIG = $(MINGWBIN)/pkg-config + WX_CONFIG = /usr/bin/sh $(MINGWBIN)/wx-config --static=yes + PROTOC = $(MINGWBIN)/protoc + LDFLAGS += \ + -static + CXXFLAGS += \ + -fext-numeric-literals \ + -Wno-deprecated-enum-float-conversion \ + -Wno-deprecated-enum-enum-conversion + + # Required to get the gcc run - time libraries on the path. + export PATH := $(PATH):$(MINGWBIN) + EXT ?= .exe +endif + # Special OSX settings. ifeq ($(shell uname),Darwin) diff --git a/build/ab.mk b/build/ab.mk index 28e77fe4..7614259f 100644 --- a/build/ab.mk +++ b/build/ab.mk @@ -13,6 +13,11 @@ hide = @ PKG_CONFIG ?= pkg-config ECHO ?= echo +ifeq ($(OS), Windows_NT) + EXT ?= .exe +endif +EXT ?= + include $(OBJ)/build.mk .PHONY: update-ab diff --git a/build/c.py b/build/c.py index 0b1ac12f..b94e73c6 100644 --- a/build/c.py +++ b/build/c.py @@ -75,13 +75,12 @@ def findsources(name, srcs, deps, cflags, filerule): return objs -def libraryimpl(self, name, srcs, deps, hdrs, cflags, commands, label, kind): +def libraryimpl(self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, kind): if not srcs and not hdrs: raise ABException( "clibrary contains no sources and no exported headers" ) - ldflags = [] libraries = [d for d in deps if hasattr(d, "clibrary")] for library in libraries: if library.clibrary.cflags: @@ -162,11 +161,12 @@ def clibrary( deps: Targets = [], hdrs: TargetsMap = {}, cflags=[], + ldflags=[], commands=["$(AR) cqs {outs[0]} {ins}"], label="LIB", ): return libraryimpl( - self, name, srcs, deps, hdrs, cflags, commands, label, cfile + self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, cfile ) @@ -178,11 +178,12 @@ def cxxlibrary( deps: Targets = [], hdrs: TargetsMap = {}, cflags=[], + ldflags=[], commands=["$(AR) cqs {outs[0]} {ins}"], label="LIB", ): return libraryimpl( - self, name, srcs, deps, hdrs, cflags, commands, label, cxxfile + self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, cxxfile ) @@ -202,7 +203,7 @@ def programimpl( normalrule( replaces=self, ins=(findsources(name, srcs, deps, cflags, filerule) + ars + ars), - outs=[basename(name)], + outs=[basename(name)+"$(EXT)"], deps=deps, label=label, commands=commands, diff --git a/dep/emu/build.py b/dep/emu/build.py new file mode 100644 index 00000000..9531b053 --- /dev/null +++ b/dep/emu/build.py @@ -0,0 +1,9 @@ +from build.c import clibrary + +clibrary( + name="emu", + srcs=["./fnmatch.c"], + hdrs={ + "fnmatch.h": "./fnmatch.h" + } +) \ No newline at end of file diff --git a/dep/libusbp/build.py b/dep/libusbp/build.py index 5305c8f0..b6cb4910 100644 --- a/dep/libusbp/build.py +++ b/dep/libusbp/build.py @@ -1,3 +1,4 @@ +from build.ab import emit from build.c import clibrary from build.pkg import package from config import windows, osx, unix @@ -15,6 +16,7 @@ srcs = [ "./include/libusbp.h", ] deps = [] +ldflags = [] if windows: srcs += [ @@ -28,6 +30,7 @@ if windows: "./src/windows/list_windows.c", "./src/windows/serial_port_windows.c", ] + ldflags += ["-lsetupapi", "-lwinusb", "-lole32", "-luuid"] elif osx: srcs += [ "./src/mac/async_in_transfer_mac.c", @@ -57,7 +60,8 @@ else: clibrary( name="libusbp", srcs=srcs, - cflags=["-Idep/libusbp/include", "-Idep/libusbp/src"], + cflags =["-Idep/libusbp/include", "-Idep/libusbp/src"], + ldflags=ldflags, deps=deps, hdrs={ "libusbp_internal.h": "./src/libusbp_internal.h", From fd884027c02cab04aaec53d442949e5ece4eff9b Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 26 Oct 2023 01:28:58 +0200 Subject: [PATCH 24/49] Try using the mingw python. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 5dc75bff..071888d0 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -68,7 +68,7 @@ jobs: mingw-w64-i686-wxWidgets mingw-w64-i686-zlib mingw-w64-i686-nsis - python + mingw-w64-python zip vim - name: update-protobuf From 8fd98d674a1790d16ebe0bffff4c4f7c9eaaf6e1 Mon Sep 17 00:00:00 2001 From: dg Date: Thu, 26 Oct 2023 18:26:10 +0000 Subject: [PATCH 25/49] Additional windows fixes. --- .github/workflows/ccpp.yml | 2 +- README.md | 78 +++++++++++++++++++------------------- build.py | 14 +++---- src/formats/build.py | 2 +- tests/build.py | 1 + tools/build.py | 9 ++++- 6 files changed, 56 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 071888d0..5f7ef369 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -68,7 +68,7 @@ jobs: mingw-w64-i686-wxWidgets mingw-w64-i686-zlib mingw-w64-i686-nsis - mingw-w64-python + mingw-w64-i686-python zip vim - name: update-protobuf diff --git a/README.md b/README.md index dd2cc632..8f2f3320 100644 --- a/README.md +++ b/README.md @@ -103,45 +103,45 @@ particular filesystem and can read (and sometimes write, support varies) files directly from disks, flux files or disk images. Some formats have multiple choices because they can store multiple types of file system. - - - -| Profile | Format | Read? | Write? | Filesystem? | -|:--------|:-------|:-----:|:------:|:------------| -| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | | -| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS | -| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | | -| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | | -| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS | -| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS | -| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS | -| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | | -| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | | -| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS | -| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS | -| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS | -| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS | -| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | | -| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | | -| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | -| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | -| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | -| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | -| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | -| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | -| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | | -| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | | -| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | | -| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE | -| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND | -| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | | -| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 | -| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | | -| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS | -| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | | -| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS | -{: .datatable } - + + + +| Profile | Format | Read? | Write? | Filesystem? | +|:--------|:-------|:-----:|:------:|:------------| +| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | | +| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS | +| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | | +| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | | +| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS | +| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS | +| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS | +| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | | +| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | | +| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS | +| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS | +| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS | +| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS | +| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | | +| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | | +| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | +| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | +| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | +| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | +| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | +| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | +| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | | +| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | | +| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | | +| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE | +| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND | +| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | | +| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 | +| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | | +| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS | +| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | | +| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS | +{: .datatable } + ### Notes diff --git a/build.py b/build.py index 0d7a8d44..dfbdb107 100644 --- a/build.py +++ b/build.py @@ -219,14 +219,14 @@ cxxlibrary( export( name="all", items={ - "fluxengine": "src+fluxengine", - "fluxengine-gui": "src/gui", - "brother120tool": "tools+brother120tool", - "brother240tool": "tools+brother240tool", - "upgrade-flux-file": "tools+upgrade-flux-file", + "fluxengine$(EXT)": "src+fluxengine", + "fluxengine-gui$(EXT)": "src/gui", + "brother120tool$(EXT)": "tools+brother120tool", + "brother240tool$(EXT)": "tools+brother240tool", + "upgrade-flux-file$(EXT)": "tools+upgrade-flux-file", } - | {"FluxEngine.pkg": "src/gui+fluxengine_pkg"} + | ({"FluxEngine.pkg": "src/gui+fluxengine_pkg"} if config.osx - else {}, + else {}), deps=["tests", "src/formats+docs", "scripts+mkdocindex"], ) diff --git a/src/formats/build.py b/src/formats/build.py index 7f7dba4e..7331080c 100644 --- a/src/formats/build.py +++ b/src/formats/build.py @@ -74,7 +74,7 @@ export( name=f"{f}_doc", ins=["scripts+mkdoc"], outs=[f"disk-{f}.md"], - commands=["{ins[0]} " + f + " > {outs[0]}"], + commands=["{ins[0]} " + f + " | tr -d '\\r' > {outs[0]}"], label="MKDOC", ) for f in formats diff --git a/tests/build.py b/tests/build.py index 8a704d04..ef3f9625 100644 --- a/tests/build.py +++ b/tests/build.py @@ -61,6 +61,7 @@ export( deps=[ "+fl2_proto_lib", "+protocol", + "+z_lib", ".+test_proto_lib", "dep/adflib", "dep/agg", diff --git a/tools/build.py b/tools/build.py index 1faeee19..5d2895f5 100644 --- a/tools/build.py +++ b/tools/build.py @@ -1,15 +1,20 @@ from build.c import cxxprogram +import config + +emu = [] +if config.windows: + emu = ["dep/emu"] cxxprogram( name="brother120tool", srcs=["./brother120tool.cc"], - deps=["+lib", "lib+config_proto_lib"], + deps=["+lib", "lib+config_proto_lib"] + emu, ) cxxprogram( name="brother240tool", srcs=["./brother240tool.cc"], - deps=["+lib", "lib+config_proto_lib"], + deps=["+lib", "lib+config_proto_lib"] + emu, ) cxxprogram( From e1cf927bf3ce11ee1af56eda89095a74b7090338 Mon Sep 17 00:00:00 2001 From: dg Date: Thu, 26 Oct 2023 18:35:21 +0000 Subject: [PATCH 26/49] Typo fix. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e4be9230..065fe8a7 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ endif .PHONY: all all: +all README.md -README.md: $(OBJ)/scripts+mkdocindex/scripts+mkdocindex +README.md: $(OBJ)/scripts+mkdocindex/scripts+mkdocindex$(EXT) @echo MKDOC $@ @csplit -s -f$(OBJ)/README. README.md '//' '%%' @(cat $(OBJ)/README.00 && $< && cat $(OBJ)/README.01) > README.md From a2a5c7eff03b451e83a61a578bda33110b59901c Mon Sep 17 00:00:00 2001 From: dg Date: Thu, 26 Oct 2023 19:07:43 +0000 Subject: [PATCH 27/49] Build Windows with all CPUs. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 5f7ef369..e7261d79 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -83,7 +83,7 @@ jobs: repository: 'davidgiven/fluxengine-testdata' path: 'fluxengine-testdata' - name: build - run: make -j2 -C fluxengine + run: make -j`nproc` -C fluxengine - name: nsis run: | From dcaeabacc67f70259784c8b6417e766fea67b18b Mon Sep 17 00:00:00 2001 From: dg Date: Thu, 26 Oct 2023 19:08:21 +0000 Subject: [PATCH 28/49] --no_warn_duplicate_libraries is apparently too new for github CI... --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 065fe8a7..9d6495bf 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,7 @@ endif ifeq ($(shell uname),Darwin) LDFLAGS += \ -framework IOKit \ - -framework Foundation \ - -Wl,-no_warn_duplicate_libraries + -framework Foundation endif .PHONY: all From dcb92db519fdb4bc1227d2fb24826dd801bd584b Mon Sep 17 00:00:00 2001 From: dg Date: Thu, 26 Oct 2023 19:29:01 +0000 Subject: [PATCH 29/49] Remove old build system. --- arch/build.mk | 43 -------------- dep/adflib/build.mk | 22 -------- dep/agg/build.mk | 38 ------------- dep/emu/build.mk | 21 ------- dep/fatfs/build.mk | 13 ----- dep/hfsutils/build.mk | 22 -------- dep/libusbp/build.mk | 66 ---------------------- dep/stb/build.mk | 23 -------- lib/build.mk | 108 ------------------------------------ scripts/build.mk | 11 ---- src/build.mk | 52 ----------------- src/formats/build.mk | 103 ---------------------------------- src/gui/build.mk | 103 ---------------------------------- src/gui/drivetypes/build.mk | 33 ----------- tests/build.mk | 56 ------------------- tools/build.mk | 43 -------------- 16 files changed, 757 deletions(-) delete mode 100644 arch/build.mk delete mode 100644 dep/adflib/build.mk delete mode 100644 dep/agg/build.mk delete mode 100644 dep/emu/build.mk delete mode 100644 dep/fatfs/build.mk delete mode 100644 dep/hfsutils/build.mk delete mode 100644 dep/libusbp/build.mk delete mode 100644 dep/stb/build.mk delete mode 100644 lib/build.mk delete mode 100644 scripts/build.mk delete mode 100644 src/build.mk delete mode 100644 src/formats/build.mk delete mode 100644 src/gui/build.mk delete mode 100644 src/gui/drivetypes/build.mk delete mode 100644 tests/build.mk delete mode 100644 tools/build.mk diff --git a/arch/build.mk b/arch/build.mk deleted file mode 100644 index 6dbe319b..00000000 --- a/arch/build.mk +++ /dev/null @@ -1,43 +0,0 @@ -LIBARCH_SRCS = \ - arch/aeslanier/decoder.cc \ - arch/agat/agat.cc \ - arch/agat/decoder.cc \ - arch/agat/encoder.cc \ - arch/amiga/amiga.cc \ - arch/amiga/decoder.cc \ - arch/amiga/encoder.cc \ - arch/apple2/decoder.cc \ - arch/apple2/encoder.cc \ - arch/brother/decoder.cc \ - arch/brother/encoder.cc \ - arch/c64/c64.cc \ - arch/c64/decoder.cc \ - arch/c64/encoder.cc \ - arch/f85/decoder.cc \ - arch/fb100/decoder.cc \ - arch/ibm/decoder.cc \ - arch/ibm/encoder.cc \ - arch/macintosh/decoder.cc \ - arch/macintosh/encoder.cc \ - arch/micropolis/decoder.cc \ - arch/micropolis/encoder.cc \ - arch/mx/decoder.cc \ - arch/northstar/decoder.cc \ - arch/northstar/encoder.cc \ - arch/rolandd20/decoder.cc \ - arch/smaky6/decoder.cc \ - arch/tids990/decoder.cc \ - arch/tids990/encoder.cc \ - arch/victor9k/decoder.cc \ - arch/victor9k/encoder.cc \ - arch/zilogmcz/decoder.cc \ - -LIBARCH_OBJS = $(patsubst %.cc, $(OBJDIR)/%.o, $(LIBARCH_SRCS)) -OBJS += $(LIBARCH_OBJS) -$(LIBARCH_SRCS): | $(PROTO_HDRS) -$(LIBARCH_SRCS): CFLAGS += $(PROTO_CFLAGS) -LIBARCH_LIB = $(OBJDIR)/libarch.a -LIBARCH_LDFLAGS = -$(LIBARCH_LIB): $(LIBARCH_OBJS) - -$(call use-pkgconfig, $(LIBARCH_LIB), $(LIBARCH_OBJS), fmt) diff --git a/dep/adflib/build.mk b/dep/adflib/build.mk deleted file mode 100644 index f3471f13..00000000 --- a/dep/adflib/build.mk +++ /dev/null @@ -1,22 +0,0 @@ -ADFLIB_SRCS = \ - DEP/ADFLIB/SRC/ADF_BITM.C \ - DEP/ADFLIB/SRC/ADF_CACHE.C \ - DEP/ADFLIB/SRC/ADF_DIR.C \ - DEP/ADFLIB/SRC/ADF_DISK.C \ - DEP/ADFLIB/SRC/ADF_DUMP.C \ - DEP/ADFLIB/SRC/ADF_ENV.C \ - DEP/ADFLIB/SRC/ADF_FILE.C \ - DEP/ADFLIB/SRC/ADF_HD.C \ - DEP/ADFLIB/SRC/ADF_LINK.C \ - DEP/ADFLIB/SRC/ADF_RAW.C \ - DEP/ADFLIB/SRC/ADF_SALV.C \ - DEP/ADFLIB/SRC/ADF_UTIL.C \ - -ADFLIB_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(ADFLIB_SRCS)) -$(ADFLIB_OBJS): CFLAGS += -Idep/adflib/src -Idep/adflib -ADFLIB_LIB = $(OBJDIR)/libadflib.a -$(ADFLIB_LIB): $(ADFLIB_OBJS) -ADFLIB_CFLAGS = -Idep/adflib/src -ADFLIB_LDFLAGS = -OBJS += $(ADFLIB_OBJS) - diff --git a/dep/agg/build.mk b/dep/agg/build.mk deleted file mode 100644 index 82b004a3..00000000 --- a/dep/agg/build.mk +++ /dev/null @@ -1,38 +0,0 @@ -AGG_SRCS = \ - dep/agg/src/agg_arrowhead.cpp \ - dep/agg/src/agg_line_aa_basics.cpp \ - dep/agg/src/agg_vcgen_bspline.cpp \ - dep/agg/src/agg_vpgen_segmentator.cpp \ - dep/agg/src/agg_color_rgba.cpp \ - dep/agg/src/agg_sqrt_tables.cpp \ - dep/agg/src/agg_bspline.cpp \ - dep/agg/src/agg_curves.cpp \ - dep/agg/src/agg_rounded_rect.cpp \ - dep/agg/src/agg_vcgen_markers_term.cpp \ - dep/agg/src/agg_vcgen_dash.cpp \ - dep/agg/src/agg2d.cpp \ - dep/agg/src/agg_trans_affine.cpp \ - dep/agg/src/agg_gsv_text.cpp \ - dep/agg/src/agg_vcgen_smooth_poly1.cpp \ - dep/agg/src/agg_trans_single_path.cpp \ - dep/agg/src/agg_vpgen_clip_polygon.cpp \ - dep/agg/src/agg_embedded_raster_fonts.cpp \ - dep/agg/src/agg_trans_double_path.cpp \ - dep/agg/src/agg_vcgen_stroke.cpp \ - dep/agg/src/agg_arc.cpp \ - dep/agg/src/agg_image_filters.cpp \ - dep/agg/src/agg_trans_warp_magnifier.cpp \ - dep/agg/src/agg_vpgen_clip_polyline.cpp \ - dep/agg/src/agg_bezier_arc.cpp \ - dep/agg/src/agg_line_profile_aa.cpp \ - dep/agg/src/agg_vcgen_contour.cpp \ - -AGG_OBJS = $(patsubst %.cpp, $(OBJDIR)/%.o, $(AGG_SRCS)) -AGG_LIB = $(OBJDIR)/libagg.a -$(AGG_LIB): $(AGG_OBJS) -AGG_LDFLAGS = $(AGG_LIB) -AGG_CFLAGS = -Idep/agg/include -OBJS += $(AGG_OBJS) - -$(AGG_OBJS): CFLAGS += $(AGG_CFLAGS) - diff --git a/dep/emu/build.mk b/dep/emu/build.mk deleted file mode 100644 index ba0f7edc..00000000 --- a/dep/emu/build.mk +++ /dev/null @@ -1,21 +0,0 @@ -ifeq ($(OS), Windows_NT) - -EMU_SRCS = \ - dep/emu/fnmatch.c - -EMU_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(EMU_SRCS)) -$(EMU_OBJS): CFLAGS += -Idep/emu -EMU_LIB = $(OBJDIR)/libemu.a -$(EMU_LIB): $(EMU_OBJS) -EMU_CFLAGS = -Idep/emu -EMU_LDFLAGS = $(EMU_LIB) -OBJS += $(EMU_OBJS) - -else - -EMU_LIB = -EMU_CFLAGS = -EMU_LDFLAGS = - -endif - diff --git a/dep/fatfs/build.mk b/dep/fatfs/build.mk deleted file mode 100644 index c81a7df0..00000000 --- a/dep/fatfs/build.mk +++ /dev/null @@ -1,13 +0,0 @@ -FATFS_SRCS = \ - dep/fatfs/source/ff.c \ - dep/fatfs/source/ffsystem.c \ - dep/fatfs/source/ffunicode.c \ - -FATFS_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(FATFS_SRCS)) -$(FATFS_OBJS): CFLAGS += -Idep/fatfs/source -FATFS_LIB = $(OBJDIR)/libfatfs.a -$(FATFS_LIB): $(FATFS_OBJS) -FATFS_CFLAGS = -Idep/fatfs/source -FATFS_LDFLAGS = -OBJS += $(FATFS_OBJS) - diff --git a/dep/hfsutils/build.mk b/dep/hfsutils/build.mk deleted file mode 100644 index 2ffd727e..00000000 --- a/dep/hfsutils/build.mk +++ /dev/null @@ -1,22 +0,0 @@ -HFSUTILS_SRCS = \ - dep/hfsutils/libhfs/block.c \ - dep/hfsutils/libhfs/btree.c \ - dep/hfsutils/libhfs/data.c \ - dep/hfsutils/libhfs/file.c \ - dep/hfsutils/libhfs/hfs.c \ - dep/hfsutils/libhfs/low.c \ - dep/hfsutils/libhfs/medium.c \ - dep/hfsutils/libhfs/memcmp.c \ - dep/hfsutils/libhfs/node.c \ - dep/hfsutils/libhfs/record.c \ - dep/hfsutils/libhfs/version.c \ - dep/hfsutils/libhfs/volume.c \ - -HFSUTILS_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(HFSUTILS_SRCS)) -$(HFSUTILS_OBJS): CFLAGS += -Idep/hfsutils/libhfs -HFSUTILS_LIB = $(OBJDIR)/libhfsutils.a -$(HFSUTILS_LIB): $(HFSUTILS_OBJS) -HFSUTILS_CFLAGS = -Idep/hfsutils/libhfs -HFSUTILS_LDFLAGS = -OBJS += $(HFSUTILS_OBJS) - diff --git a/dep/libusbp/build.mk b/dep/libusbp/build.mk deleted file mode 100644 index ee09b84f..00000000 --- a/dep/libusbp/build.mk +++ /dev/null @@ -1,66 +0,0 @@ -LIBUSBP_SRCS = \ - dep/libusbp/src/async_in_pipe.c \ - dep/libusbp/src/error.c \ - dep/libusbp/src/error_hresult.c \ - dep/libusbp/src/find_device.c \ - dep/libusbp/src/list.c \ - dep/libusbp/src/pipe_id.c \ - dep/libusbp/src/string.c \ - -ifeq ($(OS), Windows_NT) - -LIBUSBP_LDFLAGS += -lsetupapi -lwinusb -lole32 -luuid -LIBUSBP_SRCS += \ - dep/libusbp/src/windows/async_in_transfer_windows.c \ - dep/libusbp/src/windows/device_instance_id_windows.c \ - dep/libusbp/src/windows/device_windows.c \ - dep/libusbp/src/windows/error_windows.c \ - dep/libusbp/src/windows/generic_handle_windows.c \ - dep/libusbp/src/windows/generic_interface_windows.c \ - dep/libusbp/src/windows/interface_windows.c \ - dep/libusbp/src/windows/list_windows.c \ - dep/libusbp/src/windows/serial_port_windows.c \ - -else ifeq ($(shell uname),Darwin) - -LIBUSBP_SRCS += \ - dep/libusbp/src/mac/async_in_transfer_mac.c \ - dep/libusbp/src/mac/device_mac.c \ - dep/libusbp/src/mac/error_mac.c \ - dep/libusbp/src/mac/generic_handle_mac.c \ - dep/libusbp/src/mac/generic_interface_mac.c \ - dep/libusbp/src/mac/iokit_mac.c \ - dep/libusbp/src/mac/list_mac.c \ - dep/libusbp/src/mac/serial_port_mac.c \ - -else ifeq ($(shell uname),Linux) - -LIBUSBP_CFLAGS += $(shell pkg-config --cflags libudev) -LIBUSBP_LDFLAGS += $(shell pkg-config --libs libudev) -LIBUSBP_SRCS += \ - dep/libusbp/src/linux/async_in_transfer_linux.c \ - dep/libusbp/src/linux/device_linux.c \ - dep/libusbp/src/linux/error_linux.c \ - dep/libusbp/src/linux/generic_handle_linux.c \ - dep/libusbp/src/linux/generic_interface_linux.c \ - dep/libusbp/src/linux/list_linux.c \ - dep/libusbp/src/linux/serial_port_linux.c \ - dep/libusbp/src/linux/udev_linux.c \ - dep/libusbp/src/linux/usbfd_linux.c \ - -else - -LIBUSBP_SRCS += \ - dep/libusbp/src/dummy.c - -endif - -LIBUSBP_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(LIBUSBP_SRCS)) -$(LIBUSBP_OBJS): private CFLAGS += -Idep/libusbp/src -Idep/libusbp/include -LIBUSBP_LIB = $(OBJDIR)/libusbp.a -LIBUSBP_CFLAGS += -Idep/libusbp/include -LIBUSBP_LDFLAGS += -$(LIBUSBP_LIB): $(LIBUSBP_OBJS) -OBJS += $(LIBUSBP_OBJS) - - diff --git a/dep/stb/build.mk b/dep/stb/build.mk deleted file mode 100644 index 1a7378ac..00000000 --- a/dep/stb/build.mk +++ /dev/null @@ -1,23 +0,0 @@ -ifeq ($(shell $(PKG_CONFIG) stb; echo $$?), 0) - -# System libstb present. - -STB_LIB = -STB_CFLAGS := $(shell $(PKG_CONFIG) --cflags stb) -STB_LDFLAGS := $(shell $(PKG_CONFIG) --libs stb) - -else - -STB_SRCS = \ - dep/stb/stb_image_write.c - -STB_OBJS = $(patsubst %.c, $(OBJDIR)/%.o, $(STB_SRCS)) -$(STB_OBJS): CFLAGS += -Idep/stb/src -STB_LIB = $(OBJDIR)/libstb.a -$(STB_LIB): $(STB_OBJS) -STB_CFLAGS = -STB_LDFLAGS = $(STB_LIB) -OBJS += $(STB_OBJS) - -endif - diff --git a/lib/build.mk b/lib/build.mk deleted file mode 100644 index c8fc1c5f..00000000 --- a/lib/build.mk +++ /dev/null @@ -1,108 +0,0 @@ -LIBFLUXENGINE_SRCS = \ - lib/bitmap.cc \ - lib/bytes.cc \ - lib/config.cc \ - lib/crc.cc \ - lib/csvreader.cc \ - lib/decoders/decoders.cc \ - lib/decoders/fluxdecoder.cc \ - lib/decoders/fluxmapreader.cc \ - lib/decoders/fmmfm.cc \ - lib/encoders/encoders.cc \ - lib/fl2.cc \ - lib/flags.cc \ - lib/fluxmap.cc \ - lib/fluxsink/a2rfluxsink.cc \ - lib/fluxsink/aufluxsink.cc \ - lib/fluxsink/fl2fluxsink.cc \ - lib/fluxsink/fluxsink.cc \ - lib/fluxsink/hardwarefluxsink.cc \ - lib/fluxsink/scpfluxsink.cc \ - lib/fluxsink/vcdfluxsink.cc \ - lib/fluxsource/a2rfluxsource.cc \ - lib/fluxsource/cwffluxsource.cc \ - lib/fluxsource/erasefluxsource.cc \ - lib/fluxsource/fl2fluxsource.cc \ - lib/fluxsource/fluxsource.cc \ - lib/fluxsource/flx.cc \ - lib/fluxsource/flxfluxsource.cc \ - lib/fluxsource/hardwarefluxsource.cc \ - lib/fluxsource/kryoflux.cc \ - lib/fluxsource/kryofluxfluxsource.cc \ - lib/fluxsource/memoryfluxsource.cc \ - lib/fluxsource/scpfluxsource.cc \ - lib/fluxsource/testpatternfluxsource.cc \ - lib/globals.cc \ - lib/hexdump.cc \ - lib/image.cc \ - lib/imagereader/d64imagereader.cc \ - lib/imagereader/d88imagereader.cc \ - lib/imagereader/dimimagereader.cc \ - lib/imagereader/diskcopyimagereader.cc \ - lib/imagereader/fdiimagereader.cc \ - lib/imagereader/imagereader.cc \ - lib/imagereader/imdimagereader.cc \ - lib/imagereader/imgimagereader.cc \ - lib/imagereader/jv3imagereader.cc \ - lib/imagereader/nfdimagereader.cc \ - lib/imagereader/nsiimagereader.cc \ - lib/imagereader/td0imagereader.cc \ - lib/imagewriter/d64imagewriter.cc \ - lib/imagewriter/d88imagewriter.cc \ - lib/imagewriter/diskcopyimagewriter.cc \ - lib/imagewriter/imagewriter.cc \ - lib/imagewriter/imdimagewriter.cc \ - lib/imagewriter/imgimagewriter.cc \ - lib/imagewriter/ldbsimagewriter.cc \ - lib/imagewriter/nsiimagewriter.cc \ - lib/imagewriter/rawimagewriter.cc \ - lib/layout.cc \ - lib/ldbs.cc \ - lib/logger.cc \ - lib/proto.cc \ - lib/readerwriter.cc \ - lib/sector.cc \ - lib/usb/fluxengineusb.cc \ - lib/usb/greaseweazle.cc \ - lib/usb/greaseweazleusb.cc \ - lib/usb/serial.cc \ - lib/usb/usb.cc \ - lib/usb/usbfinder.cc \ - lib/utils.cc \ - lib/vfs/acorndfs.cc \ - lib/vfs/amigaffs.cc \ - lib/vfs/appledos.cc \ - lib/vfs/applesingle.cc \ - lib/vfs/brother120fs.cc \ - lib/vfs/cbmfs.cc \ - lib/vfs/cpmfs.cc \ - lib/vfs/fatfs.cc \ - lib/vfs/fluxsectorinterface.cc \ - lib/vfs/imagesectorinterface.cc \ - lib/vfs/lif.cc \ - lib/vfs/machfs.cc \ - lib/vfs/microdos.cc \ - lib/vfs/philefs.cc \ - lib/vfs/prodos.cc \ - lib/vfs/roland.cc \ - lib/vfs/smaky6fs.cc \ - lib/vfs/vfs.cc \ - lib/vfs/zdos.cc \ - -LIBFLUXENGINE_OBJS = $(patsubst %.cc, $(OBJDIR)/%.o, $(LIBFLUXENGINE_SRCS)) -OBJS += $(LIBFLUXENGINE_OBJS) -$(LIBFLUXENGINE_SRCS): | $(PROTO_HDRS) -LIBFLUXENGINE_LIB = $(OBJDIR)/libfluxengine.a -LIBFLUXENGINE_CFLAGS = -LIBFLUXENGINE_LDFLAGS = - -$(LIBFLUXENGINE_LIB): $(LIBFLUXENGINE_OBJS) - -$(LIBFLUXENGINE_OBJS): CFLAGS += $(LIBARCH_CFLAGS) -$(LIBFLUXENGINE_OBJS): CFLAGS += $(LIBUSBP_CFLAGS) -$(LIBFLUXENGINE_OBJS): CFLAGS += $(PROTO_CFLAGS) -$(LIBFLUXENGINE_OBJS): CFLAGS += $(FATFS_CFLAGS) -$(LIBFLUXENGINE_OBJS): CFLAGS += $(ADFLIB_CFLAGS) -$(LIBFLUXENGINE_OBJS): CFLAGS += $(HFSUTILS_CFLAGS) - -$(call use-pkgconfig, $(LIBFLUXENGINE_LIB), $(LIBFLUXENGINE_OBJS), fmt) diff --git a/scripts/build.mk b/scripts/build.mk deleted file mode 100644 index 45505f95..00000000 --- a/scripts/build.mk +++ /dev/null @@ -1,11 +0,0 @@ -$(OBJDIR)/protoencode_ConfigProto.exe: $(OBJDIR)/scripts/protoencode_ConfigProto.o -$(OBJDIR)/protoencode_TestProto.exe: $(OBJDIR)/scripts/protoencode_TestProto.o - -$(OBJDIR)/scripts/protoencode_%.o: scripts/protoencode.cc - @mkdir -p $(dir $@) - @echo CXX $< $* - @$(CXX) $(CFLAGS) -DPROTO=$* $(CXXFLAGS) -MMD -MP -MF $(@:.o=.d) -c -o $@ $< - -$(call use-library, $(OBJDIR)/protoencode_ConfigProto.exe, $(OBJDIR)/scripts/protoencode_ConfigProto.o, PROTO) -$(call use-library, $(OBJDIR)/protoencode_TestProto.exe, $(OBJDIR)/scripts/protoencode_TestProto.o, PROTO) - diff --git a/src/build.mk b/src/build.mk deleted file mode 100644 index 0d3dadd0..00000000 --- a/src/build.mk +++ /dev/null @@ -1,52 +0,0 @@ -include src/formats/build.mk - -FLUXENGINE_SRCS = \ - src/fe-analysedriveresponse.cc \ - src/fe-analyselayout.cc \ - src/fe-format.cc \ - src/fe-getdiskinfo.cc \ - src/fe-getfile.cc \ - src/fe-getfileinfo.cc \ - src/fe-inspect.cc \ - src/fe-ls.cc \ - src/fe-merge.cc \ - src/fe-mkdir.cc \ - src/fe-mv.cc \ - src/fe-rm.cc \ - src/fe-putfile.cc \ - src/fe-rawread.cc \ - src/fe-rawwrite.cc \ - src/fe-read.cc \ - src/fe-rpm.cc \ - src/fe-seek.cc \ - src/fe-testbandwidth.cc \ - src/fe-testvoltages.cc \ - src/fe-write.cc \ - src/fileutils.cc \ - src/fluxengine.cc \ - -FLUXENGINE_OBJS = $(patsubst %.cc, $(OBJDIR)/%.o, $(FLUXENGINE_SRCS)) -OBJS += $(FLUXENGINE_OBJS) -$(FLUXENGINE_SRCS): | $(PROTO_HDRS) -FLUXENGINE_BIN = $(OBJDIR)/fluxengine.exe -$(FLUXENGINE_BIN): $(FLUXENGINE_OBJS) - -$(call use-pkgconfig, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), fmt) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), AGG) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), LIBARCH) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), LIBFLUXENGINE) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), LIBFORMATS) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), LIBUSBP) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), PROTO) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), STB) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), FATFS) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), ADFLIB) -$(call use-library, $(FLUXENGINE_BIN), $(FLUXENGINE_OBJS), HFSUTILS) - -binaries: fluxengine$(EXT) - -fluxengine$(EXT): $(FLUXENGINE_BIN) - @echo CP $@ - @cp $< $@ - - diff --git a/src/formats/build.mk b/src/formats/build.mk deleted file mode 100644 index c9455dd3..00000000 --- a/src/formats/build.mk +++ /dev/null @@ -1,103 +0,0 @@ -FORMATS = \ - 40track_drive \ - acornadfs \ - acorndfs \ - aeslanier \ - agat \ - amiga \ - ampro \ - apple2_drive \ - apple2 \ - atarist \ - bk \ - brother \ - commodore \ - eco1 \ - epsonpf10 \ - f85 \ - fb100 \ - hplif \ - ibm \ - icl30 \ - mac \ - micropolis \ - ms2000 \ - mx \ - n88basic \ - northstar \ - psos \ - rolandd20 \ - rx50 \ - shugart_drive \ - smaky6 \ - tids990 \ - tiki \ - victor9k \ - zilogmcz \ - -$(OBJDIR)/src/formats/format_%.o: $(OBJDIR)/src/formats/format_%.cc -$(OBJDIR)/src/formats/format_%.cc: $(OBJDIR)/protoencode_ConfigProto.exe src/formats/%.textpb - @mkdir -p $(dir $@) - @echo PROTOENCODE $* - @$^ $@ formats_$*_pb - -OBJS += $(patsubst %, $(OBJDIR)/src/formats/format_%.o, $(FORMATS)) - -$(OBJDIR)/src/formats/table.cc: scripts/mktable.sh src/formats/build.mk - @mkdir -p $(dir $@) - @echo MKTABLE $@ - @scripts/mktable.sh formats $(FORMATS) > $@ - -LIBFORMATS_SRCS = \ - $(patsubst %, $(OBJDIR)/src/formats/format_%.cc, $(FORMATS)) \ - $(OBJDIR)/src/formats/table.cc -LIBFORMATS_OBJS = $(patsubst %.cc, %.o, $(LIBFORMATS_SRCS)) -.PRECIOUS: $(LIBFORMATS_SRCS) - -LIBFORMATS_LIB = $(OBJDIR)/libformats.a -LIBFORMATS_LDFLAGS = -$(LIBFORMATS_LIB): $(LIBFORMATS_OBJS) - - -$(OBJDIR)/mkdoc.exe: $(OBJDIR)/scripts/mkdoc.o - -$(OBJDIR)/scripts/mkdoc.o: scripts/mkdoc.cc - @mkdir -p $(dir $@) - @echo CXX $< $* - @$(CXX) $(CFLAGS) -DPROTO=$* $(CXXFLAGS) -MMD -MP -MF $(@:.o=.d) -c -o $@ $< - -$(call use-library, $(OBJDIR)/mkdoc.exe, $(OBJDIR)/scripts/mkdoc.o, PROTO) -$(call use-library, $(OBJDIR)/mkdoc.exe, $(OBJDIR)/scripts/mkdoc.o, LIBFORMATS) -$(call use-library, $(OBJDIR)/mkdoc.exe, $(OBJDIR)/scripts/mkdoc.o, LIBFLUXENGINE) - - -docs: $(patsubst %, doc/disk-%.md, $(FORMATS)) - -doc/disk-%.md: src/formats/%.textpb $(OBJDIR)/mkdoc.exe - @echo MKDOC $@ - @mkdir -p $(dir $@) - @$(OBJDIR)/mkdoc.exe $* > $@ - - -$(OBJDIR)/mkdocindex.exe: $(OBJDIR)/scripts/mkdocindex.o - -$(OBJDIR)/scripts/mkdocindex.o: scripts/mkdocindex.cc - -$(call use-library, $(OBJDIR)/mkdocindex.exe, $(OBJDIR)/scripts/mkdocindex.o, PROTO) -$(call use-library, $(OBJDIR)/mkdocindex.exe, $(OBJDIR)/scripts/mkdocindex.o, LIBFORMATS) -$(call use-library, $(OBJDIR)/mkdocindex.exe, $(OBJDIR)/scripts/mkdocindex.o, LIBFLUXENGINE) - - -docs: $(patsubst %, doc/disk-%.md, $(FORMATS)) - -doc/disk-%.md: src/formats/%.textpb $(OBJDIR)/mkdoc.exe - @echo MKDOC $@ - @mkdir -p $(dir $@) - @$(OBJDIR)/mkdoc.exe $* > $@ - -docs: README.md -README.md: $(OBJDIR)/mkdocindex.exe - @echo MKDOCINDEX $@ - @csplit -s -f$(OBJDIR)/README. README.md '//' '%%' - @(cat $(OBJDIR)/README.00 && $(OBJDIR)/mkdocindex.exe && cat $(OBJDIR)/README.01) > README.md - diff --git a/src/gui/build.mk b/src/gui/build.mk deleted file mode 100644 index f2f96376..00000000 --- a/src/gui/build.mk +++ /dev/null @@ -1,103 +0,0 @@ -ifneq ($(shell $(WX_CONFIG) --version),) - -include src/gui/drivetypes/build.mk - -FLUXENGINE_GUI_SRCS = \ - src/gui/browserpanel.cc \ - src/gui/customstatusbar.cc \ - src/gui/explorerpanel.cc \ - src/gui/filesystemmodel.cc \ - src/gui/fileviewerwindow.cc \ - src/gui/fluxviewercontrol.cc \ - src/gui/fluxviewerwindow.cc \ - src/gui/histogramviewer.cc \ - src/gui/iconbutton.cc \ - src/gui/idlepanel.cc \ - src/gui/imagerpanel.cc \ - src/gui/jobqueue.cc \ - src/gui/layout.cpp \ - src/gui/main.cc \ - src/gui/mainwindow.cc \ - src/gui/texteditorwindow.cc \ - src/gui/textviewerwindow.cc \ - src/gui/visualisationcontrol.cc \ - -src/gui/idlepanel.cc: \ - $(OBJDIR)/extras/hardware.h \ - $(OBJDIR)/extras/fluxfile.h \ - $(OBJDIR)/extras/imagefile.h - -FLUXENGINE_GUI_OBJS = \ - $(patsubst %.cpp, $(OBJDIR)/%.o, \ - $(patsubst %.cc, $(OBJDIR)/%.o, $(FLUXENGINE_GUI_SRCS)) \ - ) -OBJS += $(FLUXENGINE_GUI_OBJS) -$(FLUXENGINE_GUI_SRCS): | $(PROTO_HDRS) -$(FLUXENGINE_GUI_OBJS): CFLAGS += $(shell $(WX_CONFIG) --cxxflags core base adv aui richtext) -FLUXENGINE_GUI_BIN = $(OBJDIR)/fluxengine-gui.exe -$(FLUXENGINE_GUI_BIN): LDFLAGS += $(shell $(WX_CONFIG) --libs core base adv aui richtext) -$(FLUXENGINE_GUI_BIN): $(FLUXENGINE_GUI_OBJS) - -$(call use-pkgconfig, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), fmt) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), LIBARCH) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), LIBFLUXENGINE) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), LIBFORMATS) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), LIBDRIVETYPES) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), LIBUSBP) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), PROTO) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), FATFS) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), ADFLIB) -$(call use-library, $(FLUXENGINE_GUI_BIN), $(FLUXENGINE_GUI_OBJS), HFSUTILS) - -binaries: fluxengine-gui$(EXT) - -fluxengine-gui$(EXT): $(FLUXENGINE_GUI_BIN) - @echo CP $@ - @cp $< $@ - -$(OBJDIR)/%.h: %.png - @echo ENCODE $@ - @mkdir -p $(dir $@) - @xxd -i $^ > $@ - -ifeq ($(PLATFORM),OSX) - -binaries: FluxEngine.pkg - -FluxEngine.pkg: FluxEngine.app - @echo PKGBUILD $@ - @pkgbuild --quiet --install-location /Applications --component $< $@ - -FluxEngine.app: fluxengine-gui$(EXT) $(OBJDIR)/fluxengine.icns src/gui/build.mk - @echo MAKEAPP $@ - rm -rf $@ - cp -a extras/FluxEngine.app.template $@ - touch $@ - cp fluxengine-gui$(EXT) $@/Contents/MacOS/fluxengine-gui - mkdir -p $@/Contents/Resources - cp $(OBJDIR)/fluxengine.icns $@/Contents/Resources/FluxEngine.icns - dylibbundler -of -x $@/Contents/MacOS/fluxengine-gui -b -d $@/Contents/libs -cd > /dev/null - cp $$(brew --prefix wxwidgets)/README.md $@/Contents/libs/wxWidgets.md - cp $$(brew --prefix protobuf)/LICENSE $@/Contents/libs/protobuf.txt - cp $$(brew --prefix fmt)/LICENSE.rst $@/Contents/libs/fmt.rst - cp $$(brew --prefix libpng)/LICENSE $@/Contents/libs/libpng.txt - cp $$(brew --prefix libjpeg)/README $@/Contents/libs/libjpeg.txt - -$(OBJDIR)/fluxengine.icns: $(OBJDIR)/fluxengine.iconset - @echo ICONUTIL $@ - @iconutil -c icns -o $@ $< - -$(OBJDIR)/fluxengine.iconset: extras/icon.png - @echo ICONSET $@ - @rm -rf $@ - @mkdir -p $@ - @sips -z 64 64 $< --out $@/icon_32x32@2x.png > /dev/null - -endif - -else - -$(warning wx-config missing, not building GUI) - -endif - diff --git a/src/gui/drivetypes/build.mk b/src/gui/drivetypes/build.mk deleted file mode 100644 index c65ea14f..00000000 --- a/src/gui/drivetypes/build.mk +++ /dev/null @@ -1,33 +0,0 @@ -DRIVETYPES = \ - 35_40 \ - 35_80 \ - 525_40 \ - 525_40M \ - 525_80 \ - 525_80M \ - 8_38 \ - 8_77 \ - apple2 \ - -$(OBJDIR)/src/gui/drivetypes/drivetype_%.o: $(OBJDIR)/src/gui/drivetypes/drivetype_%.cc -$(OBJDIR)/src/gui/drivetypes/drivetype_%.cc: $(OBJDIR)/protoencode_ConfigProto.exe src/gui/drivetypes/%.textpb - @mkdir -p $(dir $@) - @echo PROTOENCODE $* - @$^ $@ drivetypes_$*_pb - -$(OBJDIR)/src/gui/drivetypes/table.cc: scripts/mktable.sh src/gui/drivetypes/build.mk \ - $(patsubst %,src/gui/drivetypes/%.textpb,$(DRIVETYPES)) - @mkdir -p $(dir $@) - @echo MKTABLE $@ - @scripts/mktable.sh drivetypes $(DRIVETYPES) > $@ - -LIBDRIVETYPES_SRCS = \ - $(patsubst %, $(OBJDIR)/src/gui/drivetypes/drivetype_%.cc, $(DRIVETYPES)) \ - $(OBJDIR)/src/gui/drivetypes/table.cc -LIBDRIVETYPES_OBJS = $(patsubst %.cc, %.o, $(LIBDRIVETYPES_SRCS)) -.PRECIOUS: $(LIBDRIVETYPES_SRCS) - -LIBDRIVETYPES_LIB = $(OBJDIR)/libgui/drivetypes.a -LIBDRIVETYPES_LDFLAGS = $(LIBDRIVETYPES_LIB) -$(LIBDRIVETYPES_LIB): $(LIBDRIVETYPES_OBJS) - diff --git a/tests/build.mk b/tests/build.mk deleted file mode 100644 index 08d617c6..00000000 --- a/tests/build.mk +++ /dev/null @@ -1,56 +0,0 @@ - -$(OBJDIR)/tests/%.log: $(OBJDIR)/tests/%.exe - @mkdir -p $(dir $@) - @echo TEST $* - @$< && touch $@ - -declare-test = $(eval $(declare-test-impl)) -define declare-test-impl - -tests: $(OBJDIR)/tests/$1.log -$(OBJDIR)/tests/$1.exe: $(OBJDIR)/tests/$1.o -$(OBJDIR)/tests/$1.o: private CFLAGS += -Idep/snowhouse/include -OBJS += $(OBJDIR)/tests/$1.o -$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, LIBARCH) -$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, LIBFLUXENGINE) -$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, LIBFORMATS) -$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, LIBUSBP) -$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, PROTO) -$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, FATFS) -$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, ADFLIB) -$(call use-library, $(OBJDIR)/tests/$1.exe, $(OBJDIR)/tests/$1.o, HFSUTILS) - -endef - -$(call declare-test,agg) -$(call declare-test,amiga) -$(call declare-test,applesingle) -$(call declare-test,bitaccumulator) -$(call declare-test,bytes) -$(call declare-test,compression) -$(call declare-test,configs) -$(call declare-test,cpmfs) -$(call declare-test,csvreader) -$(call declare-test,flags) -$(call declare-test,fluxmapreader) -$(call declare-test,fluxpattern) -$(call declare-test,flx) -$(call declare-test,fmmfm) -$(call declare-test,greaseweazle) -$(call declare-test,kryoflux) -$(call declare-test,layout) -$(call declare-test,ldbs) -$(call declare-test,options) -$(call declare-test,proto) -$(call declare-test,utils) -$(call declare-test,vfs) - -$(call use-library, $(OBJDIR)/tests/agg.exe, $(OBJDIR)/tests/agg.o, AGG) -$(call use-library, $(OBJDIR)/tests/agg.exe, $(OBJDIR)/tests/agg.o, STB) - -$(OBJDIR)/tests/proto.exe: $(OBJDIR)/tests/testproto.o -$(OBJDIR)/tests/testproto.cc: $(OBJDIR)/protoencode_TestProto.exe tests/testproto.textpb - @mkdir -p $(dir $@) - @echo PROTOENCODE $@ - @$^ $@ testproto_pb - diff --git a/tools/build.mk b/tools/build.mk deleted file mode 100644 index 1586c7f1..00000000 --- a/tools/build.mk +++ /dev/null @@ -1,43 +0,0 @@ -$(OBJDIR)/brother120tool.exe: $(OBJDIR)/tools/brother120tool.o -$(OBJDIR)/brother240tool.exe: $(OBJDIR)/tools/brother240tool.o -$(OBJDIR)/upgrade-flux-file.exe: $(OBJDIR)/tools/upgrade-flux-file.o - -OBJS += \ - $(OBJDIR)/tools/brother120tool.o \ - $(OBJDIR)/tools/brother240tool.o \ - $(OBJDIR)/tools/upgrade-flux-file.o \ - -$(call use-library, $(OBJDIR)/brother120tool.exe, $(OBJDIR)/tools/brother120tool.o, PROTO) -$(call use-library, $(OBJDIR)/brother120tool.exe, $(OBJDIR)/tools/brother120tool.o, LIBFLUXENGINE) -$(call use-library, $(OBJDIR)/brother120tool.exe, $(OBJDIR)/tools/brother120tool.o, LIBFORMATS) -$(call use-library, $(OBJDIR)/brother120tool.exe, $(OBJDIR)/tools/brother120tool.o, LIBUSBP) -$(call use-library, $(OBJDIR)/brother120tool.exe, $(OBJDIR)/tools/brother120tool.o, PROTO) -$(call use-library, $(OBJDIR)/brother120tool.exe, $(OBJDIR)/tools/brother120tool.o, EMU) - -$(call use-library, $(OBJDIR)/brother240tool.exe, $(OBJDIR)/tools/brother240tool.o, PROTO) -$(call use-library, $(OBJDIR)/brother240tool.exe, $(OBJDIR)/tools/brother240tool.o, LIBFLUXENGINE) -$(call use-library, $(OBJDIR)/brother240tool.exe, $(OBJDIR)/tools/brother240tool.o, LIBFORMATS) -$(call use-library, $(OBJDIR)/brother240tool.exe, $(OBJDIR)/tools/brother240tool.o, LIBUSBP) -$(call use-library, $(OBJDIR)/brother240tool.exe, $(OBJDIR)/tools/brother240tool.o, EMU) - -$(call use-pkgconfig, $(OBJDIR)/upgrade-flux-file.exe, $(OBJDIR)/tools/upgrade-flux-file.o, sqlite3) -$(call use-library, $(OBJDIR)/upgrade-flux-file.exe, $(OBJDIR)/tools/upgrade-flux-file.o, LIBARCH) -$(call use-library, $(OBJDIR)/upgrade-flux-file.exe, $(OBJDIR)/tools/upgrade-flux-file.o, LIBFLUXENGINE) -$(call use-library, $(OBJDIR)/upgrade-flux-file.exe, $(OBJDIR)/tools/upgrade-flux-file.o, LIBFORMATS) -$(call use-library, $(OBJDIR)/upgrade-flux-file.exe, $(OBJDIR)/tools/upgrade-flux-file.o, PROTO) -$(call use-library, $(OBJDIR)/upgrade-flux-file.exe, $(OBJDIR)/tools/upgrade-flux-file.o, LIBUSBP) - -brother120tool$(EXT): $(OBJDIR)/brother120tool.exe - @echo CP $@ - @cp $< $@ - -brother240tool$(EXT): $(OBJDIR)/brother240tool.exe - @echo CP $@ - @cp $< $@ - -upgrade-flux-file$(EXT): $(OBJDIR)/upgrade-flux-file.exe - @echo CP $@ - @cp $< $@ - -binaries: brother120tool$(EXT) brother240tool$(EXT) upgrade-flux-file$(EXT) - From 6038a1167110fffbac6192d2d65f68c7cf764eaa Mon Sep 17 00:00:00 2001 From: dg Date: Thu, 26 Oct 2023 19:31:58 +0000 Subject: [PATCH 30/49] Update the README. --- Makefile | 4 ++-- doc/building.md | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 9d6495bf..dec73042 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ OBJ = .obj # Special Windows settings. ifeq ($(OS), Windows_NT) + EXT ?= .exe MINGWBIN = /mingw32/bin CCPREFIX = $(MINGWBIN)/ PKG_CONFIG = $(MINGWBIN)/pkg-config @@ -22,7 +23,6 @@ ifeq ($(OS), Windows_NT) # Required to get the gcc run - time libraries on the path. export PATH := $(PATH):$(MINGWBIN) - EXT ?= .exe endif # Special OSX settings. @@ -30,7 +30,7 @@ endif ifeq ($(shell uname),Darwin) LDFLAGS += \ -framework IOKit \ - -framework Foundation + -framework Foundation endif .PHONY: all diff --git a/doc/building.md b/doc/building.md index 1002bcb1..643776d9 100644 --- a/doc/building.md +++ b/doc/building.md @@ -204,7 +204,7 @@ install some support packages. - For Linux with Ubuntu/Debian: `libusb-1.0-0-dev`, `libsqlite3-dev`, `zlib1g-dev`, `libudev-dev`, `protobuf-compiler`, `libwxgtk3.0-gtk3-dev`, - `libfmt-dev`. + `libfmt-dev`, `python3`. - For Linux with Fedora/Red Hat: `git`, `make`, `gcc`, `gcc-c++`, `xxd`, `protobuf-compiler`, `protobuf-devel`, `fmt-devel`, `systemd-devel`, `wxGTK3-devel`, @@ -214,7 +214,7 @@ install some support packages. - For Windows with MSYS2: `make`, `mingw-w64-i686-libusb`, `mingw-w64-i686-protobuf`, `mingw-w64-i686-sqlite3`, `mingw-w64-i686-zlib`, `mingw-w64-i686-gcc`, `vim`, `diffutils`, `mingw-w64-i686-wxWidgets`, - `mingw-w64-i686-fmt`, `mingw-w64-i686-pkg-config`. + `mingw-w64-i686-fmt`, `mingw-w64-i686-pkg-config`, `mingw-w64-i686-python`. These lists are not necessarily exhaustive --- please [get in touch](https://github.com/davidgiven/fluxengine/issues/new) if I've missed @@ -222,10 +222,16 @@ anything. Windows and Linux (and other Unixes) build by just doing `make`. OSX builds by doing `gmake` (we're using a feature which the elderly default make in OSX -doesn't have). You should end up with some executables in the current -directory, one of which is called `fluxengine` or `fluxengine.exe` depending on -your platform. It has minimal dependencies and you should be able to put it -anywhere. The other binaries may also be of interest. +doesn't have). Remember to add an appropriate `-j` option for a parallel build. +You should end up with some executables in the current directory, one of which +is called `fluxengine` or `fluxengine.exe` depending on your platform. It has +minimal dependencies and you should be able to put it anywhere. The other +binaries may also be of interest. + +Potential issues: + + - Complaints about a missing `libudev` on Windows? Make sure you're using the + mingw Python rather than the msys Python. If it doesn't build, please [get in touch](https://github.com/davidgiven/fluxengine/issues/new). From 5af0b68e06e7a3716ddb98eae5e443b7bf182ce8 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 27 Oct 2023 20:43:46 +0200 Subject: [PATCH 31/49] Add the corpus tests. --- README.md | 78 ++++++++++++++++++++-------------------- build.py | 86 +++++++++++++++++++++++++++++++++++++++++--- build/c.py | 6 ++-- build/utils.py | 37 ++++++++++++++----- dep/emu/build.py | 8 +---- dep/libusbp/build.py | 2 +- 6 files changed, 155 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 8f2f3320..dd2cc632 100644 --- a/README.md +++ b/README.md @@ -103,45 +103,45 @@ particular filesystem and can read (and sometimes write, support varies) files directly from disks, flux files or disk images. Some formats have multiple choices because they can store multiple types of file system. - - - -| Profile | Format | Read? | Write? | Filesystem? | -|:--------|:-------|:-----:|:------:|:------------| -| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | | -| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS | -| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | | -| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | | -| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS | -| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS | -| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS | -| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | | -| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | | -| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS | -| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS | -| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS | -| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS | -| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | | -| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | | -| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | -| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | -| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | -| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | -| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | -| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | -| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | | -| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | | -| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | | -| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE | -| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND | -| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | | -| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 | -| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | | -| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS | -| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | | -| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS | -{: .datatable } - + + + +| Profile | Format | Read? | Write? | Filesystem? | +|:--------|:-------|:-----:|:------:|:------------| +| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | | +| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS | +| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | | +| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | | +| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS | +| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS | +| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS | +| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | | +| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | | +| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS | +| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS | +| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS | +| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS | +| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | | +| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | | +| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | +| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | +| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | +| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | +| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | +| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | +| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | | +| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | | +| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | | +| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE | +| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND | +| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | | +| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 | +| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | | +| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS | +| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | | +| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS | +{: .datatable } + ### Notes diff --git a/build.py b/build.py index dfbdb107..c26718d8 100644 --- a/build.py +++ b/build.py @@ -2,7 +2,10 @@ from build.ab import export from build.c import clibrary, cxxlibrary from build.protobuf import proto, protocc from build.pkg import package +from build.utils import test +from glob import glob import config +import re package(name="protobuf_lib", package="protobuf") package(name="z_lib", package="zlib") @@ -216,6 +219,83 @@ cxxlibrary( ], ) +corpustests = [] +if not glob("../fluxengine-testdata/data"): + print("fluxengine-testdata not found; skipping corpus tests") +else: + corpus = [ + ("agat", "", "--drive.tpi=96"), + ("amiga", "", "--drive.tpi=135"), + ("apple2", "", "--140 --drive.tpi=96"), + ("atarist", "", "--360 --drive.tpi=135"), + ("atarist", "", "--370 --drive.tpi=135"), + ("atarist", "", "--400 --drive.tpi=135"), + ("atarist", "", "--410 --drive.tpi=135"), + ("atarist", "", "--720 --drive.tpi=135"), + ("atarist", "", "--740 --drive.tpi=135"), + ("atarist", "", "--800 --drive.tpi=135"), + ("atarist", "", "--820 --drive.tpi=135"), + ("bk", "", ""), + ("brother", "", "--120 --drive.tpi=135"), + ("brother", "", "--240 --drive.tpi=135"), + ( + "commodore", + "scripts/commodore1541_test.textpb", + "--171 --drive.tpi=96", + ), + ( + "commodore", + "scripts/commodore1541_test.textpb", + "--192 --drive.tpi=96", + ), + ("commodore", "", "--800 --drive.tpi=135"), + ("commodore", "", "--1620 --drive.tpi=135"), + ("hplif", "", "--264 --drive.tpi=135"), + ("hplif", "", "--608 --drive.tpi=135"), + ("hplif", "", "--616 --drive.tpi=135"), + ("hplif", "", "--770 --drive.tpi=135"), + ("ibm", "", "--1200 --drive.tpi=96"), + ("ibm", "", "--1232 --drive.tpi=96"), + ("ibm", "", "--1440 --drive.tpi=135"), + ("ibm", "", "--1680 --drive.tpi=135"), + ("ibm", "", "--180 --drive.tpi=96"), + ("ibm", "", "--160 --drive.tpi=96"), + ("ibm", "", "--320 --drive.tpi=96"), + ("ibm", "", "--360 --drive.tpi=96"), + ("ibm", "", "--720_96 --drive.tpi=96"), + ("ibm", "", "--720_135 --drive.tpi=135"), + ("mac", "scripts/mac400_test.textpb", "--400 --drive.tpi=135"), + ("mac", "scripts/mac800_test.textpb", "--800 --drive.tpi=135"), + ("n88basic", "", "--drive.tpi=96"), + ("rx50", "", "--drive.tpi=96"), + ("tids990", "", "--drive.tpi=48"), + ("victor9k", "", "--612 --drive.tpi=96"), + ("victor9k", "", "--1224 --drive.tpi=96"), + ] + + for c in corpus: + name = re.sub(r"[^a-zA-Z0-9]", "_", "".join(c), 0) + corpustests += [ + test( + name=f"corpustest_{name}_{format}", + ins=["src+fluxengine"], + deps=["scripts/encodedecodetest.sh"], + commands=[ + "{deps[0]} " + + c[0] + + " " + + format + + " {ins[0]} " + + c[1] + + " " + + c[2] + + ">/dev/null" + ], + label="CORPUSTEST", + ) + for format in ["scp", "flux"] + ] + export( name="all", items={ @@ -225,8 +305,6 @@ export( "brother240tool$(EXT)": "tools+brother240tool", "upgrade-flux-file$(EXT)": "tools+upgrade-flux-file", } - | ({"FluxEngine.pkg": "src/gui+fluxengine_pkg"} - if config.osx - else {}), - deps=["tests", "src/formats+docs", "scripts+mkdocindex"], + | ({"FluxEngine.pkg": "src/gui+fluxengine_pkg"} if config.osx else {}), + deps=["tests", "src/formats+docs", "scripts+mkdocindex"] + corpustests, ) diff --git a/build/c.py b/build/c.py index b94e73c6..2400fc0a 100644 --- a/build/c.py +++ b/build/c.py @@ -75,7 +75,9 @@ def findsources(name, srcs, deps, cflags, filerule): return objs -def libraryimpl(self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, kind): +def libraryimpl( + self, name, srcs, deps, hdrs, cflags, ldflags, commands, label, kind +): if not srcs and not hdrs: raise ABException( "clibrary contains no sources and no exported headers" @@ -203,7 +205,7 @@ def programimpl( normalrule( replaces=self, ins=(findsources(name, srcs, deps, cflags, filerule) + ars + ars), - outs=[basename(name)+"$(EXT)"], + outs=[basename(name) + "$(EXT)"], deps=deps, label=label, commands=commands, diff --git a/build/utils.py b/build/utils.py index cd51676b..e1a227aa 100644 --- a/build/utils.py +++ b/build/utils.py @@ -1,4 +1,4 @@ -from build.ab import Rule, normalrule, Target, filenameof +from build.ab import Rule, normalrule, Target, filenameof, Targets from os.path import basename @@ -14,11 +14,30 @@ def objectify(self, name, src: Target, symbol): @Rule -def test(self, name, command: Target): - normalrule( - replaces=self, - ins=[command], - outs=["sentinel"], - commands=["{ins[0]}", "touch {outs}"], - label="TEST", - ) +def test( + self, + name, + command: Target = None, + commands=None, + ins: Targets = [], + deps: Targets = [], + label="TEST", +): + if command: + normalrule( + replaces=self, + ins=[command], + outs=["sentinel"], + commands=["{ins[0]}", "touch {outs}"], + deps=deps, + label=label, + ) + else: + normalrule( + replaces=self, + ins=ins, + outs=["sentinel"], + commands=commands + ["touch {outs}"], + deps=deps, + label=label, + ) diff --git a/dep/emu/build.py b/dep/emu/build.py index 9531b053..a18f4db6 100644 --- a/dep/emu/build.py +++ b/dep/emu/build.py @@ -1,9 +1,3 @@ from build.c import clibrary -clibrary( - name="emu", - srcs=["./fnmatch.c"], - hdrs={ - "fnmatch.h": "./fnmatch.h" - } -) \ No newline at end of file +clibrary(name="emu", srcs=["./fnmatch.c"], hdrs={"fnmatch.h": "./fnmatch.h"}) diff --git a/dep/libusbp/build.py b/dep/libusbp/build.py index b6cb4910..2fe67486 100644 --- a/dep/libusbp/build.py +++ b/dep/libusbp/build.py @@ -60,7 +60,7 @@ else: clibrary( name="libusbp", srcs=srcs, - cflags =["-Idep/libusbp/include", "-Idep/libusbp/src"], + cflags=["-Idep/libusbp/include", "-Idep/libusbp/src"], ldflags=ldflags, deps=deps, hdrs={ From 0dbce00fe4c87d6ddf351e22dd605d7eda1c67bb Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 27 Oct 2023 21:38:44 +0200 Subject: [PATCH 32/49] Try building a Windows manifest. --- Makefile | 1 + extras/build.py | 10 ++++++++++ src/gui/build.py | 16 +++++++++++++++- src/gui/manifest.xml | 13 +++++++++++++ src/gui/windres.rc | 9 +++++++++ 5 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/gui/manifest.xml create mode 100644 src/gui/windres.rc diff --git a/Makefile b/Makefile index dec73042..9887892f 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ ifeq ($(OS), Windows_NT) PKG_CONFIG = $(MINGWBIN)/pkg-config WX_CONFIG = /usr/bin/sh $(MINGWBIN)/wx-config --static=yes PROTOC = $(MINGWBIN)/protoc + WINDRES = windres LDFLAGS += \ -static CXXFLAGS += \ diff --git a/extras/build.py b/extras/build.py index 69f76583..a0728955 100644 --- a/extras/build.py +++ b/extras/build.py @@ -32,3 +32,13 @@ normalrule( commands=["iconutil -c icns -o {outs[0]} {ins[0]}"], label="ICONUTIL", ) + +normalrule( + name="fluxengine_ico", + ins=["./icon.png"], + outs=["fluxengine.ico"], + commands=[ + "convert {ins[0]} -resize 64x46 -define icon:auto-resize=64,48,32,16 {outs[0]}" + ], + label="MAKEICON", +) diff --git a/src/gui/build.py b/src/gui/build.py index 31edbccf..c9f67189 100644 --- a/src/gui/build.py +++ b/src/gui/build.py @@ -14,6 +14,19 @@ WX_LDFLAGS := $(shell $(WX_CONFIG) --libs core base adv aui richtext) """ ) +extrasrcs = [] +if config.windows: + extrasrcs += [ + normalrule( + name="rc", + ins=["./windres.rc"], + outs=["rc.o"], + deps=["./manifest.xml", "extras+fluxengine_ico"], + commands=["$(WINDRES) {ins[0]} {outs[0]}"], + label="WINDRES", + ) + ] + cxxprogram( name="gui", srcs=[ @@ -35,7 +48,8 @@ cxxprogram( "./textviewerwindow.cc", "./visualisationcontrol.cc", "./layout.cpp", - ], + ] + + extrasrcs, cflags=["$(WX_CFLAGS)"], ldflags=["$(WX_LDFLAGS)"], deps=[ diff --git a/src/gui/manifest.xml b/src/gui/manifest.xml new file mode 100644 index 00000000..2ca99465 --- /dev/null +++ b/src/gui/manifest.xml @@ -0,0 +1,13 @@ + + + FluxEngine + + + + + + + + diff --git a/src/gui/windres.rc b/src/gui/windres.rc new file mode 100644 index 00000000..9d2a5059 --- /dev/null +++ b/src/gui/windres.rc @@ -0,0 +1,9 @@ +/* © 2023 David Given. + * FluxEngine is licensed under the MIT open source license. See the COPYING + * file in this distribution for the full text. + */ + +#include "winuser.h" + +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "src/gui/manifest.xml" +101 ICON DISCARDABLE ".obj/extras+fluxengine_ico/fluxengine.ico" From 112234401609de98f9281e5267dc05d73eaa0303 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 27 Oct 2023 21:28:47 +0100 Subject: [PATCH 33/49] Try to correctly build the manifest this time. --- README.md | 78 ++++++++++++++++++++++++------------------------ build/c.py | 2 ++ src/gui/build.py | 2 +- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index dd2cc632..8f2f3320 100644 --- a/README.md +++ b/README.md @@ -103,45 +103,45 @@ particular filesystem and can read (and sometimes write, support varies) files directly from disks, flux files or disk images. Some formats have multiple choices because they can store multiple types of file system. - - - -| Profile | Format | Read? | Write? | Filesystem? | -|:--------|:-------|:-----:|:------:|:------------| -| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | | -| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS | -| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | | -| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | | -| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS | -| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS | -| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS | -| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | | -| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | | -| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS | -| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS | -| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS | -| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS | -| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | | -| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | | -| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | -| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | -| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | -| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | -| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | -| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | -| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | | -| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | | -| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | | -| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE | -| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND | -| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | | -| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 | -| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | | -| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS | -| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | | -| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS | -{: .datatable } - + + + +| Profile | Format | Read? | Write? | Filesystem? | +|:--------|:-------|:-----:|:------:|:------------| +| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | | +| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS | +| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | | +| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | | +| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS | +| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS | +| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS | +| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | | +| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | | +| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS | +| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS | +| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS | +| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS | +| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | | +| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | | +| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | +| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | +| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | +| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | +| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | +| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | +| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | | +| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | | +| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | | +| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE | +| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND | +| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | | +| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 | +| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | | +| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS | +| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | | +| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS | +{: .datatable } + ### Notes diff --git a/build/c.py b/build/c.py index 2400fc0a..eef55ed1 100644 --- a/build/c.py +++ b/build/c.py @@ -71,6 +71,8 @@ def findsources(name, srcs, deps, cflags, filerule): for f in filenamesof(s) if f.endswith(".c") or f.endswith(".cc") or f.endswith(".cpp") ] + if any(f.endswith(".o") for f in filenamesof(s)): + objs += [s] return objs diff --git a/src/gui/build.py b/src/gui/build.py index c9f67189..a7118161 100644 --- a/src/gui/build.py +++ b/src/gui/build.py @@ -23,7 +23,7 @@ if config.windows: outs=["rc.o"], deps=["./manifest.xml", "extras+fluxengine_ico"], commands=["$(WINDRES) {ins[0]} {outs[0]}"], - label="WINDRES", + label="WINDRES" ) ] From 1e6993c12d251c4b2502ac4811249e69074066b5 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 27 Oct 2023 21:39:55 +0100 Subject: [PATCH 34/49] Add missing dependency. --- .github/workflows/ccpp.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index e7261d79..b478ec9a 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -59,18 +59,19 @@ jobs: install: >- diffutils make + mingw-w64-i686-binutils mingw-w64-i686-fmt mingw-w64-i686-gcc mingw-w64-i686-libusb + mingw-w64-i686-nsis mingw-w64-i686-pkg-config mingw-w64-i686-protobuf + mingw-w64-i686-python mingw-w64-i686-sqlite3 mingw-w64-i686-wxWidgets mingw-w64-i686-zlib - mingw-w64-i686-nsis - mingw-w64-i686-python - zip vim + zip - name: update-protobuf run: | pacman -U --noconfirm https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-protobuf-21.9-1-any.pkg.tar.zst From d2ff9806bd8cc16914dba768abb9f606900fa909 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 27 Oct 2023 21:47:22 +0100 Subject: [PATCH 35/49] Enable build logging. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index b478ec9a..1af7f327 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -84,7 +84,7 @@ jobs: repository: 'davidgiven/fluxengine-testdata' path: 'fluxengine-testdata' - name: build - run: make -j`nproc` -C fluxengine + run: make -j1 hide= -C fluxengine - name: nsis run: | From c90b0e7dc257686c2024d4fd3266a9fe24e2fa27 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 27 Oct 2023 22:10:00 +0100 Subject: [PATCH 36/49] Try and fix dependencies again... --- .github/workflows/ccpp.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 1af7f327..0bc9cf59 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -70,6 +70,7 @@ jobs: mingw-w64-i686-sqlite3 mingw-w64-i686-wxWidgets mingw-w64-i686-zlib + mingw-w64-imagemagick vim zip - name: update-protobuf @@ -84,7 +85,7 @@ jobs: repository: 'davidgiven/fluxengine-testdata' path: 'fluxengine-testdata' - name: build - run: make -j1 hide= -C fluxengine + run: make -j`nproc` -C fluxengine - name: nsis run: | From 15908c52bd367b7ee175ba7d8b6ea429226203a2 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 27 Oct 2023 22:12:46 +0100 Subject: [PATCH 37/49] Typo fix. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 0bc9cf59..775996a4 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -70,7 +70,7 @@ jobs: mingw-w64-i686-sqlite3 mingw-w64-i686-wxWidgets mingw-w64-i686-zlib - mingw-w64-imagemagick + mingw-w64-i686-imagemagick vim zip - name: update-protobuf From 43e6840e78fb4087e0971de5aa39c7a4f53cb8fa Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 28 Oct 2023 00:49:19 +0100 Subject: [PATCH 38/49] Try and set the imagemagick time limit? --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 775996a4..011019d2 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -85,7 +85,7 @@ jobs: repository: 'davidgiven/fluxengine-testdata' path: 'fluxengine-testdata' - name: build - run: make -j`nproc` -C fluxengine + run: MAGICK_TIME_LIMIT=100 make -j`nproc` -C fluxengine - name: nsis run: | From 38408820ca23a6b6fa9a493d23364bd3620775c1 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 28 Oct 2023 12:52:25 +0200 Subject: [PATCH 39/49] Update the release workflow. --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9272a53..0bf6e487 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,7 @@ jobs: mingw-w64-i686-wxWidgets mingw-w64-i686-zlib mingw-w64-i686-nsis + mingw-w64-i686-python zip vim - uses: actions/checkout@v3 @@ -42,7 +43,7 @@ jobs: - name: build run: | - make -j2 + MAGICK_TIME_LIMIT=100 make -j`nproc` - name: nsis run: | From b8929dd5896e115e876520d1fd293f11dc064534 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 28 Oct 2023 13:33:10 +0200 Subject: [PATCH 40/49] Fix Windows dependencies. --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bf6e487..f19cfb8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,18 +23,20 @@ jobs: install: >- diffutils make + mingw-w64-i686-binutils mingw-w64-i686-fmt mingw-w64-i686-gcc mingw-w64-i686-libusb + mingw-w64-i686-nsis mingw-w64-i686-pkg-config mingw-w64-i686-protobuf + mingw-w64-i686-python mingw-w64-i686-sqlite3 mingw-w64-i686-wxWidgets mingw-w64-i686-zlib - mingw-w64-i686-nsis - mingw-w64-i686-python - zip + mingw-w64-i686-imagemagick vim + zip - uses: actions/checkout@v3 - name: update-protobuf From 8b75609b7002f19c5f268c446d86c939760f6701 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 29 Oct 2023 11:18:05 +0100 Subject: [PATCH 41/49] Update line endings. --- doc/disk-40track_drive.md | 17 +---- doc/disk-acornadfs.md | 41 +----------- doc/disk-acorndfs.md | 40 +----------- doc/disk-aeslanier.md | 50 +-------------- doc/disk-agat.md | 38 +---------- doc/disk-amiga.md | 43 +------------ doc/disk-ampro.md | 54 +--------------- doc/disk-apple2.md | 76 +--------------------- doc/disk-apple2_drive.md | 18 +----- doc/disk-atarist.md | 63 +----------------- doc/disk-bk.md | 32 +--------- doc/disk-brother.md | 130 +------------------------------------- doc/disk-commodore.md | 76 +--------------------- doc/disk-eco1.md | 44 +------------ doc/disk-epsonpf10.md | 21 +----- doc/disk-f85.md | 49 +------------- doc/disk-fb100.md | 50 +-------------- doc/disk-hplif.md | 44 +------------ doc/disk-ibm.md | 124 +----------------------------------- doc/disk-icl30.md | 21 +----- doc/disk-mac.md | 75 +--------------------- doc/disk-micropolis.md | 89 +------------------------- doc/disk-ms2000.md | 35 +--------- doc/disk-mx.md | 71 +-------------------- doc/disk-n88basic.md | 28 +------- doc/disk-northstar.md | 52 +-------------- doc/disk-psos.md | 34 +--------- doc/disk-rolandd20.md | 50 +-------------- doc/disk-rx50.md | 25 +------- doc/disk-shugart_drive.md | 17 +---- doc/disk-smaky6.md | 36 +---------- doc/disk-tids990.md | 41 +----------- doc/disk-tiki.md | 29 +-------- doc/disk-victor9k.md | 64 +------------------ doc/disk-zilogmcz.md | 44 +------------ 35 files changed, 70 insertions(+), 1651 deletions(-) diff --git a/doc/disk-40track_drive.md b/doc/disk-40track_drive.md index 203628f8..f5ce0ddb 100644 --- a/doc/disk-40track_drive.md +++ b/doc/disk-40track_drive.md @@ -1,15 +1,2 @@ -40track_drive -==== -## Adjust configuration for a 40-track drive - - -This is an extension profile; adding this to the command line will configure -FluxEngine to read from 40-track, 48tpi 5.25" drives. You have to tell it because there is -no way to detect this automatically. - -For example: - -``` -fluxengine read ibm --180 40track_drive -``` - +-d +\r diff --git a/doc/disk-acornadfs.md b/doc/disk-acornadfs.md index 2e63eff3..f5ce0ddb 100644 --- a/doc/disk-acornadfs.md +++ b/doc/disk-acornadfs.md @@ -1,39 +1,2 @@ -acornadfs -==== -## BBC Micro, Archimedes - - -Acorn ADFS disks are used by the 6502-based BBC Micro and ARM-based Archimedes -series of computers. They are yet another variation on MFM encoded IBM scheme -disks, although with different sector sizes and with the 0-based sector -identifiers rather than 1-based sector identifiers. The index hole is ignored -and sectors are written whereever, requiring FluxEngine to do two revolutions -to read a disk. - -There are various different kinds, which should all work out of the box. - -Be aware that Acorn logical block numbering goes all the way up side 0 and -then all the way up side 1. However, FluxEngine uses traditional disk images -with alternating sides, with the blocks from track 0 side 0 then track 0 side -1 then track 1 side 0 etc. Most Acorn emulators will use both formats, but -they might require nudging as the side order can't be reliably autodetected. - -## Options - - - Format variants: - - `160`: 160kB 3.5" or 5.25" 40-track SSDD; S format - - `320`: 320kB 3.5" or 5.25" 80-track SSDD; M format - - `640`: 640kB 3.5" or 5.25" 80-track DSDD; L format - - `800`: 800kB 3.5" 80-track DSDD; D and E formats - - `1600`: 1600kB 3.5" 80-track DSHD; F formats - -## Examples - -To read: - - - `fluxengine read acornadfs --160 -s drive:0 -o acornadfs.img` - - `fluxengine read acornadfs --320 -s drive:0 -o acornadfs.img` - - `fluxengine read acornadfs --640 -s drive:0 -o acornadfs.img` - - `fluxengine read acornadfs --800 -s drive:0 -o acornadfs.img` - - `fluxengine read acornadfs --1600 -s drive:0 -o acornadfs.img` - +-d +\r diff --git a/doc/disk-acorndfs.md b/doc/disk-acorndfs.md index a36b0ddc..f5ce0ddb 100644 --- a/doc/disk-acorndfs.md +++ b/doc/disk-acorndfs.md @@ -1,38 +1,2 @@ -acorndfs -==== -## Acorn Atom, BBC Micro series - - -Acorn DFS disks are used by the Acorn Atom and BBC Micro series of computers. -They are pretty standard FM encoded IBM scheme disks, with 256-sectors and -0-based sector identifiers. There's nothing particularly special here. - -DFS disks are all single-sided, but allow the other side of the disk to be -used as another volume. - -They come in two varieties, 40 track and 80 track. These should both work. -Some rare disks are both at the same time. FluxEngine can read these but it -requires a bit of fiddling as they have the same tracks on twice. - -## Options - - - Format variants: - - `100`: 100kB 40-track SSSD - - `200`: 200kB 80-track SSSD - -## Examples - -To read: - - - `fluxengine read acorndfs --100 -s drive:0 -o acorndfs.img` - - `fluxengine read acorndfs --200 -s drive:0 -o acorndfs.img` - -To write: - - - `fluxengine write acorndfs --100 -d drive:0 -i acorndfs.img` - - `fluxengine write acorndfs --200 -d drive:0 -i acorndfs.img` - -## References - - - [The Acorn DFS disc format](https://beebwiki.mdfs.net/Acorn_DFS_disc_format) - +-d +\r diff --git a/doc/disk-aeslanier.md b/doc/disk-aeslanier.md index 73073fc3..f5ce0ddb 100644 --- a/doc/disk-aeslanier.md +++ b/doc/disk-aeslanier.md @@ -1,48 +1,2 @@ -aeslanier -==== -## 616kB 5.25" 77-track SSDD hard sectored - - -Back in 1980 Lanier released a series of very early integrated word processor -appliances, the No Problem. These were actually [rebranded AES Data Superplus -machines](http://vintagecomputers.site90.net/aes/). They were gigantic, -weighed 40kg, and one example I've found cost ꆲ5bb4 -of nearly ㇢1a6e - -8080 machines with 32kB of RAM, they ran their own proprietary word -processing software off twin 5.25" drive units, but apparently other software -was available. - -The disk format is exceptionally weird. They used 77 track, 32 sector, single-sided -_hard_ sectored disks, where there were multiple index holes, -indicating to the hardware where the sectors start. The encoding scheme -itself is [MMFM (aka -M2FM)](http://www.retrotechnology.com/herbs_stuff/m2fm.html), an early -attempt at double-density disk encoding which rapidly got obsoleted by the -simpler MFM --- and the bytes are stored on disk _backwards_. Even aside from -the encoding, the format on disk was strange; unified sector header/data -records, so that the sector header (containing the sector and track number) -is actually inside the user data. - -FluxEngine can read these, but I only have a single, fairly poor example of a -disk image, and I've had to make a lot of guesses as to the sector format -based on what looks right. If anyone knows _anything_ about these disks, -[please get in touch](https://github.com/davidgiven/fluxengine/issues/new). - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read aeslanier -s drive:0 -o aeslanier.img` - -## References - - * [SA800 Diskette Storage Drive - Theory Of - Operations](http://www.hartetechnologies.com/manuals/Shugart/50664-1_SA800_TheorOp_May78.pdf): - talks about MMFM a lot, but the Lanier machines didn't use this disk - format. - +-d +\r diff --git a/doc/disk-agat.md b/doc/disk-agat.md index dc2b579d..f5ce0ddb 100644 --- a/doc/disk-agat.md +++ b/doc/disk-agat.md @@ -1,36 +1,2 @@ -agat -==== -## 840kB 5.25" 80-track DS - - -The Agat (Russian: ↊fd74 -1983. These were based around a 6502 and were nominally Apple II-compatible -although with enough differences to be problematic. - -They could use either standard Apple II 140kB disks, or a proprietary 840kb -MFM-based double-sided format. FluxEngine supports both of these; this profile -is for the proprietary format. for the Apple II format, use the `apple2` -profile. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read agat -s drive:0 -o agat.img` - -To write: - - - `fluxengine write agat -d drive:0 -i agat.img` - -## References - - - [Magazine article on the - Agat](https://sudonull.com/post/54185-Is-AGAT-a-bad-copy-of-Apple) - - - [Forum thread with (some) documentation on the - format](https://torlus.com/floppy/forum/viewtopic.php?t=1385) - +-d +\r diff --git a/doc/disk-amiga.md b/doc/disk-amiga.md index fe40ed94..f5ce0ddb 100644 --- a/doc/disk-amiga.md +++ b/doc/disk-amiga.md @@ -1,41 +1,2 @@ -amiga -==== -## 880kB 3.5" DSDD - - -Amiga disks use MFM, but don't use IBM scheme. Instead, the entire track is -read and written as a unit, with each sector butting up against the previous -one. This saves a lot of space which allows the Amiga to not just store 880kB -on a DD disk, but _also_ allows an extra 16 bytes of metadata per sector. - -This metadata is mostly unused, so the default for FluxEngine is to ignore it -and just use the 512 bytes of main sector data. If you want it, specify a -528-byte sector size. The metadata will come after the user data. - -Bizarrely, the data in each sector is stored with all the odd bits first, and -then all the even bits. This is tied into the checksum algorithm, which is -distinctly subpar and not particularly good at detecting errors. - -## Options - - - Sector size: - - `without_metadata`: 512-byte sectors - - `with_metadata`: 528-byte sectors - -## Examples - -To read: - - - `fluxengine read amiga -s drive:0 -o amiga.adf` - -To write: - - - `fluxengine write amiga -d drive:0 -i amiga.adf` - -## References - - - [The Amiga Floppy Boot Process and Physical - Layout](https://wiki.amigaos.net/wiki/Amiga_Floppy_Boot_Process_and_Physical_Layout) - - - [The Amiga Disk File FAQ](http://lclevy.free.fr/adflib/adf_info.html) - +-d +\r diff --git a/doc/disk-ampro.md b/doc/disk-ampro.md index f1b51f32..f5ce0ddb 100644 --- a/doc/disk-ampro.md +++ b/doc/disk-ampro.md @@ -1,52 +1,2 @@ -ampro -==== -## CP/M - - -The Ampro Little Board was a very simple and cheap Z80-based computer from -1984, which ran CP/M. It was, in fact, a single PCB which you could mount -on the bottom of a 5.25" drive. - -[All about the Ampro Little Board](http://oldcomputers.net/ampro-little-board.html) - -It stored either 400kB on a double-sided 40-track drive or 800kB on a -double-sided 80 track drive. The disk format it used was a slightly quirky -variation of the standard MFM IBM scheme --- sector numbering starts at 17 -rather than 1 (or Acorn's 0). FluxEngine supports this. - -FluxEngine has direct filesystem support for these disks, or you can pass the -disk images into [cpmtools](http://www.moria.de/~michael/cpmtools/): - -``` -$ cpmls -f ampdsdd ampro.img -0: --a60014.e -amprodsk.com -bitchk.doc -bitchk.mac -cpmmac.mac -dir.com -himem.doc -himem.mac -kaydiag.lbr -kayinfo.lbr -...etc... -``` - -## Options - - - Format variants: - - `400`: 400kB 40-track DSDD - - `800`: 800kB 80-track DSDD - -## Examples - -To read: - - - `fluxengine read ampro --400 -s drive:0 -o ampro.img` - - `fluxengine read ampro --800 -s drive:0 -o ampro.img` - -## References - - - [The Ampro Little Board](http://oldcomputers.net/ampro-little-board.html) - +-d +\r diff --git a/doc/disk-apple2.md b/doc/disk-apple2.md index d866a497..f5ce0ddb 100644 --- a/doc/disk-apple2.md +++ b/doc/disk-apple2.md @@ -1,74 +1,2 @@ -apple2 -==== -## Prodos, Appledos, and CP/M - - -Apple II disks are nominally fairly sensible 40-track, single-sided, 256 -bytes-per-sector jobs. However, they come in two varieties: DOS 3.3/ProDOS and -above, and pre-DOS 3.3. They use different GCR encoding systems, dubbed -6-and-2 and 5-and-3, and are mutually incompatible (although in some rare -cases you can mix 6-and-2 and 5-and-3 sectors on the same disk). - -The difference is in the drive controller; the 6-and-2 controller is capable -of a more efficient encoding, and can fit 16 sectors on a track, storing -140kB on a disk. The 5-and-3 controller can only fit 13, with a mere 114kB. - -Both formats use GCR (in different varieties) in a nice, simple grid of -sectors, unlike the Macintosh. Like the Macintosh, there's a crazy encoding -scheme applied to the data before it goes down on disk to speed up -checksumming. - -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 -having spiral tracks! Copy protection for the Apple II was even madder than -on other systems. - -FluxEngine can only read well-behaved 6-and-2 disks. It doesn't even try to -handle the weird stuff. - -Apple DOS also applies logical sector remapping on top of the physical sector -numbering on the disk, and this _varies_ depending on what the disk is for. -FluxEngine can remap the sectors from physical to logical using modifiers. If -you don't specify a remapping modifier, you get the sectors in the order they -appear on the disk. - -If you don't want an image in physical sector order, specify one of the -filesystem ordering options. These also select the appropriate file system; -FluxEngine has read-only support for all of these. - -In addition, some third-party systems use 80-track double sides drives, with -the same underlying disk format. The complication here is that the AppleDOS -filesystem only supports up to 50 tracks, so it needs tweaking to support -larger disks. It treats the second side of the disk as a completely different -volume. - -## Options - - - Format variants: - - `140`: 140kB 5.25" 35-track SS - - `640`: 640kB 5.25" 80-track DS - - Filesystem and sector skew: - - `nofs`: use physical CHS sector order and no file system - - `appledos`: use AppleDOS soft sector skew and file system - - `prodos`: use ProDOS soft sector skew and filesystem - - `cpm`: use CP/M soft sector skew and filesystem - - `side1`: for AppleDOS file system access, read the volume on side 1 of a disk - -## Examples - -To read: - - - `fluxengine read apple2 --140 -s drive:0 -o apple2.img` - - `fluxengine read apple2 --640 -s drive:0 -o apple2.img` - -To write: - - - `fluxengine write apple2 --140 -d drive:0 -i apple2.img` - - `fluxengine write apple2 --640 -d drive:0 -i apple2.img` - -## References - - - [Beneath Apple DOS](https://fabiensanglard.net/fd_proxy/prince_of_persia/Beneath%20Apple%20DOS.pdf) - - - [MAME's ap2_dsk.cpp file](https://github.com/mamedev/mame/blob/4263a71e64377db11392c458b580c5ae83556bc7/src/lib/formats/ap2_dsk.cpp) - +-d +\r diff --git a/doc/disk-apple2_drive.md b/doc/disk-apple2_drive.md index e631d138..f5ce0ddb 100644 --- a/doc/disk-apple2_drive.md +++ b/doc/disk-apple2_drive.md @@ -1,16 +1,2 @@ -apple2_drive -==== -## Adjust configuration for a 40-track Apple II drive - - -This is an extension profile; adding this to the command line will configure -FluxEngine to adjust the pinout and track spacing to work with an Apple II -drive. This only works on Greaseweazle hardware and requires a custom -connector. - -For example: - -``` -fluxengine read apple2 --160 apple2_drive -``` - +-d +\r diff --git a/doc/disk-atarist.md b/doc/disk-atarist.md index 25f3e11e..f5ce0ddb 100644 --- a/doc/disk-atarist.md +++ b/doc/disk-atarist.md @@ -1,61 +1,2 @@ -atarist -==== -## Almost PC compatible - - -Atari ST disks are standard MFM encoded IBM scheme disks without an IAM header. -Disks are typically formatted 512 bytes per sector with between 9-10 (sometimes -11!) sectors per track and 80-82 tracks per side. - -For some reason, occasionally formatting software will put an extra IDAM record -with a sector number of 66 on a disk, which can horribly confuse things. The -Atari profiles below are configured to ignore these. - -Be aware that many PC drives (including mine) won't do the 82 track formats. - -## Options - - - Format variants: - - `360`: 360kB 3.5" 80-track 9-sector SSDD - - `370`: 370kB 3.5" 82-track 9-sector SSDD - - `400`: 400kB 3.5" 80-track 10-sector SSDD - - `410`: 410kB 3.5" 82-track 10-sector SSDD - - `720`: 720kB 3.5" 80-track 9-sector DSDD - - `740`: 740kB 3.5" 82-track 9-sector DSDD - - `800`: 800kB 3.5" 80-track 10-sector DSDD - - `820`: 820kB 3.5" 82-track 10-sector DSDD - -## Examples - -To read: - - - `fluxengine read atarist --360 -s drive:0 -o atarist.img` - - `fluxengine read atarist --370 -s drive:0 -o atarist.img` - - `fluxengine read atarist --400 -s drive:0 -o atarist.img` - - `fluxengine read atarist --410 -s drive:0 -o atarist.img` - - `fluxengine read atarist --720 -s drive:0 -o atarist.img` - - `fluxengine read atarist --740 -s drive:0 -o atarist.img` - - `fluxengine read atarist --800 -s drive:0 -o atarist.img` - - `fluxengine read atarist --820 -s drive:0 -o atarist.img` - -To write: - - - `fluxengine write atarist --360 -d drive:0 -i atarist.img` - - `fluxengine write atarist --370 -d drive:0 -i atarist.img` - - `fluxengine write atarist --400 -d drive:0 -i atarist.img` - - `fluxengine write atarist --410 -d drive:0 -i atarist.img` - - `fluxengine write atarist --720 -d drive:0 -i atarist.img` - - `fluxengine write atarist --740 -d drive:0 -i atarist.img` - - `fluxengine write atarist --800 -d drive:0 -i atarist.img` - - `fluxengine write atarist --820 -d drive:0 -i atarist.img` - -## References - - - [Atari ST Floppy Drive Hardware - Information](https://info-coach.fr/atari/hardware/FD-Hard.php) by Jean - Louis-Guerin - - - [Atari ST Floppy Drive Software - Information](https://info-coach.fr/atari/software/FD-Soft.php) by Jean - Louis-Guerin - +-d +\r diff --git a/doc/disk-bk.md b/doc/disk-bk.md index fa18d96a..f5ce0ddb 100644 --- a/doc/disk-bk.md +++ b/doc/disk-bk.md @@ -1,30 +1,2 @@ -bk -==== -## 800kB 5.25"/3.5" 80-track 10-sector DSDD - - -The BK (an abbreviation for 1ba9 -is a Soviet era personal computer from Elektronika based on a PDP-11 -single-chip processor. It was the _only_ official, government approved home -computer in mass production at the time. - -It got a floppy interface in 1989 when the 128kB BK-0011 was released. This -used a relatively normal double-sided IBM scheme format with 80 sectors and ten -sectors per track, resulting in 800kB disks. The format is, in fact, identical -to the Atari ST 800kB format. Either 5.25" or 3.5" drives were used depending -on what was available at the time, with the same format on both. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read bk -s drive:0 -o bk800.img` - -To write: - - - `fluxengine write bk -d drive:0 -i bk800.img` - +-d +\r diff --git a/doc/disk-brother.md b/doc/disk-brother.md index 7d3e2ea8..f5ce0ddb 100644 --- a/doc/disk-brother.md +++ b/doc/disk-brother.md @@ -1,128 +1,2 @@ -brother -==== -## GCR family - - -Brother word processor disks are weird, using custom tooling and chipsets. -They are completely not PC compatible in every possible way other than the -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 -`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 -disk don't line up with the position of the head in a PC drive). The word -processors themselves solved this by microstepping until they found where the -real track is, but normal PC drives aren't capable of doing this. Particularly -with the 120kB disks, you might want to fiddle with the start track (e.g. -`:t=0-79x2`) to get a clean read. Keep an eye on the bad sector map that's -dumped at the end of a read. My word processor likes to put logical track 0 on -physical track 3, which means that logical track 77 is on physical track 80; -luckily my PC drive can access track 80. - -Using FluxEngine to *write* disks isn't a problem, so the -simplest solution is to use FluxEngine to create a new disk, with the tracks -aligned properly, and then use a word processor to copy the files you want -onto it. The new disk can then be read and you can extract the files. -Obviously this sucks if you don't actually have a word processor, but I can't -do anything about that. - -If you find one of these misaligned disks then *please* [get in -touch](https://github.com/davidgiven/fluxengine/issues/new); I want to -investigate. - -## Options - - - Format variants: - - `120`: 120kB 3.5" 39-track SS GCR - - `240`: 240kB 3.5" 78-track SS GCR - -## Examples - -To read: - - - `fluxengine read brother --120 -s drive:0 -o brother.img` - - `fluxengine read brother --240 -s drive:0 -o brother.img` - -To write: - - - `fluxengine write brother --120 -d drive:0 -i brother.img` - - `fluxengine write brother --240 -d drive:0 -i brother.img` - -Dealing with misaligned disks ------------------------------ - -While FluxEngine can't read misaligned disks directly, Brother word processors -_can_. If you have access to a compatible word processor, there's a fairly -simple workaround to allow you to extract the data: - - 1. Format a disk using FluxEngine (by simply writing a blank filesystem image - to a disk). This will have the correct alignment to work on a PC drive. - - 2. Use a word processor to copy the misaligned disk to the newly formatted - disk. The machine will happily adjust itself to both sets of alignments. - - 3. Use FluxEngine to read the data off the correctly aligned disk. - -I realise this is rather unsatisfactory, as the Brother hardware is becoming -rarer and they cope rather badly with damaged disks, but this is a limitation -of the hardware of normal PC drives. (It _is_ possible to deliberately misalign -a drive to make it match up with a bad disk, but this is for experts only --- I -wouldn't dare.) - -Low level format ----------------- - -The drive is a single-sided 3.5" drive spinning at not 300 rpm (I don't know -the precise speed yet but FluxEngine doesn't care). The 240kB disks have 78 -tracks and the 120kB disks have 39. - -Each track has 12 256-byte sectors. The drive ignores the index hole so they're -lined up all anyhow. As FluxEngine can only read from index to index, it -actually reads two complete revolutions and reassembles the sectors from that. - -The underlying encoding is exceptionally weird; they use two different kinds of -GCR, one kind for the sector header records and a completely different one for -the data itself. It also has a completely bizarre CRC variant which a genius on -StackOverflow reverse engineered for me. However, odd though it may be, it does -seem pretty robust. - -See the source code for the GCR tables and CRC routine. - -Sectors are about 16.2ms apart on the disk (at 300 rpm). The header and -data records are 0.694ms apart. (All measured from the beginning of the -record.) The sector order is 05a3816b4927, which gives a sector skew of 5. - -High level format ------------------ - -Once decoded, you end up with a file system image. FluxEngine supports direct -filesystem access for both kinds of disks. - -### 120kB disks - -These disks use a proprietary and very simple file system. It's FAT-like -with an obvious directory and allocation table. It's supported by FluxEngine. - -Any files whose names begin with an asterisk (`*`) will be marked as hidden. If -the file is named `*boot`, then a boot sector will be created which will load -and run the file at 0x7000 if the machine is started with CODE+Q pressed. So -far this has only been confirmed to work on a WP-1. - -### 240kB disks - -Conversely, the 240kB disks turns out to be a completely normal Microsoft FAT -file system with a media type of 0x58 --- did you know that FAT supports 256 -byte sectors? I didn't --- of the MSX-DOS variety. There's a faint -possibility that the word processor is based on MSX-DOS, but I haven't -reverse engineered it to find out. - -Standard Linux mtools will access the filesystem image and allow you to move -files in and out. However, you'll need to change the media type bytes at -offsets 0x015 and 0x100 from 0x58 to 0xf0 before mtools will touch it. The -supplied `brother240tool` will do this. Additionally, FluxEngine's own FAT -file system supports this. - +-d +\r diff --git a/doc/disk-commodore.md b/doc/disk-commodore.md index c2ad45f9..f5ce0ddb 100644 --- a/doc/disk-commodore.md +++ b/doc/disk-commodore.md @@ -1,74 +1,2 @@ -commodore -==== -## 1541, 1581, 8050 and variations - - -Commodore 8-bit computer 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 with a slightly odd sector -count. - -The GCR disks are much more interesting. They could store 170kB on a -single-sided disk (although later drives were double-sided), using a proprietary -encoding and record scheme; like [Apple Macintosh disks](macintosh.md) they -stored varying numbers of sectors per track to make the most of the physical -disk area, although unlike them they did it by changing the bitrate rather than -adjusting the motor speed. - -The drives were also intelligent and ran DOS on a CPU inside them. The -computer itself knew nothing about file systems. You could even upload -programs onto the drive and run them there, allowing all sorts of custom disk -formats, although this was mostly used to compensate for the [cripplingly -slow connection to the -computer](https://ilesj.wordpress.com/2014/05/14/1541-why-so-complicated/) of -300 bytes per second (!). (The drive itself could transfer data reasonably -quickly.) - - - a 1541 disk has 35 tracks of 17 to 21 sectors, each 256 bytes long - (sometimes 40 tracks), and uses GCR encoding. - - - a standard 1581 disk has 80 tracks and two sides, each with 10 sectors, 512 - bytes long, and uses normal IBM encoding. - - - an 8050 disk has 77 tracks and two sides, with four speed zones; the number - of sectors varies from 23 to 29, using GCR encoding. These will store - 1042kB. These drives are peculiar because they are 100tpi and therefore the - disks cannot be read in normal 96tpi drives. - - - a CMD FD2000 disk (a popular third-party Commodore disk drive) has 81 - tracks and two sides, each with 10 1024-byte sectors, for a massive 1620kB - of storage. This also uses IBM encoding. - -A CMD FD2000 disk (a popular third-party Commodore disk drive) - -## Options - - - Format variants: - - `171`: 171kB 1541, 35-track variant - - `192`: 192kB 1541, 40-track variant - - `800`: 800kB 3.5" 1581 - - `1042`: 1042kB 5.25" 8051 - - `1620`: 1620kB, CMD FD2000 - -## Examples - -To read: - - - `fluxengine read commodore --171 -s drive:0 -o commodore.d64` - - `fluxengine read commodore --192 -s drive:0 -o commodore.d64` - - `fluxengine read commodore --800 -s drive:0 -o commodore.d64` - - `fluxengine read commodore --1042 -s drive:0 -o commodore.d64` - - `fluxengine read commodore --1620 -s drive:0 -o commodore.d64` - -To write: - - - `fluxengine write commodore --171 -d drive:0 -i commodore.d64` - - `fluxengine write commodore --192 -d drive:0 -i commodore.d64` - - `fluxengine write commodore --800 -d drive:0 -i commodore.d64` - - `fluxengine write commodore --1620 -d drive:0 -i commodore.d64` - -## References - - - [Ruud's Commodore Site: 1541](http://www.baltissen.org/newhtm/1541c.htm): - documentation on the 1541 disk format. - +-d +\r diff --git a/doc/disk-eco1.md b/doc/disk-eco1.md index f31ca3a1..f5ce0ddb 100644 --- a/doc/disk-eco1.md +++ b/doc/disk-eco1.md @@ -1,42 +1,2 @@ -eco1 -==== -## CP/M; 1210kB 77-track mixed format DSHD - - -The Eco1 is a Italian CP/M machine produced in 1982. It had 64kB of RAM, in -later models expandable up to 384kB, and _two_ Z80 processors. One of these was -used solely for managing the twin 8" drives, each storing 1.2MB, which was -quite impressive for a CP/M machine in those days. Visually it is best -described as 'very brown'. - -
- A contemporary advert for the Eco1 -
- -Its format is standard IBM scheme, but with an interesting wrinkle: there are -_three_ different formatting zones on the disk: - - - Track 0 side 0: 26 sectors, 128 bytes per sector (3296 bytes) - - Track 0 side 1: 26 sectors, 256 bytes per sector (6656 bytes) - - All others: 16 sectors, 512 bytes per sector (8192 bytes) - -The standard `read ibm` command will autodetect and read these disks, but due -to the format confusing the size autodetection the images need postprocessing -to be useful, so there's a custom profile for the Eco1 which produces sensible -images. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read eco1 -s drive:0 -o eco1.img` - -## References - - - [Apulio Retrocomputing's page on the - Eco1](https://www.apuliaretrocomputing.it/wordpress/?p=8976) - +-d +\r diff --git a/doc/disk-epsonpf10.md b/doc/disk-epsonpf10.md index 4f272f09..f5ce0ddb 100644 --- a/doc/disk-epsonpf10.md +++ b/doc/disk-epsonpf10.md @@ -1,19 +1,2 @@ -epsonpf10 -==== -## CP/M; 3.5" 40-track DSDD - - -The Epson PF10 is the disk unit for the Epson Z80 series of 'laptops', running -CP/M. It uses a single-sided 40-track 3.5" format, which is unusual, but the -format itself is yet another IBM scheme variant. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read epsonpf10 -s drive:0 -o epsonpf10.img` - +-d +\r diff --git a/doc/disk-f85.md b/doc/disk-f85.md index 3f99b343..f5ce0ddb 100644 --- a/doc/disk-f85.md +++ b/doc/disk-f85.md @@ -1,47 +1,2 @@ -f85 -==== -## 461kB 5.25" 77-track SS - - -The Durango F85 was an early office computer based around a 5MHz 8085 processor, -sold in 1977. It had an impressive 64kB of RAM, upgradable to 128kB, and ran -its own multitasking operating system call DX-85M, as well as CP/M. It had an -interesting electric-typewriter form factor, with a little monitor sitting on -the side of it --- in operation you were facing the 14" printer. - -It was touted as being portable. Which it was, if you were strong; the story -is that they had to do an extensive search to find someone capable of lifting -it for the following photo... - -
-A Durango F85, held precariously -
- -...and even then, they had to airbrush out the tendons in her neck from the -effort! - -It used 5.25 soft-sectored disks storing an impressive-for-those-days -480kBish on a side, using a proprietary 4-in-5 GCR encoding. They used 77 -tracks, 12 sectors and 512 bytes per sector. Later models used double-sided -disks; I don't have access to an image of one so don't know how they work -(there's a suspicious looking spare byte in the sector header which could -store the side). As always, if you have one, please [get in -touch](https://github.com/davidgiven/fluxengine/issues/new). - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read f85 -s drive:0 -o f85.img` - -## References - -There's amazingly little information about these things. - - * [Chuck Guzis' F85 page](http://www.sydex.com/durango/durango.html) with - lots of pictures - +-d +\r diff --git a/doc/disk-fb100.md b/doc/disk-fb100.md index 2ba81422..f5ce0ddb 100644 --- a/doc/disk-fb100.md +++ b/doc/disk-fb100.md @@ -1,48 +1,2 @@ -fb100 -==== -## 100kB 3.5" 40-track SSSD - - -The Brother FB-100 is a serial-attached smart floppy drive used by a several -different machines for mass storage, including the Tandy Model 100 and -clones, the Husky Hunter 2, and (bizarrely) several knitting machines. It was -usually rebadged, sometimes with a cheap paper label stuck over the Brother -logo, but the most common variant appears to be the Tandy Portable Disk Drive -or TPDD: - -
- A Tandy Portable Disk Drive -
- -It's a bit of an oddball: the disk encoding is FM with a very custom record -scheme: 40-track single-sided 3.5" disks storing 100kB or so each. Each track -had only _two_ sectors, each 1280 bytes, but with an additional 12 bytes of -ID data used for filesystem management. - -There was also apparently a TPDD-2 which could store twice as much data, but -I don't have access to one of those disks. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read fb100 -s drive:0 -o fb100.img` - -## References - - - [Tandy Portable Disk Drive operations - manual](http://www.classiccmp.org/cini/pdf/Tandy/Portable%20Disk%20Drive%20Operation%20Manual.pdf) - - - [Tandy Portable Disk Drive service - manual](https://archive.org/details/TandyPortableDiskDriveSoftwareManual26-3808s) - - - [TPDD design notes (including a dump of the - ROM)](http://bitchin100.com/wiki/index.php?title=TPDD_Design_Notes) - - - [Knitting machine FB-100 - resources](http://www.k2g2.org/wiki:brother_fb-100) - +-d +\r diff --git a/doc/disk-hplif.md b/doc/disk-hplif.md index f5cf22f6..f5ce0ddb 100644 --- a/doc/disk-hplif.md +++ b/doc/disk-hplif.md @@ -1,42 +1,2 @@ -hplif -==== -## a variety of disk formats used by HP - - -LIF, a.k.a. Logical Interchange Format, is a series of formats used by -Hewlett-Packard across their entire range of computers, from calculators to -modern servers. It also defines a simple non-hierarchical filesystem which is -bizarrely _still_ supported by HP-UX systems. - -Floppy-disk wise, they're yet more variations of the standard IBM floppy -encoding scheme. - -## Options - - - Format variants: - - `264`: 264kB 3.5" 66-track SSDD; HP9121 format - - `608`: 608kB 3.5" 76-track DSDD; HP9122 format - - `616`: 616kB 3.5" 77-track DSDD - - `770`: 770kB 3.5" 77-track DSDD - -## Examples - -To read: - - - `fluxengine read hplif --264 -s drive:0 -o hplif.img` - - `fluxengine read hplif --608 -s drive:0 -o hplif.img` - - `fluxengine read hplif --616 -s drive:0 -o hplif.img` - - `fluxengine read hplif --770 -s drive:0 -o hplif.img` - -To write: - - - `fluxengine write hplif --264 -d drive:0 -i hplif.img` - - `fluxengine write hplif --608 -d drive:0 -i hplif.img` - - `fluxengine write hplif --616 -d drive:0 -i hplif.img` - - `fluxengine write hplif --770 -d drive:0 -i hplif.img` - -## References - - * [A summary of the Hewlett Packard floppy disk - formats](http://www.bitsavers.org/pdf/hp/disc/912x/HP_Flexible_Disk_Formats.pdf) - +-d +\r diff --git a/doc/disk-ibm.md b/doc/disk-ibm.md index 742be528..f5ce0ddb 100644 --- a/doc/disk-ibm.md +++ b/doc/disk-ibm.md @@ -1,122 +1,2 @@ -ibm -==== -## Generic PC 3.5"/5.25" disks - - -IBM scheme disks are _the_ most common disk format, ever. They're used by a -huge variety of different systems, and they come in a huge variety of different -forms, but they're all fundamentally the same: either FM or MFM, either single- -or double-sided, with distinct sector header and data records and no sector -metadata. Systems which use IBM scheme disks include but are not limited to: - - - IBM PCs (naturally) - - Atari ST - - late era Apple machines - - Acorn machines - - the TRS-80 - - late era Commodore machines (the 1571 and so on) - - most CP/M machines - - NEC PC-88 series - - NEC PC-98 series - - Sharp X68000 - - Fujitsu FM Towns - - VAX & PDP-11 - - etc - -FluxEngine supports reading these. However, some variants are more peculiar -than others, and as a result there are specific decoders which set the defaults -correctly for certain formats (for example: on PC disks the sector numbers -start from 1, but on Acorn disks they start from 0). The IBM decoder described -here is the generic one, and is suited for 'conventional' PC disks. While you -can read all the variant formats with it if you use the right set of arguments, -it's easier to use the specific decoder. - -There is a generic decoder which should adjust automatically to whichever disk -format you are using, but it's unreliable and not recommended. This format -should also be used if you are writing images such as DIM which specify the -image format. FluxEngine will use these parameters. - -## Options - - - Format variants: - - `auto`: try to autodetect the format (unreliable) - - `160`: 160kB 5.25" 40-track 8-sector SSDD - - `180`: 180kB 5.25" 40-track 9-sector SSDD - - `320`: 320kB 5.25" 40-track 8-sector DSDD - - `360`: 360kB 5.25" 40-track 9-sector DSDD - - `720_96`: 720kB 5.25" 80-track 9-sector DSDD - - `720_135`: 720kB 3.5" 80-track 9-sector DSDD - - `1200`: 1200kB 5.25" 80-track 15-sector DSHD - - `1232`: 1232kB 5.25" 77-track 8-sector DSHD - - `1440`: 1440kB 3.5" 80-track 18-sector DSHD - - `1680`: 1680kB 3.5" 80-track 21-sector DSHD; DMF - -## Examples - -To read: - - - `fluxengine read ibm --auto -s drive:0 -o ibm.img` - - `fluxengine read ibm --160 -s drive:0 -o ibm.img` - - `fluxengine read ibm --180 -s drive:0 -o ibm.img` - - `fluxengine read ibm --320 -s drive:0 -o ibm.img` - - `fluxengine read ibm --360 -s drive:0 -o ibm.img` - - `fluxengine read ibm --720_96 -s drive:0 -o ibm.img` - - `fluxengine read ibm --720_135 -s drive:0 -o ibm.img` - - `fluxengine read ibm --1200 -s drive:0 -o ibm.img` - - `fluxengine read ibm --1232 -s drive:0 -o ibm.img` - - `fluxengine read ibm --1440 -s drive:0 -o ibm.img` - - `fluxengine read ibm --1680 -s drive:0 -o ibm.img` - -To write: - - - `fluxengine write ibm --160 -d drive:0 -i ibm.img` - - `fluxengine write ibm --180 -d drive:0 -i ibm.img` - - `fluxengine write ibm --320 -d drive:0 -i ibm.img` - - `fluxengine write ibm --360 -d drive:0 -i ibm.img` - - `fluxengine write ibm --720_96 -d drive:0 -i ibm.img` - - `fluxengine write ibm --720_135 -d drive:0 -i ibm.img` - - `fluxengine write ibm --1200 -d drive:0 -i ibm.img` - - `fluxengine write ibm --1232 -d drive:0 -i ibm.img` - - `fluxengine write ibm --1440 -d drive:0 -i ibm.img` - - `fluxengine write ibm --1680 -d drive:0 -i ibm.img` - -Mixed-format disks ------------------- - -Some disks, such as those belonging to early CP/M machines, or N88-Basic disks -(for PC-88 and PC-98), have more than one format on the disk at once. Typically, -the first few tracks will be low-density FM encoded and will be read by the -machine's ROM; those tracks contain new floppy drive handling code capable of -coping with MFM data, and so the rest of the disk will use that, allowing them -to store more data. - -FluxEngine can read these fine, but it tends to get a bit confused when it sees -tracks with differing numbers of sectors --- if track 0 has 32 sectors but -track 1 has 16, it will assume that sectors 16..31 are missing on track 1 and -size the image file accordingly. This can be worked around by specifying the -size of each track; see the `eco1` read profile for an example. - -N88-Basic format floppies can be written by either specifying the `n88basic` -format, or by using D88 or NFD format images which include explicit sector -layout information. - -Writing other formats can be made to work too, by creating a custom format -specifier, using the `n88basic` format as an example. -Please [get in touch](https://github.com/davidgiven/fluxengine/issues/new) if -you have specific requirements. - -360rpm 3.5" disks ------------------ - -Japanese PCs (NEC PC-98, Sharp X68000, Fujitsu FM Towns) spin their floppy -drives at 360rpm rather than the more typical 300rpm. This was done in order -to be fully backwards compatible with 5.25" disks, while using the exact -same floppy controller. Later models of the PC-9821, as well as most USB floppy -drives, feature "tri-mode" support which in addition to normal 300rpm modes, -can change their speed to read and write 360rpm DD and HD disks. - -Neither the FluxEngine or Greaseweazle hardware can currently command a -tri-mode drive to spin at 360rpm. However on both devices the FluxEngine -software is capable of both reading and writing 300rpm disks at 360rpm and vice -versa, so it shouldn't matter. - +-d +\r diff --git a/doc/disk-icl30.md b/doc/disk-icl30.md index a5333a8d..f5ce0ddb 100644 --- a/doc/disk-icl30.md +++ b/doc/disk-icl30.md @@ -1,19 +1,2 @@ -icl30 -==== -## CP/M; 263kB 35-track DSSD - - -The ICL Model 30 is a reasonably standard CP/M machine using 35-track single -density disks and the traditional CP/M 128-byte secotrs --- 30 of them per -track! Other than that it's another IBM scheme variation. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read icl30 -s drive:0 -o icl30.img` - +-d +\r diff --git a/doc/disk-mac.md b/doc/disk-mac.md index 655c5175..f5ce0ddb 100644 --- a/doc/disk-mac.md +++ b/doc/disk-mac.md @@ -1,73 +1,2 @@ -mac -==== -## 400kB/800kB 3.5" GCR - - -Macintosh disks come in two varieties: the newer 1440kB ones, which are -perfectly ordinary PC disks you should use the `ibm` profile to read them, 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. - -It's not just the weird, custom GCR encoding. It's not just the utterly -bizarre additional encoding/checksum built on top of that where [every byte -is mutated according to the previous bytes in the -sector](https://www.bigmessowires.com/2011/10/02/crazy-disk-encoding-schemes/). -It's not just the odd way in which disks think they have four sides, two on one -side and two on the other, so that the track byte stores only the bottom 6 bits -of the track number. It's not just the way that Macintosh sectors are 524 bytes -long. No, it's the way the Macintosh drive changes speed depending on which -track it's looking at, so that each track contains a different amount of data. - -The reason for this is actually quite sensible: the tracks towards the centre -of the disk are obviously moving more slowly, so you can't pack the bits in -quite as closely (due to limitations in the magnetic media). You can use a -higher bitrate at the edge of the disk than in the middle. Many platforms, for -example the Commodore 64 1541 drive, changed bitrate this way. - -But Macintosh disks used a constant bitrate and changed the speed that the disk -spun instead to achieve the same effect... - -_Anyway_: FluxEngine will read them fine on conventional drives. Because it's -clever. - -Macintosh computers never really used the twelve bytes of metadata and the -standard for disk images is to omit it. If you want them, specify that you want -524-byte sectors. The metadata will follow the 512 bytes of user data. - -## Options - - - Format variants: - - `400`: 400kB 80-track SSDD - - `800`: 800kB 80-track DSDD - - `metadata`: read/write 524 byte sectors - -## Examples - -To read: - - - `fluxengine read mac --400 -s drive:0 -o mac.dsk` - - `fluxengine read mac --800 -s drive:0 -o mac.dsk` - -To write: - - - `fluxengine write mac --400 -d drive:0 -i mac.dsk` - - `fluxengine write mac --800 -d drive:0 -i mac.dsk` - -## References - - - [MAME's ap_dsk35.cpp file](https://github.com/mamedev/mame/blob/4263a71e64377db11392c458b580c5ae83556bc7/src/lib/formats/ap_dsk35.cpp), - without which I'd never have managed to do this - - - [Crazy Disk Encoding - Schemes](https://www.bigmessowires.com/2011/10/02/crazy-disk-encoding-schemes/), which made - me realise just how nuts the format is - - - [Les Disquettes et le drive Disk II](http://www.hackzapple.com/DISKII/DISKIITECH.HTM), an - epicly detailed writeup of the Apple II disk format (which is closely related) - - - [The DiskCopy 4.2 - format](https://www.discferret.com/wiki/Apple_DiskCopy_4.2), described on - the DiskFerret website. - +-d +\r diff --git a/doc/disk-micropolis.md b/doc/disk-micropolis.md index a5c2576f..f5ce0ddb 100644 --- a/doc/disk-micropolis.md +++ b/doc/disk-micropolis.md @@ -1,87 +1,2 @@ -micropolis -==== -## 100tpi MetaFloppy disks - - -Micropolis MetaFloppy disks use MFM and hard sectors. Mod I was 48 TPI and -stored 143k per side. Mod II was 100 TPI and stored 315k per side. Each of the -16 sectors contains 266 bytes of "user data," allowing 10 bytes of metadata for -use by the operating system. Micropolis DOS (MDOS) used the metadata bytes, but -CP/M did not. - -Some later systems were Micropolis-compatible and so were also 100 TPI, like -the Vector Graphic Dual-Mode Disk Controller which was paired with a Tandon -drive. - -**Important note:** You _cannot_ read these disks with a normal PC drive, as -these drives are 96tpi. The track spacing is determined by the physical geometry -of the drive and can't be changed in software. You'll need to get hold of a -100tpi Micropolis drive. Luckily these seem to use the same connector and -pinout as a 96tpi PC 5.25" drive. In use they should be identical. - -While most operating systems use the standard Micropolis checksum, Vector -Graphic MZOS uses a unique checksum. The decoder will automatically detect -the checksum type in use; however, a specific checksum type may be forced -using the `--decoder.micropolis.checksum_type=TYPE` where TYPE is one of: - -| Checksum | Description | -|------------|-----------------------------------------| -| AUTO | Automatically detect | -| MICROPOLIS | Standard Micropolis (MDOS, CP/M, OASIS) | -| MZOS | Vector Graphic MZOS | - -Later versions of the Micropolis format supported ECC, especially in -controllers with HDD support. The ECC can detect and correct errors. However, -it is unclear what ECC algorithm was used by each vendor. ECC is disabled by -default, but available for checking and correcting using -`--decoder.micropolis.ecc_type=TYPE` and for writing from IMG files using -`--encoder.micropolis.ecc_type=TYPE`, where TYPE is one of: - -| ECC | Description | -|--------|------------------------------------------| -| NONE | No ECC processing enabled | -| VECTOR | Vector Graphic Dual-Mode Disk Controller | - -The [CP/M BIOS](https://www.seasip.info/Cpm/bios.html) defined SELDSK, SETTRK, -and SETSEC, but no function to select the head/side. Double-sided floppies -could be represented as having either twice the number of sectors, for CHS, or -twice the number of tracks, HCS; the second side's tracks in opposite order -logically followed the first side (e.g., tracks 77-153). Micropolis disks -tended to be the latter. FluxEngine always emits CHS format disks, so you may -need to apply extra options to change the format if desired. - -## Options - - - : - - `143`: 143kB 5.25" SSDD hard-sectored; Micropolis MetaFloppy Mod I - - `287`: 287kB 5.25" DSDD hard-sectored; Micropolis MetaFloppy Mod I - - `315`: 315kB 5.25" SSDD hard-sectored; Micropolis MetaFloppy Mod II - - `630`: 630kB 5.25" DSDD hard-sectored; Micropolis MetaFloppy Mod II - - `vgi`: Read/write VGI format images with 275 bytes per sector - -## Examples - -To read: - - - `fluxengine read micropolis -s drive:0 -o micropolis.img` - -To write: - - - `fluxengine write micropolis -d drive:0 -i micropolis.img` - -## References - - - [Micropolis 1040/1050 S-100 Floppy Disk Subsystems User's Manual][micropolis1040/1050]. - Section 6, pages 261-266. Documents pre-ECC sector format. Note that the - entire record, starting at the sync byte, is controlled by software - - - [Vector Graphic Dual-Mode Disk Controller Board Engineering Documentation][vectordualmode]. - Section 1.6.2. Documents ECC sector format - - - [AltairZ80 Simulator Usage Manual][altairz80]. Section 10.6. Documents ECC - sector format and VGI file format - -[micropolis1040/1050]: http://www.bitsavers.org/pdf/micropolis/metafloppy/1084-01_1040_1050_Users_Manual_Apr79.pdf -[vectordualmode]: http://bitsavers.org/pdf/vectorGraphic/hardware/7200-1200-02-1_Dual-Mode_Disk_Controller_Board_Engineering_Documentation_Feb81.pdf -[altairz80]: http://www.bitsavers.org/simh.trailing-edge.com_201206/pdf/altairz80_doc.pdf - +-d +\r diff --git a/doc/disk-ms2000.md b/doc/disk-ms2000.md index 71f144e9..f5ce0ddb 100644 --- a/doc/disk-ms2000.md +++ b/doc/disk-ms2000.md @@ -1,33 +1,2 @@ -ms2000 -==== -## MS2000 Microdisk Development System - - -The RCA MicroDisk Development System MS2000 is a highly obscure (i.e. I gather -that single digit numbers of original machines exist) development system for the -RCA1802 series of CPUs, as made famous by the Cosmac ELF. It was a fairly -straightforward big bag o'RAM system with a 2kB boot ROM, 62kB of RAM, twin -floppy drives and a serial terminal --- CP/M users will find it very familiar. - -Read and writing disks is currently not supported by FluxEngine, but there is -basic support for the MicroDisk operating system's file system. This should -allow files to be read from MS2000 disk images. - -The disks are normal DD 3.5" disks, using a 70-track, single sided variation of -the venerable IBM floppy disk scheme, so allowing 315kB of storage per disk. - -If you have access to flux files for MS2000 disks, please [get in -touch](https://github.com/davidgiven/cpm65/issues/new) --- I would like to add -better support for these. - -## Options - -(no options) - -## Examples - -## References - - - [The EMMA-02 emulator](https://www.emma02.hobby-site.com/ms2000.html), which - supports the MS2000 and provides information on it. - +-d +\r diff --git a/doc/disk-mx.md b/doc/disk-mx.md index 0e3102e9..f5ce0ddb 100644 --- a/doc/disk-mx.md +++ b/doc/disk-mx.md @@ -1,69 +1,2 @@ -mx -==== -## Soviet-era PDP-11 clone - - -The DVK (in Russian, 沾7d65 -Computing Complex) was a late 1970s Soviet personal computer, a cut-down -version of the professional SM EVM (ⵁ241c ---- literally System of Mini Computers), which _itself_ was an unlicensed -clone of the PDP-11. The MX board was an early floppy drive controller board -for it. - -
-A DVK computer -
- -The MX format is interesting in that it has to be read a track at a time. The -format contains the usual ID prologue at the beginning of the track, then -eleven data blocks and checksums, then the epilogue, then it stops. The -actual encoding is normal FM. There were four different disk variants, in all -combinations of single- and double-sided and 40- and 80-tracked; but every -track contained eleven 256-byte sectors. - -The format varies subtly depending on whether you're using the 'new' driver -or the 'old' driver. FluxEngine should read both. - -A track is: - - * 8 x 0x0000 words (FM encoded as 01010101...) - * 1 x 0x00F3 --- start of track - * 1 x 0xnnnn --- track number - * 11 of: - * 128 words (256 bytes) of data - * 16 bit checksum - * **if 'new' format:** - * 3 x 0x83nn --- `n = (track_number<<1) + side_number` - * **if 'old' format:** - * 3 x 0x8301 - -The checksum is just the unsigned integer sum of all the words in the sector. -Words are all stored little-endian. - -## Options - - - Format variants: - - `110`: 110kB 5.25" 40-track SSSD - - `220ds`: 220kB 5.25" 40-track DSSD - - `220ss`: 220kB 5.25" 80-track SSSD - - `440`: 440kB 5.25" 80-track DSSD - -## Examples - -To read: - - - `fluxengine read mx --110 -s drive:0 -o mx.img` - - `fluxengine read mx --220ds -s drive:0 -o mx.img` - - `fluxengine read mx --220ss -s drive:0 -o mx.img` - - `fluxengine read mx --440 -s drive:0 -o mx.img` - -## References - - - [The Soviet Digital Electronics - Museum](http://www.leningrad.su/museum/main.php) (source of the image - above) - - - [a random post on the HxC2001 support - forum](http://torlus.com/floppy/forum/viewtopic.php?t=1384) with lots of - information on the format - +-d +\r diff --git a/doc/disk-n88basic.md b/doc/disk-n88basic.md index 749b256c..f5ce0ddb 100644 --- a/doc/disk-n88basic.md +++ b/doc/disk-n88basic.md @@ -1,26 +1,2 @@ -n88basic -==== -## PC8800/PC98 5.25" 77-track 26-sector DSHD - - -The N88-BASIC disk format is the one used by the operating system of the same -name for the Japanese PC8800 and PC98 computers. It is another IBM scheme -variant, and is very similar to some mixed-format CP/M disk formats, where -track 0 side 0 uses 128-byte single density sectors and the rest of the disk -uses 512-byte double density sectors. (The reason for this is that the PC8800 -boot ROM could only read single density data.) - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read n88basic -s drive:0 -o n88basic.img` - -To write: - - - `fluxengine write n88basic -d drive:0 -i n88basic.img` - +-d +\r diff --git a/doc/disk-northstar.md b/doc/disk-northstar.md index 26386574..f5ce0ddb 100644 --- a/doc/disk-northstar.md +++ b/doc/disk-northstar.md @@ -1,50 +1,2 @@ -northstar -==== -## 5.25" hard sectored - - -Northstar Floppy disks use 10-sector hard sectored disks with either FM or MFM -encoding. They may be single- or double-sided. Each of the 10 sectors contains -256 (FM) or 512 (MFM) bytes of data. The disk has 35 cylinders, with tracks 0- -34 on side 0, and tracks 35-69 on side 1. Tracks on side 1 are numbered "back- -wards" in that track 35 corresponds to cylinder 34, side 1, and track 69 -corresponds to cylinder 0, side 1. - -The Northstar sector format does not include any head positioning information. -As such, reads from Northstar floppies need to by synchronized with the index -pulse, in order to properly identify the sector being read. This is handled -automatically by FluxEngine. - -Due to the nature of the track ordering on side 1, an .nsi image reader and -writer are provided for double-sided disks. The .nsi image writer supports -both single- and double-sided disks; however single-sided .nsi images are -equivalent to .img images. - -## Options - - - Format variants: - - `87`: 87.5kB 5.25" 35-track SSSD hard-sectored - - `175`: 175kB 5.25" 40-track SSDD hard-sectored - - `350`: 350kB 5.25" 40-track DSDD hard-sectored - -## Examples - -To read: - - - `fluxengine read northstar --87 -s drive:0 -o northstar.nsi` - - `fluxengine read northstar --175 -s drive:0 -o northstar.nsi` - - `fluxengine read northstar --350 -s drive:0 -o northstar.nsi` - -To write: - - - `fluxengine write northstar --87 -d drive:0 -i northstar.nsi` - - `fluxengine write northstar --175 -d drive:0 -i northstar.nsi` - - `fluxengine write northstar --350 -d drive:0 -i northstar.nsi` - -## References - - - [MICRO-DISK SYSTEM MDS-A-D DOUBLE DENSITY Manual][northstar_mds]. - Page 33 documents sector format for single- and double-density. - -[northstar_mds]: http://bitsavers.org/pdf/northstar/boards/Northstar_MDS-A-D_1978.pdf - +-d +\r diff --git a/doc/disk-psos.md b/doc/disk-psos.md index 27df0224..f5ce0ddb 100644 --- a/doc/disk-psos.md +++ b/doc/disk-psos.md @@ -1,32 +1,2 @@ -psos -==== -## 800kB DSDD with PHILE - - -pSOS was an influential real-time operating system from the 1980s, used mainly -on 68000-based machines, lasting up until about 2000 when it was bought (and -cancelled) by Wind River. It had its own floppy disk format and file system, -both of which are partially supported here. - -The PHILE file system is almost completely undocumented and so many of the data -structures have had to be reverse engineered and are not well known. Please -[get in touch](https://github.com/davidgiven/fluxengine/issues/new) if you know -anything about it. - -The floppy disk format itself is an IBM scheme variation with 1024-byte sectors -and, oddly, swapped sides. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read psos -s drive:0 -o pme.img` - -To write: - - - `fluxengine write psos -d drive:0 -i pme.img` - +-d +\r diff --git a/doc/disk-rolandd20.md b/doc/disk-rolandd20.md index 92eaa1dc..f5ce0ddb 100644 --- a/doc/disk-rolandd20.md +++ b/doc/disk-rolandd20.md @@ -1,48 +1,2 @@ -rolandd20 -==== -## 3.5" electronic synthesiser disks - - -The Roland D20 is a classic electronic synthesiser with a built-in floppy -drive, used for saving MIDI sequences and samples. - -Weirdly, it seems to use precisely the same format as the Brother word -processors: a thoroughly non-IBM-compatible custom GCR system. - -FluxEngine supports both reading and writing D20 disks, as well as basic support -for the filesystem, allowing files to be read from and written to D20 disks. -Note that the D20 was never intended to support arbitrary files on its disks and -is very likely to crash if you put unexpected files on a disk. In addition, -while the file format itself is currently unknown, there is a header at the top -of the file containing what appears to be the name shown in the D20 file -browser, so the name by which you see it is not necessarily the filename. - -A word of warning --- just like the Brother word processors, the D20 floppy -drive isn't very well aligned. The drive itself uses quarter-stepping to -automatically adapt to whatever alignment the disk was formatted with. This -means that trying to read such a disk on a PC drive, which does _not_ have -adjustable alignment, may not work very well. In these situations it is possible -to adjust the alignment of most modern drives, but this is a somewhat risky -process and may result in permanently wrecking the drive alignment. - -Please [get in touch](https://github.com/davidgiven/fluxengine/issues/new) if -you know anything about it. - -Many thanks to trondl [on the VCF -forums](https://forum.vcfed.org/index.php?threads/roland-d-20-decoding-the-mysterious-floppy-format.1243226/) -for assistance with this! - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read rolandd20 -s drive:0 -o rolandd20.img` - -To write: - - - `fluxengine write rolandd20 -d drive:0 -i rolandd20.img` - +-d +\r diff --git a/doc/disk-rx50.md b/doc/disk-rx50.md index d39a5ca2..f5ce0ddb 100644 --- a/doc/disk-rx50.md +++ b/doc/disk-rx50.md @@ -1,23 +1,2 @@ -rx50 -==== -## 400kB 5.25" 80-track 10-sector SSDD - - -The Digital RX50 is one of the external floppy drive units used by Digital's -range of computers, especially the DEC Rainbow microcomputer. It is a fairly -vanilla single-sided IBM scheme variation. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read rx50 -s drive:0 -o rx50.img` - -To write: - - - `fluxengine write rx50 -d drive:0 -i rx50.img` - +-d +\r diff --git a/doc/disk-shugart_drive.md b/doc/disk-shugart_drive.md index 086e1d39..f5ce0ddb 100644 --- a/doc/disk-shugart_drive.md +++ b/doc/disk-shugart_drive.md @@ -1,15 +1,2 @@ -shugart_drive -==== -## Adjust configuration for a Shugart drive - - -This is an extension profile; adding this to the command line will configure -FluxEngine to adjust the pinout to work with a Shugart drive. This only works -on Greaseweazle hardware. - -For example: - -``` -fluxengine read ibm --720 shugart_drive -``` - +-d +\r diff --git a/doc/disk-smaky6.md b/doc/disk-smaky6.md index 03dec9f8..f5ce0ddb 100644 --- a/doc/disk-smaky6.md +++ b/doc/disk-smaky6.md @@ -1,34 +1,2 @@ -smaky6 -==== -## 308kB 5.25" 77-track 16-sector SSDD, hard sectored - - -The Smaky 6 is a Swiss computer from 1978 produced by Epsitec. It's based -around a Z80 processor and has one or two Micropolis 5.25" drives which use -16-sector hard sectored disks. The disk format is single-sided with 77 tracks -and 256-byte sectors, resulting in 308kB disks. It uses MFM with a custom -sector record scheme. It was later superceded by a 68000-based Smaky which used -different disks. - -FluxEngine supports these, although because the Micropolis drives use a 100tpi -track pitch, you can't read Smaky 6 disks with a normal PC 96tpi drive. You -will have to find a 100tpi drive from somewhere (they're rare). - -There is experimental read-only support for the Smaky 6 filesystem, allowing -the directory to be listed and files read from disks. It's not known whether -this is completely correct, so don't trust it! - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read smaky6 -s drive:0 -o smaky6.img` - -## References - - - [Smaky Info, 1978-2002 (in French)](https://www.smaky.ch/theme.php?id=sminfo) - +-d +\r diff --git a/doc/disk-tids990.md b/doc/disk-tids990.md index e25dea48..f5ce0ddb 100644 --- a/doc/disk-tids990.md +++ b/doc/disk-tids990.md @@ -1,39 +1,2 @@ -tids990 -==== -## 1126kB 8" DSSD - - -The Texas Instruments DS990 was a multiuser modular computing system from 1998, -based around the TMS-9900 processor (as used by the TI-99). It had an 8" floppy -drive module, the FD1000, which was a 77-track, 288-byte sector FM/MFM system -with 26 sectors per track. The encoding scheme was very similar to a simplified -version of the IBM scheme, but of course not compatible. A double-sided disk -would store a very satisfactory 1126kB of data; here's one at old-computers.com: - -
- -A DS990 at old-computers.com -
- -FluxEngine will read and write these (but only the DSDD MFM variant). - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read tids990 -s drive:0 -o tids990.img` - -To write: - - - `fluxengine write tids990 -d drive:0 -i tids990.img` - -## References - - - [The FD1000 Depot Maintenance - Manual](http://www.bitsavers.org/pdf/ti/990/disk/2261885-9701_FD1000depotVo1_Jan81.pdf) - +-d +\r diff --git a/doc/disk-tiki.md b/doc/disk-tiki.md index bcf4cf89..f5ce0ddb 100644 --- a/doc/disk-tiki.md +++ b/doc/disk-tiki.md @@ -1,27 +1,2 @@ -tiki -==== -## CP/M - - -The Tiki 100 is a Z80-based Norwegian microcomputer from the mid 1980s intended -for eductional use. It mostly ran an unbranded CP/M clone, and uses fairly -normal CP/M disks --- IBM scheme and from 128 to 512 bytes per sector depending -on the precise format. - -## Options - - - Format variants: - - `90`: 90kB 40-track 18-sector SSSD - - `200`: 200kB 40-track 10-sector SSDD - - `400`: 400kB 40-track 10-sector DSDD - - `800`: 800kB 80-track 10-sector DSDD - -## Examples - -To read: - - - `fluxengine read tiki --90 -s drive:0 -o tiki.img` - - `fluxengine read tiki --200 -s drive:0 -o tiki.img` - - `fluxengine read tiki --400 -s drive:0 -o tiki.img` - - `fluxengine read tiki --800 -s drive:0 -o tiki.img` - +-d +\r diff --git a/doc/disk-victor9k.md b/doc/disk-victor9k.md index 82e69814..f5ce0ddb 100644 --- a/doc/disk-victor9k.md +++ b/doc/disk-victor9k.md @@ -1,62 +1,2 @@ -victor9k -==== -## 1224kB 5.25" DSDD GCR - - -The Victor 9000 / Sirius One was a rather strange old 8086-based machine -which used a disk format very reminiscent of the Commodore format; not a -coincidence, as Chuck Peddle designed them both. They're 80-track, 512-byte -sector GCR disks, with a variable-speed drive and a varying number of sectors -per track --- from 19 to 12. Disks can be double-sided, meaning that they can -store 1224kB per disk, which was almost unheard of back then. Because the way -that the tracks on head 1 are offset from head 0 (this happens with all disks), -the speed zone allocation on head 1 differs from head 0... - -| Zone | Head 0 tracks | Head 1 tracks | Sectors | Original period (ms) | -|:----:|:-------------:|:-------------:|:-------:|:--------------------:| -| 0 | 0-3 | | 19 | 237.9 | -| 1 | 4-15 | 0-7 | 18 | 224.5 | -| 2 | 16-26 | 8-18 | 17 | 212.2 | -| 3 | 27-37 | 19-29 | 16 | 199.9 | -| 4 | 38-47\* | 30-39\* | 15 | 187.6 | -| 5 | 48-59 | 40-51 | 14 | 175.3 | -| 6 | 60-70 | 52-62 | 13 | 163.0 | -| 7 | 71-79 | 63-74 | 12 | 149.6 | -| 8 | | 75-79 | 11 | 144.0 | - -(The Original Period column is the original rotation rate. When used in -FluxEngine, the disk always spins at 360 rpm, which corresponds to a rotational -period of 166 ms.) - -\*The Victor 9000 Hardware Reference Manual has a bug in the documentation -and lists Zone 4 as ending with track 48 on head 0 and track 40 on head 1. -The above table matches observed data on various disks and the assembly -code in the boot loader, which ends Zone 4 with track 47 on head 0 -and track 39 on Head 1. - -FluxEngine can read and write both the single-sided and double-sided variants. - -## Options - - - Format variants: - - `612`: 612kB 80-track DSHD GCR - - `1224`: 1224kB 80-track DSHD GCR - -## Examples - -To read: - - - `fluxengine read victor9k --612 -s drive:0 -o victor9k.img` - - `fluxengine read victor9k --1224 -s drive:0 -o victor9k.img` - -To write: - - - `fluxengine write victor9k --612 -d drive:0 -i victor9k.img` - - `fluxengine write victor9k --1224 -d drive:0 -i victor9k.img` - -## References - - - [The Victor 9000 technical reference manual](http://bitsavers.org/pdf/victor/victor9000/Victor9000TechRef_Jun82.pdf) - - - [DiskFerret's Victor 9000 format guide](https://discferret.com/wiki/Victor_9000_format) - +-d +\r diff --git a/doc/disk-zilogmcz.md b/doc/disk-zilogmcz.md index 7d2cb218..f5ce0ddb 100644 --- a/doc/disk-zilogmcz.md +++ b/doc/disk-zilogmcz.md @@ -1,42 +1,2 @@ -zilogmcz -==== -## 320kB 8" 77-track SSSD hard-sectored - - -The Zilog MCZ is an extremely early Z80 development system, produced by -Zilog, which came out in 1976. It used twin 8-inch hard sectored floppy -drives; here's one at the Centre -for Computing History: - -
- -A Zilog MCZ at the Centre For Computing History -
- -The MCZ ran Zilog's own operating system, Z80-RIO, and used 77 track -single-sided disks, with 32 sectors (each marked by an index hole), with 132 -bytes per sector --- 128 bytes of user payload plus two two-byte metadata -words used to construct linked lists of sectors for storing files. These -stored 320kB each. - -FluxEngine has read support for these, including support for RIO's ZDOS file -system. - -## Options - -(no options) - -## Examples - -To read: - - - `fluxengine read zilogmcz -s drive:0 -o zilogmcz.img` - -## References - - * [About the Zilog MCZ](http://www.retrotechnology.com/restore/zilog.html), - containing lots of useful links - - * [The hardware user's manual](https://amaus.org/static/S100/zilog/ZDS/Zilog%20ZDS%201-25%20Hardware%20Users%20Manual.pdf) - +-d +\r From 95d49add2c6e575a50932b7c393ebe47cb1b13be Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 29 Oct 2023 11:18:21 +0100 Subject: [PATCH 42/49] Don't show '$formats' for the format list. --- src/gui/idlepanel.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/idlepanel.cc b/src/gui/idlepanel.cc index e4f5f3dd..6b971d00 100644 --- a/src/gui/idlepanel.cc +++ b/src/gui/idlepanel.cc @@ -695,8 +695,11 @@ private: for (auto& group : globalConfig()->option_group()) { + std::string groupName = group.comment(); + if (groupName == "$formats") + groupName = "Formats"; sizer->Add(new wxStaticText( - formatOptionsContainer, wxID_ANY, group.comment() + ":")); + formatOptionsContainer, wxID_ANY, groupName + ":")); bool first = true; bool valueSet = false; From ff1fb761f25a9fb5682249a719099209ca78f532 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 29 Oct 2023 21:06:56 +0100 Subject: [PATCH 43/49] Update documentation (last time was wrong). --- doc/disk-40track_drive.md | 17 ++++- doc/disk-acornadfs.md | 41 +++++++++++- doc/disk-acorndfs.md | 40 +++++++++++- doc/disk-aeslanier.md | 50 ++++++++++++++- doc/disk-agat.md | 38 ++++++++++- doc/disk-amiga.md | 43 ++++++++++++- doc/disk-ampro.md | 54 +++++++++++++++- doc/disk-apple2.md | 76 +++++++++++++++++++++- doc/disk-apple2_drive.md | 18 +++++- doc/disk-atarist.md | 63 +++++++++++++++++- doc/disk-bk.md | 32 +++++++++- doc/disk-brother.md | 130 +++++++++++++++++++++++++++++++++++++- doc/disk-commodore.md | 76 +++++++++++++++++++++- doc/disk-eco1.md | 44 ++++++++++++- doc/disk-epsonpf10.md | 21 +++++- doc/disk-f85.md | 49 +++++++++++++- doc/disk-fb100.md | 50 ++++++++++++++- doc/disk-hplif.md | 44 ++++++++++++- doc/disk-ibm.md | 124 +++++++++++++++++++++++++++++++++++- doc/disk-icl30.md | 21 +++++- doc/disk-mac.md | 75 +++++++++++++++++++++- doc/disk-micropolis.md | 89 +++++++++++++++++++++++++- doc/disk-ms2000.md | 35 +++++++++- doc/disk-mx.md | 71 ++++++++++++++++++++- doc/disk-n88basic.md | 28 +++++++- doc/disk-northstar.md | 52 ++++++++++++++- doc/disk-psos.md | 34 +++++++++- doc/disk-rolandd20.md | 50 ++++++++++++++- doc/disk-rx50.md | 25 +++++++- doc/disk-shugart_drive.md | 17 ++++- doc/disk-smaky6.md | 36 ++++++++++- doc/disk-tids990.md | 41 +++++++++++- doc/disk-tiki.md | 29 ++++++++- doc/disk-victor9k.md | 64 ++++++++++++++++++- doc/disk-zilogmcz.md | 44 ++++++++++++- 35 files changed, 1651 insertions(+), 70 deletions(-) diff --git a/doc/disk-40track_drive.md b/doc/disk-40track_drive.md index f5ce0ddb..203628f8 100644 --- a/doc/disk-40track_drive.md +++ b/doc/disk-40track_drive.md @@ -1,2 +1,15 @@ --d -\r +40track_drive +==== +## Adjust configuration for a 40-track drive + + +This is an extension profile; adding this to the command line will configure +FluxEngine to read from 40-track, 48tpi 5.25" drives. You have to tell it because there is +no way to detect this automatically. + +For example: + +``` +fluxengine read ibm --180 40track_drive +``` + diff --git a/doc/disk-acornadfs.md b/doc/disk-acornadfs.md index f5ce0ddb..2e63eff3 100644 --- a/doc/disk-acornadfs.md +++ b/doc/disk-acornadfs.md @@ -1,2 +1,39 @@ --d -\r +acornadfs +==== +## BBC Micro, Archimedes + + +Acorn ADFS disks are used by the 6502-based BBC Micro and ARM-based Archimedes +series of computers. They are yet another variation on MFM encoded IBM scheme +disks, although with different sector sizes and with the 0-based sector +identifiers rather than 1-based sector identifiers. The index hole is ignored +and sectors are written whereever, requiring FluxEngine to do two revolutions +to read a disk. + +There are various different kinds, which should all work out of the box. + +Be aware that Acorn logical block numbering goes all the way up side 0 and +then all the way up side 1. However, FluxEngine uses traditional disk images +with alternating sides, with the blocks from track 0 side 0 then track 0 side +1 then track 1 side 0 etc. Most Acorn emulators will use both formats, but +they might require nudging as the side order can't be reliably autodetected. + +## Options + + - Format variants: + - `160`: 160kB 3.5" or 5.25" 40-track SSDD; S format + - `320`: 320kB 3.5" or 5.25" 80-track SSDD; M format + - `640`: 640kB 3.5" or 5.25" 80-track DSDD; L format + - `800`: 800kB 3.5" 80-track DSDD; D and E formats + - `1600`: 1600kB 3.5" 80-track DSHD; F formats + +## Examples + +To read: + + - `fluxengine read acornadfs --160 -s drive:0 -o acornadfs.img` + - `fluxengine read acornadfs --320 -s drive:0 -o acornadfs.img` + - `fluxengine read acornadfs --640 -s drive:0 -o acornadfs.img` + - `fluxengine read acornadfs --800 -s drive:0 -o acornadfs.img` + - `fluxengine read acornadfs --1600 -s drive:0 -o acornadfs.img` + diff --git a/doc/disk-acorndfs.md b/doc/disk-acorndfs.md index f5ce0ddb..a36b0ddc 100644 --- a/doc/disk-acorndfs.md +++ b/doc/disk-acorndfs.md @@ -1,2 +1,38 @@ --d -\r +acorndfs +==== +## Acorn Atom, BBC Micro series + + +Acorn DFS disks are used by the Acorn Atom and BBC Micro series of computers. +They are pretty standard FM encoded IBM scheme disks, with 256-sectors and +0-based sector identifiers. There's nothing particularly special here. + +DFS disks are all single-sided, but allow the other side of the disk to be +used as another volume. + +They come in two varieties, 40 track and 80 track. These should both work. +Some rare disks are both at the same time. FluxEngine can read these but it +requires a bit of fiddling as they have the same tracks on twice. + +## Options + + - Format variants: + - `100`: 100kB 40-track SSSD + - `200`: 200kB 80-track SSSD + +## Examples + +To read: + + - `fluxengine read acorndfs --100 -s drive:0 -o acorndfs.img` + - `fluxengine read acorndfs --200 -s drive:0 -o acorndfs.img` + +To write: + + - `fluxengine write acorndfs --100 -d drive:0 -i acorndfs.img` + - `fluxengine write acorndfs --200 -d drive:0 -i acorndfs.img` + +## References + + - [The Acorn DFS disc format](https://beebwiki.mdfs.net/Acorn_DFS_disc_format) + diff --git a/doc/disk-aeslanier.md b/doc/disk-aeslanier.md index f5ce0ddb..73073fc3 100644 --- a/doc/disk-aeslanier.md +++ b/doc/disk-aeslanier.md @@ -1,2 +1,48 @@ --d -\r +aeslanier +==== +## 616kB 5.25" 77-track SSDD hard sectored + + +Back in 1980 Lanier released a series of very early integrated word processor +appliances, the No Problem. These were actually [rebranded AES Data Superplus +machines](http://vintagecomputers.site90.net/aes/). They were gigantic, +weighed 40kg, and one example I've found cost ꆲ5bb4 +of nearly ㇢1a6e + +8080 machines with 32kB of RAM, they ran their own proprietary word +processing software off twin 5.25" drive units, but apparently other software +was available. + +The disk format is exceptionally weird. They used 77 track, 32 sector, single-sided +_hard_ sectored disks, where there were multiple index holes, +indicating to the hardware where the sectors start. The encoding scheme +itself is [MMFM (aka +M2FM)](http://www.retrotechnology.com/herbs_stuff/m2fm.html), an early +attempt at double-density disk encoding which rapidly got obsoleted by the +simpler MFM --- and the bytes are stored on disk _backwards_. Even aside from +the encoding, the format on disk was strange; unified sector header/data +records, so that the sector header (containing the sector and track number) +is actually inside the user data. + +FluxEngine can read these, but I only have a single, fairly poor example of a +disk image, and I've had to make a lot of guesses as to the sector format +based on what looks right. If anyone knows _anything_ about these disks, +[please get in touch](https://github.com/davidgiven/fluxengine/issues/new). + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read aeslanier -s drive:0 -o aeslanier.img` + +## References + + * [SA800 Diskette Storage Drive - Theory Of + Operations](http://www.hartetechnologies.com/manuals/Shugart/50664-1_SA800_TheorOp_May78.pdf): + talks about MMFM a lot, but the Lanier machines didn't use this disk + format. + diff --git a/doc/disk-agat.md b/doc/disk-agat.md index f5ce0ddb..dc2b579d 100644 --- a/doc/disk-agat.md +++ b/doc/disk-agat.md @@ -1,2 +1,36 @@ --d -\r +agat +==== +## 840kB 5.25" 80-track DS + + +The Agat (Russian: ↊fd74 +1983. These were based around a 6502 and were nominally Apple II-compatible +although with enough differences to be problematic. + +They could use either standard Apple II 140kB disks, or a proprietary 840kb +MFM-based double-sided format. FluxEngine supports both of these; this profile +is for the proprietary format. for the Apple II format, use the `apple2` +profile. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read agat -s drive:0 -o agat.img` + +To write: + + - `fluxengine write agat -d drive:0 -i agat.img` + +## References + + - [Magazine article on the + Agat](https://sudonull.com/post/54185-Is-AGAT-a-bad-copy-of-Apple) + + - [Forum thread with (some) documentation on the + format](https://torlus.com/floppy/forum/viewtopic.php?t=1385) + diff --git a/doc/disk-amiga.md b/doc/disk-amiga.md index f5ce0ddb..fe40ed94 100644 --- a/doc/disk-amiga.md +++ b/doc/disk-amiga.md @@ -1,2 +1,41 @@ --d -\r +amiga +==== +## 880kB 3.5" DSDD + + +Amiga disks use MFM, but don't use IBM scheme. Instead, the entire track is +read and written as a unit, with each sector butting up against the previous +one. This saves a lot of space which allows the Amiga to not just store 880kB +on a DD disk, but _also_ allows an extra 16 bytes of metadata per sector. + +This metadata is mostly unused, so the default for FluxEngine is to ignore it +and just use the 512 bytes of main sector data. If you want it, specify a +528-byte sector size. The metadata will come after the user data. + +Bizarrely, the data in each sector is stored with all the odd bits first, and +then all the even bits. This is tied into the checksum algorithm, which is +distinctly subpar and not particularly good at detecting errors. + +## Options + + - Sector size: + - `without_metadata`: 512-byte sectors + - `with_metadata`: 528-byte sectors + +## Examples + +To read: + + - `fluxengine read amiga -s drive:0 -o amiga.adf` + +To write: + + - `fluxengine write amiga -d drive:0 -i amiga.adf` + +## References + + - [The Amiga Floppy Boot Process and Physical + Layout](https://wiki.amigaos.net/wiki/Amiga_Floppy_Boot_Process_and_Physical_Layout) + + - [The Amiga Disk File FAQ](http://lclevy.free.fr/adflib/adf_info.html) + diff --git a/doc/disk-ampro.md b/doc/disk-ampro.md index f5ce0ddb..f1b51f32 100644 --- a/doc/disk-ampro.md +++ b/doc/disk-ampro.md @@ -1,2 +1,52 @@ --d -\r +ampro +==== +## CP/M + + +The Ampro Little Board was a very simple and cheap Z80-based computer from +1984, which ran CP/M. It was, in fact, a single PCB which you could mount +on the bottom of a 5.25" drive. + +[All about the Ampro Little Board](http://oldcomputers.net/ampro-little-board.html) + +It stored either 400kB on a double-sided 40-track drive or 800kB on a +double-sided 80 track drive. The disk format it used was a slightly quirky +variation of the standard MFM IBM scheme --- sector numbering starts at 17 +rather than 1 (or Acorn's 0). FluxEngine supports this. + +FluxEngine has direct filesystem support for these disks, or you can pass the +disk images into [cpmtools](http://www.moria.de/~michael/cpmtools/): + +``` +$ cpmls -f ampdsdd ampro.img +0: +-a60014.e +amprodsk.com +bitchk.doc +bitchk.mac +cpmmac.mac +dir.com +himem.doc +himem.mac +kaydiag.lbr +kayinfo.lbr +...etc... +``` + +## Options + + - Format variants: + - `400`: 400kB 40-track DSDD + - `800`: 800kB 80-track DSDD + +## Examples + +To read: + + - `fluxengine read ampro --400 -s drive:0 -o ampro.img` + - `fluxengine read ampro --800 -s drive:0 -o ampro.img` + +## References + + - [The Ampro Little Board](http://oldcomputers.net/ampro-little-board.html) + diff --git a/doc/disk-apple2.md b/doc/disk-apple2.md index f5ce0ddb..d866a497 100644 --- a/doc/disk-apple2.md +++ b/doc/disk-apple2.md @@ -1,2 +1,74 @@ --d -\r +apple2 +==== +## Prodos, Appledos, and CP/M + + +Apple II disks are nominally fairly sensible 40-track, single-sided, 256 +bytes-per-sector jobs. However, they come in two varieties: DOS 3.3/ProDOS and +above, and pre-DOS 3.3. They use different GCR encoding systems, dubbed +6-and-2 and 5-and-3, and are mutually incompatible (although in some rare +cases you can mix 6-and-2 and 5-and-3 sectors on the same disk). + +The difference is in the drive controller; the 6-and-2 controller is capable +of a more efficient encoding, and can fit 16 sectors on a track, storing +140kB on a disk. The 5-and-3 controller can only fit 13, with a mere 114kB. + +Both formats use GCR (in different varieties) in a nice, simple grid of +sectors, unlike the Macintosh. Like the Macintosh, there's a crazy encoding +scheme applied to the data before it goes down on disk to speed up +checksumming. + +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 +having spiral tracks! Copy protection for the Apple II was even madder than +on other systems. + +FluxEngine can only read well-behaved 6-and-2 disks. It doesn't even try to +handle the weird stuff. + +Apple DOS also applies logical sector remapping on top of the physical sector +numbering on the disk, and this _varies_ depending on what the disk is for. +FluxEngine can remap the sectors from physical to logical using modifiers. If +you don't specify a remapping modifier, you get the sectors in the order they +appear on the disk. + +If you don't want an image in physical sector order, specify one of the +filesystem ordering options. These also select the appropriate file system; +FluxEngine has read-only support for all of these. + +In addition, some third-party systems use 80-track double sides drives, with +the same underlying disk format. The complication here is that the AppleDOS +filesystem only supports up to 50 tracks, so it needs tweaking to support +larger disks. It treats the second side of the disk as a completely different +volume. + +## Options + + - Format variants: + - `140`: 140kB 5.25" 35-track SS + - `640`: 640kB 5.25" 80-track DS + - Filesystem and sector skew: + - `nofs`: use physical CHS sector order and no file system + - `appledos`: use AppleDOS soft sector skew and file system + - `prodos`: use ProDOS soft sector skew and filesystem + - `cpm`: use CP/M soft sector skew and filesystem + - `side1`: for AppleDOS file system access, read the volume on side 1 of a disk + +## Examples + +To read: + + - `fluxengine read apple2 --140 -s drive:0 -o apple2.img` + - `fluxengine read apple2 --640 -s drive:0 -o apple2.img` + +To write: + + - `fluxengine write apple2 --140 -d drive:0 -i apple2.img` + - `fluxengine write apple2 --640 -d drive:0 -i apple2.img` + +## References + + - [Beneath Apple DOS](https://fabiensanglard.net/fd_proxy/prince_of_persia/Beneath%20Apple%20DOS.pdf) + + - [MAME's ap2_dsk.cpp file](https://github.com/mamedev/mame/blob/4263a71e64377db11392c458b580c5ae83556bc7/src/lib/formats/ap2_dsk.cpp) + diff --git a/doc/disk-apple2_drive.md b/doc/disk-apple2_drive.md index f5ce0ddb..e631d138 100644 --- a/doc/disk-apple2_drive.md +++ b/doc/disk-apple2_drive.md @@ -1,2 +1,16 @@ --d -\r +apple2_drive +==== +## Adjust configuration for a 40-track Apple II drive + + +This is an extension profile; adding this to the command line will configure +FluxEngine to adjust the pinout and track spacing to work with an Apple II +drive. This only works on Greaseweazle hardware and requires a custom +connector. + +For example: + +``` +fluxengine read apple2 --160 apple2_drive +``` + diff --git a/doc/disk-atarist.md b/doc/disk-atarist.md index f5ce0ddb..25f3e11e 100644 --- a/doc/disk-atarist.md +++ b/doc/disk-atarist.md @@ -1,2 +1,61 @@ --d -\r +atarist +==== +## Almost PC compatible + + +Atari ST disks are standard MFM encoded IBM scheme disks without an IAM header. +Disks are typically formatted 512 bytes per sector with between 9-10 (sometimes +11!) sectors per track and 80-82 tracks per side. + +For some reason, occasionally formatting software will put an extra IDAM record +with a sector number of 66 on a disk, which can horribly confuse things. The +Atari profiles below are configured to ignore these. + +Be aware that many PC drives (including mine) won't do the 82 track formats. + +## Options + + - Format variants: + - `360`: 360kB 3.5" 80-track 9-sector SSDD + - `370`: 370kB 3.5" 82-track 9-sector SSDD + - `400`: 400kB 3.5" 80-track 10-sector SSDD + - `410`: 410kB 3.5" 82-track 10-sector SSDD + - `720`: 720kB 3.5" 80-track 9-sector DSDD + - `740`: 740kB 3.5" 82-track 9-sector DSDD + - `800`: 800kB 3.5" 80-track 10-sector DSDD + - `820`: 820kB 3.5" 82-track 10-sector DSDD + +## Examples + +To read: + + - `fluxengine read atarist --360 -s drive:0 -o atarist.img` + - `fluxengine read atarist --370 -s drive:0 -o atarist.img` + - `fluxengine read atarist --400 -s drive:0 -o atarist.img` + - `fluxengine read atarist --410 -s drive:0 -o atarist.img` + - `fluxengine read atarist --720 -s drive:0 -o atarist.img` + - `fluxengine read atarist --740 -s drive:0 -o atarist.img` + - `fluxengine read atarist --800 -s drive:0 -o atarist.img` + - `fluxengine read atarist --820 -s drive:0 -o atarist.img` + +To write: + + - `fluxengine write atarist --360 -d drive:0 -i atarist.img` + - `fluxengine write atarist --370 -d drive:0 -i atarist.img` + - `fluxengine write atarist --400 -d drive:0 -i atarist.img` + - `fluxengine write atarist --410 -d drive:0 -i atarist.img` + - `fluxengine write atarist --720 -d drive:0 -i atarist.img` + - `fluxengine write atarist --740 -d drive:0 -i atarist.img` + - `fluxengine write atarist --800 -d drive:0 -i atarist.img` + - `fluxengine write atarist --820 -d drive:0 -i atarist.img` + +## References + + - [Atari ST Floppy Drive Hardware + Information](https://info-coach.fr/atari/hardware/FD-Hard.php) by Jean + Louis-Guerin + + - [Atari ST Floppy Drive Software + Information](https://info-coach.fr/atari/software/FD-Soft.php) by Jean + Louis-Guerin + diff --git a/doc/disk-bk.md b/doc/disk-bk.md index f5ce0ddb..fa18d96a 100644 --- a/doc/disk-bk.md +++ b/doc/disk-bk.md @@ -1,2 +1,30 @@ --d -\r +bk +==== +## 800kB 5.25"/3.5" 80-track 10-sector DSDD + + +The BK (an abbreviation for 1ba9 +is a Soviet era personal computer from Elektronika based on a PDP-11 +single-chip processor. It was the _only_ official, government approved home +computer in mass production at the time. + +It got a floppy interface in 1989 when the 128kB BK-0011 was released. This +used a relatively normal double-sided IBM scheme format with 80 sectors and ten +sectors per track, resulting in 800kB disks. The format is, in fact, identical +to the Atari ST 800kB format. Either 5.25" or 3.5" drives were used depending +on what was available at the time, with the same format on both. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read bk -s drive:0 -o bk800.img` + +To write: + + - `fluxengine write bk -d drive:0 -i bk800.img` + diff --git a/doc/disk-brother.md b/doc/disk-brother.md index f5ce0ddb..7d3e2ea8 100644 --- a/doc/disk-brother.md +++ b/doc/disk-brother.md @@ -1,2 +1,128 @@ --d -\r +brother +==== +## GCR family + + +Brother word processor disks are weird, using custom tooling and chipsets. +They are completely not PC compatible in every possible way other than the +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 +`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 +disk don't line up with the position of the head in a PC drive). The word +processors themselves solved this by microstepping until they found where the +real track is, but normal PC drives aren't capable of doing this. Particularly +with the 120kB disks, you might want to fiddle with the start track (e.g. +`:t=0-79x2`) to get a clean read. Keep an eye on the bad sector map that's +dumped at the end of a read. My word processor likes to put logical track 0 on +physical track 3, which means that logical track 77 is on physical track 80; +luckily my PC drive can access track 80. + +Using FluxEngine to *write* disks isn't a problem, so the +simplest solution is to use FluxEngine to create a new disk, with the tracks +aligned properly, and then use a word processor to copy the files you want +onto it. The new disk can then be read and you can extract the files. +Obviously this sucks if you don't actually have a word processor, but I can't +do anything about that. + +If you find one of these misaligned disks then *please* [get in +touch](https://github.com/davidgiven/fluxengine/issues/new); I want to +investigate. + +## Options + + - Format variants: + - `120`: 120kB 3.5" 39-track SS GCR + - `240`: 240kB 3.5" 78-track SS GCR + +## Examples + +To read: + + - `fluxengine read brother --120 -s drive:0 -o brother.img` + - `fluxengine read brother --240 -s drive:0 -o brother.img` + +To write: + + - `fluxengine write brother --120 -d drive:0 -i brother.img` + - `fluxengine write brother --240 -d drive:0 -i brother.img` + +Dealing with misaligned disks +----------------------------- + +While FluxEngine can't read misaligned disks directly, Brother word processors +_can_. If you have access to a compatible word processor, there's a fairly +simple workaround to allow you to extract the data: + + 1. Format a disk using FluxEngine (by simply writing a blank filesystem image + to a disk). This will have the correct alignment to work on a PC drive. + + 2. Use a word processor to copy the misaligned disk to the newly formatted + disk. The machine will happily adjust itself to both sets of alignments. + + 3. Use FluxEngine to read the data off the correctly aligned disk. + +I realise this is rather unsatisfactory, as the Brother hardware is becoming +rarer and they cope rather badly with damaged disks, but this is a limitation +of the hardware of normal PC drives. (It _is_ possible to deliberately misalign +a drive to make it match up with a bad disk, but this is for experts only --- I +wouldn't dare.) + +Low level format +---------------- + +The drive is a single-sided 3.5" drive spinning at not 300 rpm (I don't know +the precise speed yet but FluxEngine doesn't care). The 240kB disks have 78 +tracks and the 120kB disks have 39. + +Each track has 12 256-byte sectors. The drive ignores the index hole so they're +lined up all anyhow. As FluxEngine can only read from index to index, it +actually reads two complete revolutions and reassembles the sectors from that. + +The underlying encoding is exceptionally weird; they use two different kinds of +GCR, one kind for the sector header records and a completely different one for +the data itself. It also has a completely bizarre CRC variant which a genius on +StackOverflow reverse engineered for me. However, odd though it may be, it does +seem pretty robust. + +See the source code for the GCR tables and CRC routine. + +Sectors are about 16.2ms apart on the disk (at 300 rpm). The header and +data records are 0.694ms apart. (All measured from the beginning of the +record.) The sector order is 05a3816b4927, which gives a sector skew of 5. + +High level format +----------------- + +Once decoded, you end up with a file system image. FluxEngine supports direct +filesystem access for both kinds of disks. + +### 120kB disks + +These disks use a proprietary and very simple file system. It's FAT-like +with an obvious directory and allocation table. It's supported by FluxEngine. + +Any files whose names begin with an asterisk (`*`) will be marked as hidden. If +the file is named `*boot`, then a boot sector will be created which will load +and run the file at 0x7000 if the machine is started with CODE+Q pressed. So +far this has only been confirmed to work on a WP-1. + +### 240kB disks + +Conversely, the 240kB disks turns out to be a completely normal Microsoft FAT +file system with a media type of 0x58 --- did you know that FAT supports 256 +byte sectors? I didn't --- of the MSX-DOS variety. There's a faint +possibility that the word processor is based on MSX-DOS, but I haven't +reverse engineered it to find out. + +Standard Linux mtools will access the filesystem image and allow you to move +files in and out. However, you'll need to change the media type bytes at +offsets 0x015 and 0x100 from 0x58 to 0xf0 before mtools will touch it. The +supplied `brother240tool` will do this. Additionally, FluxEngine's own FAT +file system supports this. + diff --git a/doc/disk-commodore.md b/doc/disk-commodore.md index f5ce0ddb..c2ad45f9 100644 --- a/doc/disk-commodore.md +++ b/doc/disk-commodore.md @@ -1,2 +1,74 @@ --d -\r +commodore +==== +## 1541, 1581, 8050 and variations + + +Commodore 8-bit computer 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 with a slightly odd sector +count. + +The GCR disks are much more interesting. They could store 170kB on a +single-sided disk (although later drives were double-sided), using a proprietary +encoding and record scheme; like [Apple Macintosh disks](macintosh.md) they +stored varying numbers of sectors per track to make the most of the physical +disk area, although unlike them they did it by changing the bitrate rather than +adjusting the motor speed. + +The drives were also intelligent and ran DOS on a CPU inside them. The +computer itself knew nothing about file systems. You could even upload +programs onto the drive and run them there, allowing all sorts of custom disk +formats, although this was mostly used to compensate for the [cripplingly +slow connection to the +computer](https://ilesj.wordpress.com/2014/05/14/1541-why-so-complicated/) of +300 bytes per second (!). (The drive itself could transfer data reasonably +quickly.) + + - a 1541 disk has 35 tracks of 17 to 21 sectors, each 256 bytes long + (sometimes 40 tracks), and uses GCR encoding. + + - a standard 1581 disk has 80 tracks and two sides, each with 10 sectors, 512 + bytes long, and uses normal IBM encoding. + + - an 8050 disk has 77 tracks and two sides, with four speed zones; the number + of sectors varies from 23 to 29, using GCR encoding. These will store + 1042kB. These drives are peculiar because they are 100tpi and therefore the + disks cannot be read in normal 96tpi drives. + + - a CMD FD2000 disk (a popular third-party Commodore disk drive) has 81 + tracks and two sides, each with 10 1024-byte sectors, for a massive 1620kB + of storage. This also uses IBM encoding. + +A CMD FD2000 disk (a popular third-party Commodore disk drive) + +## Options + + - Format variants: + - `171`: 171kB 1541, 35-track variant + - `192`: 192kB 1541, 40-track variant + - `800`: 800kB 3.5" 1581 + - `1042`: 1042kB 5.25" 8051 + - `1620`: 1620kB, CMD FD2000 + +## Examples + +To read: + + - `fluxengine read commodore --171 -s drive:0 -o commodore.d64` + - `fluxengine read commodore --192 -s drive:0 -o commodore.d64` + - `fluxengine read commodore --800 -s drive:0 -o commodore.d64` + - `fluxengine read commodore --1042 -s drive:0 -o commodore.d64` + - `fluxengine read commodore --1620 -s drive:0 -o commodore.d64` + +To write: + + - `fluxengine write commodore --171 -d drive:0 -i commodore.d64` + - `fluxengine write commodore --192 -d drive:0 -i commodore.d64` + - `fluxengine write commodore --800 -d drive:0 -i commodore.d64` + - `fluxengine write commodore --1620 -d drive:0 -i commodore.d64` + +## References + + - [Ruud's Commodore Site: 1541](http://www.baltissen.org/newhtm/1541c.htm): + documentation on the 1541 disk format. + diff --git a/doc/disk-eco1.md b/doc/disk-eco1.md index f5ce0ddb..f31ca3a1 100644 --- a/doc/disk-eco1.md +++ b/doc/disk-eco1.md @@ -1,2 +1,42 @@ --d -\r +eco1 +==== +## CP/M; 1210kB 77-track mixed format DSHD + + +The Eco1 is a Italian CP/M machine produced in 1982. It had 64kB of RAM, in +later models expandable up to 384kB, and _two_ Z80 processors. One of these was +used solely for managing the twin 8" drives, each storing 1.2MB, which was +quite impressive for a CP/M machine in those days. Visually it is best +described as 'very brown'. + +
+ A contemporary advert for the Eco1 +
+ +Its format is standard IBM scheme, but with an interesting wrinkle: there are +_three_ different formatting zones on the disk: + + - Track 0 side 0: 26 sectors, 128 bytes per sector (3296 bytes) + - Track 0 side 1: 26 sectors, 256 bytes per sector (6656 bytes) + - All others: 16 sectors, 512 bytes per sector (8192 bytes) + +The standard `read ibm` command will autodetect and read these disks, but due +to the format confusing the size autodetection the images need postprocessing +to be useful, so there's a custom profile for the Eco1 which produces sensible +images. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read eco1 -s drive:0 -o eco1.img` + +## References + + - [Apulio Retrocomputing's page on the + Eco1](https://www.apuliaretrocomputing.it/wordpress/?p=8976) + diff --git a/doc/disk-epsonpf10.md b/doc/disk-epsonpf10.md index f5ce0ddb..4f272f09 100644 --- a/doc/disk-epsonpf10.md +++ b/doc/disk-epsonpf10.md @@ -1,2 +1,19 @@ --d -\r +epsonpf10 +==== +## CP/M; 3.5" 40-track DSDD + + +The Epson PF10 is the disk unit for the Epson Z80 series of 'laptops', running +CP/M. It uses a single-sided 40-track 3.5" format, which is unusual, but the +format itself is yet another IBM scheme variant. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read epsonpf10 -s drive:0 -o epsonpf10.img` + diff --git a/doc/disk-f85.md b/doc/disk-f85.md index f5ce0ddb..3f99b343 100644 --- a/doc/disk-f85.md +++ b/doc/disk-f85.md @@ -1,2 +1,47 @@ --d -\r +f85 +==== +## 461kB 5.25" 77-track SS + + +The Durango F85 was an early office computer based around a 5MHz 8085 processor, +sold in 1977. It had an impressive 64kB of RAM, upgradable to 128kB, and ran +its own multitasking operating system call DX-85M, as well as CP/M. It had an +interesting electric-typewriter form factor, with a little monitor sitting on +the side of it --- in operation you were facing the 14" printer. + +It was touted as being portable. Which it was, if you were strong; the story +is that they had to do an extensive search to find someone capable of lifting +it for the following photo... + +
+A Durango F85, held precariously +
+ +...and even then, they had to airbrush out the tendons in her neck from the +effort! + +It used 5.25 soft-sectored disks storing an impressive-for-those-days +480kBish on a side, using a proprietary 4-in-5 GCR encoding. They used 77 +tracks, 12 sectors and 512 bytes per sector. Later models used double-sided +disks; I don't have access to an image of one so don't know how they work +(there's a suspicious looking spare byte in the sector header which could +store the side). As always, if you have one, please [get in +touch](https://github.com/davidgiven/fluxengine/issues/new). + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read f85 -s drive:0 -o f85.img` + +## References + +There's amazingly little information about these things. + + * [Chuck Guzis' F85 page](http://www.sydex.com/durango/durango.html) with + lots of pictures + diff --git a/doc/disk-fb100.md b/doc/disk-fb100.md index f5ce0ddb..2ba81422 100644 --- a/doc/disk-fb100.md +++ b/doc/disk-fb100.md @@ -1,2 +1,48 @@ --d -\r +fb100 +==== +## 100kB 3.5" 40-track SSSD + + +The Brother FB-100 is a serial-attached smart floppy drive used by a several +different machines for mass storage, including the Tandy Model 100 and +clones, the Husky Hunter 2, and (bizarrely) several knitting machines. It was +usually rebadged, sometimes with a cheap paper label stuck over the Brother +logo, but the most common variant appears to be the Tandy Portable Disk Drive +or TPDD: + +
+ A Tandy Portable Disk Drive +
+ +It's a bit of an oddball: the disk encoding is FM with a very custom record +scheme: 40-track single-sided 3.5" disks storing 100kB or so each. Each track +had only _two_ sectors, each 1280 bytes, but with an additional 12 bytes of +ID data used for filesystem management. + +There was also apparently a TPDD-2 which could store twice as much data, but +I don't have access to one of those disks. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read fb100 -s drive:0 -o fb100.img` + +## References + + - [Tandy Portable Disk Drive operations + manual](http://www.classiccmp.org/cini/pdf/Tandy/Portable%20Disk%20Drive%20Operation%20Manual.pdf) + + - [Tandy Portable Disk Drive service + manual](https://archive.org/details/TandyPortableDiskDriveSoftwareManual26-3808s) + + - [TPDD design notes (including a dump of the + ROM)](http://bitchin100.com/wiki/index.php?title=TPDD_Design_Notes) + + - [Knitting machine FB-100 + resources](http://www.k2g2.org/wiki:brother_fb-100) + diff --git a/doc/disk-hplif.md b/doc/disk-hplif.md index f5ce0ddb..f5cf22f6 100644 --- a/doc/disk-hplif.md +++ b/doc/disk-hplif.md @@ -1,2 +1,42 @@ --d -\r +hplif +==== +## a variety of disk formats used by HP + + +LIF, a.k.a. Logical Interchange Format, is a series of formats used by +Hewlett-Packard across their entire range of computers, from calculators to +modern servers. It also defines a simple non-hierarchical filesystem which is +bizarrely _still_ supported by HP-UX systems. + +Floppy-disk wise, they're yet more variations of the standard IBM floppy +encoding scheme. + +## Options + + - Format variants: + - `264`: 264kB 3.5" 66-track SSDD; HP9121 format + - `608`: 608kB 3.5" 76-track DSDD; HP9122 format + - `616`: 616kB 3.5" 77-track DSDD + - `770`: 770kB 3.5" 77-track DSDD + +## Examples + +To read: + + - `fluxengine read hplif --264 -s drive:0 -o hplif.img` + - `fluxengine read hplif --608 -s drive:0 -o hplif.img` + - `fluxengine read hplif --616 -s drive:0 -o hplif.img` + - `fluxengine read hplif --770 -s drive:0 -o hplif.img` + +To write: + + - `fluxengine write hplif --264 -d drive:0 -i hplif.img` + - `fluxengine write hplif --608 -d drive:0 -i hplif.img` + - `fluxengine write hplif --616 -d drive:0 -i hplif.img` + - `fluxengine write hplif --770 -d drive:0 -i hplif.img` + +## References + + * [A summary of the Hewlett Packard floppy disk + formats](http://www.bitsavers.org/pdf/hp/disc/912x/HP_Flexible_Disk_Formats.pdf) + diff --git a/doc/disk-ibm.md b/doc/disk-ibm.md index f5ce0ddb..742be528 100644 --- a/doc/disk-ibm.md +++ b/doc/disk-ibm.md @@ -1,2 +1,122 @@ --d -\r +ibm +==== +## Generic PC 3.5"/5.25" disks + + +IBM scheme disks are _the_ most common disk format, ever. They're used by a +huge variety of different systems, and they come in a huge variety of different +forms, but they're all fundamentally the same: either FM or MFM, either single- +or double-sided, with distinct sector header and data records and no sector +metadata. Systems which use IBM scheme disks include but are not limited to: + + - IBM PCs (naturally) + - Atari ST + - late era Apple machines + - Acorn machines + - the TRS-80 + - late era Commodore machines (the 1571 and so on) + - most CP/M machines + - NEC PC-88 series + - NEC PC-98 series + - Sharp X68000 + - Fujitsu FM Towns + - VAX & PDP-11 + - etc + +FluxEngine supports reading these. However, some variants are more peculiar +than others, and as a result there are specific decoders which set the defaults +correctly for certain formats (for example: on PC disks the sector numbers +start from 1, but on Acorn disks they start from 0). The IBM decoder described +here is the generic one, and is suited for 'conventional' PC disks. While you +can read all the variant formats with it if you use the right set of arguments, +it's easier to use the specific decoder. + +There is a generic decoder which should adjust automatically to whichever disk +format you are using, but it's unreliable and not recommended. This format +should also be used if you are writing images such as DIM which specify the +image format. FluxEngine will use these parameters. + +## Options + + - Format variants: + - `auto`: try to autodetect the format (unreliable) + - `160`: 160kB 5.25" 40-track 8-sector SSDD + - `180`: 180kB 5.25" 40-track 9-sector SSDD + - `320`: 320kB 5.25" 40-track 8-sector DSDD + - `360`: 360kB 5.25" 40-track 9-sector DSDD + - `720_96`: 720kB 5.25" 80-track 9-sector DSDD + - `720_135`: 720kB 3.5" 80-track 9-sector DSDD + - `1200`: 1200kB 5.25" 80-track 15-sector DSHD + - `1232`: 1232kB 5.25" 77-track 8-sector DSHD + - `1440`: 1440kB 3.5" 80-track 18-sector DSHD + - `1680`: 1680kB 3.5" 80-track 21-sector DSHD; DMF + +## Examples + +To read: + + - `fluxengine read ibm --auto -s drive:0 -o ibm.img` + - `fluxengine read ibm --160 -s drive:0 -o ibm.img` + - `fluxengine read ibm --180 -s drive:0 -o ibm.img` + - `fluxengine read ibm --320 -s drive:0 -o ibm.img` + - `fluxengine read ibm --360 -s drive:0 -o ibm.img` + - `fluxengine read ibm --720_96 -s drive:0 -o ibm.img` + - `fluxengine read ibm --720_135 -s drive:0 -o ibm.img` + - `fluxengine read ibm --1200 -s drive:0 -o ibm.img` + - `fluxengine read ibm --1232 -s drive:0 -o ibm.img` + - `fluxengine read ibm --1440 -s drive:0 -o ibm.img` + - `fluxengine read ibm --1680 -s drive:0 -o ibm.img` + +To write: + + - `fluxengine write ibm --160 -d drive:0 -i ibm.img` + - `fluxengine write ibm --180 -d drive:0 -i ibm.img` + - `fluxengine write ibm --320 -d drive:0 -i ibm.img` + - `fluxengine write ibm --360 -d drive:0 -i ibm.img` + - `fluxengine write ibm --720_96 -d drive:0 -i ibm.img` + - `fluxengine write ibm --720_135 -d drive:0 -i ibm.img` + - `fluxengine write ibm --1200 -d drive:0 -i ibm.img` + - `fluxengine write ibm --1232 -d drive:0 -i ibm.img` + - `fluxengine write ibm --1440 -d drive:0 -i ibm.img` + - `fluxengine write ibm --1680 -d drive:0 -i ibm.img` + +Mixed-format disks +------------------ + +Some disks, such as those belonging to early CP/M machines, or N88-Basic disks +(for PC-88 and PC-98), have more than one format on the disk at once. Typically, +the first few tracks will be low-density FM encoded and will be read by the +machine's ROM; those tracks contain new floppy drive handling code capable of +coping with MFM data, and so the rest of the disk will use that, allowing them +to store more data. + +FluxEngine can read these fine, but it tends to get a bit confused when it sees +tracks with differing numbers of sectors --- if track 0 has 32 sectors but +track 1 has 16, it will assume that sectors 16..31 are missing on track 1 and +size the image file accordingly. This can be worked around by specifying the +size of each track; see the `eco1` read profile for an example. + +N88-Basic format floppies can be written by either specifying the `n88basic` +format, or by using D88 or NFD format images which include explicit sector +layout information. + +Writing other formats can be made to work too, by creating a custom format +specifier, using the `n88basic` format as an example. +Please [get in touch](https://github.com/davidgiven/fluxengine/issues/new) if +you have specific requirements. + +360rpm 3.5" disks +----------------- + +Japanese PCs (NEC PC-98, Sharp X68000, Fujitsu FM Towns) spin their floppy +drives at 360rpm rather than the more typical 300rpm. This was done in order +to be fully backwards compatible with 5.25" disks, while using the exact +same floppy controller. Later models of the PC-9821, as well as most USB floppy +drives, feature "tri-mode" support which in addition to normal 300rpm modes, +can change their speed to read and write 360rpm DD and HD disks. + +Neither the FluxEngine or Greaseweazle hardware can currently command a +tri-mode drive to spin at 360rpm. However on both devices the FluxEngine +software is capable of both reading and writing 300rpm disks at 360rpm and vice +versa, so it shouldn't matter. + diff --git a/doc/disk-icl30.md b/doc/disk-icl30.md index f5ce0ddb..a5333a8d 100644 --- a/doc/disk-icl30.md +++ b/doc/disk-icl30.md @@ -1,2 +1,19 @@ --d -\r +icl30 +==== +## CP/M; 263kB 35-track DSSD + + +The ICL Model 30 is a reasonably standard CP/M machine using 35-track single +density disks and the traditional CP/M 128-byte secotrs --- 30 of them per +track! Other than that it's another IBM scheme variation. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read icl30 -s drive:0 -o icl30.img` + diff --git a/doc/disk-mac.md b/doc/disk-mac.md index f5ce0ddb..655c5175 100644 --- a/doc/disk-mac.md +++ b/doc/disk-mac.md @@ -1,2 +1,73 @@ --d -\r +mac +==== +## 400kB/800kB 3.5" GCR + + +Macintosh disks come in two varieties: the newer 1440kB ones, which are +perfectly ordinary PC disks you should use the `ibm` profile to read them, 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. + +It's not just the weird, custom GCR encoding. It's not just the utterly +bizarre additional encoding/checksum built on top of that where [every byte +is mutated according to the previous bytes in the +sector](https://www.bigmessowires.com/2011/10/02/crazy-disk-encoding-schemes/). +It's not just the odd way in which disks think they have four sides, two on one +side and two on the other, so that the track byte stores only the bottom 6 bits +of the track number. It's not just the way that Macintosh sectors are 524 bytes +long. No, it's the way the Macintosh drive changes speed depending on which +track it's looking at, so that each track contains a different amount of data. + +The reason for this is actually quite sensible: the tracks towards the centre +of the disk are obviously moving more slowly, so you can't pack the bits in +quite as closely (due to limitations in the magnetic media). You can use a +higher bitrate at the edge of the disk than in the middle. Many platforms, for +example the Commodore 64 1541 drive, changed bitrate this way. + +But Macintosh disks used a constant bitrate and changed the speed that the disk +spun instead to achieve the same effect... + +_Anyway_: FluxEngine will read them fine on conventional drives. Because it's +clever. + +Macintosh computers never really used the twelve bytes of metadata and the +standard for disk images is to omit it. If you want them, specify that you want +524-byte sectors. The metadata will follow the 512 bytes of user data. + +## Options + + - Format variants: + - `400`: 400kB 80-track SSDD + - `800`: 800kB 80-track DSDD + - `metadata`: read/write 524 byte sectors + +## Examples + +To read: + + - `fluxengine read mac --400 -s drive:0 -o mac.dsk` + - `fluxengine read mac --800 -s drive:0 -o mac.dsk` + +To write: + + - `fluxengine write mac --400 -d drive:0 -i mac.dsk` + - `fluxengine write mac --800 -d drive:0 -i mac.dsk` + +## References + + - [MAME's ap_dsk35.cpp file](https://github.com/mamedev/mame/blob/4263a71e64377db11392c458b580c5ae83556bc7/src/lib/formats/ap_dsk35.cpp), + without which I'd never have managed to do this + + - [Crazy Disk Encoding + Schemes](https://www.bigmessowires.com/2011/10/02/crazy-disk-encoding-schemes/), which made + me realise just how nuts the format is + + - [Les Disquettes et le drive Disk II](http://www.hackzapple.com/DISKII/DISKIITECH.HTM), an + epicly detailed writeup of the Apple II disk format (which is closely related) + + - [The DiskCopy 4.2 + format](https://www.discferret.com/wiki/Apple_DiskCopy_4.2), described on + the DiskFerret website. + diff --git a/doc/disk-micropolis.md b/doc/disk-micropolis.md index f5ce0ddb..a5c2576f 100644 --- a/doc/disk-micropolis.md +++ b/doc/disk-micropolis.md @@ -1,2 +1,87 @@ --d -\r +micropolis +==== +## 100tpi MetaFloppy disks + + +Micropolis MetaFloppy disks use MFM and hard sectors. Mod I was 48 TPI and +stored 143k per side. Mod II was 100 TPI and stored 315k per side. Each of the +16 sectors contains 266 bytes of "user data," allowing 10 bytes of metadata for +use by the operating system. Micropolis DOS (MDOS) used the metadata bytes, but +CP/M did not. + +Some later systems were Micropolis-compatible and so were also 100 TPI, like +the Vector Graphic Dual-Mode Disk Controller which was paired with a Tandon +drive. + +**Important note:** You _cannot_ read these disks with a normal PC drive, as +these drives are 96tpi. The track spacing is determined by the physical geometry +of the drive and can't be changed in software. You'll need to get hold of a +100tpi Micropolis drive. Luckily these seem to use the same connector and +pinout as a 96tpi PC 5.25" drive. In use they should be identical. + +While most operating systems use the standard Micropolis checksum, Vector +Graphic MZOS uses a unique checksum. The decoder will automatically detect +the checksum type in use; however, a specific checksum type may be forced +using the `--decoder.micropolis.checksum_type=TYPE` where TYPE is one of: + +| Checksum | Description | +|------------|-----------------------------------------| +| AUTO | Automatically detect | +| MICROPOLIS | Standard Micropolis (MDOS, CP/M, OASIS) | +| MZOS | Vector Graphic MZOS | + +Later versions of the Micropolis format supported ECC, especially in +controllers with HDD support. The ECC can detect and correct errors. However, +it is unclear what ECC algorithm was used by each vendor. ECC is disabled by +default, but available for checking and correcting using +`--decoder.micropolis.ecc_type=TYPE` and for writing from IMG files using +`--encoder.micropolis.ecc_type=TYPE`, where TYPE is one of: + +| ECC | Description | +|--------|------------------------------------------| +| NONE | No ECC processing enabled | +| VECTOR | Vector Graphic Dual-Mode Disk Controller | + +The [CP/M BIOS](https://www.seasip.info/Cpm/bios.html) defined SELDSK, SETTRK, +and SETSEC, but no function to select the head/side. Double-sided floppies +could be represented as having either twice the number of sectors, for CHS, or +twice the number of tracks, HCS; the second side's tracks in opposite order +logically followed the first side (e.g., tracks 77-153). Micropolis disks +tended to be the latter. FluxEngine always emits CHS format disks, so you may +need to apply extra options to change the format if desired. + +## Options + + - : + - `143`: 143kB 5.25" SSDD hard-sectored; Micropolis MetaFloppy Mod I + - `287`: 287kB 5.25" DSDD hard-sectored; Micropolis MetaFloppy Mod I + - `315`: 315kB 5.25" SSDD hard-sectored; Micropolis MetaFloppy Mod II + - `630`: 630kB 5.25" DSDD hard-sectored; Micropolis MetaFloppy Mod II + - `vgi`: Read/write VGI format images with 275 bytes per sector + +## Examples + +To read: + + - `fluxengine read micropolis -s drive:0 -o micropolis.img` + +To write: + + - `fluxengine write micropolis -d drive:0 -i micropolis.img` + +## References + + - [Micropolis 1040/1050 S-100 Floppy Disk Subsystems User's Manual][micropolis1040/1050]. + Section 6, pages 261-266. Documents pre-ECC sector format. Note that the + entire record, starting at the sync byte, is controlled by software + + - [Vector Graphic Dual-Mode Disk Controller Board Engineering Documentation][vectordualmode]. + Section 1.6.2. Documents ECC sector format + + - [AltairZ80 Simulator Usage Manual][altairz80]. Section 10.6. Documents ECC + sector format and VGI file format + +[micropolis1040/1050]: http://www.bitsavers.org/pdf/micropolis/metafloppy/1084-01_1040_1050_Users_Manual_Apr79.pdf +[vectordualmode]: http://bitsavers.org/pdf/vectorGraphic/hardware/7200-1200-02-1_Dual-Mode_Disk_Controller_Board_Engineering_Documentation_Feb81.pdf +[altairz80]: http://www.bitsavers.org/simh.trailing-edge.com_201206/pdf/altairz80_doc.pdf + diff --git a/doc/disk-ms2000.md b/doc/disk-ms2000.md index f5ce0ddb..71f144e9 100644 --- a/doc/disk-ms2000.md +++ b/doc/disk-ms2000.md @@ -1,2 +1,33 @@ --d -\r +ms2000 +==== +## MS2000 Microdisk Development System + + +The RCA MicroDisk Development System MS2000 is a highly obscure (i.e. I gather +that single digit numbers of original machines exist) development system for the +RCA1802 series of CPUs, as made famous by the Cosmac ELF. It was a fairly +straightforward big bag o'RAM system with a 2kB boot ROM, 62kB of RAM, twin +floppy drives and a serial terminal --- CP/M users will find it very familiar. + +Read and writing disks is currently not supported by FluxEngine, but there is +basic support for the MicroDisk operating system's file system. This should +allow files to be read from MS2000 disk images. + +The disks are normal DD 3.5" disks, using a 70-track, single sided variation of +the venerable IBM floppy disk scheme, so allowing 315kB of storage per disk. + +If you have access to flux files for MS2000 disks, please [get in +touch](https://github.com/davidgiven/cpm65/issues/new) --- I would like to add +better support for these. + +## Options + +(no options) + +## Examples + +## References + + - [The EMMA-02 emulator](https://www.emma02.hobby-site.com/ms2000.html), which + supports the MS2000 and provides information on it. + diff --git a/doc/disk-mx.md b/doc/disk-mx.md index f5ce0ddb..0e3102e9 100644 --- a/doc/disk-mx.md +++ b/doc/disk-mx.md @@ -1,2 +1,69 @@ --d -\r +mx +==== +## Soviet-era PDP-11 clone + + +The DVK (in Russian, 沾7d65 +Computing Complex) was a late 1970s Soviet personal computer, a cut-down +version of the professional SM EVM (ⵁ241c +--- literally System of Mini Computers), which _itself_ was an unlicensed +clone of the PDP-11. The MX board was an early floppy drive controller board +for it. + +
+A DVK computer +
+ +The MX format is interesting in that it has to be read a track at a time. The +format contains the usual ID prologue at the beginning of the track, then +eleven data blocks and checksums, then the epilogue, then it stops. The +actual encoding is normal FM. There were four different disk variants, in all +combinations of single- and double-sided and 40- and 80-tracked; but every +track contained eleven 256-byte sectors. + +The format varies subtly depending on whether you're using the 'new' driver +or the 'old' driver. FluxEngine should read both. + +A track is: + + * 8 x 0x0000 words (FM encoded as 01010101...) + * 1 x 0x00F3 --- start of track + * 1 x 0xnnnn --- track number + * 11 of: + * 128 words (256 bytes) of data + * 16 bit checksum + * **if 'new' format:** + * 3 x 0x83nn --- `n = (track_number<<1) + side_number` + * **if 'old' format:** + * 3 x 0x8301 + +The checksum is just the unsigned integer sum of all the words in the sector. +Words are all stored little-endian. + +## Options + + - Format variants: + - `110`: 110kB 5.25" 40-track SSSD + - `220ds`: 220kB 5.25" 40-track DSSD + - `220ss`: 220kB 5.25" 80-track SSSD + - `440`: 440kB 5.25" 80-track DSSD + +## Examples + +To read: + + - `fluxengine read mx --110 -s drive:0 -o mx.img` + - `fluxengine read mx --220ds -s drive:0 -o mx.img` + - `fluxengine read mx --220ss -s drive:0 -o mx.img` + - `fluxengine read mx --440 -s drive:0 -o mx.img` + +## References + + - [The Soviet Digital Electronics + Museum](http://www.leningrad.su/museum/main.php) (source of the image + above) + + - [a random post on the HxC2001 support + forum](http://torlus.com/floppy/forum/viewtopic.php?t=1384) with lots of + information on the format + diff --git a/doc/disk-n88basic.md b/doc/disk-n88basic.md index f5ce0ddb..749b256c 100644 --- a/doc/disk-n88basic.md +++ b/doc/disk-n88basic.md @@ -1,2 +1,26 @@ --d -\r +n88basic +==== +## PC8800/PC98 5.25" 77-track 26-sector DSHD + + +The N88-BASIC disk format is the one used by the operating system of the same +name for the Japanese PC8800 and PC98 computers. It is another IBM scheme +variant, and is very similar to some mixed-format CP/M disk formats, where +track 0 side 0 uses 128-byte single density sectors and the rest of the disk +uses 512-byte double density sectors. (The reason for this is that the PC8800 +boot ROM could only read single density data.) + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read n88basic -s drive:0 -o n88basic.img` + +To write: + + - `fluxengine write n88basic -d drive:0 -i n88basic.img` + diff --git a/doc/disk-northstar.md b/doc/disk-northstar.md index f5ce0ddb..26386574 100644 --- a/doc/disk-northstar.md +++ b/doc/disk-northstar.md @@ -1,2 +1,50 @@ --d -\r +northstar +==== +## 5.25" hard sectored + + +Northstar Floppy disks use 10-sector hard sectored disks with either FM or MFM +encoding. They may be single- or double-sided. Each of the 10 sectors contains +256 (FM) or 512 (MFM) bytes of data. The disk has 35 cylinders, with tracks 0- +34 on side 0, and tracks 35-69 on side 1. Tracks on side 1 are numbered "back- +wards" in that track 35 corresponds to cylinder 34, side 1, and track 69 +corresponds to cylinder 0, side 1. + +The Northstar sector format does not include any head positioning information. +As such, reads from Northstar floppies need to by synchronized with the index +pulse, in order to properly identify the sector being read. This is handled +automatically by FluxEngine. + +Due to the nature of the track ordering on side 1, an .nsi image reader and +writer are provided for double-sided disks. The .nsi image writer supports +both single- and double-sided disks; however single-sided .nsi images are +equivalent to .img images. + +## Options + + - Format variants: + - `87`: 87.5kB 5.25" 35-track SSSD hard-sectored + - `175`: 175kB 5.25" 40-track SSDD hard-sectored + - `350`: 350kB 5.25" 40-track DSDD hard-sectored + +## Examples + +To read: + + - `fluxengine read northstar --87 -s drive:0 -o northstar.nsi` + - `fluxengine read northstar --175 -s drive:0 -o northstar.nsi` + - `fluxengine read northstar --350 -s drive:0 -o northstar.nsi` + +To write: + + - `fluxengine write northstar --87 -d drive:0 -i northstar.nsi` + - `fluxengine write northstar --175 -d drive:0 -i northstar.nsi` + - `fluxengine write northstar --350 -d drive:0 -i northstar.nsi` + +## References + + - [MICRO-DISK SYSTEM MDS-A-D DOUBLE DENSITY Manual][northstar_mds]. + Page 33 documents sector format for single- and double-density. + +[northstar_mds]: http://bitsavers.org/pdf/northstar/boards/Northstar_MDS-A-D_1978.pdf + diff --git a/doc/disk-psos.md b/doc/disk-psos.md index f5ce0ddb..27df0224 100644 --- a/doc/disk-psos.md +++ b/doc/disk-psos.md @@ -1,2 +1,32 @@ --d -\r +psos +==== +## 800kB DSDD with PHILE + + +pSOS was an influential real-time operating system from the 1980s, used mainly +on 68000-based machines, lasting up until about 2000 when it was bought (and +cancelled) by Wind River. It had its own floppy disk format and file system, +both of which are partially supported here. + +The PHILE file system is almost completely undocumented and so many of the data +structures have had to be reverse engineered and are not well known. Please +[get in touch](https://github.com/davidgiven/fluxengine/issues/new) if you know +anything about it. + +The floppy disk format itself is an IBM scheme variation with 1024-byte sectors +and, oddly, swapped sides. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read psos -s drive:0 -o pme.img` + +To write: + + - `fluxengine write psos -d drive:0 -i pme.img` + diff --git a/doc/disk-rolandd20.md b/doc/disk-rolandd20.md index f5ce0ddb..92eaa1dc 100644 --- a/doc/disk-rolandd20.md +++ b/doc/disk-rolandd20.md @@ -1,2 +1,48 @@ --d -\r +rolandd20 +==== +## 3.5" electronic synthesiser disks + + +The Roland D20 is a classic electronic synthesiser with a built-in floppy +drive, used for saving MIDI sequences and samples. + +Weirdly, it seems to use precisely the same format as the Brother word +processors: a thoroughly non-IBM-compatible custom GCR system. + +FluxEngine supports both reading and writing D20 disks, as well as basic support +for the filesystem, allowing files to be read from and written to D20 disks. +Note that the D20 was never intended to support arbitrary files on its disks and +is very likely to crash if you put unexpected files on a disk. In addition, +while the file format itself is currently unknown, there is a header at the top +of the file containing what appears to be the name shown in the D20 file +browser, so the name by which you see it is not necessarily the filename. + +A word of warning --- just like the Brother word processors, the D20 floppy +drive isn't very well aligned. The drive itself uses quarter-stepping to +automatically adapt to whatever alignment the disk was formatted with. This +means that trying to read such a disk on a PC drive, which does _not_ have +adjustable alignment, may not work very well. In these situations it is possible +to adjust the alignment of most modern drives, but this is a somewhat risky +process and may result in permanently wrecking the drive alignment. + +Please [get in touch](https://github.com/davidgiven/fluxengine/issues/new) if +you know anything about it. + +Many thanks to trondl [on the VCF +forums](https://forum.vcfed.org/index.php?threads/roland-d-20-decoding-the-mysterious-floppy-format.1243226/) +for assistance with this! + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read rolandd20 -s drive:0 -o rolandd20.img` + +To write: + + - `fluxengine write rolandd20 -d drive:0 -i rolandd20.img` + diff --git a/doc/disk-rx50.md b/doc/disk-rx50.md index f5ce0ddb..d39a5ca2 100644 --- a/doc/disk-rx50.md +++ b/doc/disk-rx50.md @@ -1,2 +1,23 @@ --d -\r +rx50 +==== +## 400kB 5.25" 80-track 10-sector SSDD + + +The Digital RX50 is one of the external floppy drive units used by Digital's +range of computers, especially the DEC Rainbow microcomputer. It is a fairly +vanilla single-sided IBM scheme variation. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read rx50 -s drive:0 -o rx50.img` + +To write: + + - `fluxengine write rx50 -d drive:0 -i rx50.img` + diff --git a/doc/disk-shugart_drive.md b/doc/disk-shugart_drive.md index f5ce0ddb..086e1d39 100644 --- a/doc/disk-shugart_drive.md +++ b/doc/disk-shugart_drive.md @@ -1,2 +1,15 @@ --d -\r +shugart_drive +==== +## Adjust configuration for a Shugart drive + + +This is an extension profile; adding this to the command line will configure +FluxEngine to adjust the pinout to work with a Shugart drive. This only works +on Greaseweazle hardware. + +For example: + +``` +fluxengine read ibm --720 shugart_drive +``` + diff --git a/doc/disk-smaky6.md b/doc/disk-smaky6.md index f5ce0ddb..03dec9f8 100644 --- a/doc/disk-smaky6.md +++ b/doc/disk-smaky6.md @@ -1,2 +1,34 @@ --d -\r +smaky6 +==== +## 308kB 5.25" 77-track 16-sector SSDD, hard sectored + + +The Smaky 6 is a Swiss computer from 1978 produced by Epsitec. It's based +around a Z80 processor and has one or two Micropolis 5.25" drives which use +16-sector hard sectored disks. The disk format is single-sided with 77 tracks +and 256-byte sectors, resulting in 308kB disks. It uses MFM with a custom +sector record scheme. It was later superceded by a 68000-based Smaky which used +different disks. + +FluxEngine supports these, although because the Micropolis drives use a 100tpi +track pitch, you can't read Smaky 6 disks with a normal PC 96tpi drive. You +will have to find a 100tpi drive from somewhere (they're rare). + +There is experimental read-only support for the Smaky 6 filesystem, allowing +the directory to be listed and files read from disks. It's not known whether +this is completely correct, so don't trust it! + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read smaky6 -s drive:0 -o smaky6.img` + +## References + + - [Smaky Info, 1978-2002 (in French)](https://www.smaky.ch/theme.php?id=sminfo) + diff --git a/doc/disk-tids990.md b/doc/disk-tids990.md index f5ce0ddb..e25dea48 100644 --- a/doc/disk-tids990.md +++ b/doc/disk-tids990.md @@ -1,2 +1,39 @@ --d -\r +tids990 +==== +## 1126kB 8" DSSD + + +The Texas Instruments DS990 was a multiuser modular computing system from 1998, +based around the TMS-9900 processor (as used by the TI-99). It had an 8" floppy +drive module, the FD1000, which was a 77-track, 288-byte sector FM/MFM system +with 26 sectors per track. The encoding scheme was very similar to a simplified +version of the IBM scheme, but of course not compatible. A double-sided disk +would store a very satisfactory 1126kB of data; here's one at old-computers.com: + +
+ +A DS990 at old-computers.com +
+ +FluxEngine will read and write these (but only the DSDD MFM variant). + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read tids990 -s drive:0 -o tids990.img` + +To write: + + - `fluxengine write tids990 -d drive:0 -i tids990.img` + +## References + + - [The FD1000 Depot Maintenance + Manual](http://www.bitsavers.org/pdf/ti/990/disk/2261885-9701_FD1000depotVo1_Jan81.pdf) + diff --git a/doc/disk-tiki.md b/doc/disk-tiki.md index f5ce0ddb..bcf4cf89 100644 --- a/doc/disk-tiki.md +++ b/doc/disk-tiki.md @@ -1,2 +1,27 @@ --d -\r +tiki +==== +## CP/M + + +The Tiki 100 is a Z80-based Norwegian microcomputer from the mid 1980s intended +for eductional use. It mostly ran an unbranded CP/M clone, and uses fairly +normal CP/M disks --- IBM scheme and from 128 to 512 bytes per sector depending +on the precise format. + +## Options + + - Format variants: + - `90`: 90kB 40-track 18-sector SSSD + - `200`: 200kB 40-track 10-sector SSDD + - `400`: 400kB 40-track 10-sector DSDD + - `800`: 800kB 80-track 10-sector DSDD + +## Examples + +To read: + + - `fluxengine read tiki --90 -s drive:0 -o tiki.img` + - `fluxengine read tiki --200 -s drive:0 -o tiki.img` + - `fluxengine read tiki --400 -s drive:0 -o tiki.img` + - `fluxengine read tiki --800 -s drive:0 -o tiki.img` + diff --git a/doc/disk-victor9k.md b/doc/disk-victor9k.md index f5ce0ddb..82e69814 100644 --- a/doc/disk-victor9k.md +++ b/doc/disk-victor9k.md @@ -1,2 +1,62 @@ --d -\r +victor9k +==== +## 1224kB 5.25" DSDD GCR + + +The Victor 9000 / Sirius One was a rather strange old 8086-based machine +which used a disk format very reminiscent of the Commodore format; not a +coincidence, as Chuck Peddle designed them both. They're 80-track, 512-byte +sector GCR disks, with a variable-speed drive and a varying number of sectors +per track --- from 19 to 12. Disks can be double-sided, meaning that they can +store 1224kB per disk, which was almost unheard of back then. Because the way +that the tracks on head 1 are offset from head 0 (this happens with all disks), +the speed zone allocation on head 1 differs from head 0... + +| Zone | Head 0 tracks | Head 1 tracks | Sectors | Original period (ms) | +|:----:|:-------------:|:-------------:|:-------:|:--------------------:| +| 0 | 0-3 | | 19 | 237.9 | +| 1 | 4-15 | 0-7 | 18 | 224.5 | +| 2 | 16-26 | 8-18 | 17 | 212.2 | +| 3 | 27-37 | 19-29 | 16 | 199.9 | +| 4 | 38-47\* | 30-39\* | 15 | 187.6 | +| 5 | 48-59 | 40-51 | 14 | 175.3 | +| 6 | 60-70 | 52-62 | 13 | 163.0 | +| 7 | 71-79 | 63-74 | 12 | 149.6 | +| 8 | | 75-79 | 11 | 144.0 | + +(The Original Period column is the original rotation rate. When used in +FluxEngine, the disk always spins at 360 rpm, which corresponds to a rotational +period of 166 ms.) + +\*The Victor 9000 Hardware Reference Manual has a bug in the documentation +and lists Zone 4 as ending with track 48 on head 0 and track 40 on head 1. +The above table matches observed data on various disks and the assembly +code in the boot loader, which ends Zone 4 with track 47 on head 0 +and track 39 on Head 1. + +FluxEngine can read and write both the single-sided and double-sided variants. + +## Options + + - Format variants: + - `612`: 612kB 80-track DSHD GCR + - `1224`: 1224kB 80-track DSHD GCR + +## Examples + +To read: + + - `fluxengine read victor9k --612 -s drive:0 -o victor9k.img` + - `fluxengine read victor9k --1224 -s drive:0 -o victor9k.img` + +To write: + + - `fluxengine write victor9k --612 -d drive:0 -i victor9k.img` + - `fluxengine write victor9k --1224 -d drive:0 -i victor9k.img` + +## References + + - [The Victor 9000 technical reference manual](http://bitsavers.org/pdf/victor/victor9000/Victor9000TechRef_Jun82.pdf) + + - [DiskFerret's Victor 9000 format guide](https://discferret.com/wiki/Victor_9000_format) + diff --git a/doc/disk-zilogmcz.md b/doc/disk-zilogmcz.md index f5ce0ddb..7d2cb218 100644 --- a/doc/disk-zilogmcz.md +++ b/doc/disk-zilogmcz.md @@ -1,2 +1,42 @@ --d -\r +zilogmcz +==== +## 320kB 8" 77-track SSSD hard-sectored + + +The Zilog MCZ is an extremely early Z80 development system, produced by +Zilog, which came out in 1976. It used twin 8-inch hard sectored floppy +drives; here's one at the Centre +for Computing History: + +
+ +A Zilog MCZ at the Centre For Computing History +
+ +The MCZ ran Zilog's own operating system, Z80-RIO, and used 77 track +single-sided disks, with 32 sectors (each marked by an index hole), with 132 +bytes per sector --- 128 bytes of user payload plus two two-byte metadata +words used to construct linked lists of sectors for storing files. These +stored 320kB each. + +FluxEngine has read support for these, including support for RIO's ZDOS file +system. + +## Options + +(no options) + +## Examples + +To read: + + - `fluxengine read zilogmcz -s drive:0 -o zilogmcz.img` + +## References + + * [About the Zilog MCZ](http://www.retrotechnology.com/restore/zilog.html), + containing lots of useful links + + * [The hardware user's manual](https://amaus.org/static/S100/zilog/ZDS/Zilog%20ZDS%201-25%20Hardware%20Users%20Manual.pdf) + From 533b217c8f8331ea7444b1fe38dd5368364bffca Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 29 Oct 2023 21:10:14 +0100 Subject: [PATCH 44/49] Eliminate the broken tpi system for a simple drive/format type field. --- Makefile | 2 +- README.md | 78 +-- arch/micropolis/decoder.cc | 36 +- arch/micropolis/encoder.cc | 17 +- build.py | 82 +-- lib/build.py | 2 +- lib/config.cc | 1 - lib/config.h | 3 +- lib/drive.proto | 27 +- lib/fl2.proto | 19 +- lib/fluxsink/fl2fluxsink.cc | 3 +- lib/fluxsink/scpfluxsink.cc | 2 +- lib/fluxsource/a2rfluxsource.cc | 7 +- lib/fluxsource/fl2fluxsource.cc | 4 +- lib/fluxsource/scpfluxsource.cc | 5 +- lib/imagereader/d88imagereader.cc | 4 +- lib/imagereader/nfdimagereader.cc | 2 +- lib/layout.cc | 69 +- lib/layout.h | 3 + lib/layout.proto | 4 +- lib/proto.cc | 3 +- lib/readerwriter.cc | 4 +- lib/usb/fluxengineusb.cc | 2 +- lib/vfs/lif.cc | 2 +- lib/vfs/roland.cc | 8 +- lib/vfs/sectorinterface.h | 2 +- lib/vfs/vfs.cc | 7 +- scripts/encodedecodetest.sh | 23 +- src/fe-analysedriveresponse.cc | 3 +- src/fe-inspect.cc | 3 +- src/fe-ls.cc | 4 +- src/fe-rawread.cc | 3 +- src/fe-rawwrite.cc | 3 +- src/formats/40track_drive.textpb | 3 +- src/formats/acornadfs.textpb | 10 +- src/formats/acorndfs.textpb | 4 +- src/formats/aeslanier.textpb | 2 +- src/formats/agat.textpb | 2 +- src/formats/amiga.textpb | 2 +- src/formats/ampro.textpb | 4 +- src/formats/apple2.textpb | 4 +- src/formats/apple2_drive.textpb | 3 +- src/formats/atarist.textpb | 2 +- src/formats/bk.textpb | 2 +- src/formats/brother.textpb | 6 +- src/formats/commodore.textpb | 10 +- src/formats/eco1.textpb | 2 +- src/formats/epsonpf10.textpb | 2 +- src/formats/f85.textpb | 2 +- src/formats/fb100.textpb | 2 +- src/formats/hplif.textpb | 2 +- src/formats/ibm.textpb | 22 +- src/formats/icl30.textpb | 2 +- src/formats/mac.textpb | 2 +- src/formats/micropolis.textpb | 8 +- src/formats/ms2000.textpb | 2 +- src/formats/mx.textpb | 8 +- src/formats/n88basic.textpb | 2 +- src/formats/northstar.textpb | 2 +- src/formats/psos.textpb | 2 +- src/formats/rolandd20.textpb | 2 +- src/formats/rx50.textpb | 2 +- src/formats/smaky6.textpb | 2 +- src/formats/tids990.textpb | 2 +- src/formats/tiki.textpb | 8 +- src/formats/victor9k.textpb | 2 +- src/formats/zilogmcz.textpb | 2 +- src/gui/browserpanel.cc | 10 +- src/gui/drivetypes/35_40.textpb | 6 - src/gui/drivetypes/35_80.textpb | 6 - src/gui/drivetypes/525_40.textpb | 6 - src/gui/drivetypes/525_40M.textpb | 6 - src/gui/drivetypes/525_80.textpb | 6 - src/gui/drivetypes/525_80M.textpb | 6 - src/gui/drivetypes/8_38.textpb | 6 - src/gui/drivetypes/8_77.textpb | 6 - src/gui/drivetypes/apple2.textpb | 3 +- src/gui/drivetypes/build.py | 10 +- src/gui/icon.png.h | 1063 ++++++++++++++++++++++++++--- src/gui/idlepanel.cc | 12 +- src/gui/layout.h | 848 ++++++++++++++--------- src/gui/main.cc | 26 +- tests/configs.cc | 4 +- tests/cpmfs.cc | 4 +- tests/layout.cc | 16 +- tests/options.cc | 14 +- 86 files changed, 1831 insertions(+), 798 deletions(-) delete mode 100644 src/gui/drivetypes/35_40.textpb delete mode 100644 src/gui/drivetypes/35_80.textpb delete mode 100644 src/gui/drivetypes/525_40.textpb delete mode 100644 src/gui/drivetypes/525_40M.textpb delete mode 100644 src/gui/drivetypes/525_80.textpb delete mode 100644 src/gui/drivetypes/525_80M.textpb delete mode 100644 src/gui/drivetypes/8_38.textpb delete mode 100644 src/gui/drivetypes/8_77.textpb diff --git a/Makefile b/Makefile index 9887892f..7aaebe78 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CC = gcc CXX = g++ -std=c++17 -CFLAGS = -g -Os +CFLAGS = -g -O0 LDFLAGS = OBJ = .obj diff --git a/README.md b/README.md index 8f2f3320..dd2cc632 100644 --- a/README.md +++ b/README.md @@ -103,45 +103,45 @@ particular filesystem and can read (and sometimes write, support varies) files directly from disks, flux files or disk images. Some formats have multiple choices because they can store multiple types of file system. - - - -| Profile | Format | Read? | Write? | Filesystem? | -|:--------|:-------|:-----:|:------:|:------------| -| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | | -| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS | -| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | | -| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | | -| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS | -| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS | -| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS | -| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | | -| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | | -| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS | -| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS | -| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS | -| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS | -| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | | -| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | | -| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | -| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | -| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | -| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | -| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | -| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | -| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | | -| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | | -| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | | -| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE | -| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND | -| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | | -| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 | -| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | | -| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS | -| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | | -| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS | -{: .datatable } - + + + +| Profile | Format | Read? | Write? | Filesystem? | +|:--------|:-------|:-----:|:------:|:------------| +| [`acornadfs`](doc/disk-acornadfs.md) | Acorn ADFS: BBC Micro, Archimedes | 🦖 | | | +| [`acorndfs`](doc/disk-acorndfs.md) | Acorn DFS: Acorn Atom, BBC Micro series | 🦄 | | ACORNDFS | +| [`aeslanier`](doc/disk-aeslanier.md) | AES Lanier "No Problem": 616kB 5.25" 77-track SSDD hard sectored | 🦖 | | | +| [`agat`](doc/disk-agat.md) | Agat: 840kB 5.25" 80-track DS | 🦖 | 🦖 | | +| [`amiga`](doc/disk-amiga.md) | Amiga: 880kB 3.5" DSDD | 🦄 | 🦄 | AMIGAFFS | +| [`ampro`](doc/disk-ampro.md) | Ampro Little Board: CP/M | 🦖 | | CPMFS | +| [`apple2`](doc/disk-apple2.md) | Apple II: Prodos, Appledos, and CP/M | 🦄 | 🦄 | APPLEDOS CPMFS PRODOS | +| [`atarist`](doc/disk-atarist.md) | Atari ST: Almost PC compatible | 🦄 | 🦄 | | +| [`bk`](doc/disk-bk.md) | BK: 800kB 5.25"/3.5" 80-track 10-sector DSDD | 🦖 | 🦖 | | +| [`brother`](doc/disk-brother.md) | Brother word processors: GCR family | 🦄 | 🦄 | BROTHER120 FATFS | +| [`commodore`](doc/disk-commodore.md) | Commodore: 1541, 1581, 8050 and variations | 🦄 | 🦄 | CBMFS | +| [`eco1`](doc/disk-eco1.md) | VDS Eco1: CP/M; 1210kB 77-track mixed format DSHD | 🦖 | | CPMFS | +| [`epsonpf10`](doc/disk-epsonpf10.md) | Epson PF-10: CP/M; 3.5" 40-track DSDD | 🦖 | | CPMFS | +| [`f85`](doc/disk-f85.md) | Durango F85: 461kB 5.25" 77-track SS | 🦖 | | | +| [`fb100`](doc/disk-fb100.md) | Brother FB-100: 100kB 3.5" 40-track SSSD | 🦖 | | | +| [`hplif`](doc/disk-hplif.md) | Hewlett-Packard LIF: a variety of disk formats used by HP | 🦄 | 🦄 | LIF | +| [`ibm`](doc/disk-ibm.md) | IBM PC: Generic PC 3.5"/5.25" disks | 🦄 | 🦄 | FATFS | +| [`icl30`](doc/disk-icl30.md) | ICL Model 30: CP/M; 263kB 35-track DSSD | 🦖 | | CPMFS | +| [`mac`](doc/disk-mac.md) | Macintosh: 400kB/800kB 3.5" GCR | 🦄 | 🦄 | MACHFS | +| [`micropolis`](doc/disk-micropolis.md) | Micropolis: 100tpi MetaFloppy disks | 🦄 | 🦄 | | +| [`ms2000`](doc/disk-ms2000.md) | : MS2000 Microdisk Development System | | | MICRODOS | +| [`mx`](doc/disk-mx.md) | DVK MX: Soviet-era PDP-11 clone | 🦖 | | | +| [`n88basic`](doc/disk-n88basic.md) | N88-BASIC: PC8800/PC98 5.25" 77-track 26-sector DSHD | 🦄 | 🦄 | | +| [`northstar`](doc/disk-northstar.md) | Northstar: 5.25" hard sectored | 🦄 | 🦄 | | +| [`psos`](doc/disk-psos.md) | pSOS: 800kB DSDD with PHILE | 🦄 | 🦄 | PHILE | +| [`rolandd20`](doc/disk-rolandd20.md) | Roland D20: 3.5" electronic synthesiser disks | 🦄 | 🦖 | ROLAND | +| [`rx50`](doc/disk-rx50.md) | Digital RX50: 400kB 5.25" 80-track 10-sector SSDD | 🦖 | 🦖 | | +| [`smaky6`](doc/disk-smaky6.md) | Smaky 6: 308kB 5.25" 77-track 16-sector SSDD, hard sectored | 🦖 | | SMAKY6 | +| [`tids990`](doc/disk-tids990.md) | Texas Instruments DS990: 1126kB 8" DSSD | 🦖 | 🦖 | | +| [`tiki`](doc/disk-tiki.md) | Tiki 100: CP/M | | | CPMFS | +| [`victor9k`](doc/disk-victor9k.md) | Victor 9000 / Sirius One: 1224kB 5.25" DSDD GCR | 🦖 | 🦖 | | +| [`zilogmcz`](doc/disk-zilogmcz.md) | Zilog MCZ: 320kB 8" 77-track SSSD hard-sectored | 🦖 | | ZDOS | +{: .datatable } + ### Notes diff --git a/arch/micropolis/decoder.cc b/arch/micropolis/decoder.cc index 8acd2f58..725b536e 100644 --- a/arch/micropolis/decoder.cc +++ b/arch/micropolis/decoder.cc @@ -67,28 +67,32 @@ static uint8_t b(uint32_t field, uint8_t pos) static uint8_t eccNextBit(uint32_t ecc, uint8_t data_bit) { // This is 0x81932080 which is 0x0104C981 with reversed bits - return b(ecc, 7) ^ b(ecc, 13) ^ b(ecc, 16) ^ b(ecc, 17) ^ b(ecc, 20) - ^ b(ecc, 23) ^ b(ecc, 24) ^ b(ecc, 31) ^ data_bit; + return b(ecc, 7) ^ b(ecc, 13) ^ b(ecc, 16) ^ b(ecc, 17) ^ b(ecc, 20) ^ + b(ecc, 23) ^ b(ecc, 24) ^ b(ecc, 31) ^ data_bit; } uint32_t vectorGraphicEcc(const Bytes& bytes) { uint32_t e = 0; - Bytes payloadBytes = bytes.slice(0, bytes.size()-4); + Bytes payloadBytes = bytes.slice(0, bytes.size() - 4); ByteReader payload(payloadBytes); - while (!payload.eof()) { + while (!payload.eof()) + { uint8_t byte = payload.read_8(); - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) + { e = (e << 1) | eccNextBit(e, byte >> 7); byte <<= 1; } } - Bytes trailerBytes = bytes.slice(bytes.size()-4); + Bytes trailerBytes = bytes.slice(bytes.size() - 4); ByteReader trailer(trailerBytes); uint32_t res = e; - while (!trailer.eof()) { + while (!trailer.eof()) + { uint8_t byte = trailer.read_8(); - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) + { res = (res << 1) | eccNextBit(e, byte >> 7); e <<= 1; byte <<= 1; @@ -101,13 +105,15 @@ uint32_t vectorGraphicEcc(const Bytes& bytes) static bool vectorGraphicEccFix(Bytes& bytes, uint32_t syndrome) { uint32_t ecc = syndrome; - int pos = (MICROPOLIS_ENCODED_SECTOR_SIZE-5)*8+7; + int pos = (MICROPOLIS_ENCODED_SECTOR_SIZE - 5) * 8 + 7; bool aligned = false; - while ((ecc & 0xff000000) == 0) { + while ((ecc & 0xff000000) == 0) + { pos += 8; ecc <<= 8; } - for (; pos >= 0; pos--) { + for (; pos >= 0; pos--) + { bool bit = ecc & 1; ecc >>= 1; if (bit) @@ -119,7 +125,7 @@ static bool vectorGraphicEccFix(Bytes& bytes, uint32_t syndrome) } if (pos < 0) return false; - bytes[pos/8] ^= ecc >> 16; + bytes[pos / 8] ^= ecc >> 16; return true; } @@ -199,9 +205,11 @@ public: bool eccPresent = bytes[274] == 0xaa; uint32_t ecc = 0; - if (_config.ecc_type() == MicropolisDecoderProto::VECTOR && eccPresent) { + if (_config.ecc_type() == MicropolisDecoderProto::VECTOR && eccPresent) + { ecc = vectorGraphicEcc(bytes.slice(0, 274)); - if (ecc != 0) { + if (ecc != 0) + { vectorGraphicEccFix(bytes, ecc); ecc = vectorGraphicEcc(bytes.slice(0, 274)); } diff --git a/arch/micropolis/encoder.cc b/arch/micropolis/encoder.cc index 309e33ff..4c177b48 100644 --- a/arch/micropolis/encoder.cc +++ b/arch/micropolis/encoder.cc @@ -49,7 +49,8 @@ static void write_sector(std::vector& bits, uint8_t eccPresent = 0; uint32_t ecc = 0; - if (eccType == MicropolisEncoderProto::VECTOR) { + if (eccType == MicropolisEncoderProto::VECTOR) + { eccPresent = 0xaa; ecc = vectorGraphicEcc(sectorData + Bytes(4)); } @@ -98,23 +99,25 @@ public: unsigned prev_cursor = 0; unsigned cursor = 0; - for (const auto& sectorData : sectors) { + for (const auto& sectorData : sectors) + { indexes.push_back(cursor); prev_cursor = cursor; write_sector(bits, cursor, sectorData, _config.ecc_type()); } - indexes.push_back(prev_cursor + (cursor - prev_cursor)/2); + indexes.push_back(prev_cursor + (cursor - prev_cursor) / 2); indexes.push_back(cursor); if (cursor != bits.size()) error("track data mismatched length"); std::unique_ptr fluxmap(new Fluxmap); - nanoseconds_t clockPeriod = calculatePhysicalClockPeriod( - _config.clock_period_us() * 1e3, - _config.rotational_period_ms() * 1e6); + nanoseconds_t clockPeriod = + calculatePhysicalClockPeriod(_config.clock_period_us() * 1e3, + _config.rotational_period_ms() * 1e6); auto pos = bits.begin(); - for (int i = 1; i < indexes.size(); i++) { + for (int i = 1; i < indexes.size(); i++) + { auto end = bits.begin() + indexes[i]; fluxmap->appendBits(std::vector(pos, end), clockPeriod); fluxmap->appendIndex(); diff --git a/build.py b/build.py index c26718d8..b6616437 100644 --- a/build.py +++ b/build.py @@ -224,53 +224,53 @@ if not glob("../fluxengine-testdata/data"): print("fluxengine-testdata not found; skipping corpus tests") else: corpus = [ - ("agat", "", "--drive.tpi=96"), - ("amiga", "", "--drive.tpi=135"), - ("apple2", "", "--140 --drive.tpi=96"), - ("atarist", "", "--360 --drive.tpi=135"), - ("atarist", "", "--370 --drive.tpi=135"), - ("atarist", "", "--400 --drive.tpi=135"), - ("atarist", "", "--410 --drive.tpi=135"), - ("atarist", "", "--720 --drive.tpi=135"), - ("atarist", "", "--740 --drive.tpi=135"), - ("atarist", "", "--800 --drive.tpi=135"), - ("atarist", "", "--820 --drive.tpi=135"), + ("agat", "", ""), + ("amiga", "", ""), + ("apple2", "", "--140 40track_drive"), + ("atarist", "", "--360"), + ("atarist", "", "--370"), + ("atarist", "", "--400"), + ("atarist", "", "--410"), + ("atarist", "", "--720"), + ("atarist", "", "--740"), + ("atarist", "", "--800"), + ("atarist", "", "--820"), ("bk", "", ""), - ("brother", "", "--120 --drive.tpi=135"), - ("brother", "", "--240 --drive.tpi=135"), + ("brother", "", "--120 40track_drive"), + ("brother", "", "--240"), ( "commodore", "scripts/commodore1541_test.textpb", - "--171 --drive.tpi=96", + "--171 40track_drive", ), ( "commodore", "scripts/commodore1541_test.textpb", - "--192 --drive.tpi=96", + "--192 40track_drive", ), - ("commodore", "", "--800 --drive.tpi=135"), - ("commodore", "", "--1620 --drive.tpi=135"), - ("hplif", "", "--264 --drive.tpi=135"), - ("hplif", "", "--608 --drive.tpi=135"), - ("hplif", "", "--616 --drive.tpi=135"), - ("hplif", "", "--770 --drive.tpi=135"), - ("ibm", "", "--1200 --drive.tpi=96"), - ("ibm", "", "--1232 --drive.tpi=96"), - ("ibm", "", "--1440 --drive.tpi=135"), - ("ibm", "", "--1680 --drive.tpi=135"), - ("ibm", "", "--180 --drive.tpi=96"), - ("ibm", "", "--160 --drive.tpi=96"), - ("ibm", "", "--320 --drive.tpi=96"), - ("ibm", "", "--360 --drive.tpi=96"), - ("ibm", "", "--720_96 --drive.tpi=96"), - ("ibm", "", "--720_135 --drive.tpi=135"), - ("mac", "scripts/mac400_test.textpb", "--400 --drive.tpi=135"), - ("mac", "scripts/mac800_test.textpb", "--800 --drive.tpi=135"), - ("n88basic", "", "--drive.tpi=96"), - ("rx50", "", "--drive.tpi=96"), - ("tids990", "", "--drive.tpi=48"), - ("victor9k", "", "--612 --drive.tpi=96"), - ("victor9k", "", "--1224 --drive.tpi=96"), + ("commodore", "", "--800"), + ("commodore", "", "--1620"), + ("hplif", "", "--264"), + ("hplif", "", "--608"), + ("hplif", "", "--616"), + ("hplif", "", "--770"), + ("ibm", "", "--1200"), + ("ibm", "", "--1232"), + ("ibm", "", "--1440"), + ("ibm", "", "--1680"), + ("ibm", "", "--180 40track_drive"), + ("ibm", "", "--160 40track_drive"), + ("ibm", "", "--320 40track_drive"), + ("ibm", "", "--360 40track_drive"), + ("ibm", "", "--720_96"), + ("ibm", "", "--720_135"), + ("mac", "scripts/mac400_test.textpb", "--400"), + ("mac", "scripts/mac800_test.textpb", "--800"), + ("n88basic", "", ""), + ("rx50", "", ""), + ("tids990", "", ""), + ("victor9k", "", "--612"), + ("victor9k", "", "--1224"), ] for c in corpus: @@ -285,11 +285,11 @@ else: + c[0] + " " + format - + " {ins[0]} " + + " {ins[0]} '" + c[1] - + " " + + "' '" + c[2] - + ">/dev/null" + + "' $(dir {outs[0]}) > /dev/null" ], label="CORPUSTEST", ) diff --git a/lib/build.py b/lib/build.py index 6aa2a7df..7602d214 100644 --- a/lib/build.py +++ b/lib/build.py @@ -19,7 +19,7 @@ proto( "./usb/usb.proto", "./vfs/vfs.proto", ], - deps=[".+common_proto"], + deps=[".+common_proto", "+fl2_proto"], ) protocc(name="config_proto_lib", srcs=[".+config_proto", "arch+arch_proto"]) diff --git a/lib/config.cc b/lib/config.cc index a20102b8..3b987145 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -172,7 +172,6 @@ ConfigProto* Config::combined() /* First apply any standalone options. */ std::set options = _appliedOptions; - std::set prereqs; for (const auto& option : _baseConfig.option()) { if (options.find(option.name()) != options.end()) diff --git a/lib/config.h b/lib/config.h index 31886de8..156e9910 100644 --- a/lib/config.h +++ b/lib/config.h @@ -52,7 +52,8 @@ class InapplicableValueException : public ErrorException public: InapplicableValueException(): ErrorException("selected format cannot be used here") - {} + { + } }; struct FluxConstructor diff --git a/lib/drive.proto b/lib/drive.proto index 2b3e310e..6bbe1766 100644 --- a/lib/drive.proto +++ b/lib/drive.proto @@ -1,8 +1,9 @@ syntax = "proto2"; import "lib/common.proto"; +import "lib/fl2.proto"; -// Next: 17 +// Next: 15 message DriveProto { optional int32 drive = 1 @@ -11,32 +12,30 @@ message DriveProto [ default = INDEXMODE_DRIVE, (help) = "index pulse source" ]; optional int32 hard_sector_count = 3 [ default = 0, (help) = "number of hard sectors on disk" ]; - optional double hard_sector_threshold_ns = 16 + optional double hard_sector_threshold_ns = 4 [ default = 0, (help) = "index pulses longer than this interval are " "considered sector markers; shorter indicates an true index marker" ]; - optional bool high_density = 4 + optional bool high_density = 5 [ default = true, (help) = "set if this is a high density disk" ]; - optional bool sync_with_index = 5 + optional bool sync_with_index = 6 [ default = false, (help) = "start reading at index mark" ]; - optional double revolutions = 6 + optional double revolutions = 7 [ default = 1.2, (help) = "number of revolutions to read" ]; - optional int32 tracks = 7 + optional int32 tracks = 8 [ default = 81, (help) = "Number of tracks supported by drive" ]; - optional int32 heads = 8 + optional int32 heads = 9 [ default = 2, (help) = "Number of heads supported by drive" ]; - optional int32 head_bias = 9 [ + optional int32 head_bias = 10 [ default = 0, (help) = "Bias to apply to the head position (in tracks)" ]; - optional int32 group_offset = 14 [ + optional int32 group_offset = 11 [ default = 0, (help) = "When writing groups, erase all tracks except this one in each group" ]; - optional int32 head_width = 10 - [ default = 1, (help) = "Width of the head (in tracks)" ]; - optional float tpi = 11 [ default = 0, (help) = "TPI of drive; 0 disables all track mapping" ]; - optional double rotational_period_ms = 12 + optional DriveType drive_type = 12 [ default = DRIVETYPE_UNKNOWN, (help) = "Type of drive" ]; + optional double rotational_period_ms = 13 [ default = 0, (help) = "Rotational period of the drive in milliseconds (0 to autodetect)"]; enum ErrorBehaviour { @@ -45,7 +44,7 @@ message DriveProto RECALIBRATE = 2; } - optional ErrorBehaviour error_behaviour = 15 + optional ErrorBehaviour error_behaviour = 14 [ default = JIGGLE, (help) = "what to do when an error occurs during reads" ]; } diff --git a/lib/fl2.proto b/lib/fl2.proto index fa0d5f2a..899cfc4f 100644 --- a/lib/fl2.proto +++ b/lib/fl2.proto @@ -15,11 +15,28 @@ message TrackFluxProto { repeated bytes flux = 3; } +enum DriveType { + DRIVETYPE_UNKNOWN = 0; + DRIVETYPE_40TRACK = 1; + DRIVETYPE_80TRACK = 2; + DRIVETYPE_APPLE2 = 3; +} + +enum FormatType { + FORMATTYPE_UNKNOWN = 0; + FORMATTYPE_40TRACK = 1; + FORMATTYPE_80TRACK = 2; +} + +// NEXT: 8 message FluxFileProto { optional int32 magic = 1; optional FluxFileVersion version = 2; repeated TrackFluxProto track = 3; optional double rotational_period_ms = 4; - optional int32 tpi = 5; + optional DriveType drive_type = 6 [default = DRIVETYPE_UNKNOWN]; + optional FormatType format_type = 7 [default = FORMATTYPE_UNKNOWN]; + + reserved 5; } diff --git a/lib/fluxsink/fl2fluxsink.cc b/lib/fluxsink/fl2fluxsink.cc index d4223956..0822ccaf 100644 --- a/lib/fluxsink/fl2fluxsink.cc +++ b/lib/fluxsink/fl2fluxsink.cc @@ -45,7 +45,8 @@ public: proto.set_rotational_period_ms( globalConfig()->drive().rotational_period_ms()); - proto.set_tpi(globalConfig()->drive().tpi()); + proto.set_drive_type(globalConfig()->drive().drive_type()); + proto.set_format_type(globalConfig()->layout().format_type()); saveFl2File(_filename, proto); } diff --git a/lib/fluxsink/scpfluxsink.cc b/lib/fluxsink/scpfluxsink.cc index 9fe519e6..77d0a26a 100644 --- a/lib/fluxsink/scpfluxsink.cc +++ b/lib/fluxsink/scpfluxsink.cc @@ -55,7 +55,7 @@ public: _fileheader.start_track = strackno(minTrack, minSide); _fileheader.end_track = strackno(maxTrack, maxSide); _fileheader.flags = SCP_FLAG_INDEXED; - if (globalConfig()->drive().tpi() != 48) + if (globalConfig()->drive().drive_type() != DRIVETYPE_40TRACK) _fileheader.flags |= SCP_FLAG_96TPI; _fileheader.cell_width = 0; if ((minSide == 0) && (maxSide == 0)) diff --git a/lib/fluxsource/a2rfluxsource.cc b/lib/fluxsource/a2rfluxsource.cc index 45feed14..f2bb2f64 100644 --- a/lib/fluxsource/a2rfluxsource.cc +++ b/lib/fluxsource/a2rfluxsource.cc @@ -80,13 +80,14 @@ public: /* 5.25" with quarter stepping. */ _extraConfig.mutable_drive()->set_tracks(160); _extraConfig.mutable_drive()->set_heads(1); - _extraConfig.mutable_drive()->set_head_width(4); - _extraConfig.mutable_drive()->set_tpi(48 * 4); + _extraConfig.mutable_drive()->set_drive_type( + DRIVETYPE_APPLE2); } else { /* 3.5". */ - _extraConfig.mutable_drive()->set_tpi(135); + _extraConfig.mutable_drive()->set_drive_type( + DRIVETYPE_80TRACK); } Bytes stream = findChunk("STRM"); diff --git a/lib/fluxsource/fl2fluxsource.cc b/lib/fluxsource/fl2fluxsource.cc index c51c63f2..f4c2f5f4 100644 --- a/lib/fluxsource/fl2fluxsource.cc +++ b/lib/fluxsource/fl2fluxsource.cc @@ -39,8 +39,8 @@ public: _extraConfig.mutable_drive()->set_rotational_period_ms( _proto.rotational_period_ms()); - if (_proto.has_tpi()) - _extraConfig.mutable_drive()->set_tpi(_proto.tpi()); + if (_proto.has_drive_type()) + _extraConfig.mutable_drive()->set_drive_type(_proto.drive_type()); } public: diff --git a/lib/fluxsource/scpfluxsource.cc b/lib/fluxsource/scpfluxsource.cc index 17855470..bdab7227 100644 --- a/lib/fluxsource/scpfluxsource.cc +++ b/lib/fluxsource/scpfluxsource.cc @@ -42,8 +42,9 @@ public: (_header.file_id[2] != 'P')) error("input not a SCP file"); - int tpi = (_header.flags & SCP_FLAG_96TPI) ? 96 : 48; - _extraConfig.mutable_drive()->set_tpi(tpi); + _extraConfig.mutable_drive()->set_drive_type( + (_header.flags & SCP_FLAG_96TPI) ? DRIVETYPE_80TRACK + : DRIVETYPE_40TRACK); _resolution = 25 * (_header.resolution + 1); int startSide = (_header.heads == 2) ? 1 : 0; diff --git a/lib/imagereader/d88imagereader.cc b/lib/imagereader/d88imagereader.cc index 5708e70b..3bee4018 100644 --- a/lib/imagereader/d88imagereader.cc +++ b/lib/imagereader/d88imagereader.cc @@ -61,13 +61,13 @@ public: if (mediaFlag == 0x20) { _extraConfig.mutable_drive()->set_high_density(true); - _extraConfig.mutable_layout()->set_tpi(96); + _extraConfig.mutable_layout()->set_format_type(FORMATTYPE_80TRACK); } else { clockRate = 300; _extraConfig.mutable_drive()->set_high_density(false); - _extraConfig.mutable_layout()->set_tpi(48); + _extraConfig.mutable_layout()->set_format_type(FORMATTYPE_40TRACK); } auto layout = _extraConfig.mutable_layout(); diff --git a/lib/imagereader/nfdimagereader.cc b/lib/imagereader/nfdimagereader.cc index 3dd2495b..b626c31c 100644 --- a/lib/imagereader/nfdimagereader.cc +++ b/lib/imagereader/nfdimagereader.cc @@ -58,7 +58,7 @@ public: log("NFD: HD 1.2MB mode"); log("NFD: forcing hign density mode"); _extraConfig.mutable_drive()->set_high_density(true); - _extraConfig.mutable_layout()->set_tpi(96); + _extraConfig.mutable_layout()->set_format_type(FORMATTYPE_80TRACK); std::unique_ptr image(new Image); for (int track = 0; track < 163; track++) diff --git a/lib/layout.cc b/lib/layout.cc index f004c9c1..9c89ab68 100644 --- a/lib/layout.cc +++ b/lib/layout.cc @@ -2,34 +2,49 @@ #include "lib/layout.h" #include "lib/proto.h" #include "lib/logger.h" - -bool approximatelyEqual(float a, float b, float epsilon) -{ - return fabs(a - b) <= ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon); -} +#include "lib/fl2.h" static unsigned getTrackStep() { - if (globalConfig()->layout().tpi() == 0) - error("no layout TPI set"); - if (globalConfig()->drive().tpi() == 0) - return 1; + auto format_type = globalConfig()->layout().format_type(); + auto drive_type = globalConfig()->drive().drive_type(); - if (globalConfig()->layout().tpi() == 0.0) - error("layout TPI is zero; this shouldn't happen?"); + switch (format_type) + { + case FORMATTYPE_40TRACK: + switch (drive_type) + { + case DRIVETYPE_40TRACK: + return 1; - float trackStepFactor = - globalConfig()->drive().tpi() / globalConfig()->layout().tpi(); + case DRIVETYPE_80TRACK: + return 2; - if (!approximatelyEqual(trackStepFactor, round(trackStepFactor), 0.001)) - error( - "this drive can't handle this image, because the drive TPI doesn't " - "divide neatly into the layout TPI"); - if (trackStepFactor < 0.999) - error( - "this drive can't handle this image, because the head is too big"); + case DRIVETYPE_APPLE2: + return 4; + } - return round(trackStepFactor); + case FORMATTYPE_80TRACK: + switch (drive_type) + { + case DRIVETYPE_40TRACK: + error( + "you can't write an 80 track image to a 40 track " + "drive"); + + case DRIVETYPE_80TRACK: + return 1; + + case DRIVETYPE_APPLE2: + error( + "you can't write an 80 track image to an Apple II " + "drive"); + } + } + + warning( + "don't know the drive and format types; performing 1:1 track mapping"); + return 1; } unsigned Layout::remapTrackPhysicalToLogical(unsigned ptrack) @@ -237,3 +252,15 @@ std::shared_ptr Layout::getLayoutOfTrackPhysical( return getLayoutOfTrack(remapTrackPhysicalToLogical(physicalTrack), remapSidePhysicalToLogical(physicalSide)); } + +int Layout::getHeadWidth() +{ + switch (globalConfig()->drive().drive_type()) + { + case DRIVETYPE_APPLE2: + return 4; + + default: + return 1; + } +} diff --git a/lib/layout.h b/lib/layout.h index 24d2bf4c..f886150c 100644 --- a/lib/layout.h +++ b/lib/layout.h @@ -52,6 +52,9 @@ public: /* Expand a SectorList into the actual sector IDs. */ static std::vector expandSectorList( const SectorListProto& sectorsProto); + + /* Return the head width of the current drive. */ + static int getHeadWidth(); }; class TrackInfo diff --git a/lib/layout.proto b/lib/layout.proto index d4b50f22..edd33cca 100644 --- a/lib/layout.proto +++ b/lib/layout.proto @@ -1,6 +1,7 @@ syntax = "proto2"; import "lib/common.proto"; +import "lib/fl2.proto"; message SectorListProto { @@ -57,5 +58,6 @@ message LayoutProto [ default = CHS, (help) = "the order of sectors in the filesystem" ]; optional bool swap_sides = 5 [ default = false, (help) = "the sides are inverted on this disk" ]; - optional float tpi = 6 [ (help) = "TPI of image; if 0, use TPI of drive" ]; + optional FormatType format_type = 6 + [ default = FORMATTYPE_UNKNOWN, (help) = "Format type of image" ]; } diff --git a/lib/proto.cc b/lib/proto.cc index 32a1213f..fa3f8e20 100644 --- a/lib/proto.cc +++ b/lib/proto.cc @@ -288,8 +288,7 @@ std::string getProtoFieldValue(ProtoField& protoField) case google::protobuf::FieldDescriptor::TYPE_ENUM: { const auto* enumvalue = reflection->GetEnum(*message, field); - const auto* enumfield = field->enum_type(); - return enumfield->name(); + return enumvalue->name(); } case google::protobuf::FieldDescriptor::TYPE_MESSAGE: diff --git a/lib/readerwriter.cc b/lib/readerwriter.cc index 9d3bd4e5..e1c25ccd 100644 --- a/lib/readerwriter.cc +++ b/lib/readerwriter.cc @@ -218,7 +218,7 @@ ReadResult readGroup(FluxSourceIteratorHolder& fluxSourceIteratorHolder, ReadResult result = BAD_AND_CAN_NOT_RETRY; for (unsigned offset = 0; offset < trackInfo->groupSize; - offset += globalConfig()->drive().head_width()) + offset += Layout::getHeadWidth()) { auto& fluxSourceIterator = fluxSourceIteratorHolder.getIterator( trackInfo->physicalTrack + offset, trackInfo->physicalSide); @@ -274,7 +274,7 @@ void writeTracks(FluxSink& fluxSink, for (;;) { for (int offset = 0; offset < trackInfo->groupSize; - offset += globalConfig()->drive().head_width()) + offset += Layout::getHeadWidth()) { unsigned physicalTrack = trackInfo->physicalTrack + offset; diff --git a/lib/usb/fluxengineusb.cc b/lib/usb/fluxengineusb.cc index 9b4459a8..8a2bf015 100644 --- a/lib/usb/fluxengineusb.cc +++ b/lib/usb/fluxengineusb.cc @@ -76,7 +76,7 @@ public: "your FluxEngine firmware is at version {} but the client is " "for version {}; please upgrade", version, - (int) FLUXENGINE_PROTOCOL_VERSION); + (int)FLUXENGINE_PROTOCOL_VERSION); } private: diff --git a/lib/vfs/lif.cc b/lib/vfs/lif.cc index 68e96f2a..0dbe5c04 100644 --- a/lib/vfs/lif.cc +++ b/lib/vfs/lif.cc @@ -214,7 +214,7 @@ private: _directoryBlock = rbr.read_be32(); rbr.skip(4); _directorySize = rbr.read_be32(); - rbr.skip(4); + rbr.skip(4); unsigned tracks = rbr.read_be32(); unsigned heads = rbr.read_be32(); unsigned sectors = rbr.read_be32(); diff --git a/lib/vfs/roland.cc b/lib/vfs/roland.cc index c5b61ac0..d642a083 100644 --- a/lib/vfs/roland.cc +++ b/lib/vfs/roland.cc @@ -69,10 +69,10 @@ private: void putBlock(RolandFsFilesystem* fs, uint8_t offset, uint8_t block) { if (blocks.size() <= offset) - blocks.resize(offset+1); + blocks.resize(offset + 1); blocks[offset] = block; - length = (offset+1) * fs->_blockSectors * fs->_sectorSize; + length = (offset + 1) * fs->_blockSectors * fs->_sectorSize; attributes[Filesystem::LENGTH] = std::to_string(length); } @@ -84,7 +84,7 @@ private: if (!blocknumber) break; - putBlock(fs, offset+i, blocknumber); + putBlock(fs, offset + i, blocknumber); } } @@ -336,7 +336,7 @@ private: else de = it->second; - de->putBlocks(this, extent*16, direntBytes); + de->putBlocks(this, extent * 16, direntBytes); } } diff --git a/lib/vfs/sectorinterface.h b/lib/vfs/sectorinterface.h index 7984e470..2d875217 100644 --- a/lib/vfs/sectorinterface.h +++ b/lib/vfs/sectorinterface.h @@ -12,7 +12,7 @@ class Encoder; class SectorInterface { public: - virtual ~SectorInterface() {} + virtual ~SectorInterface() {} public: virtual std::shared_ptr get( diff --git a/lib/vfs/vfs.cc b/lib/vfs/vfs.cc index b9496d7d..051272d2 100644 --- a/lib/vfs/vfs.cc +++ b/lib/vfs/vfs.cc @@ -281,9 +281,10 @@ Bytes Filesystem::getSector(unsigned track, unsigned side, unsigned sector) Bytes Filesystem::getLogicalSector(uint32_t number, uint32_t count) { if ((number + count) > _locations.size()) - throw BadFilesystemException( - fmt::format("invalid filesystem: sector {} is out of bounds ({} maximum)", - number + count - 1, _locations.size())); + throw BadFilesystemException(fmt::format( + "invalid filesystem: sector {} is out of bounds ({} maximum)", + number + count - 1, + _locations.size())); Bytes data; ByteWriter bw(data); diff --git a/scripts/encodedecodetest.sh b/scripts/encodedecodetest.sh index c43e6392..8bb152c2 100755 --- a/scripts/encodedecodetest.sh +++ b/scripts/encodedecodetest.sh @@ -1,22 +1,21 @@ #!/bin/sh set -e -format=$1 -tmp=/tmp/$$-$format -srcfile=$tmp.src.img -fluxfile=$tmp.$2 -destfile=$tmp.dest.img -fluxengine=$3 -shift -shift -shift +format="$1" +ext="$2" +fluxengine="$3" +script="$4" +flags="$5" +dir="$6" -trap "rm -f $srcfile $fluxfile $destfile" EXIT +srcfile=$dir.$format.src.img +fluxfile=$dir.$format.$ext +destfile=$dir.$format.dest.img dd if=/dev/urandom of=$srcfile bs=1048576 count=2 2>&1 -$fluxengine write $format -i $srcfile -d $fluxfile --drive.rotational_period_ms=200 "$@" -$fluxengine read $format -s $fluxfile -o $destfile --drive.rotational_period_ms=200 "$@" +$fluxengine write $format -i $srcfile -d $fluxfile --drive.rotational_period_ms=200 $flags +$fluxengine read $format -s $fluxfile -o $destfile --drive.rotational_period_ms=200 $flags if [ ! -s $destfile ]; then echo "Zero length output file!" >&2 exit 1 diff --git a/src/fe-analysedriveresponse.cc b/src/fe-analysedriveresponse.cc index 8587978f..3841fba2 100644 --- a/src/fe-analysedriveresponse.cc +++ b/src/fe-analysedriveresponse.cc @@ -246,8 +246,7 @@ static void draw_x_graticules(Agg2D& painter, int mainAnalyseDriveResponse(int argc, const char* argv[]) { - globalConfig().overrides()->mutable_flux_source()->set_type( - FLUXTYPE_DRIVE); + globalConfig().overrides()->mutable_flux_source()->set_type(FLUXTYPE_DRIVE); flags.parseFlagsWithConfigFiles(argc, argv, {}); if (globalConfig()->flux_sink().type() != FLUXTYPE_DRIVE) diff --git a/src/fe-inspect.cc b/src/fe-inspect.cc index f244d496..7514e8bf 100644 --- a/src/fe-inspect.cc +++ b/src/fe-inspect.cc @@ -131,8 +131,7 @@ static nanoseconds_t guessClock(const Fluxmap& fluxmap) int mainInspect(int argc, const char* argv[]) { - globalConfig().overrides()->mutable_flux_source()->set_type( - FLUXTYPE_DRIVE); + globalConfig().overrides()->mutable_flux_source()->set_type(FLUXTYPE_DRIVE); flags.parseFlagsWithConfigFiles(argc, argv, {}); auto& fluxSource = globalConfig().getFluxSource(); diff --git a/src/fe-ls.cc b/src/fe-ls.cc index 29208936..4a2869b2 100644 --- a/src/fe-ls.cc +++ b/src/fe-ls.cc @@ -57,8 +57,8 @@ int mainLs(int argc, const char* argv[]) quote(dirent->filename), maxlen + 2, dirent->length, - dirent->mode, - dirent->attributes[Filesystem::CTIME]); + dirent->mode, + dirent->attributes[Filesystem::CTIME]); total += dirent->length; } fmt::print("({} files, {} bytes)\n", files.size(), total); diff --git a/src/fe-rawread.cc b/src/fe-rawread.cc index 23818629..3374e8b5 100644 --- a/src/fe-rawread.cc +++ b/src/fe-rawread.cc @@ -53,8 +53,7 @@ int mainRawRead(int argc, const char* argv[]) if (argc == 1) showProfiles("rawread", formats); - globalConfig().overrides()->mutable_flux_source()->set_type( - FLUXTYPE_DRIVE); + globalConfig().overrides()->mutable_flux_source()->set_type(FLUXTYPE_DRIVE); flags.parseFlagsWithConfigFiles(argc, argv, formats); if (globalConfig()->flux_sink().type() == FLUXTYPE_DRIVE) diff --git a/src/fe-rawwrite.cc b/src/fe-rawwrite.cc index e456b3b6..4fbe53f8 100644 --- a/src/fe-rawwrite.cc +++ b/src/fe-rawwrite.cc @@ -59,8 +59,7 @@ int mainRawWrite(int argc, const char* argv[]) if (argc == 1) showProfiles("rawwrite", formats); - globalConfig().overrides()->mutable_flux_sink()->set_type( - FLUXTYPE_DRIVE); + globalConfig().overrides()->mutable_flux_sink()->set_type(FLUXTYPE_DRIVE); flags.parseFlagsWithConfigFiles(argc, argv, formats); if (globalConfig()->flux_source().type() == FLUXTYPE_DRIVE) diff --git a/src/formats/40track_drive.textpb b/src/formats/40track_drive.textpb index b4647bda..736b709d 100644 --- a/src/formats/40track_drive.textpb +++ b/src/formats/40track_drive.textpb @@ -16,8 +16,7 @@ fluxengine read ibm --180 40track_drive drive { tracks: 40 - head_width: 1 - tpi: 48 + drive_type: DRIVETYPE_40TRACK } diff --git a/src/formats/acornadfs.textpb b/src/formats/acornadfs.textpb index 1d96b9b2..de3932e0 100644 --- a/src/formats/acornadfs.textpb +++ b/src/formats/acornadfs.textpb @@ -42,7 +42,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 1 layoutdata { @@ -62,7 +62,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 1 layoutdata { @@ -82,7 +82,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { @@ -102,7 +102,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { @@ -123,7 +123,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { diff --git a/src/formats/acorndfs.textpb b/src/formats/acorndfs.textpb index 37623a70..e87e562b 100644 --- a/src/formats/acorndfs.textpb +++ b/src/formats/acorndfs.textpb @@ -78,7 +78,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 } } @@ -91,7 +91,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 } } diff --git a/src/formats/aeslanier.textpb b/src/formats/aeslanier.textpb index 1e741932..70c60e13 100644 --- a/src/formats/aeslanier.textpb +++ b/src/formats/aeslanier.textpb @@ -51,7 +51,7 @@ decoder { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 1 layoutdata { diff --git a/src/formats/agat.textpb b/src/formats/agat.textpb index f7f0164c..6585ff9d 100644 --- a/src/formats/agat.textpb +++ b/src/formats/agat.textpb @@ -32,7 +32,7 @@ image_writer { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { diff --git a/src/formats/amiga.textpb b/src/formats/amiga.textpb index dc9f717f..e23a23cc 100644 --- a/src/formats/amiga.textpb +++ b/src/formats/amiga.textpb @@ -40,7 +40,7 @@ image_writer { } layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { diff --git a/src/formats/ampro.textpb b/src/formats/ampro.textpb index 010f38db..1a912317 100644 --- a/src/formats/ampro.textpb +++ b/src/formats/ampro.textpb @@ -82,7 +82,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 } } @@ -94,7 +94,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 } } diff --git a/src/formats/apple2.textpb b/src/formats/apple2.textpb index 24f90891..7461b464 100644 --- a/src/formats/apple2.textpb +++ b/src/formats/apple2.textpb @@ -73,7 +73,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 35 sides: 1 layoutdata { @@ -93,7 +93,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 order: HCS diff --git a/src/formats/apple2_drive.textpb b/src/formats/apple2_drive.textpb index 0cf4b923..0527daf4 100644 --- a/src/formats/apple2_drive.textpb +++ b/src/formats/apple2_drive.textpb @@ -24,8 +24,7 @@ usb { drive { tracks: 160 heads: 1 - head_width: 4 - tpi: 192 + drive_type: DRIVETYPE_APPLE2 } diff --git a/src/formats/atarist.textpb b/src/formats/atarist.textpb index a0431b25..260ea6b9 100644 --- a/src/formats/atarist.textpb +++ b/src/formats/atarist.textpb @@ -51,7 +51,7 @@ decoder { } layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK } option_group { diff --git a/src/formats/bk.textpb b/src/formats/bk.textpb index bf13827e..0db6ff16 100644 --- a/src/formats/bk.textpb +++ b/src/formats/bk.textpb @@ -28,7 +28,7 @@ image_writer { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { diff --git a/src/formats/brother.textpb b/src/formats/brother.textpb index f5469047..08c9f915 100644 --- a/src/formats/brother.textpb +++ b/src/formats/brother.textpb @@ -141,7 +141,7 @@ option_group { config { layout { - tpi: 67.5 + format_type: FORMATTYPE_40TRACK tracks: 39 sides: 1 layoutdata { @@ -162,7 +162,7 @@ option_group { drive { head_bias: 0 - group_offset: 1 + group_offset: 0 } filesystem { @@ -178,7 +178,7 @@ option_group { config { layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 78 sides: 1 layoutdata { diff --git a/src/formats/commodore.textpb b/src/formats/commodore.textpb index 081ed1bc..3748e016 100644 --- a/src/formats/commodore.textpb +++ b/src/formats/commodore.textpb @@ -76,7 +76,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 35 sides: 1 layoutdata { @@ -132,7 +132,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 1 layoutdata { @@ -188,7 +188,7 @@ option_group { config { layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 swap_sides: true @@ -230,7 +230,7 @@ option_group { config { layout { - tpi: 100 + format_type: FORMATTYPE_80TRACK sides: 2 tracks: 77 layoutdata { @@ -282,7 +282,7 @@ option_group { config { layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 81 sides: 2 swap_sides: true diff --git a/src/formats/eco1.textpb b/src/formats/eco1.textpb index 20e565f1..311aae32 100644 --- a/src/formats/eco1.textpb +++ b/src/formats/eco1.textpb @@ -41,7 +41,7 @@ image_writer { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 2 layoutdata { diff --git a/src/formats/epsonpf10.textpb b/src/formats/epsonpf10.textpb index ce660a4a..915e3ba3 100644 --- a/src/formats/epsonpf10.textpb +++ b/src/formats/epsonpf10.textpb @@ -15,7 +15,7 @@ image_writer { } layout { - tpi: 67.5 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 2 layoutdata { diff --git a/src/formats/f85.textpb b/src/formats/f85.textpb index d73feb1b..8dc81aae 100644 --- a/src/formats/f85.textpb +++ b/src/formats/f85.textpb @@ -50,7 +50,7 @@ decoder { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 1 layoutdata { diff --git a/src/formats/fb100.textpb b/src/formats/fb100.textpb index c848d201..6940f7e5 100644 --- a/src/formats/fb100.textpb +++ b/src/formats/fb100.textpb @@ -51,7 +51,7 @@ decoder { } layout { - tpi: 67.5 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 1 layoutdata { diff --git a/src/formats/hplif.textpb b/src/formats/hplif.textpb index 88dc2faa..aadfb61d 100644 --- a/src/formats/hplif.textpb +++ b/src/formats/hplif.textpb @@ -46,7 +46,7 @@ filesystem { } layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK } option_group { diff --git a/src/formats/ibm.textpb b/src/formats/ibm.textpb index 90c60138..a6a976d6 100644 --- a/src/formats/ibm.textpb +++ b/src/formats/ibm.textpb @@ -110,7 +110,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK } } } @@ -121,7 +121,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 1 layoutdata { @@ -150,7 +150,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 1 layoutdata { @@ -179,7 +179,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 2 layoutdata { @@ -208,7 +208,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 2 layoutdata { @@ -237,7 +237,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { @@ -266,7 +266,7 @@ option_group { config { layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { @@ -295,7 +295,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { @@ -324,7 +324,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 2 layoutdata { @@ -353,7 +353,7 @@ option_group { config { layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { @@ -382,7 +382,7 @@ option_group { config { layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { diff --git a/src/formats/icl30.textpb b/src/formats/icl30.textpb index 99726e26..d1692ac3 100644 --- a/src/formats/icl30.textpb +++ b/src/formats/icl30.textpb @@ -15,7 +15,7 @@ image_writer { } layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 35 sides: 2 layoutdata { diff --git a/src/formats/mac.textpb b/src/formats/mac.textpb index 0384e24c..6f8872fd 100644 --- a/src/formats/mac.textpb +++ b/src/formats/mac.textpb @@ -70,7 +70,7 @@ image_writer { } layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { diff --git a/src/formats/micropolis.textpb b/src/formats/micropolis.textpb index 3c95443c..dd445c62 100644 --- a/src/formats/micropolis.textpb +++ b/src/formats/micropolis.textpb @@ -142,7 +142,7 @@ option_group { config { layout { - tpi: 50 + format_type: FORMATTYPE_40TRACK tracks: 35 sides: 1 } @@ -156,7 +156,7 @@ option_group { config { layout { - tpi: 50 + format_type: FORMATTYPE_40TRACK tracks: 35 sides: 2 } @@ -169,7 +169,7 @@ option_group { config { layout { - tpi: 100 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 1 } @@ -182,7 +182,7 @@ option_group { config { layout { - tpi: 100 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 2 } diff --git a/src/formats/ms2000.textpb b/src/formats/ms2000.textpb index 0e85b60d..f677f415 100644 --- a/src/formats/ms2000.textpb +++ b/src/formats/ms2000.textpb @@ -41,7 +41,7 @@ image_writer { layout { tracks: 70 sides: 1 - tpi: 135 + format_type: FORMATTYPE_80TRACK layoutdata { sector_size: 512 physical { diff --git a/src/formats/mx.textpb b/src/formats/mx.textpb index 6cbcca2e..6620f6f4 100644 --- a/src/formats/mx.textpb +++ b/src/formats/mx.textpb @@ -83,7 +83,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 1 } @@ -96,7 +96,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 2 } @@ -109,7 +109,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 1 } @@ -123,7 +123,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 } diff --git a/src/formats/n88basic.textpb b/src/formats/n88basic.textpb index 053c34fb..1a21f79c 100644 --- a/src/formats/n88basic.textpb +++ b/src/formats/n88basic.textpb @@ -28,7 +28,7 @@ image_writer { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 2 layoutdata { diff --git a/src/formats/northstar.textpb b/src/formats/northstar.textpb index 0516f6a4..fca37c42 100644 --- a/src/formats/northstar.textpb +++ b/src/formats/northstar.textpb @@ -44,7 +44,7 @@ image_writer { } layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK layoutdata { physical { start_sector: 0 diff --git a/src/formats/psos.textpb b/src/formats/psos.textpb index ba4b75c9..4bf9afaa 100644 --- a/src/formats/psos.textpb +++ b/src/formats/psos.textpb @@ -35,7 +35,7 @@ image_writer { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 order: HCS diff --git a/src/formats/rolandd20.textpb b/src/formats/rolandd20.textpb index 19c670a1..e1d5367d 100644 --- a/src/formats/rolandd20.textpb +++ b/src/formats/rolandd20.textpb @@ -46,7 +46,7 @@ image_writer { } layout { - tpi: 135 + format_type: FORMATTYPE_80TRACK tracks: 78 sides: 1 layoutdata { diff --git a/src/formats/rx50.textpb b/src/formats/rx50.textpb index 93457074..ea049a5e 100644 --- a/src/formats/rx50.textpb +++ b/src/formats/rx50.textpb @@ -25,7 +25,7 @@ image_writer { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 1 layoutdata { diff --git a/src/formats/smaky6.textpb b/src/formats/smaky6.textpb index 0df3d3bb..cc076a76 100644 --- a/src/formats/smaky6.textpb +++ b/src/formats/smaky6.textpb @@ -33,7 +33,7 @@ image_writer { } layout { - tpi: 100 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 1 layoutdata { diff --git a/src/formats/tids990.textpb b/src/formats/tids990.textpb index acb739db..f59ab874 100644 --- a/src/formats/tids990.textpb +++ b/src/formats/tids990.textpb @@ -40,7 +40,7 @@ image_writer { } layout { - tpi: 48 + format_type: FORMATTYPE_80TRACK tracks: 77 sides: 2 layoutdata { diff --git a/src/formats/tiki.textpb b/src/formats/tiki.textpb index 838749ad..34c30a47 100644 --- a/src/formats/tiki.textpb +++ b/src/formats/tiki.textpb @@ -27,7 +27,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 1 layoutdata { @@ -59,7 +59,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 1 layoutdata { @@ -91,7 +91,7 @@ option_group { config { layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 40 sides: 2 layoutdata { @@ -124,7 +124,7 @@ option_group { config { layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { diff --git a/src/formats/victor9k.textpb b/src/formats/victor9k.textpb index 1f2f9bef..c839e502 100644 --- a/src/formats/victor9k.textpb +++ b/src/formats/victor9k.textpb @@ -59,7 +59,7 @@ image_writer { } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 80 sides: 2 layoutdata { diff --git a/src/formats/zilogmcz.textpb b/src/formats/zilogmcz.textpb index c6cae4f9..29525d00 100644 --- a/src/formats/zilogmcz.textpb +++ b/src/formats/zilogmcz.textpb @@ -45,7 +45,7 @@ decoder { } layout { - tpi: 48 + format_type: FORMATTYPE_40TRACK tracks: 77 sides: 1 layoutdata { diff --git a/src/gui/browserpanel.cc b/src/gui/browserpanel.cc index cf151c04..69b7030e 100644 --- a/src/gui/browserpanel.cc +++ b/src/gui/browserpanel.cc @@ -244,12 +244,12 @@ private: uint32_t usedBlocks = std::stoul( metadata.at(Filesystem::USED_BLOCKS)); - if (!totalBlocks) - throw std::out_of_range("no disk usage data"); + if (!totalBlocks) + throw std::out_of_range("no disk usage data"); - diskSpaceGauge->Enable(); - diskSpaceGauge->SetRange(totalBlocks); - diskSpaceGauge->SetValue(usedBlocks); + diskSpaceGauge->Enable(); + diskSpaceGauge->SetRange(totalBlocks); + diskSpaceGauge->SetValue(usedBlocks); } catch (const std::out_of_range& e) { diff --git a/src/gui/drivetypes/35_40.textpb b/src/gui/drivetypes/35_40.textpb deleted file mode 100644 index a0e9bc39..00000000 --- a/src/gui/drivetypes/35_40.textpb +++ /dev/null @@ -1,6 +0,0 @@ -comment: '3.5" 40 track 67.5tpi' - -drive { - tpi: 67.5 -} - diff --git a/src/gui/drivetypes/35_80.textpb b/src/gui/drivetypes/35_80.textpb deleted file mode 100644 index 852ed2cb..00000000 --- a/src/gui/drivetypes/35_80.textpb +++ /dev/null @@ -1,6 +0,0 @@ -comment: '3.5" 80 track 135tpi' - -drive { - tpi: 135 -} - diff --git a/src/gui/drivetypes/525_40.textpb b/src/gui/drivetypes/525_40.textpb deleted file mode 100644 index ae0ea006..00000000 --- a/src/gui/drivetypes/525_40.textpb +++ /dev/null @@ -1,6 +0,0 @@ -comment: '5.25" 40 track 48tpi' - -drive { - tpi: 48 -} - diff --git a/src/gui/drivetypes/525_40M.textpb b/src/gui/drivetypes/525_40M.textpb deleted file mode 100644 index c34bd46c..00000000 --- a/src/gui/drivetypes/525_40M.textpb +++ /dev/null @@ -1,6 +0,0 @@ -comment: '5.25" 40 track 50tpi (Micropolis Mod-I)' - -drive { - tpi: 50 -} - diff --git a/src/gui/drivetypes/525_80.textpb b/src/gui/drivetypes/525_80.textpb deleted file mode 100644 index 4c01a16c..00000000 --- a/src/gui/drivetypes/525_80.textpb +++ /dev/null @@ -1,6 +0,0 @@ -comment: '5.25" 80 track 96tpi' - -drive { - tpi: 96 -} - diff --git a/src/gui/drivetypes/525_80M.textpb b/src/gui/drivetypes/525_80M.textpb deleted file mode 100644 index c5fec8c8..00000000 --- a/src/gui/drivetypes/525_80M.textpb +++ /dev/null @@ -1,6 +0,0 @@ -comment: '5.25" 80 track 100tpi (Micropolis Mod-II)' - -drive { - tpi: 100 -} - diff --git a/src/gui/drivetypes/8_38.textpb b/src/gui/drivetypes/8_38.textpb deleted file mode 100644 index bccffe4c..00000000 --- a/src/gui/drivetypes/8_38.textpb +++ /dev/null @@ -1,6 +0,0 @@ -comment: '8" 38 track 32tpi' - -drive { - tpi: 32 -} - diff --git a/src/gui/drivetypes/8_77.textpb b/src/gui/drivetypes/8_77.textpb deleted file mode 100644 index dd3a2d51..00000000 --- a/src/gui/drivetypes/8_77.textpb +++ /dev/null @@ -1,6 +0,0 @@ -comment: '8" 77 track 48tpi' - -drive { - tpi: 48 -} - diff --git a/src/gui/drivetypes/apple2.textpb b/src/gui/drivetypes/apple2.textpb index 1967af6c..e8d933ce 100644 --- a/src/gui/drivetypes/apple2.textpb +++ b/src/gui/drivetypes/apple2.textpb @@ -9,7 +9,6 @@ usb { drive { tracks: 160 heads: 1 - head_width: 4 - tpi: 192 + drive_type: DRIVETYPE_APPLE2 } diff --git a/src/gui/drivetypes/build.py b/src/gui/drivetypes/build.py index 4a69fdbd..0e950c9a 100644 --- a/src/gui/drivetypes/build.py +++ b/src/gui/drivetypes/build.py @@ -3,14 +3,8 @@ from build.c import cxxlibrary from scripts.build import protoencode drivetypes = [ - "35_40", - "35_80", - "525_40M", - "525_40", - "525_80M", - "525_80", - "8_38", - "8_77", + "40track", + "80track", "apple2", ] diff --git a/src/gui/icon.png.h b/src/gui/icon.png.h index 4d76b49a..83326b5c 100644 --- a/src/gui/icon.png.h +++ b/src/gui/icon.png.h @@ -5,113 +5,968 @@ #include #include -static const unsigned char icon_png[] = -{ - 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, - 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x40, - 0x00, 0x00, 0x00, 0x40, 0x08, 0x06, 0x00, 0x00, 0x00, 0xAA, - 0x69, 0x71, 0xDE, 0x00, 0x00, 0x03, 0x80, 0x49, 0x44, 0x41, - 0x54, 0x78, 0x9C, 0xD5, 0x9B, 0x5B, 0x9A, 0xA3, 0x20, 0x10, - 0x85, 0x0F, 0xF3, 0xCD, 0x6A, 0xDC, 0x4F, 0xBB, 0x9D, 0x90, - 0xED, 0x98, 0xFD, 0x64, 0x3B, 0xCC, 0x43, 0x02, 0x2D, 0x25, - 0x97, 0x2A, 0x28, 0xC0, 0x39, 0x2F, 0x1D, 0x6D, 0x29, 0xF8, - 0x8F, 0x65, 0x81, 0xC6, 0x00, 0x6B, 0xE5, 0x16, 0xF7, 0x8F, - 0x3F, 0x0B, 0xFB, 0x76, 0xD6, 0x5A, 0x60, 0xB1, 0x09, 0x66, - 0x51, 0xBF, 0x1E, 0x1E, 0x00, 0xF0, 0xFD, 0xBC, 0x64, 0x2C, - 0x2B, 0x3A, 0x8D, 0xE0, 0xBD, 0x56, 0x99, 0x30, 0xBB, 0xC3, - 0x24, 0xBC, 0xD7, 0x0A, 0x13, 0x66, 0xD6, 0x80, 0x22, 0xFC, - 0xE7, 0x08, 0x07, 0x4C, 0xAE, 0x09, 0xB3, 0xDC, 0xAE, 0xC2, - 0xDB, 0xC7, 0xE3, 0x77, 0xC3, 0x18, 0x60, 0xD2, 0xD8, 0x66, - 0x74, 0x22, 0x83, 0xF7, 0x9A, 0x64, 0xC2, 0xE8, 0x0E, 0xDA, - 0xE0, 0xBD, 0x26, 0x98, 0x30, 0x32, 0x78, 0x1F, 0xBC, 0xD7, - 0x60, 0x13, 0x46, 0x05, 0xD6, 0x81, 0xF7, 0x1A, 0x68, 0xC2, - 0x88, 0x59, 0xA0, 0x09, 0xDE, 0x9A, 0x67, 0x21, 0xE2, 0xB8, - 0xD9, 0x41, 0xDB, 0x80, 0x66, 0x78, 0xEB, 0x1E, 0x97, 0x7D, - 0x71, 0xE4, 0x31, 0x26, 0xFC, 0x55, 0x8C, 0xA5, 0x72, 0xE6, - 0xFD, 0x36, 0x35, 0xE4, 0xD3, 0x83, 0x03, 0x8C, 0x71, 0x50, - 0xBC, 0x1C, 0xB4, 0x02, 0xA9, 0xA6, 0x7D, 0x12, 0xFE, 0x2C, - 0xC5, 0x9A, 0xA0, 0x11, 0x64, 0x2E, 0xBC, 0x97, 0x92, 0x09, - 0xBD, 0x01, 0xD6, 0xC0, 0x7B, 0x29, 0x98, 0xD0, 0x53, 0x04, - 0xF5, 0xAB, 0xBD, 0x78, 0x04, 0xFD, 0x85, 0xB1, 0xD5, 0x3D, - 0x75, 0xF8, 0xDC, 0xD9, 0x2F, 0x16, 0x45, 0xAF, 0x8E, 0x4C, - 0x68, 0x69, 0x34, 0xF4, 0xCC, 0x5B, 0xF7, 0x08, 0xD3, 0x22, - 0x0B, 0xDE, 0xAB, 0xD1, 0x04, 0x69, 0x83, 0x25, 0x69, 0x3F, - 0xB2, 0x30, 0x4A, 0x6A, 0x40, 0xD7, 0x22, 0x27, 0x05, 0xC1, - 0x01, 0x4B, 0xB6, 0xCB, 0x19, 0xDA, 0x50, 0x13, 0xB8, 0x0B, - 0xA1, 0xE6, 0xB5, 0x7D, 0x2B, 0x78, 0xB6, 0x6D, 0x62, 0xD5, - 0x18, 0x49, 0xB8, 0x58, 0xE2, 0x64, 0x40, 0xFD, 0x49, 0x0E, - 0x00, 0xFB, 0x2C, 0xA7, 0x79, 0xEE, 0x7A, 0x2E, 0xC1, 0x84, - 0x36, 0xE4, 0x6F, 0xED, 0x78, 0x49, 0x26, 0xD4, 0x5C, 0x62, - 0xC1, 0x47, 0x83, 0xC8, 0x65, 0x42, 0xE6, 0xCC, 0xB5, 0xD6, - 0x87, 0xD4, 0xBD, 0xC3, 0x25, 0x3E, 0xA3, 0x26, 0x94, 0x32, - 0xA0, 0x0A, 0xBF, 0x6D, 0x1B, 0xB6, 0x6D, 0x8B, 0x07, 0x92, - 0xC8, 0x84, 0x52, 0xDA, 0x4A, 0x32, 0x22, 0xDB, 0x26, 0x17, - 0x9F, 0x91, 0x09, 0x39, 0x77, 0x58, 0xF0, 0x67, 0xBD, 0xDF, - 0xEF, 0x78, 0x50, 0xCC, 0xFB, 0xFD, 0x73, 0x06, 0x9C, 0x21, - 0xB8, 0xAB, 0xC5, 0x6A, 0x4D, 0x00, 0x8A, 0x99, 0x90, 0xCA, - 0x00, 0x31, 0x3C, 0x10, 0x1E, 0x69, 0xFF, 0x6E, 0x57, 0x6A, - 0x02, 0xD0, 0x0E, 0x7F, 0xAE, 0x09, 0xAC, 0x82, 0x5A, 0xC8, - 0x04, 0xEA, 0x4A, 0x13, 0xFC, 0xBE, 0xEF, 0x70, 0xCE, 0xC1, - 0x18, 0x73, 0x35, 0xA2, 0x90, 0x09, 0xC5, 0x4B, 0x83, 0x51, - 0x1B, 0xC4, 0xB3, 0x44, 0x22, 0x13, 0xCE, 0x19, 0xD0, 0x05, - 0x0F, 0x00, 0xCE, 0x39, 0x51, 0x26, 0xF4, 0xC2, 0xA7, 0x66, - 0x89, 0x6C, 0xCC, 0xE7, 0xD3, 0x8F, 0x2D, 0xCA, 0x84, 0xB3, - 0x1B, 0x45, 0x03, 0x6A, 0xF0, 0x51, 0x50, 0x61, 0x26, 0x44, - 0xC7, 0xD1, 0x07, 0x24, 0x27, 0xD0, 0x6A, 0xDB, 0x02, 0x7C, - 0xB4, 0x7D, 0xFA, 0x06, 0x8A, 0xB5, 0x12, 0x94, 0xC0, 0x03, - 0xF2, 0x4C, 0x08, 0xC7, 0x90, 0x55, 0xA3, 0xE4, 0xF6, 0x98, - 0x0B, 0x0F, 0x20, 0xCA, 0x84, 0xAA, 0x01, 0x12, 0xF8, 0xD7, - 0xEB, 0x15, 0x3E, 0xB7, 0x98, 0x10, 0x15, 0x42, 0x52, 0xF0, - 0xB8, 0xED, 0x72, 0xFD, 0x59, 0x6B, 0xA3, 0x6B, 0xDF, 0x9B, - 0x50, 0x34, 0xA0, 0x05, 0xBE, 0xD7, 0x04, 0xAA, 0x5A, 0x36, - 0x48, 0xE0, 0xCF, 0x26, 0xF8, 0xCB, 0x20, 0x3B, 0x0B, 0xB4, - 0x9E, 0x79, 0xAF, 0x9F, 0x9F, 0x9F, 0xF0, 0xB9, 0xB7, 0x26, - 0xE4, 0xEA, 0x80, 0x30, 0xED, 0x8D, 0xB5, 0xD6, 0x7D, 0x3F, - 0x03, 0xDF, 0x1A, 0x90, 0x5A, 0x1C, 0xB8, 0xE3, 0x38, 0x2E, - 0x3B, 0x25, 0xF0, 0x5E, 0xBD, 0x26, 0xD0, 0xAA, 0x9E, 0x5B, - 0x37, 0x44, 0x6D, 0x6A, 0x97, 0x19, 0xF9, 0x0A, 0x3E, 0x75, - 0x09, 0x98, 0x7D, 0xDF, 0xA3, 0x1D, 0x2D, 0xF0, 0x54, 0xE2, - 0x29, 0x72, 0x02, 0xFC, 0x65, 0x83, 0xC8, 0x1D, 0xC7, 0xD1, - 0x0C, 0x7F, 0x3E, 0xFB, 0x51, 0x87, 0x8C, 0x4C, 0x28, 0xDD, - 0x38, 0x69, 0xC2, 0x27, 0x77, 0x10, 0x39, 0x4D, 0xF8, 0xD0, - 0x69, 0xC1, 0x84, 0x99, 0xF0, 0xD9, 0x9D, 0x44, 0x91, 0x09, - 0xBD, 0xF0, 0xA1, 0x63, 0x41, 0x4D, 0x18, 0x05, 0x5F, 0xFC, - 0x07, 0x51, 0x30, 0x81, 0x5B, 0xF4, 0x38, 0xEA, 0x99, 0x1D, - 0x80, 0x7E, 0xF8, 0xEA, 0x3F, 0x89, 0x8A, 0x26, 0x48, 0xE1, - 0xC3, 0x00, 0x1A, 0x4D, 0xD0, 0x80, 0x67, 0x1D, 0x40, 0x94, - 0x34, 0xA1, 0x15, 0x3E, 0x0C, 0x42, 0x7A, 0x17, 0xA9, 0x04, - 0xCF, 0x3E, 0x88, 0x28, 0x32, 0xA1, 0x17, 0x3E, 0x0C, 0x84, - 0x69, 0x82, 0x26, 0xBC, 0xE8, 0x40, 0xA2, 0xE4, 0xEC, 0x00, - 0x7C, 0x40, 0x72, 0xFF, 0xAB, 0x0E, 0xA6, 0x62, 0x82, 0x36, - 0xBC, 0xF8, 0x60, 0xA2, 0xA9, 0x26, 0x8C, 0x80, 0x6F, 0x6A, - 0x40, 0x14, 0x4C, 0xA0, 0xD0, 0xAD, 0x26, 0x18, 0x63, 0x70, - 0x1C, 0xC7, 0xE5, 0x19, 0x63, 0x49, 0x3D, 0x6F, 0x98, 0xAA, - 0xBC, 0x1F, 0xA0, 0x65, 0x82, 0x87, 0xF7, 0xE2, 0x98, 0xD0, - 0xFB, 0x7A, 0xAD, 0xDA, 0x1B, 0x22, 0xBD, 0x26, 0x50, 0x78, - 0xAF, 0x92, 0x09, 0x1A, 0xEF, 0x16, 0x6B, 0xBE, 0x7A, 0xD6, - 0x6C, 0xC2, 0x2A, 0x78, 0x95, 0x00, 0x44, 0x62, 0x13, 0x56, - 0xC2, 0xAB, 0x05, 0x21, 0xCA, 0x9A, 0x70, 0xE9, 0x7C, 0x31, - 0xBC, 0x6A, 0x20, 0xA2, 0xAA, 0x09, 0x77, 0x80, 0x57, 0x0F, - 0x46, 0x54, 0x5C, 0x27, 0xDC, 0x01, 0x7E, 0x48, 0x40, 0xA2, - 0x8B, 0x09, 0x77, 0x82, 0x1F, 0x16, 0x94, 0x28, 0xBA, 0x1C, - 0xEE, 0x04, 0x3F, 0x34, 0x30, 0x91, 0x03, 0x70, 0x3B, 0x78, - 0x60, 0xDE, 0x6F, 0x86, 0x92, 0x10, 0xAB, 0xE1, 0xA7, 0x74, - 0x40, 0x14, 0x1E, 0xB9, 0xDF, 0x01, 0x1E, 0x98, 0xFF, 0xCB, - 0x51, 0x03, 0xDC, 0x07, 0x7E, 0x6A, 0x47, 0x44, 0xB7, 0xF9, - 0xF1, 0xE4, 0x2A, 0x03, 0x80, 0x1B, 0xFD, 0x7C, 0x76, 0xA5, - 0xDC, 0xF7, 0xFB, 0xBA, 0xAE, 0x17, 0x9E, 0xFF, 0x77, 0x2D, - 0x85, 0xFF, 0x07, 0xE6, 0x6F, 0xFC, 0xB7, 0xE2, 0xFB, 0x3A, - 0x0B, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, - 0x42, 0x60, 0x82, +static const unsigned char icon_png[] = { + 0x89, + 0x50, + 0x4E, + 0x47, + 0x0D, + 0x0A, + 0x1A, + 0x0A, + 0x00, + 0x00, + 0x00, + 0x0D, + 0x49, + 0x48, + 0x44, + 0x52, + 0x00, + 0x00, + 0x00, + 0x40, + 0x00, + 0x00, + 0x00, + 0x40, + 0x08, + 0x06, + 0x00, + 0x00, + 0x00, + 0xAA, + 0x69, + 0x71, + 0xDE, + 0x00, + 0x00, + 0x03, + 0x80, + 0x49, + 0x44, + 0x41, + 0x54, + 0x78, + 0x9C, + 0xD5, + 0x9B, + 0x5B, + 0x9A, + 0xA3, + 0x20, + 0x10, + 0x85, + 0x0F, + 0xF3, + 0xCD, + 0x6A, + 0xDC, + 0x4F, + 0xBB, + 0x9D, + 0x90, + 0xED, + 0x98, + 0xFD, + 0x64, + 0x3B, + 0xCC, + 0x43, + 0x02, + 0x2D, + 0x25, + 0x97, + 0x2A, + 0x28, + 0xC0, + 0x39, + 0x2F, + 0x1D, + 0x6D, + 0x29, + 0xF8, + 0x8F, + 0x65, + 0x81, + 0xC6, + 0x00, + 0x6B, + 0xE5, + 0x16, + 0xF7, + 0x8F, + 0x3F, + 0x0B, + 0xFB, + 0x76, + 0xD6, + 0x5A, + 0x60, + 0xB1, + 0x09, + 0x66, + 0x51, + 0xBF, + 0x1E, + 0x1E, + 0x00, + 0xF0, + 0xFD, + 0xBC, + 0x64, + 0x2C, + 0x2B, + 0x3A, + 0x8D, + 0xE0, + 0xBD, + 0x56, + 0x99, + 0x30, + 0xBB, + 0xC3, + 0x24, + 0xBC, + 0xD7, + 0x0A, + 0x13, + 0x66, + 0xD6, + 0x80, + 0x22, + 0xFC, + 0xE7, + 0x08, + 0x07, + 0x4C, + 0xAE, + 0x09, + 0xB3, + 0xDC, + 0xAE, + 0xC2, + 0xDB, + 0xC7, + 0xE3, + 0x77, + 0xC3, + 0x18, + 0x60, + 0xD2, + 0xD8, + 0x66, + 0x74, + 0x22, + 0x83, + 0xF7, + 0x9A, + 0x64, + 0xC2, + 0xE8, + 0x0E, + 0xDA, + 0xE0, + 0xBD, + 0x26, + 0x98, + 0x30, + 0x32, + 0x78, + 0x1F, + 0xBC, + 0xD7, + 0x60, + 0x13, + 0x46, + 0x05, + 0xD6, + 0x81, + 0xF7, + 0x1A, + 0x68, + 0xC2, + 0x88, + 0x59, + 0xA0, + 0x09, + 0xDE, + 0x9A, + 0x67, + 0x21, + 0xE2, + 0xB8, + 0xD9, + 0x41, + 0xDB, + 0x80, + 0x66, + 0x78, + 0xEB, + 0x1E, + 0x97, + 0x7D, + 0x71, + 0xE4, + 0x31, + 0x26, + 0xFC, + 0x55, + 0x8C, + 0xA5, + 0x72, + 0xE6, + 0xFD, + 0x36, + 0x35, + 0xE4, + 0xD3, + 0x83, + 0x03, + 0x8C, + 0x71, + 0x50, + 0xBC, + 0x1C, + 0xB4, + 0x02, + 0xA9, + 0xA6, + 0x7D, + 0x12, + 0xFE, + 0x2C, + 0xC5, + 0x9A, + 0xA0, + 0x11, + 0x64, + 0x2E, + 0xBC, + 0x97, + 0x92, + 0x09, + 0xBD, + 0x01, + 0xD6, + 0xC0, + 0x7B, + 0x29, + 0x98, + 0xD0, + 0x53, + 0x04, + 0xF5, + 0xAB, + 0xBD, + 0x78, + 0x04, + 0xFD, + 0x85, + 0xB1, + 0xD5, + 0x3D, + 0x75, + 0xF8, + 0xDC, + 0xD9, + 0x2F, + 0x16, + 0x45, + 0xAF, + 0x8E, + 0x4C, + 0x68, + 0x69, + 0x34, + 0xF4, + 0xCC, + 0x5B, + 0xF7, + 0x08, + 0xD3, + 0x22, + 0x0B, + 0xDE, + 0xAB, + 0xD1, + 0x04, + 0x69, + 0x83, + 0x25, + 0x69, + 0x3F, + 0xB2, + 0x30, + 0x4A, + 0x6A, + 0x40, + 0xD7, + 0x22, + 0x27, + 0x05, + 0xC1, + 0x01, + 0x4B, + 0xB6, + 0xCB, + 0x19, + 0xDA, + 0x50, + 0x13, + 0xB8, + 0x0B, + 0xA1, + 0xE6, + 0xB5, + 0x7D, + 0x2B, + 0x78, + 0xB6, + 0x6D, + 0x62, + 0xD5, + 0x18, + 0x49, + 0xB8, + 0x58, + 0xE2, + 0x64, + 0x40, + 0xFD, + 0x49, + 0x0E, + 0x00, + 0xFB, + 0x2C, + 0xA7, + 0x79, + 0xEE, + 0x7A, + 0x2E, + 0xC1, + 0x84, + 0x36, + 0xE4, + 0x6F, + 0xED, + 0x78, + 0x49, + 0x26, + 0xD4, + 0x5C, + 0x62, + 0xC1, + 0x47, + 0x83, + 0xC8, + 0x65, + 0x42, + 0xE6, + 0xCC, + 0xB5, + 0xD6, + 0x87, + 0xD4, + 0xBD, + 0xC3, + 0x25, + 0x3E, + 0xA3, + 0x26, + 0x94, + 0x32, + 0xA0, + 0x0A, + 0xBF, + 0x6D, + 0x1B, + 0xB6, + 0x6D, + 0x8B, + 0x07, + 0x92, + 0xC8, + 0x84, + 0x52, + 0xDA, + 0x4A, + 0x32, + 0x22, + 0xDB, + 0x26, + 0x17, + 0x9F, + 0x91, + 0x09, + 0x39, + 0x77, + 0x58, + 0xF0, + 0x67, + 0xBD, + 0xDF, + 0xEF, + 0x78, + 0x50, + 0xCC, + 0xFB, + 0xFD, + 0x73, + 0x06, + 0x9C, + 0x21, + 0xB8, + 0xAB, + 0xC5, + 0x6A, + 0x4D, + 0x00, + 0x8A, + 0x99, + 0x90, + 0xCA, + 0x00, + 0x31, + 0x3C, + 0x10, + 0x1E, + 0x69, + 0xFF, + 0x6E, + 0x57, + 0x6A, + 0x02, + 0xD0, + 0x0E, + 0x7F, + 0xAE, + 0x09, + 0xAC, + 0x82, + 0x5A, + 0xC8, + 0x04, + 0xEA, + 0x4A, + 0x13, + 0xFC, + 0xBE, + 0xEF, + 0x70, + 0xCE, + 0xC1, + 0x18, + 0x73, + 0x35, + 0xA2, + 0x90, + 0x09, + 0xC5, + 0x4B, + 0x83, + 0x51, + 0x1B, + 0xC4, + 0xB3, + 0x44, + 0x22, + 0x13, + 0xCE, + 0x19, + 0xD0, + 0x05, + 0x0F, + 0x00, + 0xCE, + 0x39, + 0x51, + 0x26, + 0xF4, + 0xC2, + 0xA7, + 0x66, + 0x89, + 0x6C, + 0xCC, + 0xE7, + 0xD3, + 0x8F, + 0x2D, + 0xCA, + 0x84, + 0xB3, + 0x1B, + 0x45, + 0x03, + 0x6A, + 0xF0, + 0x51, + 0x50, + 0x61, + 0x26, + 0x44, + 0xC7, + 0xD1, + 0x07, + 0x24, + 0x27, + 0xD0, + 0x6A, + 0xDB, + 0x02, + 0x7C, + 0xB4, + 0x7D, + 0xFA, + 0x06, + 0x8A, + 0xB5, + 0x12, + 0x94, + 0xC0, + 0x03, + 0xF2, + 0x4C, + 0x08, + 0xC7, + 0x90, + 0x55, + 0xA3, + 0xE4, + 0xF6, + 0x98, + 0x0B, + 0x0F, + 0x20, + 0xCA, + 0x84, + 0xAA, + 0x01, + 0x12, + 0xF8, + 0xD7, + 0xEB, + 0x15, + 0x3E, + 0xB7, + 0x98, + 0x10, + 0x15, + 0x42, + 0x52, + 0xF0, + 0xB8, + 0xED, + 0x72, + 0xFD, + 0x59, + 0x6B, + 0xA3, + 0x6B, + 0xDF, + 0x9B, + 0x50, + 0x34, + 0xA0, + 0x05, + 0xBE, + 0xD7, + 0x04, + 0xAA, + 0x5A, + 0x36, + 0x48, + 0xE0, + 0xCF, + 0x26, + 0xF8, + 0xCB, + 0x20, + 0x3B, + 0x0B, + 0xB4, + 0x9E, + 0x79, + 0xAF, + 0x9F, + 0x9F, + 0x9F, + 0xF0, + 0xB9, + 0xB7, + 0x26, + 0xE4, + 0xEA, + 0x80, + 0x30, + 0xED, + 0x8D, + 0xB5, + 0xD6, + 0x7D, + 0x3F, + 0x03, + 0xDF, + 0x1A, + 0x90, + 0x5A, + 0x1C, + 0xB8, + 0xE3, + 0x38, + 0x2E, + 0x3B, + 0x25, + 0xF0, + 0x5E, + 0xBD, + 0x26, + 0xD0, + 0xAA, + 0x9E, + 0x5B, + 0x37, + 0x44, + 0x6D, + 0x6A, + 0x97, + 0x19, + 0xF9, + 0x0A, + 0x3E, + 0x75, + 0x09, + 0x98, + 0x7D, + 0xDF, + 0xA3, + 0x1D, + 0x2D, + 0xF0, + 0x54, + 0xE2, + 0x29, + 0x72, + 0x02, + 0xFC, + 0x65, + 0x83, + 0xC8, + 0x1D, + 0xC7, + 0xD1, + 0x0C, + 0x7F, + 0x3E, + 0xFB, + 0x51, + 0x87, + 0x8C, + 0x4C, + 0x28, + 0xDD, + 0x38, + 0x69, + 0xC2, + 0x27, + 0x77, + 0x10, + 0x39, + 0x4D, + 0xF8, + 0xD0, + 0x69, + 0xC1, + 0x84, + 0x99, + 0xF0, + 0xD9, + 0x9D, + 0x44, + 0x91, + 0x09, + 0xBD, + 0xF0, + 0xA1, + 0x63, + 0x41, + 0x4D, + 0x18, + 0x05, + 0x5F, + 0xFC, + 0x07, + 0x51, + 0x30, + 0x81, + 0x5B, + 0xF4, + 0x38, + 0xEA, + 0x99, + 0x1D, + 0x80, + 0x7E, + 0xF8, + 0xEA, + 0x3F, + 0x89, + 0x8A, + 0x26, + 0x48, + 0xE1, + 0xC3, + 0x00, + 0x1A, + 0x4D, + 0xD0, + 0x80, + 0x67, + 0x1D, + 0x40, + 0x94, + 0x34, + 0xA1, + 0x15, + 0x3E, + 0x0C, + 0x42, + 0x7A, + 0x17, + 0xA9, + 0x04, + 0xCF, + 0x3E, + 0x88, + 0x28, + 0x32, + 0xA1, + 0x17, + 0x3E, + 0x0C, + 0x84, + 0x69, + 0x82, + 0x26, + 0xBC, + 0xE8, + 0x40, + 0xA2, + 0xE4, + 0xEC, + 0x00, + 0x7C, + 0x40, + 0x72, + 0xFF, + 0xAB, + 0x0E, + 0xA6, + 0x62, + 0x82, + 0x36, + 0xBC, + 0xF8, + 0x60, + 0xA2, + 0xA9, + 0x26, + 0x8C, + 0x80, + 0x6F, + 0x6A, + 0x40, + 0x14, + 0x4C, + 0xA0, + 0xD0, + 0xAD, + 0x26, + 0x18, + 0x63, + 0x70, + 0x1C, + 0xC7, + 0xE5, + 0x19, + 0x63, + 0x49, + 0x3D, + 0x6F, + 0x98, + 0xAA, + 0xBC, + 0x1F, + 0xA0, + 0x65, + 0x82, + 0x87, + 0xF7, + 0xE2, + 0x98, + 0xD0, + 0xFB, + 0x7A, + 0xAD, + 0xDA, + 0x1B, + 0x22, + 0xBD, + 0x26, + 0x50, + 0x78, + 0xAF, + 0x92, + 0x09, + 0x1A, + 0xEF, + 0x16, + 0x6B, + 0xBE, + 0x7A, + 0xD6, + 0x6C, + 0xC2, + 0x2A, + 0x78, + 0x95, + 0x00, + 0x44, + 0x62, + 0x13, + 0x56, + 0xC2, + 0xAB, + 0x05, + 0x21, + 0xCA, + 0x9A, + 0x70, + 0xE9, + 0x7C, + 0x31, + 0xBC, + 0x6A, + 0x20, + 0xA2, + 0xAA, + 0x09, + 0x77, + 0x80, + 0x57, + 0x0F, + 0x46, + 0x54, + 0x5C, + 0x27, + 0xDC, + 0x01, + 0x7E, + 0x48, + 0x40, + 0xA2, + 0x8B, + 0x09, + 0x77, + 0x82, + 0x1F, + 0x16, + 0x94, + 0x28, + 0xBA, + 0x1C, + 0xEE, + 0x04, + 0x3F, + 0x34, + 0x30, + 0x91, + 0x03, + 0x70, + 0x3B, + 0x78, + 0x60, + 0xDE, + 0x6F, + 0x86, + 0x92, + 0x10, + 0xAB, + 0xE1, + 0xA7, + 0x74, + 0x40, + 0x14, + 0x1E, + 0xB9, + 0xDF, + 0x01, + 0x1E, + 0x98, + 0xFF, + 0xCB, + 0x51, + 0x03, + 0xDC, + 0x07, + 0x7E, + 0x6A, + 0x47, + 0x44, + 0xB7, + 0xF9, + 0xF1, + 0xE4, + 0x2A, + 0x03, + 0x80, + 0x1B, + 0xFD, + 0x7C, + 0x76, + 0xA5, + 0xDC, + 0xF7, + 0xFB, + 0xBA, + 0xAE, + 0x17, + 0x9E, + 0xFF, + 0x77, + 0x2D, + 0x85, + 0xFF, + 0x07, + 0xE6, + 0x6F, + 0xFC, + 0xB7, + 0xE2, + 0xFB, + 0x3A, + 0x0B, + 0x00, + 0x00, + 0x00, + 0x00, + 0x49, + 0x45, + 0x4E, + 0x44, + 0xAE, + 0x42, + 0x60, + 0x82, }; wxBitmap& icon_png_to_wx_bitmap() { - static wxMemoryInputStream memIStream( icon_png, sizeof( icon_png ) ); - static wxImage image( memIStream, wxBITMAP_TYPE_PNG ); - static wxBitmap bmp( image ); - return bmp; + static wxMemoryInputStream memIStream(icon_png, sizeof(icon_png)); + static wxImage image(memIStream, wxBITMAP_TYPE_PNG); + static wxBitmap bmp(image); + return bmp; } - -#endif //ICON_PNG_H +#endif // ICON_PNG_H diff --git a/src/gui/idlepanel.cc b/src/gui/idlepanel.cc index 6b971d00..9e213b7d 100644 --- a/src/gui/idlepanel.cc +++ b/src/gui/idlepanel.cc @@ -239,12 +239,12 @@ public: { if (_selectedFluxFormat) { - if (_selectedFluxFormat->sink) - _selectedFluxFormat->sink(_selectedFluxFilename, - globalConfig().overrides()->mutable_flux_sink()); - if (_selectedFluxFormat->source) - _selectedFluxFormat->source(_selectedFluxFilename, - globalConfig().overrides()->mutable_flux_source()); + if (_selectedFluxFormat->sink) + _selectedFluxFormat->sink(_selectedFluxFilename, + globalConfig().overrides()->mutable_flux_sink()); + if (_selectedFluxFormat->source) + _selectedFluxFormat->source(_selectedFluxFilename, + globalConfig().overrides()->mutable_flux_source()); } break; } diff --git a/src/gui/layout.h b/src/gui/layout.h index a7f189fe..e6e44682 100644 --- a/src/gui/layout.h +++ b/src/gui/layout.h @@ -51,28 +51,45 @@ /////////////////////////////////////////////////////////////////////////////// class MainWindowGen : public wxFrame { - private: +private: +protected: + wxMenuBar* menuBar; + wxMenu* m_menu1; + wxMenu* m_menu2; + wxSimplebook* dataNotebook; - protected: - wxMenuBar* menuBar; - wxMenu* m_menu1; - wxMenu* m_menu2; - wxSimplebook* dataNotebook; + // Virtual event handlers, override them in your derived class + virtual void OnClose(wxCloseEvent& event) + { + event.Skip(); + } + virtual void OnAboutMenuItem(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnExit(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnShowLogWindow(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnShowConfigWindow(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnAboutMenuItem( wxCommandEvent& event ) { event.Skip(); } - virtual void OnExit( wxCommandEvent& event ) { event.Skip(); } - virtual void OnShowLogWindow( wxCommandEvent& event ) { event.Skip(); } - virtual void OnShowConfigWindow( wxCommandEvent& event ) { event.Skip(); } - - - public: - - MainWindowGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("FluxEngine"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 616,607 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL ); - - ~MainWindowGen(); +public: + MainWindowGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxT("FluxEngine"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(616, 607), + long style = wxDEFAULT_FRAME_STYLE | wxRESIZE_BORDER | + wxFULL_REPAINT_ON_RESIZE | wxTAB_TRAVERSAL); + ~MainWindowGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -80,24 +97,32 @@ class MainWindowGen : public wxFrame /////////////////////////////////////////////////////////////////////////////// class TextViewerWindowGen : public wxDialog { - private: +private: +protected: + wxTextCtrl* textControl; + wxStdDialogButtonSizer* m_sdbSizer2; + wxButton* m_sdbSizer2OK; - protected: - wxTextCtrl* textControl; - wxStdDialogButtonSizer* m_sdbSizer2; - wxButton* m_sdbSizer2OK; + // Virtual event handlers, override them in your derived class + virtual void OnClose(wxCloseEvent& event) + { + event.Skip(); + } + virtual void OnClose(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnClose( wxCommandEvent& event ) { event.Skip(); } - - - public: - - TextViewerWindowGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 208,143 ), long style = wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER ); - - ~TextViewerWindowGen(); +public: + TextViewerWindowGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(208, 143), + long style = wxCLOSE_BOX | wxDEFAULT_DIALOG_STYLE | wxMAXIMIZE_BOX | + wxMINIMIZE_BOX | wxRESIZE_BORDER); + ~TextViewerWindowGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -105,25 +130,33 @@ class TextViewerWindowGen : public wxDialog /////////////////////////////////////////////////////////////////////////////// class FluxViewerWindowGen : public wxDialog { - private: +private: +protected: + FluxViewerControl* fluxviewer; + wxScrollBar* scrollbar; + wxStdDialogButtonSizer* m_sdbSizer2; + wxButton* m_sdbSizer2OK; - protected: - FluxViewerControl* fluxviewer; - wxScrollBar* scrollbar; - wxStdDialogButtonSizer* m_sdbSizer2; - wxButton* m_sdbSizer2OK; + // Virtual event handlers, override them in your derived class + virtual void OnClose(wxCloseEvent& event) + { + event.Skip(); + } + virtual void OnClose(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnClose( wxCommandEvent& event ) { event.Skip(); } - - - public: - - FluxViewerWindowGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 400,200 ), long style = wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER ); - - ~FluxViewerWindowGen(); +public: + FluxViewerWindowGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(400, 200), + long style = wxCLOSE_BOX | wxDEFAULT_DIALOG_STYLE | wxMAXIMIZE_BOX | + wxMINIMIZE_BOX | wxRESIZE_BORDER); + ~FluxViewerWindowGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -131,26 +164,37 @@ class FluxViewerWindowGen : public wxDialog /////////////////////////////////////////////////////////////////////////////// class TextEditorWindowGen : public wxDialog { - private: +private: +protected: + wxTextCtrl* textControl; + wxStdDialogButtonSizer* m_sdbSizer2; + wxButton* m_sdbSizer2Save; + wxButton* m_sdbSizer2Cancel; - protected: - wxTextCtrl* textControl; - wxStdDialogButtonSizer* m_sdbSizer2; - wxButton* m_sdbSizer2Save; - wxButton* m_sdbSizer2Cancel; + // Virtual event handlers, override them in your derived class + virtual void OnClose(wxCloseEvent& event) + { + event.Skip(); + } + virtual void OnCancel(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnSave(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSave( wxCommandEvent& event ) { event.Skip(); } - - - public: - - TextEditorWindowGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER ); - - ~TextEditorWindowGen(); +public: + TextEditorWindowGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxCLOSE_BOX | wxDEFAULT_DIALOG_STYLE | wxMAXIMIZE_BOX | + wxMINIMIZE_BOX | wxRESIZE_BORDER); + ~TextEditorWindowGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -158,27 +202,32 @@ class TextEditorWindowGen : public wxDialog /////////////////////////////////////////////////////////////////////////////// class FileViewerWindowGen : public wxDialog { - private: +private: +protected: + wxNotebook* m_notebook1; + wxPanel* m_panel8; + wxTextCtrl* textControl; + wxPanel* m_panel7; + wxTextCtrl* hexControl; + wxStdDialogButtonSizer* m_sdbSizer2; + wxButton* m_sdbSizer2OK; - protected: - wxNotebook* m_notebook1; - wxPanel* m_panel8; - wxTextCtrl* textControl; - wxPanel* m_panel7; - wxTextCtrl* hexControl; - wxStdDialogButtonSizer* m_sdbSizer2; - wxButton* m_sdbSizer2OK; + // Virtual event handlers, override them in your derived class + virtual void OnClose(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnClose( wxCommandEvent& event ) { event.Skip(); } - - - public: - - FileViewerWindowGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 408,269 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER ); - - ~FileViewerWindowGen(); +public: + FileViewerWindowGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(408, 269), + long style = wxDEFAULT_DIALOG_STYLE | wxMAXIMIZE_BOX | wxMINIMIZE_BOX | + wxRESIZE_BORDER); + ~FileViewerWindowGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -186,23 +235,26 @@ class FileViewerWindowGen : public wxDialog /////////////////////////////////////////////////////////////////////////////// class GetfileDialog : public wxDialog { - private: +private: +protected: + wxStaticText* m_staticText7; + wxStaticText* m_staticText9; - protected: - wxStaticText* m_staticText7; - wxStaticText* m_staticText9; +public: + wxTextCtrl* filenameText; + wxFilePickerCtrl* targetFilePicker; + wxStdDialogButtonSizer* buttons_; + wxButton* buttons_OK; + wxButton* buttons_Cancel; - public: - wxTextCtrl* filenameText; - wxFilePickerCtrl* targetFilePicker; - wxStdDialogButtonSizer* buttons_; - wxButton* buttons_OK; - wxButton* buttons_Cancel; - - GetfileDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Copy file off disk"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - - ~GetfileDialog(); + GetfileDialog(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxT("Copy file off disk"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); + ~GetfileDialog(); }; /////////////////////////////////////////////////////////////////////////////// @@ -210,24 +262,27 @@ class GetfileDialog : public wxDialog /////////////////////////////////////////////////////////////////////////////// class FileConflictDialog : public wxDialog { - private: +private: +protected: + wxStaticText* m_staticText91; + wxStaticText* m_staticText7; + wxStaticText* m_staticText9; - protected: - wxStaticText* m_staticText91; - wxStaticText* m_staticText7; - wxStaticText* m_staticText9; +public: + wxTextCtrl* newNameText; + wxTextCtrl* oldNameText; + wxStdDialogButtonSizer* buttons_; + wxButton* buttons_OK; + wxButton* buttons_Cancel; - public: - wxTextCtrl* newNameText; - wxTextCtrl* oldNameText; - wxStdDialogButtonSizer* buttons_; - wxButton* buttons_OK; - wxButton* buttons_Cancel; - - FileConflictDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Filename conflict"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - - ~FileConflictDialog(); + FileConflictDialog(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxT("Filename conflict"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); + ~FileConflictDialog(); }; /////////////////////////////////////////////////////////////////////////////// @@ -235,24 +290,27 @@ class FileConflictDialog : public wxDialog /////////////////////////////////////////////////////////////////////////////// class FileRenameDialog : public wxDialog { - private: +private: +protected: + wxStaticText* m_staticText91; + wxStaticText* m_staticText7; + wxStaticText* m_staticText9; - protected: - wxStaticText* m_staticText91; - wxStaticText* m_staticText7; - wxStaticText* m_staticText9; +public: + wxTextCtrl* newNameText; + wxTextCtrl* oldNameText; + wxStdDialogButtonSizer* buttons_; + wxButton* buttons_OK; + wxButton* buttons_Cancel; - public: - wxTextCtrl* newNameText; - wxTextCtrl* oldNameText; - wxStdDialogButtonSizer* buttons_; - wxButton* buttons_OK; - wxButton* buttons_Cancel; - - FileRenameDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Rename or move file"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - - ~FileRenameDialog(); + FileRenameDialog(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxT("Rename or move file"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); + ~FileRenameDialog(); }; /////////////////////////////////////////////////////////////////////////////// @@ -260,22 +318,25 @@ class FileRenameDialog : public wxDialog /////////////////////////////////////////////////////////////////////////////// class CreateDirectoryDialog : public wxDialog { - private: +private: +protected: + wxStaticText* m_staticText91; + wxStaticText* m_staticText9; - protected: - wxStaticText* m_staticText91; - wxStaticText* m_staticText9; +public: + wxTextCtrl* newNameText; + wxStdDialogButtonSizer* buttons_; + wxButton* buttons_OK; + wxButton* buttons_Cancel; - public: - wxTextCtrl* newNameText; - wxStdDialogButtonSizer* buttons_; - wxButton* buttons_OK; - wxButton* buttons_Cancel; - - CreateDirectoryDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Create new directory"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - - ~CreateDirectoryDialog(); + CreateDirectoryDialog(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxT("Create new directory"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); + ~CreateDirectoryDialog(); }; /////////////////////////////////////////////////////////////////////////////// @@ -283,23 +344,26 @@ class CreateDirectoryDialog : public wxDialog /////////////////////////////////////////////////////////////////////////////// class FormatDialog : public wxDialog { - private: +private: +protected: + wxStaticText* m_staticText91; + wxStaticText* m_staticText7; - protected: - wxStaticText* m_staticText91; - wxStaticText* m_staticText7; +public: + wxTextCtrl* volumeNameText; + wxCheckBox* quickFormatCheckBox; + wxStdDialogButtonSizer* buttons_; + wxButton* buttons_OK; + wxButton* buttons_Cancel; - public: - wxTextCtrl* volumeNameText; - wxCheckBox* quickFormatCheckBox; - wxStdDialogButtonSizer* buttons_; - wxButton* buttons_OK; - wxButton* buttons_Cancel; - - FormatDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Format disk"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - - ~FormatDialog(); + FormatDialog(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxT("Format disk"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); + ~FormatDialog(); }; /////////////////////////////////////////////////////////////////////////////// @@ -307,37 +371,59 @@ class FormatDialog : public wxDialog /////////////////////////////////////////////////////////////////////////////// class IdlePanelGen : public wxPanel { - private: +private: +protected: + wxStaticBitmap* applicationBitmap; + wxPanel* sourceIconPanel; + wxSimplebook* sourceBook; + wxChoice* formatChoice; + wxButton* customConfigurationButton; + wxPanel* formatOptionsContainer; + wxButton* readButton; + wxButton* writeButton; + wxButton* browseButton; + wxButton* formatButton; + wxButton* exploreButton; - protected: - wxStaticBitmap* applicationBitmap; - wxPanel* sourceIconPanel; - wxSimplebook* sourceBook; - wxChoice* formatChoice; - wxButton* customConfigurationButton; - wxPanel* formatOptionsContainer; - wxButton* readButton; - wxButton* writeButton; - wxButton* browseButton; - wxButton* formatButton; - wxButton* exploreButton; + // Virtual event handlers, override them in your derived class + virtual void OnControlsChanged(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnCustomConfigurationButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnReadButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnWriteButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowseButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnFormatButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnExploreButton(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnControlsChanged( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCustomConfigurationButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnReadButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnWriteButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowseButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnFormatButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnExploreButton( wxCommandEvent& event ) { event.Skip(); } - - - public: - - IdlePanelGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); - - ~IdlePanelGen(); +public: + IdlePanelGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(-1, -1), + long style = wxTAB_TRAVERSAL, + const wxString& name = wxEmptyString); + ~IdlePanelGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -345,30 +431,43 @@ class IdlePanelGen : public wxPanel /////////////////////////////////////////////////////////////////////////////// class ImagerPanelGen : public wxPanel { - private: +private: +protected: + wxAuiToolBar* imagerToolbar; + wxAuiToolBarItem* imagerBackTool; + VisualisationControl* visualiser; + wxButton* imagerSaveImageButton; + wxButton* imagerSaveFluxButton; + HistogramViewer* histogram; + wxButton* imagerGoAgainButton; - protected: - wxAuiToolBar* imagerToolbar; - wxAuiToolBarItem* imagerBackTool; - VisualisationControl* visualiser; - wxButton* imagerSaveImageButton; - wxButton* imagerSaveFluxButton; - HistogramViewer* histogram; - wxButton* imagerGoAgainButton; + // Virtual event handlers, override them in your derived class + virtual void OnBackButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnSaveImageButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnSaveFluxButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnImagerGoAgainButton(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnBackButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSaveImageButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSaveFluxButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnImagerGoAgainButton( wxCommandEvent& event ) { event.Skip(); } - - - public: - - ImagerPanelGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); - - ~ImagerPanelGen(); +public: + ImagerPanelGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(500, 300), + long style = wxTAB_TRAVERSAL, + const wxString& name = wxEmptyString); + ~ImagerPanelGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -376,69 +475,121 @@ class ImagerPanelGen : public wxPanel /////////////////////////////////////////////////////////////////////////////// class BrowserPanelGen : public wxPanel { - private: +private: +protected: + wxAuiToolBar* browserToolbar; + wxAuiToolBarItem* browserBackTool; + wxAuiToolBarItem* browserInfoTool; + wxAuiToolBarItem* browserViewTool; + wxAuiToolBarItem* browserSaveTool; + wxAuiToolBarItem* browserMoreMenuButton; + wxMenu* browserMoreMenu; + wxMenuItem* browserAddMenuItem; + wxMenuItem* browserNewDirectoryMenuItem; + wxMenuItem* browserRenameMenuItem; + wxMenuItem* browserDeleteMenuItem; + wxAuiToolBarItem* browserFormatTool; + wxDataViewCtrl* browserTree; + wxDataViewColumn* m_dataViewColumn1; + wxDataViewColumn* m_dataViewColumn2; + wxDataViewColumn* m_dataViewColumn3; + wxGauge* diskSpaceGauge; + wxButton* browserDiscardButton; + wxButton* browserCommitButton; + wxStaticText* m_staticText12; - protected: - wxAuiToolBar* browserToolbar; - wxAuiToolBarItem* browserBackTool; - wxAuiToolBarItem* browserInfoTool; - wxAuiToolBarItem* browserViewTool; - wxAuiToolBarItem* browserSaveTool; - wxAuiToolBarItem* browserMoreMenuButton; - wxMenu* browserMoreMenu; - wxMenuItem* browserAddMenuItem; - wxMenuItem* browserNewDirectoryMenuItem; - wxMenuItem* browserRenameMenuItem; - wxMenuItem* browserDeleteMenuItem; - wxAuiToolBarItem* browserFormatTool; - wxDataViewCtrl* browserTree; - wxDataViewColumn* m_dataViewColumn1; - wxDataViewColumn* m_dataViewColumn2; - wxDataViewColumn* m_dataViewColumn3; - wxGauge* diskSpaceGauge; - wxButton* browserDiscardButton; - wxButton* browserCommitButton; - wxStaticText* m_staticText12; + // Virtual event handlers, override them in your derived class + virtual void OnBackButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserInfoButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserViewButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserSaveButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserAddMenuItem(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserNewDirectoryMenuItem(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserRenameMenuItem(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserDeleteMenuItem(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserFormatButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserBeginDrag(wxDataViewEvent& event) + { + event.Skip(); + } + virtual void OnBrowserDrop(wxDataViewEvent& event) + { + event.Skip(); + } + virtual void OnBrowserDropPossible(wxDataViewEvent& event) + { + event.Skip(); + } + virtual void OnBrowserDirectoryExpanding(wxDataViewEvent& event) + { + event.Skip(); + } + virtual void OnBrowserFilenameChanged(wxDataViewEvent& event) + { + event.Skip(); + } + virtual void OnBrowserSelectionChanged(wxDataViewEvent& event) + { + event.Skip(); + } + virtual void OnBrowserDiscardButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnBrowserCommitButton(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnBackButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserInfoButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserViewButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserSaveButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserAddMenuItem( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserNewDirectoryMenuItem( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserRenameMenuItem( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserDeleteMenuItem( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserFormatButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserBeginDrag( wxDataViewEvent& event ) { event.Skip(); } - virtual void OnBrowserDrop( wxDataViewEvent& event ) { event.Skip(); } - virtual void OnBrowserDropPossible( wxDataViewEvent& event ) { event.Skip(); } - virtual void OnBrowserDirectoryExpanding( wxDataViewEvent& event ) { event.Skip(); } - virtual void OnBrowserFilenameChanged( wxDataViewEvent& event ) { event.Skip(); } - virtual void OnBrowserSelectionChanged( wxDataViewEvent& event ) { event.Skip(); } - virtual void OnBrowserDiscardButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnBrowserCommitButton( wxCommandEvent& event ) { event.Skip(); } +public: + BrowserPanelGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(500, 300), + long style = wxTAB_TRAVERSAL, + const wxString& name = wxEmptyString); + ~BrowserPanelGen(); - public: - - BrowserPanelGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); - - ~BrowserPanelGen(); - - void browserMoreMenuButtonOnDropDownMenu( wxAuiToolBarEvent &event ) - { - if ( event.IsDropDownClicked() ) - { - browserToolbar->SetToolSticky( event.GetId(), true ); - wxRect rect = browserToolbar->GetToolRect( event.GetId() ); - wxPoint pt = browserToolbar->ClientToScreen( rect.GetBottomLeft() ); - pt = ScreenToClient( pt ); - browserToolbar->PopupMenu( browserMoreMenu, pt ); - browserToolbar->SetToolSticky( event.GetId(), false ); - } - } - + void browserMoreMenuButtonOnDropDownMenu(wxAuiToolBarEvent& event) + { + if (event.IsDropDownClicked()) + { + browserToolbar->SetToolSticky(event.GetId(), true); + wxRect rect = browserToolbar->GetToolRect(event.GetId()); + wxPoint pt = browserToolbar->ClientToScreen(rect.GetBottomLeft()); + pt = ScreenToClient(pt); + browserToolbar->PopupMenu(browserMoreMenu, pt); + browserToolbar->SetToolSticky(event.GetId(), false); + } + } }; /////////////////////////////////////////////////////////////////////////////// @@ -446,45 +597,64 @@ class BrowserPanelGen : public wxPanel /////////////////////////////////////////////////////////////////////////////// class ExplorerPanelGen : public wxPanel { - private: +private: +protected: + wxAuiToolBar* explorerToolbar; + wxAuiToolBarItem* explorerBackTool; + wxAuiToolBarItem* explorerRefreshTool; + wxStaticText* m_staticText22; + wxSpinCtrl* explorerTrackSpinCtrl; + wxStaticText* m_staticText26; + wxSpinCtrl* explorerSideSpinCtrl; + wxStaticText* m_staticText231; + wxSpinCtrlDouble* explorerStartTimeSpinCtrl; + wxStaticText* m_staticText24; + wxButton* guessButton; + wxSpinCtrlDouble* explorerClockSpinCtrl; + wxStaticText* m_staticText25; + wxSpinCtrl* explorerBitOffsetSpinCtrl; + wxStaticText* m_staticText27; + wxChoice* explorerDecodeChoice; + wxStaticText* m_staticText241; + wxCheckBox* explorerReverseCheckBox; + HistogramViewer* histogram; + wxTextCtrl* explorerText; - protected: - wxAuiToolBar* explorerToolbar; - wxAuiToolBarItem* explorerBackTool; - wxAuiToolBarItem* explorerRefreshTool; - wxStaticText* m_staticText22; - wxSpinCtrl* explorerTrackSpinCtrl; - wxStaticText* m_staticText26; - wxSpinCtrl* explorerSideSpinCtrl; - wxStaticText* m_staticText231; - wxSpinCtrlDouble* explorerStartTimeSpinCtrl; - wxStaticText* m_staticText24; - wxButton* guessButton; - wxSpinCtrlDouble* explorerClockSpinCtrl; - wxStaticText* m_staticText25; - wxSpinCtrl* explorerBitOffsetSpinCtrl; - wxStaticText* m_staticText27; - wxChoice* explorerDecodeChoice; - wxStaticText* m_staticText241; - wxCheckBox* explorerReverseCheckBox; - HistogramViewer* histogram; - wxTextCtrl* explorerText; + // Virtual event handlers, override them in your derived class + virtual void OnBackButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnExplorerRefreshButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnExplorerSettingChange(wxSpinEvent& event) + { + event.Skip(); + } + virtual void OnExplorerSettingChange(wxSpinDoubleEvent& event) + { + event.Skip(); + } + virtual void OnGuessClockButton(wxCommandEvent& event) + { + event.Skip(); + } + virtual void OnExplorerSettingChange(wxCommandEvent& event) + { + event.Skip(); + } - // Virtual event handlers, override them in your derived class - virtual void OnBackButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnExplorerRefreshButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnExplorerSettingChange( wxSpinEvent& event ) { event.Skip(); } - virtual void OnExplorerSettingChange( wxSpinDoubleEvent& event ) { event.Skip(); } - virtual void OnGuessClockButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnExplorerSettingChange( wxCommandEvent& event ) { event.Skip(); } - - - public: - - ExplorerPanelGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 620,426 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); - - ~ExplorerPanelGen(); +public: + ExplorerPanelGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(620, 426), + long style = wxTAB_TRAVERSAL, + const wxString& name = wxEmptyString); + ~ExplorerPanelGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -492,21 +662,24 @@ class ExplorerPanelGen : public wxPanel /////////////////////////////////////////////////////////////////////////////// class HardwareSourcePanelGen : public wxPanel { - private: +private: +protected: + wxStaticText* m_staticText30; + wxStaticText* m_staticText29; - protected: - wxStaticText* m_staticText30; - wxStaticText* m_staticText29; +public: + wxStaticText* label; + wxCheckBox* highDensityToggle; + wxChoice* driveTypeChoice; - public: - wxStaticText* label; - wxCheckBox* highDensityToggle; - wxChoice* driveTypeChoice; - - HardwareSourcePanelGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); - - ~HardwareSourcePanelGen(); + HardwareSourcePanelGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(-1, -1), + long style = wxTAB_TRAVERSAL, + const wxString& name = wxEmptyString); + ~HardwareSourcePanelGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -514,21 +687,24 @@ class HardwareSourcePanelGen : public wxPanel /////////////////////////////////////////////////////////////////////////////// class FluxfileSourcePanelGen : public wxPanel { - private: +private: +protected: + wxStaticText* m_staticText28; + wxStaticText* m_staticText27; + wxStaticText* m_staticText281; - protected: - wxStaticText* m_staticText28; - wxStaticText* m_staticText27; - wxStaticText* m_staticText281; +public: + wxFilePickerCtrl* fluxImagePicker; + wxChoice* fluxImageFormat; - public: - wxFilePickerCtrl* fluxImagePicker; - wxChoice* fluxImageFormat; - - FluxfileSourcePanelGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); - - ~FluxfileSourcePanelGen(); + FluxfileSourcePanelGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(-1, -1), + long style = wxTAB_TRAVERSAL, + const wxString& name = wxEmptyString); + ~FluxfileSourcePanelGen(); }; /////////////////////////////////////////////////////////////////////////////// @@ -536,18 +712,20 @@ class FluxfileSourcePanelGen : public wxPanel /////////////////////////////////////////////////////////////////////////////// class ImagefileSourcePanelGen : public wxPanel { - private: +private: +protected: + wxStaticText* m_staticText29; + wxStaticText* m_staticText28; - protected: - wxStaticText* m_staticText29; - wxStaticText* m_staticText28; +public: + wxFilePickerCtrl* diskImagePicker; - public: - wxFilePickerCtrl* diskImagePicker; - - ImagefileSourcePanelGen( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); - - ~ImagefileSourcePanelGen(); + ImagefileSourcePanelGen(wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxSize(-1, -1), + long style = wxTAB_TRAVERSAL, + const wxString& name = wxEmptyString); + ~ImagefileSourcePanelGen(); }; - diff --git a/src/gui/main.cc b/src/gui/main.cc index 9e4425ac..f9ba7525 100644 --- a/src/gui/main.cc +++ b/src/gui/main.cc @@ -53,19 +53,19 @@ private: bool FluxEngineApp::OnInit() { - try - { - wxImage::AddHandler(new wxPNGHandler()); - Bind(EXEC_EVENT_TYPE, &FluxEngineApp::OnExec, this); - _mainWindow = CreateMainWindow(); - _mainWindow->Show(true); - return true; - } - catch (const ErrorException* e) - { - fmt::print(stderr, "Exception on startup: {}\n", e->message); - exit(1); - } + try + { + wxImage::AddHandler(new wxPNGHandler()); + Bind(EXEC_EVENT_TYPE, &FluxEngineApp::OnExec, this); + _mainWindow = CreateMainWindow(); + _mainWindow->Show(true); + return true; + } + catch (const ErrorException* e) + { + fmt::print(stderr, "Exception on startup: {}\n", e->message); + exit(1); + } } wxThread::ExitCode FluxEngineApp::Entry() diff --git a/tests/configs.cc b/tests/configs.cc index 361de8b1..a5d4c658 100644 --- a/tests/configs.cc +++ b/tests/configs.cc @@ -83,8 +83,8 @@ static void validateConfigWithOptions(std::string baseConfigName, { /* All configs must have a tpi. */ - if (!config.layout().has_tpi()) - configError("{}{}: no layout.tpi set", baseConfigName, options); + if (!config.layout().has_format_type()) + configError("{}{}: no layout.format_type set", baseConfigName, options); } static void validateToplevelConfig(std::string name) diff --git a/tests/cpmfs.cc b/tests/cpmfs.cc index 84b9efb6..48ad5928 100644 --- a/tests/cpmfs.cc +++ b/tests/cpmfs.cc @@ -119,11 +119,11 @@ int main(void) { const std::string text = R"M( drive { - tpi: 96 + drive_type: DRIVETYPE_80TRACK } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 10 sides: 1 layoutdata { diff --git a/tests/layout.cc b/tests/layout.cc index 086a2c03..eef179ba 100644 --- a/tests/layout.cc +++ b/tests/layout.cc @@ -22,11 +22,11 @@ static void test_physical_sectors() globalConfig().clear(); globalConfig().readBaseConfig(R"M( drive { - tpi: 96 + drive_type: DRIVETYPE_80TRACK } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 78 sides: 2 layoutdata { @@ -55,11 +55,11 @@ static void test_logical_sectors() globalConfig().clear(); globalConfig().readBaseConfig(R"M( drive { - tpi: 96 + drive_type: DRIVETYPE_80TRACK } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 78 sides: 2 layoutdata { @@ -94,11 +94,11 @@ static void test_both_sectors() globalConfig().clear(); globalConfig().readBaseConfig(R"M( drive { - tpi: 96 + drive_type: DRIVETYPE_80TRACK } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 78 sides: 2 layoutdata { @@ -133,11 +133,11 @@ static void test_skew() globalConfig().clear(); globalConfig().readBaseConfig(R"M( drive { - tpi: 96 + drive_type: DRIVETYPE_80TRACK } layout { - tpi: 96 + format_type: FORMATTYPE_80TRACK tracks: 78 sides: 2 layoutdata { diff --git a/tests/options.cc b/tests/options.cc index 12837966..dd8eb13c 100644 --- a/tests/options.cc +++ b/tests/options.cc @@ -23,15 +23,15 @@ static void test_option_validity() globalConfig().clear(); globalConfig().readBaseConfig(R"M( drive { - tpi: 96 + drive_type: DRIVETYPE_80TRACK } option { name: "option1" prerequisite: { - key: "drive.tpi" - value: "96" + key: "drive.drive_type" + value: "DRIVETYPE_80TRACK" } } @@ -39,8 +39,8 @@ static void test_option_validity() name: "option2" prerequisite: { - key: "drive.tpi" - value: "95" + key: "drive.drive_type" + value: "DRIVETYPE_40TRACK" } } @@ -48,8 +48,8 @@ static void test_option_validity() name: "option3" prerequisite: { - key: "drive.tpi" - value: ["0", "96"] + key: "drive.drive_type" + value: ["DRIVETYPE_UNKNOWN", "DRIVETYPE_80TRACK"] } } )M"); From 2d717af4db5fadb9c19d872e053cb8f40e769bd7 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 30 Oct 2023 23:07:36 +0100 Subject: [PATCH 45/49] The flux and image file pickers can now create new files. --- lib/layout.cc | 2 -- src/gui/layout.cpp | 4 ++-- src/gui/layout.fbp | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/layout.cc b/lib/layout.cc index 9c89ab68..b23e1cea 100644 --- a/lib/layout.cc +++ b/lib/layout.cc @@ -42,8 +42,6 @@ static unsigned getTrackStep() } } - warning( - "don't know the drive and format types; performing 1:1 track mapping"); return 1; } diff --git a/src/gui/layout.cpp b/src/gui/layout.cpp index e8d495d9..93ea55f9 100644 --- a/src/gui/layout.cpp +++ b/src/gui/layout.cpp @@ -1081,7 +1081,7 @@ FluxfileSourcePanelGen::FluxfileSourcePanelGen( wxWindow* parent, wxWindowID id, m_staticText27->Wrap( -1 ); bSizer8->Add( m_staticText27, 0, wxALL, 5 ); - fluxImagePicker = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_FILE_MUST_EXIST|wxFLP_OPEN ); + fluxImagePicker = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_OPEN|wxFLP_USE_TEXTCTRL ); fluxImagePicker->SetToolTip( wxT("Path to a .flux, .scp or other flux file.") ); bSizer8->Add( fluxImagePicker, 0, wxALL|wxEXPAND, 5 ); @@ -1118,7 +1118,7 @@ ImagefileSourcePanelGen::ImagefileSourcePanelGen( wxWindow* parent, wxWindowID i m_staticText28->Wrap( -1 ); bSizer9->Add( m_staticText28, 0, wxALL, 5 ); - diskImagePicker = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_FILE_MUST_EXIST|wxFLP_OPEN ); + diskImagePicker = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, wxT("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_OPEN|wxFLP_USE_TEXTCTRL ); diskImagePicker->SetToolTip( wxT("The path to the disk image.") ); bSizer9->Add( diskImagePicker, 0, wxALL|wxEXPAND, 5 ); diff --git a/src/gui/layout.fbp b/src/gui/layout.fbp index a176a7d0..6836a7eb 100644 --- a/src/gui/layout.fbp +++ b/src/gui/layout.fbp @@ -6592,7 +6592,7 @@ 0 1 - 1 + 0 0 0 @@ -6615,7 +6615,7 @@ Resizable 1 - wxFLP_FILE_MUST_EXIST|wxFLP_OPEN + wxFLP_OPEN|wxFLP_USE_TEXTCTRL ; ; forward_declare 0 Path to a .flux, .scp or other flux file. @@ -6963,7 +6963,7 @@ Resizable 1 - wxFLP_FILE_MUST_EXIST|wxFLP_OPEN + wxFLP_OPEN|wxFLP_USE_TEXTCTRL ; ; forward_declare 0 The path to the disk image. From 3bfa45a80cacdf6367d9bd626b8d97c5cb8ebf3c Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 30 Oct 2023 23:11:20 +0100 Subject: [PATCH 46/49] Remember to build with optimisation on. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7aaebe78..4bc653c8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CC = gcc CXX = g++ -std=c++17 -CFLAGS = -g -O0 +CFLAGS = -g -O3 LDFLAGS = OBJ = .obj From 3e47d66644bfa37b89e175cf58cb43c87b20ca49 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 30 Oct 2023 23:30:18 +0100 Subject: [PATCH 47/49] Put back the standard binaries, tests, install, install-bin makefile targets. --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makefile b/Makefile index 4bc653c8..bb750ca8 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ CFLAGS = -g -O3 LDFLAGS = OBJ = .obj +DESTDIR ?= +PREFIX ?= /usr/local +BINDIR ?= $(PREFIX)/bin # Special Windows settings. @@ -36,10 +39,27 @@ endif .PHONY: all all: +all README.md + +.PHONY: binaries tests +binaries: all +tests: all README.md: $(OBJ)/scripts+mkdocindex/scripts+mkdocindex$(EXT) @echo MKDOC $@ @csplit -s -f$(OBJ)/README. README.md '//' '%%' @(cat $(OBJ)/README.00 && $< && cat $(OBJ)/README.01) > README.md +.PHONY: tests + +.PHONY: install install-bin +install:: all install-bin + +install-bin: + @echo "INSTALL" + $(hide) install -v "$(OBJ)/src+fluxengine/src+fluxengine" "$(DESTDIR)$(BINDIR)/fluxengine" + $(hide) install -v "$(OBJ)/src/gui+gui/gui+gui" "$(DESTDIR)$(BINDIR)/fluxengine-gui" + $(hide) install -v "$(OBJ)/tools+brother120tool/tools+brother120tool" "$(DESTDIR)$(BINDIR)/brother120tool" + $(hide) install -v "$(OBJ)/tools+brother240tool/tools+brother240tool" "$(DESTDIR)$(BINDIR)/brother240tool" + $(hide) install -v "$(OBJ)/tools+upgrade-flux-file/tools+upgrade-flux-file" "$(DESTDIR)$(BINDIR)/upgrade-flux-file" + include build/ab.mk From a5484716525f26f9b14224971f52988d98ae013c Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 30 Oct 2023 23:35:27 +0100 Subject: [PATCH 48/49] Add missing files. --- .hgignore | 1 + src/gui/drivetypes/40track.textpb | 6 ++++++ src/gui/drivetypes/80track.textpb | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 src/gui/drivetypes/40track.textpb create mode 100644 src/gui/drivetypes/80track.textpb diff --git a/.hgignore b/.hgignore index 08435644..a377f988 100644 --- a/.hgignore +++ b/.hgignore @@ -1,4 +1,5 @@ .obj +.git streams .*\.flux .*\.img diff --git a/src/gui/drivetypes/40track.textpb b/src/gui/drivetypes/40track.textpb new file mode 100644 index 00000000..98280421 --- /dev/null +++ b/src/gui/drivetypes/40track.textpb @@ -0,0 +1,6 @@ +comment: '8", 5.25" or 3.5" 40 track' + +drive { + drive_type: DRIVETYPE_40TRACK +} + diff --git a/src/gui/drivetypes/80track.textpb b/src/gui/drivetypes/80track.textpb new file mode 100644 index 00000000..9c777ce0 --- /dev/null +++ b/src/gui/drivetypes/80track.textpb @@ -0,0 +1,5 @@ +comment: '8", 5.25" or 3.5" 80 track' + +drive { + drive_type: DRIVETYPE_80TRACK +} From 5dc60db7b657ce90b619e76222999b6d00c1856d Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 31 Oct 2023 00:48:50 +0100 Subject: [PATCH 49/49] When installing files, remember to create the directories. --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index bb750ca8..db6d782c 100644 --- a/Makefile +++ b/Makefile @@ -56,10 +56,10 @@ install:: all install-bin install-bin: @echo "INSTALL" - $(hide) install -v "$(OBJ)/src+fluxengine/src+fluxengine" "$(DESTDIR)$(BINDIR)/fluxengine" - $(hide) install -v "$(OBJ)/src/gui+gui/gui+gui" "$(DESTDIR)$(BINDIR)/fluxengine-gui" - $(hide) install -v "$(OBJ)/tools+brother120tool/tools+brother120tool" "$(DESTDIR)$(BINDIR)/brother120tool" - $(hide) install -v "$(OBJ)/tools+brother240tool/tools+brother240tool" "$(DESTDIR)$(BINDIR)/brother240tool" - $(hide) install -v "$(OBJ)/tools+upgrade-flux-file/tools+upgrade-flux-file" "$(DESTDIR)$(BINDIR)/upgrade-flux-file" + $(hide) install -D -v "$(OBJ)/src+fluxengine/src+fluxengine" "$(DESTDIR)$(BINDIR)/fluxengine" + $(hide) install -D -v "$(OBJ)/src/gui+gui/gui+gui" "$(DESTDIR)$(BINDIR)/fluxengine-gui" + $(hide) install -D -v "$(OBJ)/tools+brother120tool/tools+brother120tool" "$(DESTDIR)$(BINDIR)/brother120tool" + $(hide) install -D -v "$(OBJ)/tools+brother240tool/tools+brother240tool" "$(DESTDIR)$(BINDIR)/brother240tool" + $(hide) install -D -v "$(OBJ)/tools+upgrade-flux-file/tools+upgrade-flux-file" "$(DESTDIR)$(BINDIR)/upgrade-flux-file" include build/ab.mk