From cc762753667989c4a89bc57bb2a7fca46937604e Mon Sep 17 00:00:00 2001 From: 4am Date: Wed, 31 Oct 2018 11:13:03 -0400 Subject: [PATCH] add ProBoot bootloader --- Makefile | 20 +++++++------------- bin/changebootloader.py | 15 +++++++++++++++ res/{COVER => attic/COVER2} | Bin res/{COVER.A2FC => attic/COVER2.A2FC} | Bin src/4cade.a | 26 +++++++++++--------------- 5 files changed, 33 insertions(+), 28 deletions(-) create mode 100755 bin/changebootloader.py rename res/{COVER => attic/COVER2} (100%) rename res/{COVER.A2FC => attic/COVER2.A2FC} (100%) diff --git a/Makefile b/Makefile index 17be83f02..e77a7ab3c 100644 --- a/Makefile +++ b/Makefile @@ -35,14 +35,12 @@ asm: md dsk: md asm $(CADIUS) CREATEVOLUME build/"$(DISK)" "${VOLUME}" 32766KB >>build/log cp res/_FileInformation.txt build/ >>build/log - $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/PRODOS" >>build/log +# $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/PRODOS" >>build/log $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "build/LAUNCHER.SYSTEM" >>build/log $(CADIUS) CREATEFOLDER build/"$(DISK)" "/${VOLUME}/X/" >>build/log $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/GAMES.CONF" >>build/log $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/ATTRACT.CONF" >>build/log $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/FX.CONF" >>build/log - $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/COVER" >>build/log - $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/" "res/COVER.A2FC" >>build/log rsync -aP res/hgr/* build/HGR >>build/log bin/buildfileinfo.py build/HGR >>build/log $(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/HGR" "build/HGR" >>build/log @@ -58,15 +56,11 @@ dsk: md asm bin/do2po.py res/dsk/ build/po/ # rsync -a res/dsk/*.po build/po/ # bin/extract.py build/po/ | sh >build/log -# rm -f build/X/**/.DS_Store -# rm -f build/X/**/PRODOS -# rm -f build/X/**/LOADER.SYSTEM -# $(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/X" "build/X" >build/log - -artwork: dsk -# $(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/ARTWORK" "res/artwork" -# $(CADIUS) ADDFILE build/"$(DISK)" "/${VOLUME}/ARTWORK/" "res/DHRSLIDE.SYSTEM" -# $(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/ARTWORKGS" "res/artworkgs" + rm -f build/X/**/.DS_Store + rm -f build/X/**/PRODOS + rm -f build/X/**/LOADER.SYSTEM + $(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/X" "build/X" >build/log + bin/changebootloader.py build/"$(DISK)" res/proboothd mount: dsk osascript bin/V2Make.scpt "`pwd`" bin/4cade.vii build/"$(DISK)" @@ -83,4 +77,4 @@ md: clean: rm -rf build/ -all: clean asm dsk artwork mount +all: clean asm dsk mount diff --git a/bin/changebootloader.py b/bin/changebootloader.py new file mode 100755 index 000000000..87e59d366 --- /dev/null +++ b/bin/changebootloader.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import sys +import os.path + +target_2mg_file, bootloader = sys.argv[1:] +assert(os.path.splitext(target_2mg_file)[-1].lower() == ".2mg") +with open(bootloader, 'rb') as f: + boot = f.read() +assert(len(boot) == 512) +with open(target_2mg_file, 'rb') as f: + data = bytearray(f.read()) +data[64:64+len(boot)] = boot +with open(target_2mg_file, 'wb') as f: + f.write(data) diff --git a/res/COVER b/res/attic/COVER2 similarity index 100% rename from res/COVER rename to res/attic/COVER2 diff --git a/res/COVER.A2FC b/res/attic/COVER2.A2FC similarity index 100% rename from res/COVER.A2FC rename to res/attic/COVER2.A2FC diff --git a/src/4cade.a b/src/4cade.a index 858072836..34d4cb262 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -207,12 +207,14 @@ HGRLoad ; load HGR screenshot at $4000 +LOAD_FILE kHGRScreenshotDirectory, PTR - jsr $6000 ; transition effect code was loaded here earlier + jsr $6000 ; transition effect code was loaded here earlier jmp WaitOnScreenshot DHGRLoad ldx $C000 - bmi Exit + bpl + + rts ++ +STAY PTR jsr ResetPath +LDADDR kDHGRScreenshotDirectory @@ -224,21 +226,15 @@ DHGRLoad jsr LoadDHRFile !word gPathname jsr FizzleDHGR + ; note: execution falls through here WaitOnScreenshot - ldx #0 - ldy #0 -@wait lda $C000 - bmi Exit - jsr @burn - dey - bne @wait + ldx #$20 +- lda #0 + jsr WaitForKeyWithTimeout + bmi + dex - bne @wait - rts -@burn jsr @burn2 -@burn2 jsr @burn3 -@burn3 jsr Exit -Exit rts + bpl - ++ rts LoadTransition jsr okvs_nth ; get filename of transition effect code