Browse code

Added error placeholder for launcher.tal

neauoire authored on 21/09/2021 18:53:04
Showing 1 changed files
... ...
@@ -13,6 +13,8 @@
13 13
 %DEBUG  { ;print-hex/byte JSR2 #0a .Console/write DEO }
14 14
 %DEBUG2 { ;print-hex/short JSR2 #0a .Console/write DEO }
15 15
 
16
+%HEX-CHAR { DUP #09 GTH #04 JCN #30 + RTN #57 + }
17
+
16 18
 ( devices )
17 19
 
18 20
 |00 @System  &vector $2 &pad     $6 &r      $2 &g     $2 &b      $2
... ...
@@ -21,12 +23,14 @@
21 23
 |80 @Controller [ &vector $2 &button $1 &key    $1 ]
22 24
 |90 @Mouse      [ &vector $2 &x        $2 &y      $2 &state $1 &wheel  $1 ]
23 25
 |a0 @File    &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2
26
+|b0 @DateTime   [ &year   $2 &month    $1 &day    $1 &hour  $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ]
24 27
 
25 28
 ( variables )
26 29
 
27 30
 |0000
28 31
 
29 32
 @input $30
33
+@second $1
30 34
 @pointer
31 35
 	&x  $2 &y  $2
32 36
 
... ...
@@ -40,6 +44,7 @@
40 44
 	#e02a .System/b DEO2
41 45
 
42 46
 	( vectors )
47
+	;on-frame .Screen/vector DEO2
43 48
 	;on-button .Controller/vector DEO2
44 49
 	;on-mouse .Mouse/vector DEO2
45 50
 
... ...
@@ -48,6 +53,13 @@
48 53
 	
49 54
 BRK
50 55
 
56
+@on-frame ( -> )
57
+
58
+	.DateTime/second DEI .second LDZ ! BRK?
59
+	.DateTime/second DEI .second STZ ;draw-time JSR2
60
+
61
+BRK
62
+
51 63
 @on-mouse ( -> )
52 64
 
53 65
 	;pointer-icn .Screen/addr DEO2
... ...
@@ -82,18 +94,6 @@ BRK
82 94
 
83 95
 BRK
84 96
 
85
-@redraw ( -- )
86
-
87
-	#0018 #0020 #0040 #0040 ;logo-icn #03 ;draw-icn JSR2
88
-	#0020 #0070 ;welcome-txt #01 ;draw-label JSR2
89
-
90
-	#0020 #0080 ;today-txt #01 ;draw-label JSR2
91
-	#0020 #00b0 ;prompt-txt #01 ;draw-label JSR2
92
-	#0020 #00c0 ;do-txt #03 ;draw-label JSR2
93
-	#03 ;form/draw JSR2
94
-
95
-RTN
96
-
97 97
 @form ( -- )
98 98
 
99 99
 	&append ( char -- )
... ...
@@ -136,9 +136,57 @@ RTN
136 136
 
137 137
 @launch ( path* -- )
138 138
 
139
-	.File/name DEO2
140
-	#ff00 .File/length DEO2
141
-	#0100 .File/load DEO2
139
+	POP2
140
+
141
+	#0020 #00e0 ;error-txt #08 ;draw-label JSR2
142
+
143
+RTN
144
+
145
+@redraw ( -- )
146
+
147
+	#0018 #0020 #0040 #0040 ;logo-icn #03 ;draw-icn JSR2
148
+	#0020 #0070 ;welcome-txt #01 ;draw-label JSR2
149
+	;draw-time JSR2
150
+	#0020 #00b0 ;prompt-txt #01 ;draw-label JSR2
151
+	#0020 #00c0 ;do-txt #03 ;draw-label JSR2
152
+	#03 ;form/draw JSR2
153
+
154
+RTN
155
+
156
+@draw-time ( -- )
157
+
158
+	.DateTime/day DEI
159
+		DUP #0f AND ;hex-char JSR2 ;&date-str #0009 ++ STA
160
+		#04 SFT ;hex-char JSR2 ;&date-str #0008 ++ STA
161
+	.DateTime/month DEI
162
+		DUP #0f AND ;hex-char JSR2 ;&date-str #0006 ++ STA
163
+		#04 SFT ;hex-char JSR2 ;&date-str #0005 ++ STA
164
+	.DateTime/year DEI2
165
+		DUP #0f AND ;hex-char JSR2 ;&date-str #0003 ++ STA
166
+		#04 SFT ;hex-char JSR2 ;&date-str #0002 ++ STA
167
+		DUP #0f AND ;hex-char JSR2 ;&date-str INC2 STA
168
+		#04 SFT ;hex-char JSR2 ;&date-str STA
169
+
170
+	.DateTime/second DEI
171
+		DUP #0f AND ;hex-char JSR2 ;&time-str #0007 ++ STA
172
+		#04 SFT ;hex-char JSR2 ;&time-str #0006 ++ STA
173
+	.DateTime/minute DEI
174
+		DUP #0f AND ;hex-char JSR2 ;&time-str #0004 ++ STA
175
+		#04 SFT ;hex-char JSR2 ;&time-str #0003 ++ STA
176
+	.DateTime/hour DEI
177
+		DUP #0f AND ;hex-char JSR2 ;&time-str INC2 STA
178
+		#04 SFT ;hex-char JSR2 ;&time-str STA
179
+
180
+	#0020 #0080 ;&date-str #01 ;draw-label JSR2
181
+	#0080 #0080 ;&time-str #02 ;draw-label JSR2
182
+
183
+RTN
184
+	&date-str "0000-00-00 $1
185
+	&time-str "00:00:00 $1
186
+
187
+@hex-char ( hex -- char )
188
+
189
+	HEX-CHAR
142 190
 
143 191
 RTN
144 192
 
... ...
@@ -232,12 +280,15 @@ RTN
232 280
 @welcome-txt
233 281
 	"Welcome 20 "to 20 "your 20 "UXN 20 "Ordinator $1
234 282
 @today-txt
235
-	"Today 20 "is 20 "21Q04 ". $1
283
+	"Today 20 "is 20 "0000-00-00 ", 20 "the 20 "time 20 "is 20 "00:00:00 $1
236 284
 @prompt-txt
237 285
 	"What 20 "shall 20 "we 20 "do? $1
238 286
 @do-txt
239 287
 	"$: $1
240 288
 
289
+@error-txt
290
+	"Sorry, 20 "ROM 20 "not 20 "found. $1
291
+
241 292
 @pointer-icn
242 293
 	80c0 e0f0 f8e0 1000
243 294
 @cursor-icn