From b1c3d52e0a988bd13b6b223a495b361892f632c3 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Thu, 3 Feb 2022 20:14:10 -0800 Subject: [PATCH] Add ME.FIRST.SYSTEM --- package.sh | 1 + util/Makefile | 1 + util/README.md | 2 ++ util/me.first.system.s | 48 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 util/me.first.system.s diff --git a/package.sh b/package.sh index f762269..005b68d 100755 --- a/package.sh +++ b/package.sh @@ -32,6 +32,7 @@ add_file "selectors/out/bye.system.SYS" "bye.system#FF0000" "/$VOLNAME add_file "selectors/out/selector.system.SYS" "selector.system#FF0000" "/$VOLNAME" add_file "util/out/quit.system.SYS" "quit.system#FF0000" "/$VOLNAME" add_file "util/out/pause.system.SYS" "pause.system#FF0000" "/$VOLNAME" +add_file "util/out/me.first.system.SYS" "me.first.system#FF0000" "/$VOLNAME" add_file "util/out/date.BIN" "date#062000" "/$VOLNAME" cadius CREATEFOLDER "$IMGFILE" "/$VOLNAME/TEXTCOLORS" --no-case-bits --quiet diff --git a/util/Makefile b/util/Makefile index 9fd9fde..17862d5 100644 --- a/util/Makefile +++ b/util/Makefile @@ -9,6 +9,7 @@ HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) TARGETS = \ $(OUTDIR)/quit.system.SYS \ $(OUTDIR)/pause.system.SYS \ + $(OUTDIR)/me.first.system.SYS \ $(OUTDIR)/date.BIN # For timestamps diff --git a/util/README.md b/util/README.md index 3e62ef7..15939b8 100644 --- a/util/README.md +++ b/util/README.md @@ -6,3 +6,5 @@ * This invokes the ProDOS quit handler immediately. It can be used as the last in a chain of "driver" installers to invoke the program selector, e.g. if you want to also keep `BASIC.SYSTEM` in your root directory but not launch it. * [PAUSE.SYSTEM](pause.system.s) * Waits for a fraction of a second before invoking the next driver file. Useful in case the log messages from the driver installers go by too quickly! +* [ME.FIRST.SYSTEM](me.first.system.s) + * Moves the current volume to the end of DEVLST. Niche, but useful in some circumstances. diff --git a/util/me.first.system.s b/util/me.first.system.s new file mode 100644 index 0000000..4879686 --- /dev/null +++ b/util/me.first.system.s @@ -0,0 +1,48 @@ + + .setcpu "6502" + .linecont + + .feature string_escapes + + .include "apple2.inc" + .include "apple2.mac" + + .include "../inc/apple2.inc" + .include "../inc/macros.inc" + .include "../inc/prodos.inc" + +;;; ************************************************************ + .include "../inc/driver_preamble.inc" +;;; ************************************************************ + +.proc maybe_install_driver + ;; Find the current device's index in the list + ldx #0 +: lda DEVLST,x + and #$F0 + cmp DEVNUM + beq found + inx + cpx DEVCNT + bcc :- + bcs exit ; last one or not found + + ;; Save it +found: ldy DEVLST,x + + ;; Move everything up +: lda DEVLST+1,x + sta DEVLST,x + inx + cpx DEVCNT + bne :- + + ;; Place it at the end + tya + sta DEVLST,x + +exit: rts +.endproc + +;;; ************************************************************ + .include "../inc/driver_postamble.inc" +;;; ************************************************************