From d86103529e108dcc1fe4a5ba7401a806b5b688d5 Mon Sep 17 00:00:00 2001 From: 4am Date: Thu, 11 Apr 2019 21:45:43 -0400 Subject: [PATCH] build DOS-ordered disk image instead, fiddle with drive 2 check and UI wording --- Makefile | 12 +++++++----- bin/po2do.py | 33 +++++++++++++++++++++++++++++++++ src/anti-m.a | 29 +++++++++-------------------- 3 files changed, 49 insertions(+), 25 deletions(-) create mode 100755 bin/po2do.py diff --git a/Makefile b/Makefile index 27faeb7..7a9ff1f 100644 --- a/Makefile +++ b/Makefile @@ -16,22 +16,24 @@ ACME=acme # https://github.com/mach-kernel/cadius CADIUS=cadius -BUILDDISK=build/anti-m.po +BUILDDISK=build/anti-m VOLUME=ANTI.M asm: mkdir -p build $(ACME) -r build/anti-m.lst src/anti-m.a - cp res/work.bin "$(BUILDDISK)" + cp res/work.bin "$(BUILDDISK)".po cp res/_FileInformation.txt build/ >>build/log - $(CADIUS) ADDFILE "$(BUILDDISK)" "/${VOLUME}/" "build/ANTI.M.SYSTEM" >>build/log + $(CADIUS) ADDFILE "$(BUILDDISK)".po "/${VOLUME}/" "build/ANTI.M.SYSTEM" >>build/log $(ACME) -r build/proboot.lst src/proboot.a - bin/changebootloader.py "$(BUILDDISK)" build/proboot + bin/changebootloader.py "$(BUILDDISK)".po build/proboot + bin/po2do.py build/ build/ + rm "$(BUILDDISK)".po clean: rm -rf build/ mount: - open "$(BUILDDISK)" + open "$(BUILDDISK)".dsk all: clean asm mount 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)) diff --git a/src/anti-m.a b/src/anti-m.a index 9d4a1f1..33f5b01 100644 --- a/src/anti-m.a +++ b/src/anti-m.a @@ -57,7 +57,7 @@ tmp = $FC ; byte cmp #$60 bne Boot jsr CheckDrive2 - bcc Boot2 + bne Boot2 @showprompt jsr HOME lda MACHINEID @@ -162,18 +162,13 @@ CheckDrive2 bne -- dey bpl -- - ldy #0 -- lda $C0EC - jsr @knownret - pha - pla - cmp $C0EC - clc - bne + + lda #$00 + ldy #$00 +- eor $C0EC dey bne - - sec -+ lda $C0E8 + sta $C0E8 + cmp #$00 @knownret rts @@ -239,19 +234,13 @@ StringTable !word @mainmenu @header - !text "Anti-M v1.3-pre by 4am 2019-04-10" + !text "Anti-M v1.3-pre by 4am 2019-04-11" !text "________________________________________",$8D - !text $8D,$8D,$8D,$8D,$00 + !text $8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D,$00 @mainmenu !text " Insert original disk in slot 6 drive 1",$8D !text $8D - !text " and press to boot",$8D - !text $8D - !text " or",$8D - !text $8D - !text " Insert original disk in slot 6 drive 2",$8D - !text $8D - !text " and press 2 to boot",$00 + !text " and press to boot",$8D,$00 !src "src/compare.a" !src "src/idbroderbund.a"