From cf891e061fc67d997f268c0d13d18dc75592eb7f Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Fri, 4 Oct 2019 18:10:01 -0700 Subject: [PATCH] Makefile tidying, unify headers --- bbb/Makefile | 22 ++++++--- bbb/buhbye.system.s | 37 ++------------ bbb/bye.system.s | 73 +++++----------------------- bbb/prodos.inc | 102 --------------------------------------- cricket/cricket.system.s | 3 +- cricket/set.date.s | 3 +- cricket/set.time.s | 3 +- cricket/test.s | 3 +- inc/apple2.inc | 20 ++++++++ inc/ascii.inc | 13 +++++ inc/driver_preamble.inc | 11 +++-- quit/Makefile | 21 +++++--- ram.drv/Makefile | 8 +-- 13 files changed, 96 insertions(+), 223 deletions(-) delete mode 100644 bbb/prodos.inc create mode 100644 inc/ascii.inc diff --git a/bbb/Makefile b/bbb/Makefile index d2381c2..3152d0f 100644 --- a/bbb/Makefile +++ b/bbb/Makefile @@ -2,7 +2,13 @@ CAFLAGS = --target apple2enh --list-bytes 0 LDFLAGS = --config apple2-asm.cfg -TARGETS = bye.system.SYS buhbye.system.SYS +OUTDIR = out + +HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) + +TARGETS = \ + $(OUTDIR)/bye.system.SYS \ + $(OUTDIR)/buhbye.system.SYS # For timestamps MM = $(shell date "+%-m") @@ -11,17 +17,19 @@ YY = $(shell date "+%-y") DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) .PHONY: clean all -all: $(TARGETS) +all: $(OUTDIR) $(TARGETS) -HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) +$(OUTDIR): + mkdir -p $(OUTDIR) clean: - rm -f *.o - rm -f $(TARGETS) + rm -f $(OUTDIR)/*.o + rm -f $(OUTDIR)/*.list + rm -f $(OUTDIR)/$(TARGETS) -%.o: %.s $(HEADERS) +$(OUTDIR)/%.o: %.s $(HEADERS) ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $< -%.SYS: %.o +$(OUTDIR)/%.SYS: $(OUTDIR)/%.o ld65 $(LDFLAGS) -o $@ $< xattr -wx prodos.AuxType '00 20' $@ diff --git a/bbb/buhbye.system.s b/bbb/buhbye.system.s index 71cbb16..87e2a4c 100644 --- a/bbb/buhbye.system.s +++ b/bbb/buhbye.system.s @@ -15,37 +15,7 @@ .include "../inc/apple2.inc" .include "../inc/macros.inc" .include "../inc/prodos.inc" - -;;; Miscellaneous - -COL80HPOS := $57B - -;;; I/O Soft Switches / Firmware - -ROMINNW := $C082 ; Read ROM; no write -ROMINWB1 := $C089 ; Read ROM; write RAM bank 1 - -SLOT3 := $C300 - -;;; Monitor - -SETTXT := $FB39 -TABV := $FB5B -SETPWRC := $FB6F -BELL1 := $FBDD -SETINV := $FE80 - -;;; ASCII/Key codes -ASCII_TAB := $9 -ASCII_DOWN := $A ; down arrow -ASCII_UP := $B ; up arrow -ASCII_CR := $D -ASCII_RIGHT := $15 ; right arrow -ASCII_SYN := $16 ; scroll text window up -ASCII_ETB := $17 ; scroll text window down -ASCII_EM := $19 ; move cursor to upper left -ASCII_ESCAPE := $1B - + .include "../inc/ascii.inc" ;;; ************************************************************ .include "../inc/driver_preamble.inc" @@ -75,7 +45,7 @@ ASCII_ESCAPE := $1B src_ptr := $19 dst_ptr := $1B - sta ALTZPOFF + sta ALTZPOFF ; TODO: Necessary? lda ROMIN ; write bank 2 lda ROMIN @@ -107,7 +77,7 @@ loop: lda (src_ptr) ; *src_ptr = *dst_ptr cmp #quit - sta $03F3 + sta RESETVEC+1 eor #$A5 - sta $03F4 + sta RESETVEC+2 ;; Quit 80-column firmware lda #$95 ; Ctrl+U (quit 80 col firmware) @@ -130,10 +130,11 @@ self_name: .res 16 ;; Reset I/O sta CLR80VID sta CLRALTCHAR - jsr SETVID - jsr SETKBD + sta CLR80COL jsr SETNORM jsr INIT + jsr SETVID + jsr SETKBD jsr HOME ;; Update System Bit Map diff --git a/quit/Makefile b/quit/Makefile index 484dac9..e3aa4db 100644 --- a/quit/Makefile +++ b/quit/Makefile @@ -2,7 +2,12 @@ CAFLAGS = --target apple2enh --list-bytes 0 LDFLAGS = --config apple2-asm.cfg -TARGETS = quit.system.SYS +OUTDIR = out + +HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) + +TARGETS = \ + $(OUTDIR)/quit.system.SYS # For timestamps MM = $(shell date "+%-m") @@ -11,17 +16,19 @@ YY = $(shell date "+%-y") DEFINES = -D DD=$(DD) -D MM=$(MM) -D YY=$(YY) .PHONY: clean all -all: $(TARGETS) +all: $(OUTDIR) $(TARGETS) -HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) +$(OUTDIR): + mkdir -p $(OUTDIR) clean: - rm -f *.o - rm -f $(TARGETS) + rm -f $(OUTDIR)/*.o + rm -f $(OUTDIR)/*.list + rm -f $(OUTDIR)/$(TARGETS) -%.o: %.s $(HEADERS) +$(OUTDIR)/%.o: %.s $(HEADERS) ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $< -%.SYS: %.o +$(OUTDIR)/%.SYS: $(OUTDIR)/%.o ld65 $(LDFLAGS) -o $@ $< xattr -wx prodos.AuxType '00 20' $@ diff --git a/ram.drv/Makefile b/ram.drv/Makefile index 19be6ba..74f22b8 100644 --- a/ram.drv/Makefile +++ b/ram.drv/Makefile @@ -6,7 +6,8 @@ OUTDIR = out HEADERS = $(wildcard *.inc) $(wildcard ../inc/*.inc) -TARGETS = $(OUTDIR)/ram.drv.system.SYS +TARGETS = \ + $(OUTDIR)/ram.drv.system.SYS # For timestamps MM = $(shell date "+%-m") @@ -23,12 +24,11 @@ $(OUTDIR): clean: rm -f $(OUTDIR)/*.o rm -f $(OUTDIR)/*.list - rm -f $(TARGETS) + rm -f $(OUTDIR)/$(TARGETS) $(OUTDIR)/%.o: %.s $(HEADERS) ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $< -# System Files .SYS $(OUTDIR)/%.SYS: $(OUTDIR)/%.o - ld65 $(LDFLAGS) -o '$@' $< + ld65 $(LDFLAGS) -o $@ $< xattr -wx prodos.AuxType '00 20' $@