uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

dvd.tal (1394B)


      1 ( DVD Bounce )
      2 
      3 |00 @System &vector $2 &wst $1 &rst $1 &eaddr $2 &ecode $1 &pad $1 &r $2 &g $2 &b $2 &debug $1 &halt $1
      4 |20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
      5 
      6 |0000
      7 
      8 	@dvd &x $2 &y $2
      9 
     10 |0100
     11 
     12 @on-reset ( -> )
     13 	( | theme )
     14 	#4cfd .System/r DEO2
     15 	#4cf3 .System/g DEO2
     16 	#dcf2 .System/b DEO2
     17 	( | vectors )
     18 	;on-frame .Screen/vector DEO2
     19 	( | starting position )
     20 	.Screen/width DEI2 #01 SFT2 .dvd/x STZ2
     21 	.Screen/height DEI2 #01 SFT2 .dvd/y STZ2
     22 	( | set collisions )
     23 	.Screen/width DEI2 #0020 SUB2 ;on-frame/hit-hor STA2
     24 	.Screen/height DEI2 #0010 SUB2 ;on-frame/hit-ver STA2
     25 	( | drawing mode )
     26 	[ LIT2 36 -Screen/auto ] DEO
     27 	#01 draw-dvd BRK
     28 
     29 @on-frame ( -> )
     30 	#00 draw-dvd
     31 	( | x )
     32 	.dvd/x LDZ2
     33 	( left ) ORAk ?{ #0001 ,&x STR2 }
     34 	( right ) DUP2 [ LIT2 &hit-hor $2 ] NEQ2 ?{ #ffff ,&x STR2 }
     35 	[ LIT2 &x 0001 ] ADD2 .dvd/x STZ2
     36 	( | y )
     37 	.dvd/y LDZ2
     38 	( top ) ORAk ?{ #0001 ,&y STR2 }
     39 	( bottom ) DUP2 [ LIT2 &hit-ver $2 ] NEQ2 ?{ #ffff ,&y STR2 }
     40 	[ LIT2 &y 0001 ] ADD2 .dvd/y STZ2
     41 	#01 draw-dvd BRK
     42 
     43 @draw-dvd ( color -- )
     44 	;dvd-icn .Screen/addr DEO2
     45 	.dvd/x LDZ2 .Screen/x DEO2
     46 	.dvd/y LDZ2 .Screen/y DEO2
     47 	.Screen/sprite DEOk DEO
     48 	JMP2r
     49 
     50 @dvd-icn ( 4 x 2 )
     51 	[
     52 	001f 3f38 3838 787f 00fe fe7e 7777 e3c3
     53 	000f 1f3b 7b77 e7c7 00fc fe8f 8707 0efc
     54 	7f00 000f ff7f 0700 0301 00ff f0f8 ff00
     55 	8700 00ff 7f7f ff00 f000 00e0 fcfc 8000 ]
     56