~rabbits/orca-toy

4cbeb480349c509f582cfd97119c8cabaf1cd803 — Devine Lu Linvega 2 months ago 4afa095
Removed unused strings
1 files changed, 88 insertions(+), 93 deletions(-)

M src/orca.tal
M src/orca.tal => src/orca.tal +88 -93
@@ 14,7 14,7 @@

|00 @System     &vector $2 &pad      $6 &r      $2 &g     $2 &b      $2
|10 @Console    &vector $2 &read     $1 &pad    $5 &write $1
|20 @Screen     &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|20 @Screen     &vector $2 &width    $2 &height $2 &auto  $1 &pad    $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|30 @Audio0     &vector $2 &position $2 &output $1 &pad   $3 &adsr   $2 &length $2 &addr  $2 &volume $1 &pitch $1
|40 @Audio1     &vector $2 &position $2 &output $1 &pad   $3 &adsr   $2 &length $2 &addr  $2 &volume $1 &pitch $1
|50 @Audio2     &vector $2 &position $2 &output $1 &pad   $3 &adsr   $2 &length $2 &addr  $2 &volume $1 &pitch $1


@@ 55,10 55,10 @@
	#01c0 .Screen/height DEO2

	( synths )
	#dd .Audio0/volume DEO  #0118 .Audio0/adsr DEO2 #0100 .Audio0/length DEO2
	#ef .Audio1/volume DEO  #0334 .Audio1/adsr DEO2 #0100 .Audio1/length DEO2
	#fe .Audio2/volume DEO  #1414 .Audio2/adsr DEO2 #0100 .Audio2/length DEO2
	#dd .Audio3/volume DEO  #222c .Audio3/adsr DEO2 #0100 .Audio3/length DEO2
	#dd .Audio0/volume DEO #0118 .Audio0/adsr DEO2 #0100 .Audio0/length DEO2
	#ef .Audio1/volume DEO #0334 .Audio1/adsr DEO2 #0100 .Audio1/length DEO2
	#fe .Audio2/volume DEO #1414 .Audio2/adsr DEO2 #0100 .Audio2/length DEO2
	#dd .Audio3/volume DEO #222c .Audio3/adsr DEO2 #0100 .Audio3/length DEO2

	;sin-pcm .Audio0/addr DEO2
	;tri-pcm .Audio1/addr DEO2


@@ 507,8 507,7 @@ BRK
	;data/types STH2r ;mclr JSR2
	#00 .signal/midi STZ

@init-variables ( -- )

	( init-variables )
	#2400
	&loop
		STHk #2e2e .variables STHr ADD STZ2


@@ 640,7 639,7 @@ JMP2r
		NIP STHr SUB JMP2r
		&no-below
	NIP STHr ADD
	

JMP2r

( drawing )


@@ 655,7 654,7 @@ JMP2r
	;draw-sprite/blank JSR2
	( icon )
	.dpad LDZ #01 ;draw-char JSR2
	

JMP2r

@draw-position ( -- )


@@ 762,7 761,7 @@ JMP2r
		.head/addr LDZ2 ;data/types ADD2 LDA ,&dot JCN
		POP2 #20
	&no-bar
	

JMP2r
	&cross POP2 LIT '+ JMP2r
	&dot POP2 LIT '. JMP2r


@@ 848,7 847,7 @@ JMP2r
	STH #20 SUB #00 SWP #40 SFT2 ;font ADD2 STHr

@draw-sprite ( addr* color -- )
	

	STH .Screen/addr DEO2
	STHr .Screen/sprite DEO



@@ 937,11 936,11 @@ JMP2r
	( seed )
	#00 .DateTime/second DEI
	#00 .DateTime/minute DEI #60 SFT2 EOR2
	#00 .DateTime/hour   DEI #c0 SFT2 EOR2 ,prng/x STR2
	#00 .DateTime/hour   DEI #04 SFT2
	#00 .DateTime/day    DEI #10 SFT2 EOR2
	#00 .DateTime/month  DEI #60 SFT2 EOR2
		.DateTime/year  DEI2 #a0 SFT2 EOR2 ,prng/y STR2
	#00 .DateTime/hour DEI #c0 SFT2 EOR2 ,prng/x STR2
	#00 .DateTime/hour DEI #04 SFT2
	#00 .DateTime/day DEI #10 SFT2 EOR2
	#00 .DateTime/month DEI #60 SFT2 EOR2
	.DateTime/year DEI2 #a0 SFT2 EOR2 ,prng/y STR2

JMP2r



@@ 981,7 980,7 @@ JMP2r

	,copy-snarf JSR
	CHAR-DOT ;fill-sel JSR2
	

JMP2r

@copy-snarf ( -- )


@@ 1010,28 1009,23 @@ JMP2r

JMP2r

( orca/opcodes )
( library )

@op-table
	&docs
	:op-a :op-b :op-c :op-d :op-e :op-f :op-g :op-h
	:op-i :op-j :op-k :op-l :op-m :op-n :op-o :op-p
	:op-q :op-r :op-s :op-t :op-u :op-v :op-w :op-x
	:op-y :op-z
	:op-bang :op-comment :op-synth :op-midi :op-pitch :op-byte :op-self
	&docs
	:op-a/docs :op-b/docs :op-c/docs :op-d/docs :op-e/docs :op-f/docs :op-g/docs :op-h/docs
	:op-i/docs :op-j/docs :op-k/docs :op-l/docs :op-m/docs :op-n/docs :op-o/docs :op-p/docs
	:op-q/docs :op-r/docs :op-s/docs :op-t/docs :op-u/docs :op-v/docs :op-w/docs :op-x/docs
	:op-y/docs :op-z/docs
	:op-bang/docs :op-comment/docs :op-synth/docs :op-midi/docs :op-pitch/docs :op-byte/docs :op-self/docs
	&func
	:op-a/func :op-b/func :op-c/func :op-d/func :op-e/func :op-f/func :op-g/func :op-h/func
	:op-i/func :op-j/func :op-k/func :op-l/func :op-m/func :op-n/func :op-o/func :op-p/func
	:op-q/func :op-r/func :op-s/func :op-t/func :op-u/func :op-v/func :op-w/func :op-x/func
	:op-y/func :op-z/func

@op-a "add $1
	&docs 'A "Outputs 20 "sum 20 "of 20 "inputs $1
@op-a ( add ) 
	'A "Outputs 20 "sum 20 "of 20 "inputs $1
	&func ( addr* -- )

	STH2k


@@ 1045,8 1039,8 @@ JMP2r

JMP2r

@op-b "subtract $1
	&docs 'B "Outputs 20 "difference 20 "of 20 "inputs $1
@op-b ( subtract )
	'B "Outputs 20 "difference 20 "of 20 "inputs $1
	&func ( addr* -- )

	STH2k


@@ 1060,8 1054,8 @@ JMP2r

JMP2r

@op-c "clock $1
	&docs 'C "Outputs 20 "modulo 20 "of 20 "frame $1
@op-c ( clock )
	'C "Outputs 20 "modulo 20 "of 20 "frame $1
	&func ( addr* -- )

	STH2k


@@ 1075,8 1069,8 @@ JMP2r

JMP2r

@op-d "delay $1
	&docs 'D "Bangs 20 "on 20 "modulo 20 "of 20 "frame $1
@op-d ( delay )
	'D "Bangs 20 "on 20 "modulo 20 "of 20 "frame $1
	&func ( addr* -- )

	STH2k


@@ 1088,8 1082,8 @@ JMP2r

JMP2r

@op-e "east $1
	&docs 'E "Moves 20 "eastward 20 "or 20 "bangs $1
@op-e ( east )
	'E "Moves 20 "eastward 20 "or 20 "bangs $1
	&func ( addr* -- )

	STH2k ;data/cells ADD2 LDA ,&self STR


@@ 1103,20 1097,20 @@ JMP2r

JMP2r

@op-f "if $1
	&docs 'F "Bangs 20 "if 20 "inputs 20 "are 20 "equal $1
@op-f ( if )
	'F "Bangs 20 "if 20 "inputs 20 "are 20 "equal $1
	&func ( addr* -- )

	STH2k
	( get a ) #0001 SUB2 ;get-port-left-raw JSR2
	( get b ) STH2kr INC2 ;get-port-right-raw JSR2
	( bang on equal ) EQU [ #fc MUL CHAR-DOT ADD  ]
	( bang on equal ) EQU [ #fc MUL CHAR-DOT ADD ]
	( output ) STH2r #00 .grid/width LDZ ADD2 ;set-port-output JSR2

JMP2r

@op-g "generator $1
	&docs 'G "Writes 20 "operands 20 "with 20 "offset $1
@op-g ( generator )
	'G "Writes 20 "operands 20 "with 20 "offset $1
	&func ( addr* -- )

	STH2k


@@ 1136,8 1130,8 @@ JMP2r

JMP2r

@op-h "hold $1
	&docs 'H "Holds 20 "southward 20 "operand $1
@op-h ( hold )
	'H "Holds 20 "southward 20 "operand $1
	&func ( addr* -- )

	#00 .grid/width LDZ ADD2


@@ 1146,8 1140,8 @@ JMP2r

JMP2r

@op-i "increment $1
	&docs 'I "Increments 20 "southward 20 "operand $1
@op-i ( increment )
	'I "Increments 20 "southward 20 "operand $1
	&func ( addr* -- )

	STH2k


@@ 1161,8 1155,8 @@ JMP2r

JMP2r

@op-j "jumper $1
	&docs 'J "Outputs 20 "northward 20 "operand $1
@op-j ( jumper )
	'J "Outputs 20 "northward 20 "operand $1
	&func ( addr* -- )

	STH2k


@@ 1179,8 1173,8 @@ JMP2r

JMP2r

@op-k "konkat $1
	&docs 'K "Reads 20 "multiple 20 "variables $1
@op-k ( konkat )
	'K "Reads 20 "multiple 20 "variables $1
	&func ( addr* -- )

	STH2k


@@ 1199,8 1193,8 @@ JMP2r

JMP2r

@op-l "lesser $1
	&docs 'L "Outputs 20 "smallest 20 "of 20 "inputs $1
@op-l ( lesser )
	'L "Outputs 20 "smallest 20 "of 20 "inputs $1
	&func ( addr* -- )

	STH2k


@@ 1214,8 1208,8 @@ JMP2r

JMP2r

@op-m "multiply $1
	&docs 'M "Outputs 20 "product 20 "of 20 "inputs $1
@op-m ( multiply )
	'M "Outputs 20 "product 20 "of 20 "inputs $1
	&func ( addr* -- )

	STH2k


@@ 1229,8 1223,8 @@ JMP2r

JMP2r

@op-n "north $1
	&docs 'N "Moves 20 "Northward 20 "or 20 "bangs $1
@op-n ( north )
	'N "Moves 20 "Northward 20 "or 20 "bangs $1
	&func ( addr* -- )

	STH2k ;data/cells ADD2 LDA ,&self STR


@@ 1244,8 1238,8 @@ JMP2r

JMP2r

@op-o "read $1
	&docs 'O "Reads 20 "operand 20 "with 20 "offset $1
@op-o ( read )
	'O "Reads 20 "operand 20 "with 20 "offset $1
	&func ( addr* -- )

	STH2k


@@ 1256,8 1250,8 @@ JMP2r

JMP2r

@op-p "push $1
	&docs 'P "Writes 20 "eastward 20 "operand $1
@op-p ( push )
	'P "Writes 20 "eastward 20 "operand $1
	&func ( addr* -- )

	STH2k


@@ 1275,8 1269,8 @@ JMP2r

JMP2r

@op-q "query $1
	&docs 'Q "Reads 20 "operands 20 "with 20 "offset $1
@op-q ( query )
	'Q "Reads 20 "operands 20 "with 20 "offset $1
	&func ( addr* -- )

	STH2k


@@ 1297,8 1291,8 @@ JMP2r

JMP2r

@op-r "random $1
	&docs 'R "Outputs 20 "random 20 "value $1
@op-r ( random )
	'R "Outputs 20 "random 20 "value $1
	&func ( addr* -- )

	STH2k


@@ 1312,8 1306,8 @@ JMP2r

JMP2r

@op-s "south $1
	&docs 'S "Moves 20 "southward 20 "or 20 "bangs $1
@op-s ( south )
	'S "Moves 20 "southward 20 "or 20 "bangs $1
	&func ( addr* -- )

	STH2k ;data/cells ADD2 LDA ,&self STR


@@ 1327,8 1321,8 @@ JMP2r

JMP2r

@op-t "track $1
	&docs 'T "Reads 20 "eastward 20 "operand $1
@op-t ( track )
	'T "Reads 20 "eastward 20 "operand $1
	&func ( addr* -- )

	STH2k


@@ 1346,8 1340,8 @@ JMP2r

JMP2r

@op-u "Uclid $1
	&docs 'U "Bangs 20 "on 20 "Euclidean 20 "rhythm $1
@op-u ( Uclid )
	'U "Bangs 20 "on 20 "Euclidean 20 "rhythm $1
	&func ( addr* -- )

	STH2k


@@ 1363,8 1357,8 @@ JMP2r

JMP2r

@op-v "variable $1
	&docs 'V "Reads 20 "and 20 "writes 20 "variable $1
@op-v ( variable )
	'V "Reads 20 "and 20 "writes 20 "variable $1
	&func ( addr* -- )

	STH2k


@@ 1381,8 1375,8 @@ JMP2r

JMP2r

@op-w "west $1
	&docs 'W "Moves 20 "westward 20 "or 20 "bangs $1
@op-w ( west )
	'W "Moves 20 "westward 20 "or 20 "bangs $1
	&func ( addr* -- )

	STH2k ;data/cells ADD2 LDA ,&self STR


@@ 1396,8 1390,8 @@ JMP2r

JMP2r

@op-x "write $1
	&docs 'X "Writes 20 "operand 20 "with 20 "offset $1
@op-x ( write )
	'X "Writes 20 "operand 20 "with 20 "offset $1
	&func ( addr* -- )

	STH2k


@@ 1408,8 1402,8 @@ JMP2r

JMP2r

@op-y "yumper $1
	&docs 'Y "Outputs 20 "westward 20 "operand $1
@op-y ( yumper )
	'Y "Outputs 20 "westward 20 "operand $1
	&func ( addr* -- )

	STH2k


@@ 1426,8 1420,8 @@ JMP2r

JMP2r

@op-z "lerp $1
	&docs 'Z "Transitions 20 "operand 20 "to 20 "input $1
@op-z ( lerp )
	'Z "Transitions 20 "operand 20 "to 20 "input $1
	&func ( addr* -- )

	STH2k


@@ 1444,8 1438,8 @@ JMP2r

( special )

@op-bang "bang $1
	&docs '* "Bangs 20 "neighboring 20 "operands $1
@op-bang ( bang )
	'* "Bangs 20 "neighboring 20 "operands $1
	&func ( char -- )

	POP


@@ 1453,8 1447,8 @@ JMP2r

JMP2r

@op-comment "comment $1
	&docs '# "Comments 20 "a 20 "line $1
@op-comment ( comment )
	'# "Comments 20 "a 20 "line $1
	&func ( char -- )

	POP


@@ 1475,8 1469,8 @@ JMP2r

JMP2r

@op-synth "synth $1
	&docs '= "Play 20 "note 20 "with 20 "uxn 20 "synth $1
@op-synth ( synth )
	'= "Play 20 "note 20 "with 20 "uxn 20 "synth $1
	&func ( char -- )

	POP


@@ 1492,8 1486,8 @@ JMP2r

JMP2r

@op-midi "midi $1
	&docs ': "Send 20 "a 20 "midi 20 "note $1
@op-midi ( midi )
	': "Send 20 "a 20 "midi 20 "note $1
	&func ( char -- )

	POP


@@ 1535,11 1529,11 @@ JMP2r
		JMP2r
	&done
	POP2
	

JMP2r

@op-pitch "pitch $1
	&docs '; "Send 20 "a 20 "raw 20 "pitch 20 "byte $1
@op-pitch ( pitch )
	'; "Send 20 "a 20 "raw 20 "pitch 20 "byte $1
	&func ( char -- )

	POP


@@ 1553,8 1547,8 @@ JMP2r

JMP2r

@op-byte "byte $1
	&docs '/ "Send 20 "a 20 "raw 20 "hexadecimal 20 "byte $1
@op-byte ( byte )
	'/ "Send 20 "a 20 "raw 20 "hexadecimal 20 "byte $1
	&func ( char -- )

	POP


@@ 1567,8 1561,8 @@ JMP2r

JMP2r

@op-self "self $1
	&docs '$ "Load 20 "orca 20 "file $1
@op-self ( self )
	'$ "Load 20 "orca 20 "file $1
	&func ( char -- )

	POP


@@ 1711,7 1705,7 @@ JMP2r

( orca/assets )

@untitled-txt  "untitled.orca $1
@untitled-txt "untitled.orca $1

@notes
	( lc )


@@ 1964,3 1958,4 @@ JMP2r
	&cells $4000
	&locks $4000
	&types $4000