Browse code

(logic.tal) Cleanup

Devine Lu Linvega authored on 20/11/2021 22:37:48
Showing 1 changed files
... ...
@@ -17,10 +17,10 @@
17 17
 %10** { #40 SFT2 } %10// { #04 SFT2 }
18 18
 %20** { #50 SFT2 } %20// { #05 SFT2 }
19 19
 
20
-%DEBUG  { ;print-hex JSR2 #0a .Console/write DEO }
21
-%DEBUG2 { SWP ;print-hex JSR2 ;print-hex JSR2 #0a .Console/write DEO }
22
-
23 20
 %RELEASE-MOUSE { #0096 DEO }
21
+%AUTO-X { #01 .Screen/auto DEO }
22
+%AUTO-X-ADDR { #05 .Screen/auto DEO }
23
+%AUTO-NONE { #00 .Screen/auto DEO }
24 24
 
25 25
 %RTN { JMP2r }
26 26
 %TOS { #00 SWP }
... ...
@@ -52,7 +52,6 @@
52 52
 @pointer
53 53
 	&x $2 &y $2
54 54
 
55
-
56 55
 ( program )
57 56
 
58 57
 |0100 ( -> )
... ...
@@ -139,7 +138,23 @@ BRK
139 138
 	.Screen/y DEI2 #000d ++ .Screen/y DEO2
140 139
 	.input LDZ2 EOR #03 ;draw-byte JSR2
141 140
 
141
+	( labels )
142
+	AUTO-X-ADDR
143
+	.b-frame/x LDZ2 #0020 -- .Screen/x DEO2
144
+	;names-icn/and .Screen/addr DEO2
145
+	.b-frame/y2 LDZ2 #0004 ++ .Screen/y DEO2
146
+	,&draw-label JSR
147
+	.b-frame/y2 LDZ2 #0014 ++ .Screen/y DEO2
148
+	,&draw-label JSR
149
+	.b-frame/y2 LDZ2 #0024 ++ .Screen/y DEO2
150
+	,&draw-label JSR
151
+	AUTO-NONE
152
+
142 153
 RTN
154
+	&draw-label
155
+		.b-frame/x LDZ2 #0020 -- .Screen/x DEO2 
156
+		#03 .Screen/sprite DEOk DEOk DEO
157
+	RTN
143 158
 
144 159
 @draw-byte ( value -- )
145 160
 
... ...
@@ -151,6 +166,7 @@ RTN
151 166
 		INC GTHk ,&loop JCN
152 167
 	POP2
153 168
 	.Screen/y DEI2 #0003 ++ .Screen/y DEO2
169
+	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
154 170
 	STHr ;draw-hex JSR2
155 171
 	POPr
156 172
 
... ...
@@ -160,7 +176,7 @@ RTN
160 176
 
161 177
 	STH STH
162 178
 
163
-	#05 .Screen/auto DEO
179
+	AUTO-X-ADDR
164 180
 	;button-icns/off [ #00 STHkr 20* ++ ] .Screen/addr DEO2
165 181
 	OVRr STHr .Screen/sprite DEO
166 182
 	OVRr STHr .Screen/sprite DEO
... ...
@@ -168,7 +184,7 @@ RTN
168 184
 	.Screen/x DEI2 #0010 -- .Screen/x DEO2
169 185
 	OVRr STHr .Screen/sprite DEO
170 186
 	OVRr STHr .Screen/sprite DEO
171
-	#00 .Screen/auto DEO
187
+	AUTO-NONE
172 188
 	.Screen/y DEI2 #0008 -- .Screen/y DEO2
173 189
 
174 190
 	POPr POPr
... ...
@@ -177,14 +193,16 @@ RTN
177 193
 
178 194
 @draw-hex ( value -- )
179 195
 
180
-	DUP #04 SFT TOS 8** ;font-hex ++ .Screen/addr DEO2
181
-	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
182
-		( draw ) #01 .Screen/sprite DEO
183
-	#0f AND TOS 8** ;font-hex ++ .Screen/addr DEO2
184
-	.Screen/x DEI2 #0008 ++ .Screen/x DEO2
185
-		( draw ) #01 .Screen/sprite DEO
196
+	AUTO-X
197
+	DUP #04 SFT ,&draw JSR
198
+	#0f AND ,&draw JSR
199
+	AUTO-X
186 200
 
187 201
 RTN
202
+	&draw
203
+		TOS 8** ;font-hex ++ .Screen/addr DEO2
204
+		( draw ) #01 .Screen/sprite DEO
205
+	RTN
188 206
 
189 207
 @draw-cursor ( -- )
190 208
 	
... ...
@@ -218,16 +236,6 @@ RTN
218 236
 
219 237
 RTN
220 238
 
221
-@print-hex ( value -- )
222
-	
223
-	STHk #04 SFT ,&parse JSR .Console/write DEO
224
-	STHr #0f AND ,&parse JSR .Console/write DEO
225
-	RTN
226
-	&parse ( value -- char )
227
-		DUP #09 GTH ,&above JCN #30 ADD RTN &above #09 SUB #60 ADD RTN
228
-
229
-RTN
230
-
231 239
 @cursor 
232 240
 	80c0 e0f0 f8e0 1000 
233 241
 
... ...
@@ -243,6 +251,20 @@ RTN
243 251
 	bfbf bfbf 9f40 3f00
244 252
 	fafa fafa f204 f800
245 253
 
254
+@names-icn
255
+	&and
256
+	fc02 027e 8286 fa00
257
+	bcc2 8282 8282 8200
258
+	fc82 8282 8282 fc00
259
+	&ora
260
+	7c82 8282 8282 7c00
261
+	fc82 82fc 8282 8200
262
+	fc02 027e 8286 fa00
263
+	&eor
264
+	8282 4438 4482 8200
265
+	7c82 8282 8282 7c00
266
+	fc82 82fc 8282 8200
267
+
246 268
 @font-hex ( 0-F )
247 269
 	007c 8282 8282 827c 0030 1010 1010 1010
248 270
 	007c 8202 7c80 80fe 007c 8202 1c02 827c
... ...
@@ -253,4 +275,3 @@ RTN
253 275
 	007c 8280 8080 827c 00fc 8282 8282 82fc
254 276
 	007c 8280 f080 827c 007c 8280 f080 8080
255 277
 
256
-