migrate Makefile to Cadius, add po2do to build DOS-ordered .dsk file by default

This commit is contained in:
4am 2019-05-02 21:15:04 -04:00
parent d7324f72d6
commit 374e5b0d95
4 changed files with 43 additions and 6 deletions

View File

@ -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

Binary file not shown.

Binary file not shown.

33
bin/po2do.py Executable file
View File

@ -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))