diff --git a/Makefile b/Makefile index b26cf85..ed13107 100644 --- a/Makefile +++ b/Makefile @@ -12,13 +12,14 @@ # third-party tools required to build # https://sourceforge.net/projects/acme-crossass/ ACME=acme -# https://sourceforge.net/projects/applecommander/ -AC=bin/AppleCommander.jar +# https://www.brutaldeluxe.fr/products/crossdevtools/cadius/ +# https://github.com/mach-kernel/cadius +CADIUS=cadius # https://bitbucket.org/magli143/exomizer/wiki/Home # requires Exomizer 3.0 or later EXOMIZER=exomizer raw -P0 -q -BUILDDISK=build/passport.po +BUILDDISK=build/passport asm: mkdir -p build @@ -30,13 +31,16 @@ asm: printf "\x20\x00" | cat - build/t00only.tmp > build/t00only.pak cd src && $(ACME) -r ../build/passport.lst passport.a 2> ../build/relbase.log cd src && $(ACME) -DRELBASE=`cat ../build/relbase.log | cut -d"=" -f2 | cut -d"(" -f2 | cut -d")" -f1` passport.a - cp res/work.po $(BUILDDISK) - java -jar $(AC) -p $(BUILDDISK) "PASSPORT.SYSTEM" sys 0x2000 < build/PASSPORT.SYSTEM + cp res/work.po "$(BUILDDISK)".po + cp res/_FileInformation.txt build/ + $(CADIUS) ADDFILE "${BUILDDISK}".po "/PASSPORT/" "build/PASSPORT.SYSTEM" + bin/po2do.py build/ build/ + rm "$(BUILDDISK)".po clean: rm -rf build/ mount: - osascript bin/V2Make.scpt "`pwd`" $(BUILDDISK) + open "$(BUILDDISK)".dsk all: clean asm mount diff --git a/bin/AppleCommander.jar b/bin/AppleCommander.jar deleted file mode 100644 index f74e7cb..0000000 Binary files a/bin/AppleCommander.jar and /dev/null differ diff --git a/bin/V2Make.scpt b/bin/V2Make.scpt deleted file mode 100644 index 5ddb4e8..0000000 Binary files a/bin/V2Make.scpt and /dev/null differ diff --git a/bin/po2do.py b/bin/po2do.py new file mode 100755 index 0000000..3e06b19 --- /dev/null +++ b/bin/po2do.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +import sys +import glob +import os.path + +kMap = {0x00: 0x00, + 0x07: 0x08, + 0x0E: 0x01, + 0x06: 0x09, + 0x0D: 0x02, + 0x05: 0x0A, + 0x0C: 0x03, + 0x04: 0x0B, + 0x0B: 0x04, + 0x03: 0x0C, + 0x0A: 0x05, + 0x02: 0x0D, + 0x09: 0x06, + 0x01: 0x0E, + 0x08: 0x07, + 0x0F: 0x0F} + +indir, outdir = sys.argv[1:3] + +for infile in glob.glob(os.path.join(indir, "*.po")): + outfile = os.path.join(outdir, os.path.splitext(os.path.basename(infile))[0] + ".dsk") + with open(infile, 'rb') as f, open(outfile, 'wb') as g: + for track in range(0, 0x23): + sectors = [bytes(256)] * 0x10 + for dos_sector in range(0, 0x10): + sectors[kMap[dos_sector]] = f.read(256) + g.write(b"".join(sectors))