Add BUZZ command

This commit is contained in:
Joshua Bell 2021-04-13 21:20:12 -07:00
parent 9085407ac5
commit 86bafa4b76
7 changed files with 43 additions and 7 deletions

View File

@ -5,7 +5,7 @@ LDFLAGS := --config apple2-asm.cfg
OUTDIR := out OUTDIR := out
TARGETS := $(OUTDIR)/path.BIN \ 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)/copy.CMD $(OUTDIR)/date.CMD $(OUTDIR)/type.CMD \
$(OUTDIR)/bell.CMD $(OUTDIR)/hello.CMD $(OUTDIR)/echo.CMD $(OUTDIR)/online.CMD $(OUTDIR)/bell.CMD $(OUTDIR)/hello.CMD $(OUTDIR)/echo.CMD $(OUTDIR)/online.CMD

View File

@ -52,6 +52,7 @@ Sample commands included:
* `COPY` - copy a single file, e.g. `copy /path/to/file,dstfile` * `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` * `TYPE` - show file contents (TXT, BAS, or BIN/other), e.g. `type filename`
* `DATE` - prints the current ProDOS date and time * `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` * `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. * `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. * `S` and `D` arguments can be used to specify slot and drive.

31
buzz.cmd.s Normal file
View File

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

View File

@ -29,7 +29,7 @@
lda #0 lda #0
sta XCNUM sta XCNUM
;; Set accepted parameter flags (Name, Type, Address) ;; Set accepted parameter flags (2 Filenames)
lda #PBitsFlags::FN1 | PBitsFlags::FN2 ; Filenames lda #PBitsFlags::FN1 | PBitsFlags::FN2 ; Filenames
sta PBITS sta PBITS

View File

@ -8,11 +8,16 @@ INBUF := $200
LINUM := $1B LINUM := $1B
;;; ============================================================
;;; I/O Locations
SPKR := $C030
;;; ============================================================ ;;; ============================================================
;;; Monitor ROM routines ;;; Monitor ROM routines
PRTAX := $F941 PRTAX := $F941
WAIT := $FCA8
CROUT := $FD8E CROUT := $FD8E
PRBYTE := $FDDA PRBYTE := $FDDA
COUT := $FDED COUT := $FDED
@ -28,5 +33,4 @@ BELL := $FF3A
;;; Applesoft ROM locations ;;; Applesoft ROM locations
TOKTABL := $D0D0 TOKTABL := $D0D0
LINPRT := $ED24 LINPRT := $ED24

View File

@ -18,7 +18,7 @@ add_file () {
} }
add_file "out/path.BIN" "path#062000" 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" add_file "out/${file}.CMD" "${file}#F04000"
done done

View File

@ -29,9 +29,9 @@
lda #0 lda #0
sta XCNUM sta XCNUM
;; Set accepted parameter flags (Name, Type, Address) ;; Set accepted parameter flags (Filename)
lda #PBitsFlags::FN1 ; Filenames lda #PBitsFlags::FN1 ; Filename
sta PBITS sta PBITS
lda #PBitsFlags::SD ; Slot & Drive handling lda #PBitsFlags::SD ; Slot & Drive handling
sta PBITS+1 sta PBITS+1