build improvements and readme

This commit is contained in:
4am 2022-01-18 13:54:38 -05:00
parent 3aa2e7cf5f
commit ce5940168d
3 changed files with 41 additions and 2 deletions

View File

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

View File

@ -1 +1,5 @@
# million-perfect-letters
# 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)

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