Skip to content

Commit

Permalink
Add SETUP.SYSTEM and build .SETUP files
Browse files Browse the repository at this point in the history
This is an alternate approach proposed by Sean Nolan in 1987 which
allows placing the driver files in a subdirectory of the root volume
to avoid clutter and file ordering issues. Only a SETUP.SYSTEM file is
needed at the top level, and the drivers go into a SETUPS/ directory.

All drivers here (except QUIT.SYSTEM and SETUP.SYSTEM itself) have
alternate forms built into the /DRIVERS/SETUPS/ directory as XYZ.SETUP
instead of XYZ.SYSTEM. If you choose to use SETUP.SYSTEM, place these
.SETUP files in your SETUPS/ directory. The naming doesn't matter -
any SYS or BIN file can be used - but this convention makes
distribution easier. These .SETUP files do **NOT** chain to the next
file - that's handled by SETUP.SYSTEM itself.

Resolves #16
  • Loading branch information
inexorabletash committed Jan 31, 2024
1 parent 537d798 commit 7bbc969
Show file tree
Hide file tree
Showing 26 changed files with 532 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
targets := clocks selectors accelerators ram.drv util textcolors
targets := clocks selectors accelerators ram.drv setup util textcolors

.PHONY: all $(targets) package

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ The intent is that you use a tool like Copy II Plus or [Apple II DeskTop](https:

Alternately, you might want to install some drivers then immediately launch into BASIC. In that case, put `BASIC.SYSTEM` after the drivers in place of `QUIT.SYSTEM`.

## Alternate Approach

If you want to keep your volume directory tidier, consider using [SETUP.SYSTEM](./setups/README.md) instead.

# Building

Fetch, build, and install [cc65](http://cc65.github.io/cc65/):
Expand Down
6 changes: 5 additions & 1 deletion accelerators/zipchip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ OUTDIR = ../../out
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)

TARGETS = \
$(OUTDIR)/zipchip.system.SYS
$(OUTDIR)/zipchip.system.SYS \
$(OUTDIR)/zipchip.setup.SYS

LOG_SUCCESS=1
LOG_FAILURE=1
Expand Down Expand Up @@ -35,6 +36,9 @@ clean:
$(OUTDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.BIN $(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<
ifdef XATTR
Expand Down
4 changes: 4 additions & 0 deletions clocks/cricket/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ HEADERS = $(wildcard *.inc) $(wildcard ../../inc/*.inc)
TARGETS = \
$(UTILDIR)/prodos.mod.BIN \
$(OUTDIR)/cricket.system.SYS \
$(OUTDIR)/cricket.setup.SYS \
$(UTILDIR)/test.BIN \
$(UTILDIR)/set.datetime.BIN \
$(UTILDIR)/set.time.BIN \
Expand Down Expand Up @@ -43,6 +44,9 @@ clean:
$(OUTDIR)/%.o $(UTILDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<

Expand Down
2 changes: 2 additions & 0 deletions clocks/cricket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ These `BRUN`able files are also built:
* [SET.DATE](set.date.s) sets the Cricket's current date.
* [SET.TIME](set.time.s) sets the Cricket's current time.

`CRICKET.SETUP` is for use with [SETUP.SYSTEM](../../setup/README.md)

## Resources

Cricket disks on Asimov:
Expand Down
6 changes: 5 additions & 1 deletion clocks/dclock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ OUTDIR = ../../out
HEADERS = $(wildcard *.inc) $(wildcard ../../inc/*.inc)

TARGETS = \
$(OUTDIR)/dclock.system.SYS
$(OUTDIR)/dclock.system.SYS \
$(OUTDIR)/dclock.setup.SYS

LOG_SUCCESS=1
LOG_FAILURE=1
Expand Down Expand Up @@ -35,6 +36,9 @@ clean:
$(OUTDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<
ifdef XATTR
Expand Down
2 changes: 2 additions & 0 deletions clocks/dclock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Like other drivers here, this one will:
* Only attempts detection if the system is a an Apple IIc
* If detected, installs into ProDOS directly, following Technical Reference Manual requirements.
* Chains to the next `.SYSTEM` file in the directory.

`DCLOCK.SETUP` is for use with [SETUP.SYSTEM](../../setup/README.md).
6 changes: 5 additions & 1 deletion clocks/fujinet/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ OUTDIR = ../../out
HEADERS = $(wildcard *.inc) $(wildcard ../../inc/*.inc)

TARGETS = \
$(OUTDIR)/fn.clock.system.SYS
$(OUTDIR)/fn.clock.system.SYS \
$(OUTDIR)/fn.clock.setup.SYS

LOG_SUCCESS=1
LOG_FAILURE=1
Expand Down Expand Up @@ -35,6 +36,9 @@ clean:
$(OUTDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.BIN $(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<
ifdef XATTR
Expand Down
4 changes: 1 addition & 3 deletions clocks/fujinet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@

This driver is an adaptation of the other drivers in https://github.com/a2stuff/prodos-drivers




`FN.CLOCK.SETUP` is for use with [SETUP.SYSTEM](../../setup/README.md).
7 changes: 5 additions & 2 deletions clocks/jumbo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ HEADERS = $(wildcard *.inc) $(wildcard ../../inc/*.inc) \
../fujinet/smartport.inc \
../cricket/cricket.system.s


TARGETS = \
$(OUTDIR)/clock.system.SYS
$(OUTDIR)/clock.system.SYS \
$(OUTDIR)/clock.setup.SYS

LOG_SUCCESS=1
LOG_FAILURE=1
Expand Down Expand Up @@ -42,6 +42,9 @@ clean:
$(OUTDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<
ifdef XATTR
Expand Down
2 changes: 2 additions & 0 deletions clocks/jumbo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ The drivers are (in order):
By default, the installer logs on success so you can tell what clock was detected, but you can build with `LOG_SUCCESS=0` to prevent that.

If ProDOS _already_ has a clock driver installed, the driver is checked for common Thunderclock year tables. If found, the table is updated in memory to cover 2023-2028.

`CLOCK.SETUP` is for use with [SETUP.SYSTEM](../../setup/README.md).
4 changes: 4 additions & 0 deletions clocks/ns.clock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ HEADERS = $(wildcard *.inc) $(wildcard ../../inc/*.inc)

TARGETS = \
$(OUTDIR)/ns.clock.system.SYS \
$(OUTDIR)/ns.clock.setup.SYS \
$(UTILDIR)/set.datetime.BIN

LOG_SUCCESS=1
Expand Down Expand Up @@ -39,6 +40,9 @@ clean:
$(OUTDIR)/%.o $(UTILDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<

Expand Down
2 changes: 2 additions & 0 deletions clocks/ns.clock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Adapted from `NS.CLOCK.SYSTEM` (by "CAP"), with these changes:

These `BRUN`able files are also built:
* [SET.DATETIME](set.datetime.s) sets the No Slot Clock date/time.

`NS.CLOCK.SETUP` is for use with [SETUP.SYSTEM](../../setup/README.md).
6 changes: 5 additions & 1 deletion clocks/romx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ OUTDIR = ../../out
HEADERS = $(wildcard *.inc) $(wildcard ../../inc/*.inc)

TARGETS = \
$(OUTDIR)/romxrtc.system.SYS
$(OUTDIR)/romxrtc.system.SYS \
$(OUTDIR)/romxrtc.setup.SYS

LOG_SUCCESS=1
LOG_FAILURE=1
Expand Down Expand Up @@ -35,6 +36,9 @@ clean:
$(OUTDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<
ifdef XATTR
Expand Down
2 changes: 2 additions & 0 deletions clocks/romx/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# ROMX ProDOS Clock Driver

Original source c/o Jeff Mazur.

`ROMXRTC.SETUP` is for use with [SETUP.SYSTEM](../../setup/README.md).
3 changes: 3 additions & 0 deletions inc/driver_postamble.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.ifndef BUILD_SETUP_FILE

poporg
reloc_end := *

.endif
26 changes: 23 additions & 3 deletions inc/driver_preamble.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@

;; SYS files load at $2000; relocates self to $1000
.org SYS_ADDR
dst_addr := $1000

;;; ------------------------------------------------------------

.ifndef BUILD_SETUP_FILE
dst_addr := $1000
jmp relocate
.else
jmp main
.endif

.byte MM, DD, YY ; version date stamp

.ifndef BUILD_SETUP_FILE
;;; ------------------------------------------------------------
;;; Relocate this code from $2000 (.SYSTEM start location) to $1000
;;; and start executing there. This is done so that the next .SYSTEM
Expand Down Expand Up @@ -389,6 +392,23 @@ suffix:
found_self_flag:
.byte 0

.else

;;; ============================================================
;;; Main routine
;;; ============================================================

.proc main
jsr maybe_install_driver

MLI_CALL QUIT, quit_params
brk ; crash if QUIT fails

DEFINE_QUIT_PARAMS quit_params
.endproc

.endif

;;; ============================================================
;;; Common Routines
;;; ============================================================
Expand Down
56 changes: 32 additions & 24 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,47 @@ VOLNAME="drivers"

rm -f "$IMGFILE"
cadius CREATEVOLUME "$IMGFILE" "$VOLNAME" 140KB --no-case-bits --quiet
cadius CREATEFOLDER "$IMGFILE" "/$VOLNAME/CRICKET.UTIL" --no-case-bits --quiet
cadius CREATEFOLDER "$IMGFILE" "/$VOLNAME/NSCLOCK.UTIL" --no-case-bits --quiet
cadius CREATEFOLDER "$IMGFILE" "/$VOLNAME/SETUPS" --no-case-bits --quiet

add_file () {
cp "$1" "$PACKDIR/$2"
cadius ADDFILE "$IMGFILE" "$3" "$PACKDIR/$2" --no-case-bits --quiet
}

add_file "out/cricket.system.SYS" "cricket.system#FF0000" "/$VOLNAME"
add_file "out/cricket.util/set.datetime.BIN" "set.datetime#062000" "/$VOLNAME/CRICKET.UTIL"
add_file "out/cricket.util/set.date.BIN" "set.date#062000" "/$VOLNAME/CRICKET.UTIL"
add_file "out/cricket.util/set.time.BIN" "set.time#062000" "/$VOLNAME/CRICKET.UTIL"
add_file "out/cricket.util/test.BIN" "test#062000" "/$VOLNAME/CRICKET.UTIL"
add_file "out/dclock.system.SYS" "dclock.system#FF0000" "/$VOLNAME"
add_file "out/ns.clock.system.SYS" "ns.clock.system#FF0000" "/$VOLNAME"
add_file "out/nsclock.util/set.datetime.BIN" "set.datetime#062000" "/$VOLNAME/NSCLOCK.UTIL"
add_file "out/romxrtc.system.SYS" "romxrtc.system#FF0000" "/$VOLNAME"
add_file "out/fn.clock.system.SYS" "fn.clock.system#FF0000" "/$VOLNAME"
add_file "out/clock.system.SYS" "clock.system#FF0000" "/$VOLNAME"
add_file "out/ram.drv.system.SYS" "ram.drv.system#FF0000" "/$VOLNAME"
add_file "out/bbb.system.SYS" "bbb.system#FF0000" "/$VOLNAME"
add_file "out/buhbye.system.SYS" "buhbye.system#FF0000" "/$VOLNAME"
add_file "out/bye.system.SYS" "bye.system#FF0000" "/$VOLNAME"
add_file "out/selector.system.SYS" "selector.system#FF0000" "/$VOLNAME"
add_file "out/zipchip.system.SYS" "zipchip.system#FF0000" "/$VOLNAME"
add_file "out/quit.system.SYS" "quit.system#FF0000" "/$VOLNAME"
add_file "out/pause.system.SYS" "pause.system#FF0000" "/$VOLNAME"
add_file "out/me.first.system.SYS" "me.first.system#FF0000" "/$VOLNAME"
add_file "out/date.BIN" "date#062000" "/$VOLNAME"
# Drivers

for file in \
"bbb" "buhbye" "bye" "selector" \
"clock" "cricket" "dclock" "fn.clock" "ns.clock" "romxrtc" \
"ram.drv" \
"zipchip" \
"me.first" "pause"; do
add_file "out/$file.system.SYS" "$file.system#FF0000" "/$VOLNAME"
add_file "out/$file.setup.SYS" "$file.setup#FF0000" "/$VOLNAME/SETUPS"
done
add_file "out/setup.system.SYS" "setup.system#FF0000" "/$VOLNAME"
add_file "out/quit.system.SYS" "quit.system#FF0000" "/$VOLNAME"

# Utilities

add_file "out/date.BIN" "date#062000" "/$VOLNAME"

cadius CREATEFOLDER "$IMGFILE" "/$VOLNAME/CRICKET.UTIL" --no-case-bits --quiet
add_file "out/cricket.util/set.datetime.BIN" "set.datetime#062000" "/$VOLNAME/CRICKET.UTIL"
add_file "out/cricket.util/set.date.BIN" "set.date#062000" "/$VOLNAME/CRICKET.UTIL"
add_file "out/cricket.util/set.time.BIN" "set.time#062000" "/$VOLNAME/CRICKET.UTIL"
add_file "out/cricket.util/test.BIN" "test#062000" "/$VOLNAME/CRICKET.UTIL"

cadius CREATEFOLDER "$IMGFILE" "/$VOLNAME/NSCLOCK.UTIL" --no-case-bits --quiet
add_file "out/nsclock.util/set.datetime.BIN" "set.datetime#062000" "/$VOLNAME/NSCLOCK.UTIL"



cadius CREATEFOLDER "$IMGFILE" "/$VOLNAME/TEXTCOLORS" --no-case-bits --quiet
cadius CREATEFOLDER "$IMGFILE" "/$VOLNAME/SETUPS/TEXTCOLORS" --no-case-bits --quiet
for file in a2green bw deepblue gray gsblue mint pink wb; do
add_file "out/${file}.system.SYS" "${file}.system#FF0000" "/$VOLNAME/TEXTCOLORS"
add_file "out/${file}.system.SYS" "${file}.system#FF0000" "/$VOLNAME/TEXTCOLORS"
add_file "out/${file}.setup.SYS" "${file}.setup#FF0000" "/$VOLNAME/TEXTCOLORS/SETUPS"
done

rm -r "$PACKDIR"
Expand Down
9 changes: 5 additions & 4 deletions ram.drv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ OUTDIR = ../out
HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)

TARGETS = \
$(OUTDIR)/ram.drv.system.SYS
$(OUTDIR)/ram.drv.system.SYS \
$(OUTDIR)/ram.drv.setup.SYS

export LOG_SUCCESS=1
export LOG_FAILURE=1
Expand Down Expand Up @@ -35,8 +36,8 @@ clean:
$(OUTDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<
ifdef XATTR
xattr -wx prodos.AuxType '00 20' $@
endif
3 changes: 0 additions & 3 deletions ram.drv/ram.drv.system.s
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ zp_sig_addr := $06
zpproc_addr := $B0
zpproc_relay_addr := $2D0

data_buf := $1C00 ; I/O when chaining to next SYS file
driver_target := $FF00 ; Install location in ProDOS


Expand Down Expand Up @@ -711,8 +710,6 @@ map2 := *+2+$80 ; len: $80
stash_00 := *+2+$100 ; len: $80
stash_01 := *+2+$180 ; len: $80

.assert stash_01+$80 < data_buf, error, "Too long"

;;; ************************************************************
.include "../inc/driver_postamble.inc"
;;; ************************************************************
12 changes: 8 additions & 4 deletions selectors/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc)

TARGETS = \
$(OUTDIR)/selector.system.SYS \
$(OUTDIR)/selector.setup.SYS \
$(OUTDIR)/bye.system.SYS \
$(OUTDIR)/bye.setup.SYS \
$(OUTDIR)/bbb.system.SYS \
$(OUTDIR)/buhbye.system.SYS
$(OUTDIR)/bbb.setup.SYS \
$(OUTDIR)/buhbye.system.SYS \
$(OUTDIR)/buhbye.setup.SYS

# For timestamps
MM = $(shell date "+%-m")
Expand All @@ -34,8 +38,8 @@ clean:
$(OUTDIR)/%.o: %.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.setup.o: %.system.s $(HEADERS)
ca65 $(CAFLAGS) $(DEFINES) -D BUILD_SETUP_FILE --listing $(basename $@).list -o $@ $<

$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
ld65 $(LDFLAGS) -o $@ $<
ifdef XATTR
xattr -wx prodos.AuxType '00 20' $@
endif
Loading

0 comments on commit 7bbc969

Please sign in to comment.