Skip to content

Commit

Permalink
Adds a new form of SOUND command, with only one parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsc committed Feb 25, 2018
1 parent 95c4c83 commit 584bd2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -938,12 +938,17 @@ Graphic and Sound Statements

**Adjust voice sound parameters**
**SOUND _voice_, _pitch_, _dist_, _vol_ / S.**
**SOUND _voice_**
**SOUND**

Adjust sound parameters for _voice_
(from 0 to 3) ot the given _pitch_,
_distortion_ and _volume_.

If only the _voice_ parameter is
present, that voice is cleared so no
sound is produced by that voice.

If no parameters are given, clears
all voices so that no sounds are
produced.
Expand Down
12 changes: 10 additions & 2 deletions src/basic.syn
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,15 @@ NEXT_VARNAME:
POSITION:
emit TOK_BYTE emit COLCRS EXPR "," emit TOK_DPOKE emit TOK_BYTE emit ROWCRS EXPR emit TOK_POKE
# SOUND arguments, three possibilities:
# SOUND voice, freq, distort, vol
# SOUND voice
# SOUND
SOUND:
EXPR emit TOK_USHL emit TOK_NUM word AUDF1 emit TOK_ADD "," EXPR "," EXPR_AB emit TOK_SHL8 emit TOK_ADD emit TOK_DPOKE emit TOK_NUM word AUDCTL emit TOK_0 emit TOK_POKE emit TOK_NUM word SKCTL emit TOK_BYTE emit 3 emit TOK_POKE
EXPR emit TOK_USHL emit TOK_NUM word AUDF1 emit TOK_ADD emit TOK_0 emit TOK_DPOKE
emit TOK_SOUND_OFF
# Arrays
ARRAY_WORD_ADDR:
emit TOK_VAR_LOAD E_VAR_ARRAY_WORD PAR_EXPR emit TOK_USHL emit TOK_ADD
Expand Down Expand Up @@ -540,8 +549,7 @@ PARSE_LINE_COMMAND:
"DRawto" POSITION emit TOK_DRAWTO
"FIllto" POSITION emit TOK_FILLTO
"SEtcolor" EXPR emit TOK_NUM word COLOR0 emit TOK_ADD "," EXPR_AB emit TOK_POKE
"Sound" EXPR emit TOK_USHL emit TOK_NUM word AUDF1 emit TOK_ADD "," EXPR "," EXPR_AB emit TOK_SHL8 emit TOK_ADD emit TOK_DPOKE emit TOK_NUM word AUDCTL emit TOK_0 emit TOK_POKE emit TOK_NUM word SKCTL emit TOK_BYTE emit 3 emit TOK_POKE
"Sound" emit TOK_SOUND_OFF
"Sound" SOUND
"DIm" DIM_VAR DIM_MORE
"CLose" IO_CHAN emit TOK_CLOSE
"Open" IO_CHAN_COMMA emit TOK_BYTE emit OPEN XIO_EXPR
Expand Down

0 comments on commit 584bd2f

Please sign in to comment.