From 86bafa4b762b8745c1555a5abef08622259a6d7b Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Tue, 13 Apr 2021 21:20:12 -0700 Subject: [PATCH] Add BUZZ command --- Makefile | 2 +- README.md | 1 + buzz.cmd.s | 31 +++++++++++++++++++++++++++++++ copy.cmd.s | 2 +- more_apple2.inc | 8 ++++++-- package.sh | 2 +- type.cmd.s | 4 ++-- 7 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 buzz.cmd.s diff --git a/Makefile b/Makefile index 41b398e..7a501c2 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ LDFLAGS := --config apple2-asm.cfg OUTDIR := out TARGETS := $(OUTDIR)/path.BIN \ - $(OUTDIR)/chtype.CMD $(OUTDIR)/chtime.CMD \ + $(OUTDIR)/chtype.CMD $(OUTDIR)/chtime.CMD $(OUTDIR)/buzz.CMD \ $(OUTDIR)/copy.CMD $(OUTDIR)/date.CMD $(OUTDIR)/type.CMD \ $(OUTDIR)/bell.CMD $(OUTDIR)/hello.CMD $(OUTDIR)/echo.CMD $(OUTDIR)/online.CMD diff --git a/README.md b/README.md index 69f5322..65ab69a 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Sample commands included: * `COPY` - copy a single file, e.g. `copy /path/to/file,dstfile` * `TYPE` - show file contents (TXT, BAS, or BIN/other), e.g. `type filename` * `DATE` - prints the current ProDOS date and time + * `BUZZ` - emits the ProDOS "nice little tone" * `CHTYPE` - change the type/auxtype of a file. e.g. `chtype file,T$F1,A$1234` * `T` (type) and `A` (auxtype) are optional. If neither is specified, current types are shown. * `S` and `D` arguments can be used to specify slot and drive. diff --git a/buzz.cmd.s b/buzz.cmd.s new file mode 100644 index 0000000..43bbc23 --- /dev/null +++ b/buzz.cmd.s @@ -0,0 +1,31 @@ +;;; ============================================================ +;;; Bell +;;; +;;; From ProDOS 8 Technical Reference Manual 5.4: +;;; "The standard Apple II "Air-raid" bell has been replaced with a +;;; gentler tone. Use it to give users some aural feedback that +;;; they are using a ProDOS program." + + .include "apple2.inc" + .include "more_apple2.inc" + + .org $4000 + + length := $06 + +;;; Generate a nice little tone +;;; Exits with Z-flag set (BEQ) for branching +;;; Destroys the contents of the accumulator + lda #32 ;duration of tone + sta length +bell1: lda #2 ;short delay...click + jsr WAIT + sta SPKR + lda #32 ;long delay...click + jsr WAIT + sta SPKR + dec length + bne bell1 ;repeat length times + + clc + rts diff --git a/copy.cmd.s b/copy.cmd.s index ff3d6d5..8774287 100644 --- a/copy.cmd.s +++ b/copy.cmd.s @@ -29,7 +29,7 @@ lda #0 sta XCNUM - ;; Set accepted parameter flags (Name, Type, Address) + ;; Set accepted parameter flags (2 Filenames) lda #PBitsFlags::FN1 | PBitsFlags::FN2 ; Filenames sta PBITS diff --git a/more_apple2.inc b/more_apple2.inc index 52a91f0..c7b896b 100644 --- a/more_apple2.inc +++ b/more_apple2.inc @@ -8,11 +8,16 @@ INBUF := $200 LINUM := $1B +;;; ============================================================ +;;; I/O Locations + +SPKR := $C030 + ;;; ============================================================ ;;; Monitor ROM routines - PRTAX := $F941 +WAIT := $FCA8 CROUT := $FD8E PRBYTE := $FDDA COUT := $FDED @@ -28,5 +33,4 @@ BELL := $FF3A ;;; Applesoft ROM locations TOKTABL := $D0D0 - LINPRT := $ED24 diff --git a/package.sh b/package.sh index 4602560..b65c35e 100755 --- a/package.sh +++ b/package.sh @@ -18,7 +18,7 @@ add_file () { } add_file "out/path.BIN" "path#062000" -for file in bell echo hello online chtype chtime copy date type; do +for file in bell echo hello online chtype chtime copy date type buzz; do add_file "out/${file}.CMD" "${file}#F04000" done diff --git a/type.cmd.s b/type.cmd.s index fc614f8..46f128b 100644 --- a/type.cmd.s +++ b/type.cmd.s @@ -29,9 +29,9 @@ lda #0 sta XCNUM - ;; Set accepted parameter flags (Name, Type, Address) + ;; Set accepted parameter flags (Filename) - lda #PBitsFlags::FN1 ; Filenames + lda #PBitsFlags::FN1 ; Filename sta PBITS lda #PBitsFlags::SD ; Slot & Drive handling sta PBITS+1