Add build options to suppress success and/or failure logging

This commit is contained in:
Joshua Bell 2023-05-01 19:47:10 -07:00
parent ee5fbeda2d
commit 5211dc6296
16 changed files with 101 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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