Browse code

(screen.tal) Display screen size

Devine Lu Linvega authored on 10/01/2023 03:04:52
Showing 1 changed files
... ...
@@ -6,7 +6,6 @@
6 6
 
7 7
 |0000
8 8
 
9
-	@count $2
10 9
 	@center &x $2 &y $2
11 10
 
12 11
 |0100 ( -> )
... ...
@@ -25,6 +24,7 @@
25 24
 	.Screen/width DEI2 #01 SFT2 .center/x STZ2
26 25
 	.Screen/height DEI2 #01 SFT2 .center/y STZ2
27 26
 	( draw )
27
+	;draw-size JSR2
28 28
 	;draw-sprites JSR2
29 29
 	;draw-1bpp JSR2
30 30
 	;draw-2bpp JSR2
... ...
@@ -32,16 +32,21 @@
32 32
 	
33 33
 BRK
34 34
 
35
+(
36
+@|vectors )
37
+
35 38
 @on-frame ( -> )
36 39
 
37
-	#01 .Screen/auto DEO
38
-	.count LDZ2 INC2 [ DUP2 ] .count STZ2
39
-	.center/x LDZ2 #0050 ADD2 .Screen/x DEO2
40
+	.center/x LDZ2 #0070 SUB2 .Screen/x DEO2
40 41
 	.center/y LDZ2 #0048 SUB2 .Screen/y DEO2
41
-	;draw-short JSR2
42
+	;anim-chr #00 [ LIT &f $1 ] INCk ,&f STR #07 AND #40 SFT ADD2 .Screen/addr DEO2
43
+	#81 .Screen/sprite DEO
42 44
 
43 45
 BRK
44 46
 
47
+(
48
+@|drawing )
49
+
45 50
 @draw-sprites ( -- )
46 51
 	
47 52
 	( horizontal )
... ...
@@ -119,19 +124,41 @@ JMP2r
119 124
 
120 125
 JMP2r
121 126
 
122
-@draw-short ( short* -- )
127
+@draw-size ( -- )
123 128
 
124
-	SWP ,&byte JSR
125
-	&byte ( byte -- ) DUP #04 SFT ,&hex JSR #0f AND
126
-	&hex ( char -- )
127
-	#00 SWP #30 SFT2 ;font-hex ADD2 .Screen/addr DEO2
129
+	#01 .Screen/auto DEO
130
+	.center/x LDZ2 #0030 ADD2 .Screen/x DEO2
131
+	.center/y LDZ2 #0048 SUB2 .Screen/y DEO2
132
+	.Screen/width DEI2 ;draw-dec JSR2
133
+	;x-icn .Screen/addr DEO2
128 134
 	#01 .Screen/sprite DEO
135
+	.Screen/height DEI2
136
+
137
+@draw-dec ( short* -- )
138
+
139
+	#00 ,&z STR
140
+	#2710 ,&parse JSR
141
+	#03e8 ,&parse JSR
142
+	#0064 ,&parse JSR
143
+	#000a ,&parse JSR
144
+	NIP
145
+	&emit
146
+		DUP [ LIT &z $1 ] EQU ,&skip JCN
147
+			#ff ,&z STR #00 OVR #30 SFT ;font-hex ADD2 .Screen/addr DEO2
148
+			#01 .Screen/sprite DEO
149
+			&skip
150
+	POP
129 151
 
130 152
 JMP2r
153
+	&parse DIV2k DUP ,&emit JSR MUL2 SUB2 JMP2r
154
+
155
+(
156
+@|assets )
131 157
 
158
+@x-icn
159
+	0000 0018 1800 0000
132 160
 @preview_icn
133 161
 	0f38 675f dfbf bfbf 0007 1820 2344 4848
134
-
135 162
 @font-hex
136 163
 	007c 8282 8282 827c 0030 1010 1010 1010
137 164
 	007c 8202 7c80 80fe 007c 8202 1c02 827c
... ...
@@ -141,3 +168,11 @@ JMP2r
141 168
 	007c 8202 7e82 827e 00fc 8282 fc82 82fc
142 169
 	007c 8280 8080 827c 00fc 8282 8282 82fc
143 170
 	007c 8280 f080 827c 007c 8280 f080 8080
171
+
172
+@anim-chr
173
+	0000 0018 1800 0000 c381 0000 0000 81c3 0000 183c 3c18 0000 0000 0000 0000 0000 
174
+	0018 3c7e 7e3c 1800 0000 0000 0000 0000 3c7e ffe7 e7ff 7e3c 0000 0018 1800 0000 
175
+	ffff e7c3 c3e7 ffff 0000 183c 3c18 0000 ffe7 c381 81c3 e7ff 0018 3c7e 7e3c 1800 
176
+	c381 0000 0000 81c3 3c7e ffe7 e7ff 7e3c 0000 0000 0000 0000 ffff e7c3 c3e7 ffff 
177
+	0000 0000 0000 0000 ffe7 c381 81c3 e7ff
178
+