diff --git a/Makefile b/Makefile index 45a8b71..0761aa2 100644 --- a/Makefile +++ b/Makefile @@ -30,12 +30,14 @@ asm: $(CADIUS) ADDFILE "${BUILDDISK}".po "/MILLION/" "res/PREFS" >>build/log $(CADIUS) ADDFILE "${BUILDDISK}".po "/MILLION/" "build/MILLION.SYSTEM" >>build/log for f in res/levels/*; do $(CADIUS) ADDFILE "${BUILDDISK}".po "/MILLION/" "$$f" >>build/log; done + bin/po2do.py build/ build/ + rm "$(BUILDDISK)".po clean: rm -rf build/ mount: - open "$(BUILDDISK)".po + open "$(BUILDDISK)".dsk all: clean asm mount diff --git a/README.md b/README.md index 0c3417e..24411cf 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ -# million-perfect-letters \ No newline at end of file +# Million Perfect Letters +a shifty word game for the Apple II + +[Download latest Million Perfect Letters disk image](https://github.com/a2-4am/million-perfect-letters/releases/download/v1.0/Million.Perfect.Letters.v1.0.dsk) +(version **1.0**, released **2022-01-18**, runs on any 64K Apple II) 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))