Browse code

Added simple macros to Neralie

Andrew Alderwick authored on 23/04/2021 08:58:19
Showing 1 changed files
... ...
@@ -5,6 +5,10 @@
5 5
 		- Implement higher resolution time rather than counting fps
6 6
 )
7 7
 
8
+%h { .DateTime/hour   DEI }
9
+%m { .DateTime/minute DEI }
10
+%s { .DateTime/second DEI }
11
+
8 12
 ( devices )
9 13
 
10 14
 |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
... ...
@@ -61,22 +65,22 @@
61 65
 
62 66
 @neralie-calc ( -- )
63 67
 	( add up fractions of a pulse, store tenths in n6 )
64
-	#0120 #00 .DateTime/hour DEI MUL2
65
-	#00c0 #00 .DateTime/minute DEI MUL2 ADD2
66
-	#00f8 #00 .DateTime/second DEI MUL2 ADD2
68
+	#0120 #00 h MUL2
69
+	#00c0 #00 m MUL2 ADD2
70
+	#00f8 #00 s MUL2 ADD2
67 71
 	#0271 #00 .fps/next PEK MUL2 #00 .fps/current PEK DIV2 #0008 MUL2 ADD2
68 72
 	#01b0 ;modf JSR2 SWP2 #0017 MUL2 #03e8 DIV2 .neralie/n6 POK POP
69 73
 
70 74
 	( add up units and tens of pulses, store in n5 and n4 )
71
-	#0042 #00 .DateTime/hour DEI MUL2 ADD2
72
-	#005e #00 .DateTime/minute DEI MUL2 ADD2
73
-	#000b #00 .DateTime/second DEI MUL2 ADD2
75
+	#0042 #00 h MUL2 ADD2
76
+	#005e #00 m MUL2 ADD2
77
+	#000b #00 s MUL2 ADD2
74 78
 	#000a ;modf JSR2 SWP2 .neralie/n5 POK POP
75 79
 	#000a ;modf JSR2 SWP2 .neralie/n4 POK POP
76 80
 
77 81
 	( add up hundreds of pulses + 10 x beats, store in n0123 )
78
-	#01a0 #00 .DateTime/hour DEI MUL2 ADD2
79
-	#0006 #00 .DateTime/minute DEI MUL2 ADD2 .neralie/n0123 POK2
82
+	#01a0 #00 h MUL2 ADD2
83
+	#0006 #00 m MUL2 ADD2 .neralie/n0123 POK2
80 84
 
81 85
 	JMP2r
82 86
 
... ...
@@ -192,8 +196,8 @@
192 196
 @update-fps ( -- )
193 197
 	#00 .DateTime/refresh DEO
194 198
 	.fps/next PEK #01 ADD .fps/next POK
195
-	.DateTime/second DEI .fps/second PEK NEQ JMP JMP2r
196
-	.DateTime/second DEI .fps/second POK
199
+	s .fps/second PEK NEQ JMP JMP2r
200
+	s .fps/second POK
197 201
 	.fps/next PEK .fps/current POK
198 202
 
199 203
 	( ~fps.next ^print-byte-decimal JSR