Browse code

Renamed time device to datetime.

Andrew Alderwick authored on 27/03/2021 11:33:56
Showing 2 changed files
... ...
@@ -20,7 +20,7 @@
20 20
 |0100 ;Console { pad 8 char 1 byte 1 short 2 }
21 21
 |0110 ;Screen { width 2 height 2 pad 4 x 2 y 2 color 1 }
22 22
 |0120 ;Sprite { pad 8 x 2 y 2 addr 2 color 1 }
23
-|0190 ;Time { year 2 month 1 day 1 hour 1 minute 1 second 1 dow 1 doy 2 isdst 1 pad 4 get 1 }
23
+|0190 ;DateTime { year 2 month 1 day 1 hour 1 minute 1 second 1 dow 1 doy 2 isdst 1 pad 4 get 1 }
24 24
 |01F0 .RESET .FRAME .ERROR ( vectors )
25 25
 |01F8 [ 13fd 1ef3 1bf2 ] ( palette )
26 26
 
... ...
@@ -40,22 +40,22 @@
40 40
 
41 41
 @neralie-calc
42 42
 	( add up fractions of a pulse )
43
-	#0120 #00 ~Time.hour MUL2
44
-	#00c0 #00 ~Time.minute MUL2 ADD2
45
-	#00f8 #00 ~Time.second MUL2 ADD2
43
+	#0120 #00 ~DateTime.hour MUL2
44
+	#00c0 #00 ~DateTime.minute MUL2 ADD2
45
+	#00f8 #00 ~DateTime.second MUL2 ADD2
46 46
 	#0271 #00 ~fps.next MUL2 #00 ~fps.current DIV2 #0008 MUL2 ADD2
47 47
 	#01b0 DIV2
48 48
 
49 49
 	( add up units and tens of pulses )
50
-	#0042 #00 ~Time.hour MUL2 ADD2
51
-	#005e #00 ~Time.minute MUL2 ADD2
52
-	#000b #00 ~Time.second MUL2 ADD2
50
+	#0042 #00 ~DateTime.hour MUL2 ADD2
51
+	#005e #00 ~DateTime.minute MUL2 ADD2
52
+	#000b #00 ~DateTime.second MUL2 ADD2
53 53
 	DUP2 #0064 DIV2 DUP2 STH2 #0064 MUL2 SUB2 =neralie.n21 POP
54 54
 
55 55
 	( add up hundreds of pulses + 10 x beats )
56 56
 	STH2r
57
-	#01a0 #00 ~Time.hour MUL2 ADD2
58
-	#0006 #00 ~Time.minute MUL2 ADD2 =neralie.n6543
57
+	#01a0 #00 ~DateTime.hour MUL2 ADD2
58
+	#0006 #00 ~DateTime.minute MUL2 ADD2 =neralie.n6543
59 59
 
60 60
 	~neralie.n6543 ,print-short-decimal JSR2
61 61
 	#20 =Console.char
... ...
@@ -89,10 +89,10 @@
89 89
 	JMP2r
90 90
 
91 91
 @update-fps
92
-	#00 =Time.get
92
+	#00 =DateTime.get
93 93
 	~fps.next #01 ADD =fps.next
94
-	~Time.second ~fps.second NEQ JMP JMP2r
95
-	~Time.second =fps.second
94
+	~DateTime.second ~fps.second NEQ JMP JMP2r
95
+	~DateTime.second =fps.second
96 96
 	~fps.next =fps.current
97 97
 
98 98
 	~fps.next ^print-byte-decimal JSR
... ...
@@ -419,7 +419,7 @@ midi_poke(Uxn *u, Uint16 ptr, Uint8 b0, Uint8 b1)
419 419
 }
420 420
 
421 421
 Uint8
422
-time_poke(Uxn *u, Uint16 ptr, Uint8 b0, Uint8 b1)
422
+datetime_poke(Uxn *u, Uint16 ptr, Uint8 b0, Uint8 b1)
423 423
 {
424 424
 	Uint8 *m = u->ram.dat;
425 425
 	time_t seconds = time(NULL);
... ...
@@ -517,7 +517,7 @@ main(int argc, char **argv)
517 517
 	portuxn(&u, "file", file_poke);
518 518
 	portuxn(&u, "audio", audio_poke);
519 519
 	portuxn(&u, "midi", ppnil);
520
-	portuxn(&u, "time", time_poke);
520
+	portuxn(&u, "datetime", datetime_poke);
521 521
 	portuxn(&u, "---", ppnil);
522 522
 	portuxn(&u, "---", ppnil);
523 523
 	portuxn(&u, "---", ppnil);