Browse code

(clock.tal) Single rotation routine

Devine Lu Linvega authored on 20/11/2021 17:18:45
Showing 1 changed files
... ...
@@ -54,6 +54,7 @@
54 54
 	&hx $2 &hy $2 
55 55
 	&mx $2 &my $2 
56 56
 	&sx $2 &sy $2
57
+	&zx $2 &zy $2
57 58
 @line
58 59
 	&x0 $2 &y0 $2 &x $2 &y $2 &sx $2 &sy $2 &dx $2 &dy $2 &e1 $2 &e2 $2 &color $1
59 60
 
... ...
@@ -86,11 +87,10 @@
86 87
 	( circle )
87 88
 	#3c00 
88 89
 	&loop
89
-		( load ) DUP TOS 2** ;table ++ LDA2
90
-		TOS #0010 ** #001c // .center/x LDZ2 ++ #0049 -- .Screen/x DEO2
91
-		TOS #0010 ** #001c // .center/y LDZ2 ++ #0049 -- .Screen/y DEO2
90
+		DUP TOS 2** ;table ++ LDA2 
91
+			#001c ;circle JSR2 .Screen/x DEO2 .Screen/y DEO2
92 92
 		DUP #0f MOD #00 EQU INC .Screen/pixel DEO
93
-		INC GTHk ,&loop JCN
93
+		INC GTHk ;&loop JCN2
94 94
 	POP2
95 95
 
96 96
 	LIT ': 
... ...
@@ -143,6 +143,8 @@ BRK
143 143
 	.center/x LDZ2 .center/y LDZ2 
144 144
 		OVR2 OVR2 
145 145
 		OVR2 OVR2
146
+		OVR2 OVR2
147
+		.needles/zx LDZ2 .needles/zy LDZ2 #02 STHkr * ;draw-line JSR2
146 148
 		.needles/sx LDZ2 .needles/sy LDZ2 #02 STHkr * ;draw-line JSR2
147 149
 		.needles/mx LDZ2 .needles/my LDZ2 #01 STHkr * ;draw-line JSR2
148 150
 		.needles/hx LDZ2 .needles/hy LDZ2 #01 STHr * ;draw-line JSR2
... ...
@@ -207,15 +209,24 @@ RTN
207 209
 
208 210
 @make-needles ( -- )
209 211
 
210
-	#00 .DateTime/second DEI 2** ;table ++ LDA2
211
-		TOS SCALEY .needles/sy STZ2
212
-		TOS SCALEX .needles/sx STZ2
213
-	#00 .DateTime/minute DEI 2** ;table ++ LDA2
214
-		TOS 20** RADIUS ++ #0024 // SCALEY #0007 ++ .needles/my STZ2
215
-		TOS 20** RADIUS ++ #0024 // SCALEX #0007 ++ .needles/mx STZ2
216
-	#00 .DateTime/hour DEI 12HOURS #20 SFTk NIP ADD 2** ;table ++ LDA2
217
-		TOS 4// DUP2k ++ ++ #0020 ++ SCALEY .needles/hy STZ2
218
-		TOS 4// DUP2k ++ ++ #0020 ++ SCALEX .needles/hx STZ2
212
+	[ #00 .DateTime/second DEI #1e + #3c MOD ] 2** ;table ++ LDA2
213
+		#00a0 ,circle JSR .needles/zx STZ2 .needles/zy STZ2
214
+	[ #00 .DateTime/second DEI ] 2** ;table ++ LDA2
215
+		#0020 ,circle JSR .needles/sx STZ2 .needles/sy STZ2 
216
+	[ #00 .DateTime/minute DEI ] 2** ;table ++ LDA2
217
+		#0022 ,circle JSR .needles/mx STZ2 .needles/my STZ2 
218
+	[ #00 .DateTime/hour DEI 12HOURS #20 SFTk NIP ADD ] 2** ;table ++ LDA2
219
+		#002a ,circle JSR .needles/hx STZ2 .needles/hy STZ2
220
+
221
+RTN
222
+
223
+@circle ( cx cy radius* -- )
224
+
225
+	STH2 SWP
226
+	TOS 10** STH2kr // .center/x LDZ2 ++ #0080 10** STH2kr // -- 
227
+	STH2 SWP2r
228
+	TOS 10** STH2kr // .center/y LDZ2 ++  #0080 10** STH2kr // --
229
+	POP2r STH2r
219 230
 
220 231
 RTN
221 232