~rabbits/orca-toy

6c49a4497a123d725711721bb558885cc57455e5 — neauoire 1 year, 5 months ago cf2a2c7
Byte is now hexadecimal
2 files changed, 32 insertions(+), 9 deletions(-)

M README.md
M src/main.tal
M README.md => README.md +2 -1
@@ 57,7 57,8 @@ To display the list of operators inside of Orca, use `CmdOrCtrl+G`.

- `=` **synth**(channel octave note): Plays a synth note.
- `:` **midi**(channel octave note): Sends a midi note.
- `;` **byte**(octave note): Sends a single byte.
- `;` **note**(octave note): Sends a single note.
- `/` **byte**(hb lb): Sends a single byte.

## Controls


M src/main.tal => src/main.tal +30 -8
@@ 72,6 72,7 @@
%CHAR-HASH  { #23 } %CHAR-BANG  { #2a }
%CHAR-DOT   { #2e } %CHAR-SLASH { #2f }  
%CHAR-COLON { #3a } %CHAR-EQUAL { #3d }
%CHAR-SEMI  { #3b }

%IS-CHAR-KEY { STHk #20 > STHr #7b < #0101 == }
%CIUC { STHk #40 > STHr #5b < #0101 == } ( char -- flag )


@@ 1112,23 1113,43 @@ RTN

RTN

@op-byte ( x y char -- )
@op-note ( x y char -- )

	POP 
	DUP2 
		;get-bang JSR2 STH
		GET-INDEX STH2
		
	( get a )
	STH2kr INC2 ;get-port-right JSR2
	( get b )
	STH2kr INC2 INC2 ;get-port-right JSR2
	( req bang )
	ROTr STHr ,&is-bang JCN [ POP2 POP2r RTN ] &is-bang

	( set type ) STH2r IO-TYPE ROT ROT DATA-TYPES ++ STA 

	SWP #0c * + .Console/write DEO

RTN

	DUP2 GET-INDEX STH2
	;get-bang JSR2 STH ROTr ROTr
@op-byte ( x y char -- )

	POP 
	DUP2 
		;get-bang JSR2 STH
		GET-INDEX STH2
		
	( get a )
	STH2kr INC2 ;get-port-right JSR2
	( get b )
	STH2r INC2 INC2 ;get-port-right JSR2
	STH2kr INC2 INC2 ;get-port-right JSR2
	( req bang )
	ROTr STHr ,&is-bang JCN [ POP2 POP2r RTN ] &is-bang

	STHr ,&is-bang JCN 
		POP2 RTN 
		&is-bang
	( set type ) STH2r IO-TYPE ROT ROT DATA-TYPES ++ STA 

	SWP #0c * + .Console/write DEO
	#0f AND SWP #0f AND #40 SFT + .Console/write DEO

RTN



@@ 1162,6 1183,7 @@ RTN
	( special )
	DUP CHAR-BANG = ;op-bang JCN2
	DUP CHAR-HASH = ;op-comment JCN2
	DUP CHAR-SEMI = ;op-note JCN2
	DUP CHAR-EQUAL = ;op-synth JCN2
	DUP CHAR-COLON = ;op-midi JCN2
	DUP CHAR-SLASH = ;op-byte JCN2