From 5211dc629611d8e55742347c5c8e5530e613e0a4 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Mon, 1 May 2023 19:47:10 -0700 Subject: [PATCH] Add build options to suppress success and/or failure logging --- Makefile | 3 +++ README.md | 36 +++++++++++++++++++++++++++++++ clocks/Makefile | 3 +++ clocks/cricket/Makefile | 6 +++++- clocks/cricket/cricket.system.s | 4 ++++ clocks/dclock/Makefile | 6 +++++- clocks/dclock/dclock.system.s | 4 ++++ clocks/fujinet/Makefile | 6 +++++- clocks/fujinet/fn.clock.system.s | 4 ++++ clocks/jumbo/Makefile | 6 +++++- clocks/ns.clock/Makefile | 6 +++++- clocks/ns.clock/ns.clock.system.s | 4 ++++ clocks/romx/Makefile | 6 +++++- clocks/romx/romxrtc.system.s | 4 ++++ ram.drv/Makefile | 6 +++++- ram.drv/ram.drv.system.s | 4 ++++ 16 files changed, 101 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b8f960b..df85af7 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ targets := clocks selectors ram.drv util textcolors all: $(targets) +export LOG_SUCCESS=1 +export LOG_FAILURE=1 + # Build all targets $(targets): @tput setaf 3 && echo "Building: $@" && tput sgr0 diff --git a/README.md b/README.md index 9f45b4a..7ce0e20 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,39 @@ The intent is that you use a tool like Copy II Plus or [Apple II DeskTop](https: * `BASIC.SYSTEM` - which will not be automatically invoked, but is available to manually invoke 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`. + +# Building + +Fetch, build, and install [cc65](http://cc65.github.io/cc65/): + +``` +git clone https://github.com/cc65/cc65 +make -C cc65 && make -C cc65 avail +``` + +Fetch and build this repo: + +``` +git clone https://github.com/a2stuff/prodos-drivers +cd prodos-drivers +make +``` + +To make a disk image, fetch, build and install [Cadius](https://github.com/mach-kernel/cadius): + +``` +git clone https://github.com/mach-kernel/cadius +make -C cadius && make -C cadius install +``` + +Then you can: + +``` +cd prodos-drivers +make && make package +``` + +This will produce `prodos-drivers.po`, a disk image for use with emulators or tools like [ADTPro](http://adtpro.com/). + +Notes: +* Specify `LOG_SUCCESS=0` and/or `LOG_FAILURE=0` (e.g. `make LOG_SUCCESS=0`) to build with driver success and/or error logging suppressed. diff --git a/clocks/Makefile b/clocks/Makefile index 2e5d3bd..d4d88da 100644 --- a/clocks/Makefile +++ b/clocks/Makefile @@ -4,6 +4,9 @@ targets := ns.clock cricket dclock romx fujinet jumbo all: $(targets) +export LOG_SUCCESS +export LOG_FAILURE + # Build all targets $(targets): @tput setaf 3 && echo "Building: $@" && tput sgr0 diff --git a/clocks/cricket/Makefile b/clocks/cricket/Makefile index 94c8ea0..732cadd 100644 --- a/clocks/cricket/Makefile +++ b/clocks/cricket/Makefile @@ -13,11 +13,15 @@ TARGETS = \ $(OUTDIR)/set.time.BIN \ $(OUTDIR)/set.date.BIN +LOG_SUCCESS=1 +LOG_FAILURE=1 + # For timestamps MM = $(shell date "+%-m") DD = $(shell date "+%-d") YY = $(shell date "+%-y") -DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) +DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) \ + -D LOG_SUCCESS=$(LOG_SUCCESS) -D LOG_FAILURE=$(LOG_FAILURE) XATTR := $(shell command -v xattr 2> /dev/null) diff --git a/clocks/cricket/cricket.system.s b/clocks/cricket/cricket.system.s index 186323f..0529777 100644 --- a/clocks/cricket/cricket.system.s +++ b/clocks/cricket/cricket.system.s @@ -121,10 +121,12 @@ cricket_not_found: not_found: .ifndef JUMBO_CLOCK_DRIVER +.if ::LOG_FAILURE ;; Show failure message jsr log_message scrcode PRODUCT, " - Not Found." .byte 0 +.endif ; ::LOG_FAILURE .endif ; JUMBO_CLOCK_DRIVER sec ; failure @@ -213,6 +215,7 @@ loop: lda driver,y lda ROMIN2 +.if ::LOG_SUCCESS ;; Display success message jsr log_message scrcode PRODUCT, " - " @@ -220,6 +223,7 @@ loop: lda driver,y ;; Display the current date jsr cout_date +.endif ; ::LOG_SUCCESS clc ; success rts ; done! diff --git a/clocks/dclock/Makefile b/clocks/dclock/Makefile index 057049b..8aae63a 100644 --- a/clocks/dclock/Makefile +++ b/clocks/dclock/Makefile @@ -9,11 +9,15 @@ HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) TARGETS = \ $(OUTDIR)/dclock.system.SYS +LOG_SUCCESS=1 +LOG_FAILURE=1 + # For timestamps MM = $(shell date "+%-m") DD = $(shell date "+%-d") YY = $(shell date "+%-y") -DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) +DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) \ + -D LOG_SUCCESS=$(LOG_SUCCESS) -D LOG_FAILURE=$(LOG_FAILURE) XATTR := $(shell command -v xattr 2> /dev/null) diff --git a/clocks/dclock/dclock.system.s b/clocks/dclock/dclock.system.s index 4c36d56..c5761c7 100644 --- a/clocks/dclock/dclock.system.s +++ b/clocks/dclock/dclock.system.s @@ -85,10 +85,12 @@ DATA := SLOT4IO+3 ; Slinky data byte bcc InstallDriver .ifndef JUMBO_CLOCK_DRIVER +.if ::LOG_FAILURE ;; Show failure message jsr log_message scrcode PRODUCT, " - Not Found." .byte 0 +.endif ; ::LOG_FAILURE .endif ; JUMBO_CLOCK_DRIVER done: sec ; failure @@ -137,6 +139,7 @@ loop: lda driver,y lda ROMIN2 +.if ::LOG_SUCCESS ;; Display success message jsr log_message scrcode PRODUCT, " - " @@ -144,6 +147,7 @@ loop: lda driver,y ;; Display the current date jsr cout_date +.endif ; ::LOG_SUCCESS clc ; success rts ; done! diff --git a/clocks/fujinet/Makefile b/clocks/fujinet/Makefile index d0d1fb3..ca77163 100644 --- a/clocks/fujinet/Makefile +++ b/clocks/fujinet/Makefile @@ -9,11 +9,15 @@ HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) TARGETS = \ $(OUTDIR)/fn.clock.system.SYS +LOG_SUCCESS=1 +LOG_FAILURE=1 + # For timestamps MM = $(shell date "+%-m") DD = $(shell date "+%-d") YY = $(shell date "+%-y") -DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) +DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) \ + -D LOG_SUCCESS=$(LOG_SUCCESS) -D LOG_FAILURE=$(LOG_FAILURE) XATTR := $(shell command -v xattr 2> /dev/null) diff --git a/clocks/fujinet/fn.clock.system.s b/clocks/fujinet/fn.clock.system.s index ccf64db..5938804 100644 --- a/clocks/fujinet/fn.clock.system.s +++ b/clocks/fujinet/fn.clock.system.s @@ -121,10 +121,12 @@ found: not_found: .ifndef JUMBO_CLOCK_DRIVER +.if ::LOG_FAILURE ;; Show failure message jsr log_message scrcode PRODUCT, " - Not Found." .byte 0 +.endif ; ::LOG_FAILURE .endif ; JUMBO_CLOCK_DRIVER sec ; failure @@ -177,6 +179,7 @@ loop: lda driver,y lda ROMIN2 +.if ::LOG_SUCCESS ;; Display success message jsr log_message scrcode PRODUCT, " - " @@ -184,6 +187,7 @@ loop: lda driver,y ;; Display the current date jsr cout_date +.endif ; ::LOG_SUCCESS clc ; success rts ; done! diff --git a/clocks/jumbo/Makefile b/clocks/jumbo/Makefile index 3da532f..13fa78a 100644 --- a/clocks/jumbo/Makefile +++ b/clocks/jumbo/Makefile @@ -16,11 +16,15 @@ HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) \ TARGETS = \ $(OUTDIR)/clock.system.SYS +LOG_SUCCESS=1 +LOG_FAILURE=1 + # For timestamps MM = $(shell date "+%-m") DD = $(shell date "+%-d") YY = $(shell date "+%-y") -DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) +DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) \ + -D LOG_SUCCESS=$(LOG_SUCCESS) -D LOG_FAILURE=$(LOG_FAILURE) XATTR := $(shell command -v xattr 2> /dev/null) diff --git a/clocks/ns.clock/Makefile b/clocks/ns.clock/Makefile index c4a2210..2613b4a 100644 --- a/clocks/ns.clock/Makefile +++ b/clocks/ns.clock/Makefile @@ -9,11 +9,15 @@ HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) TARGETS = \ $(OUTDIR)/ns.clock.system.SYS +LOG_SUCCESS=1 +LOG_FAILURE=1 + # For timestamps MM = $(shell date "+%-m") DD = $(shell date "+%-d") YY = $(shell date "+%-y") -DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) +DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) \ + -D LOG_SUCCESS=$(LOG_SUCCESS) -D LOG_FAILURE=$(LOG_FAILURE) XATTR := $(shell command -v xattr 2> /dev/null) diff --git a/clocks/ns.clock/ns.clock.system.s b/clocks/ns.clock/ns.clock.system.s index 8bbeb2e..c3e2711 100644 --- a/clocks/ns.clock/ns.clock.system.s +++ b/clocks/ns.clock/ns.clock.system.s @@ -137,10 +137,12 @@ not_found: bpl :- .ifndef JUMBO_CLOCK_DRIVER +.if ::LOG_FAILURE ;; Show failure message jsr log_message scrcode PRODUCT, " - Not Found." .byte 0 +.endif ; ::LOG_FAILURE .endif ; JUMBO_CLOCK_DRIVER sec ; failure @@ -193,6 +195,7 @@ loop: lda driver,y lda ROMIN2 +.if ::LOG_SUCCESS ;; Display success message jsr log_message scrcode PRODUCT, " - " @@ -200,6 +203,7 @@ loop: lda driver,y ;; Display the current date jsr cout_date +.endif ; ::LOG_SUCCESS clc ; success rts ; done! diff --git a/clocks/romx/Makefile b/clocks/romx/Makefile index fb40c71..ae32de8 100644 --- a/clocks/romx/Makefile +++ b/clocks/romx/Makefile @@ -9,11 +9,15 @@ HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) TARGETS = \ $(OUTDIR)/romxrtc.system.SYS +LOG_SUCCESS=1 +LOG_FAILURE=1 + # For timestamps MM = $(shell date "+%-m") DD = $(shell date "+%-d") YY = $(shell date "+%-y") -DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) +DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) \ + -D LOG_SUCCESS=$(LOG_SUCCESS) -D LOG_FAILURE=$(LOG_FAILURE) XATTR := $(shell command -v xattr 2> /dev/null) diff --git a/clocks/romx/romxrtc.system.s b/clocks/romx/romxrtc.system.s index 0cc1aa5..41d3cb1 100644 --- a/clocks/romx/romxrtc.system.s +++ b/clocks/romx/romxrtc.system.s @@ -91,10 +91,12 @@ nope: sec ; not found bcc install_driver ; found clock! .ifndef JUMBO_CLOCK_DRIVER +.if ::LOG_FAILURE ;; Show failure message jsr log_message scrcode PRODUCT, " - Not Found." .byte 0 +.endif ; ::LOG_FAILURE .endif ; JUMBO_CLOCK_DRIVER sec ; failure @@ -156,6 +158,7 @@ loop: lda ClockDrv,y lda ROMIN2 +.if ::LOG_SUCCESS ;; Display success message jsr log_message scrcode PRODUCT, " - " @@ -163,6 +166,7 @@ loop: lda ClockDrv,y ;; Display the current date jsr cout_date +.endif ; ::LOG_SUCCESS clc ; success rts ; done! diff --git a/ram.drv/Makefile b/ram.drv/Makefile index b1e1a95..0ee52ef 100644 --- a/ram.drv/Makefile +++ b/ram.drv/Makefile @@ -9,11 +9,15 @@ HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) TARGETS = \ $(OUTDIR)/ram.drv.system.SYS +export LOG_SUCCESS=1 +export LOG_FAILURE=1 + # For timestamps MM = $(shell date "+%-m") DD = $(shell date "+%-d") YY = $(shell date "+%-y") -DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) +DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) \ + -D LOG_SUCCESS=$(LOG_SUCCESS) -D LOG_FAILURE=$(LOG_FAILURE) XATTR := $(shell command -v xattr 2> /dev/null) diff --git a/ram.drv/ram.drv.system.s b/ram.drv/ram.drv.system.s index 772c466..62db3f9 100644 --- a/ram.drv/ram.drv.system.s +++ b/ram.drv/ram.drv.system.s @@ -407,9 +407,11 @@ finish: bit ROMIN2 install_success: sta ALTZPOFF +.if ::LOG_SUCCESS jsr log_message scrcode PRODUCT, " - " .byte 0 +.endif ; ::LOG_SUCCESS ;; Initialize Applesoft zero page locations required by LINPRNT copy #0, SHIFT_SIGN_EXT ; required by FP routines @@ -430,9 +432,11 @@ install_success: install_failure: sta ALTZPOFF +.if ::LOG_FAILURE jsr log_message scrcode PRODUCT, " - Not Found" .byte 0 +.endif ; ::LOG_FAILURE rts