Browse code

Animated screen.tal to demonstrate transparent sprites

Andrew Alderwick authored on 01/08/2021 16:44:27
Showing 1 changed files
... ...
@@ -6,6 +6,7 @@
6 6
 
7 7
 |00 @System     [ &vector $2 &pad      $6 &r      $2 &g     $2 &b      $2 ]
8 8
 |20 @Screen     [ &vector $2 &width    $2 &height $2 &pad   $2 &x      $2 &y     $2 &addr $2 &pixel $1 &sprite $1 ]
9
+|b0 @DateTime   [ &year   $2 &month    $1 &day    $1 &hour  $1 &minute $1 &second $1 &dotw $1 &doty   $2 &isdst $1 ]
9 10
 
10 11
 ( variables )
11 12
 
... ...
@@ -28,15 +29,21 @@
28 29
 
29 30
 	( draw )
30 31
 	;draw-table JSR2
31
-	;draw-sprites JSR2
32
+	;on-frame .Screen/vector DEO2
32 33
 
33 34
 	;draw-1bpp JSR2
34 35
 	;draw-2bpp JSR2
35 36
 
36 37
 	;draw-pixels JSR2
38
+
37 39
 	
38 40
 BRK
39 41
 
42
+@on-frame ( -> )
43
+	;draw-background JSR2
44
+	;draw-sprites JSR2
45
+	BRK
46
+
40 47
 @draw-table ( -- )
41 48
 	
42 49
 	#00 #10
... ...
@@ -103,7 +110,19 @@ RTN
103 110
 		SWP #01 ADD SWP
104 111
 		LTHk ,&loop JCN
105 112
 	POP2
106
-	
113
+
114
+@draw-background ( -- )
115
+	;solid .Screen/addr DEO2
116
+	#00 #00
117
+	&loop
118
+		( move ) OVR #0f AND #40 SFT #02 DIV #00 SWP 
119
+			.center/x LDZ2 #0040 SUB2 ADD2 .Screen/x DEO2
120
+		( move ) OVR #f0 AND #02 DIV #00 SWP 
121
+			.center/y LDZ2 #0040 SUB2 ADD2 .Screen/y DEO2
122
+		( draw ) OVR #40 AND .DateTime/second DEI #03 DIV #03 AND ORA .Screen/sprite DEO
123
+		( incr ) SWP #01 ADD SWP
124
+		NEQk ,&loop JCN
125
+	POP2
107 126
 RTN
108 127
 
109 128
 @draw-circle ( x* y* color depth -- )
... ...
@@ -141,6 +160,9 @@ RTN
141 160
 @preview_icn  [
142 161
 	0f38 675f dfbf bfbf 0007 1820 2344 4848 
143 162
 
163
+@solid
164
+	ffff ffff ffff ffff
165
+
144 166
 @font-hex 
145 167
 	007c 8282 8282 827c 0030 1010 1010 1010
146 168
 	007c 8202 7c80 80fe 007c 8202 1c02 827c