Skip to content

Commit

Permalink
Remove SOUND_OFF token, replace with a USR call.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsc committed Mar 5, 2020
1 parent efb5a1a commit f90baab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
4 changes: 1 addition & 3 deletions src/basic.syn
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ TOKENS {
TOK_DIM, TOK_USHL
# Strings
TOK_COPY_STR, TOK_VAL, TOK_CMP_STR, TOK_INT_STR, TOK_STR_IDX, TOK_CAT_STR, TOK_CHR
# Sound off - could be implemented as simple POKE expressions, but it's shorter this way
TOK_SOUND_OFF
TOK_PAUSE
# USR, calls ML routinr
TOK_USR_ADDR, TOK_USR_PARAM, TOK_USR_CALL
Expand Down Expand Up @@ -435,7 +433,7 @@ SOUND:
emit { TOK_SHL8, TOK_ADD, TOK_DPOKE, TOK_0, TOK_NUM_POKE, &AUDCTL, \
TOK_BYTE, 3, TOK_NUM_POKE, &SKCTL }
SOUND_S1 emit { TOK_0, TOK_DPOKE }
emit TOK_SOUND_OFF
emit { TOK_NUM, &SOUND_OFF, TOK_USR_ADDR, TOK_USR_CALL }
SOUND_S1:
EXPR emit { TOK_USHL, TOK_PUSH_NUM, &AUDF1, TOK_ADD, TOK_SADDR }
Expand Down
14 changes: 2 additions & 12 deletions src/interp/soundoff.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,14 @@
; Silence all sound channels (SOUND without parameters)
; -----------------------------------------------------

.export sound_off
.export SOUND_OFF
.importzp next_instruction

.include "atari.inc"

.segment "RUNTIME"

.proc EXE_SOUND_OFF
pha
jsr sound_off
pla
jmp next_instruction
.endproc

.proc sound_off
.proc SOUND_OFF
ldy #7
lda #0
: sta AUDF1, y
Expand All @@ -50,7 +43,4 @@
rts
.endproc

.include "../deftok.inc"
deftoken "SOUND_OFF"

; vi:syntax=asm_ca65
4 changes: 2 additions & 2 deletions src/interpreter.asm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
.import __JUMPTAB_RUN__

; From soundoff.asm
.import sound_off
.import SOUND_OFF

.include "atari.inc"

Expand Down Expand Up @@ -144,7 +144,7 @@ interpreter_cptr = cptr
.endif ; FASTBASIC_FP

; Sound off
jsr sound_off
jsr SOUND_OFF

; Store current stack position to rewind on error
tsx
Expand Down
2 changes: 2 additions & 0 deletions src/parse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
; From interpreter.asm
.importzp DEGFLAG, DEGFLAG_DEG, DEGFLAG_RAD
.import EXE_END, saved_cpu_stack, PMGMODE, PMGBASE
; Interpreted commands
.import SOUND_OFF
; From errors.asm
.import error_msg_list
.importzp ERR_PARSE, ERR_NO_ELOOP, ERR_LABEL, ERR_TOO_LONG
Expand Down

0 comments on commit f90baab

Please sign in to comment.