Browse code

Displaying files in launcher

Devine Lu Linvega authored on 07/11/2021 19:30:36
Showing 1 changed files
... ...
@@ -39,7 +39,7 @@
39 39
 @second $1
40 40
 @pointer
41 41
 	&x  $2 &y  $2
42
-@browser-frame
42
+@browser
43 43
 	&x $2 &y $2
44 44
 
45 45
 ( init )
... ...
@@ -56,13 +56,28 @@
56 56
 	;on-button .Controller/vector DEO2
57 57
 	;on-mouse .Mouse/vector DEO2
58 58
 
59
+	( place )
60
+	#0080 .browser/x STZ2
61
+	#0010 .browser/y STZ2
62
+
63
+	( draw mascot )
64
+	#0010 #0010 #0060 #0060 ;mascot-icn #01 ;draw-icn JSR2
65
+
66
+	( load directory )
67
+	;dir/path .File/name DEO2
68
+	#1000 .File/length DEO2
69
+	;dir/data .File/load DEO2
70
+
71
+	;dir/data #07 ;draw-browser JSR2
72
+
59 73
 	( theme support )
60 74
 	;load-theme JSR2
61
-	
75
+
62 76
 BRK
63 77
 
64 78
 @on-frame ( -> )
65 79
 
80
+	BRK
66 81
 	.DateTime/second DEI .second LDZ ! BRK?
67 82
 	.DateTime/second DEI .second STZ ;draw-time JSR2
68 83
 
... ...
@@ -91,66 +106,41 @@ BRK
91 106
 
92 107
 	.Controller/key DEI BRK?
93 108
 
94
-	.Controller/key DEI
95
-	DUP #08 ! ,&no-backspace JCN
96
-		;form/erase JSR2 POP BRK
97
-		&no-backspace
98
-	DUP #0d ! ,&no-enter JCN
99
-		;form/validate JSR2 POP BRK
100
-		&no-enter
101
-	;form/append JSR2
102
-
103 109
 BRK
104 110
 
105
-@form ( -- )
106
-
107
-	&append ( char -- )
108
-		,&seek JSR STH2k NIP #30 < ,&can-append JCN
109
-			POP POP2r RTN
110
-			&can-append
111
-		( save ) STH2kr STA
112
-		( null ) #00 STH2r INC2 STA
113
-		#07 ,&draw JSR
114
-	RTN
115
-
116
-	&validate ( -- )
117
-		;input ;load-rom JSR2
118
-		#00 ,&draw JSR
119
-		( null ) #0000 ;input STA2
120
-	RTN
121
-
122
-	&erase ( -- )
123
-		;input LDA2 #0000 !! ,&can-erase JCN
124
-			RTN
125
-			&can-erase
126
-		#00 ,&draw JSR
127
-		( remove ) #00 ,&seek JSR #0001 -- STA
128
-		#07 ,&draw JSR
129
-	RTN
130
-
131
-	&seek ( -- end* )
132
-		;input #0001 -- 
133
-		&seek-loop 
134
-			INC2 LDAk ,&seek-loop JCN
135
-	RTN
136
-
137
-	&draw ( color -- )
138
-		STH
139
-		#0038 #00c0 ;input STHkr ;draw-label JSR2
140
-		STHr ;draw-cursor JSR2
141
-	RTN
142
-
143
-RTN
144
-
145 111
 @redraw ( -- )
146 112
 
113
+	RTN
147 114
 	#0018 #0020 #0040 #0040 ;logo-icn #03 ;draw-icn JSR2
148 115
 	#0020 #0070 ;welcome-txt #01 ;draw-label JSR2
149 116
 	;draw-time JSR2
150 117
 	#0020 #00b0 ;prompt-txt #01 ;draw-label JSR2
151 118
 	#0020 #00c0 ;do-txt #03 ;draw-label JSR2
152
-	#03 ;form/draw JSR2
153
-	#0010 #0010 #0060 #0060 ;mascot-icn #01 ;draw-icn JSR2
119
+
120
+RTN
121
+
122
+@draw-browser ( x* y* addr* color -- )
123
+
124
+	STH STH2
125
+	.browser/x LDZ2 .Screen/x DEO2
126
+	.browser/y LDZ2 .Screen/y DEO2
127
+	STH2r
128
+	&loop
129
+		LDAk #0a ! ,&no-lb JCN
130
+			#0080 .Screen/x DEO2
131
+			.Screen/y DEI2 #0010 ++ .Screen/y DEO2
132
+			,&skip JMP
133
+			&no-lb
134
+		( top-addr ) LDAk #20 - TOS #0010 MUL2 ;font ++ .Screen/addr DEO2
135
+		( top-draw ) STHkr .Screen/sprite DEO
136
+		( bottom-addr ) .Screen/addr DEI2 #0008 ++ .Screen/addr DEO2
137
+		( next-y ) .Screen/y DEI2 #0008 ++ .Screen/y DEO2
138
+		( bottom-draw ) STHkr .Screen/sprite DEO
139
+		( prev-y ) .Screen/y DEI2 #0008 -- .Screen/y DEO2
140
+		( move ) .Screen/x DEI2 #0008 ++ .Screen/x DEO2
141
+		&skip
142
+		INC2 LDAk ,&loop JCN
143
+	POP2 POPr
154 144
 
155 145
 RTN
156 146
 
... ...
@@ -301,3 +291,6 @@ include projects/assets/logo05x05.tal
301 291
 include projects/assets/mascot0cx0c.tal
302 292
 include projects/assets/msx01x02.tal
303 293
 
294
+@dir
295
+	&path ". $1
296
+	&data