From f42539a517dffc81ef9a38a63cc9087d28b585d5 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Mon, 31 Dec 2018 12:21:38 -0800 Subject: [PATCH] Snapshot: BEEPSLOT from ProDOS TRM --- Makefile | 29 ++++++++++++++++++++++ chtype.s | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 Makefile create mode 100644 chtype.s diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..702f462 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ + +CC65 = ~/dev/cc65/bin +CAFLAGS = --target apple2enh --list-bytes 0 +CCFLAGS = --config apple2-asm.cfg + +OUTDIR = out + +TARGETS = $(OUTDIR)/chtype.BIN + +.PHONY: clean all +all: $(OUTDIR) $(TARGETS) + +$(OUTDIR): + mkdir -p $(OUTDIR) + +HEADERS = $(wildcard *.inc) + +clean: + rm -f $(OUTDIR)/*.o + rm -f $(OUTDIR)/*.list + rm -f $(OUTDIR)/$(TARGETS) + + +$(OUTDIR)/%.o: %.s $(HEADERS) + $(CC65)/ca65 $(CAFLAGS) $(DEFINES) --listing $(basename $@).list -o $@ $< + +$(OUTDIR)/%.BIN $(OUTDIR)/%.SYS: $(OUTDIR)/%.o + $(CC65)/ld65 $(CCFLAGS) -o $@ $< + xattr -wx prodos.AuxType '00 20' $@ diff --git a/chtype.s b/chtype.s new file mode 100644 index 0000000..694a4d0 --- /dev/null +++ b/chtype.s @@ -0,0 +1,73 @@ + +;;; + .org $2000 + +INBUF := $200 ;GETLN input buffer. +WAIT := $FCA8 ;Monitor wait routine. +BELL := $FF3A ;Monitor bell routine +EXTRNCMD := $BE06 ;External cmd JMP vector. +XTRNADDR := $BE50 ;Ext cmd implementation addr. +XLEN := $BE52 ;Length of command string-1. +XCNUM := $BE53 ;CI cmd no. (ext cmd = 0). +PBITS := $BE54 ;Command parameter bits. +VSLOT := $BE61 ;Verified slot parameter. + +;;; +;;; REMEMBER TO SAVE THE PREVIOUS COMMAND ADDRESS. +;;; + LDA EXTRNCMD+1 + STA NXTCMD + LDA EXTRNCMD+2 + STA NXTCMD+1 +;;; + LDA #>BEEPSLOT ;Install the address of our + STA EXTRNCMD+1 ; command handler in the + LDA #EXECUTE ;Point XTRNADDR to our + STA XTRNADDR ; command execution + LDA #