Add ME.FIRST.SYSTEM

This commit is contained in:
Joshua Bell 2022-02-03 20:14:10 -08:00
parent a6d4fa6308
commit b1c3d52e0a
4 changed files with 52 additions and 0 deletions

View File

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

View File

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

View File

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

48
util/me.first.system.s Normal file
View File

@ -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"
;;; ************************************************************