about summary refs log tree commit diff stats
path: root/shell/global.mu
diff options
context:
space:
mode:
Diffstat (limited to 'shell/global.mu')
-rw-r--r--shell/global.mu32
1 files changed, 31 insertions, 1 deletions
diff --git a/shell/global.mu b/shell/global.mu
index 32142633..cf914ef1 100644
--- a/shell/global.mu
+++ b/shell/global.mu
@@ -23,7 +23,37 @@ fn initialize-globals _self: (addr global-table) {
 }
 
 fn render-globals screen: (addr screen), _self: (addr global-table), xmin: int, ymin: int, xmax: int, ymax: int {
-  clear-rect screen, xmin, ymin, xmax, ymax, 0x12/bg=grey
+  clear-rect screen, xmin, ymin, xmax, ymax, 0x12/bg=almost-black
+  var self/esi: (addr global-table) <- copy _self
+  var y/ecx: int <- copy ymin
+  var data-ah/eax: (addr handle array global) <- get self, data
+  var data/eax: (addr array global) <- lookup *data-ah
+  var final-index/edx: (addr int) <- get self, final-index
+  var curr-index/edx: int <- copy *final-index
+  {
+    compare curr-index, 0
+    break-if-<=
+    compare y, ymax
+    break-if->=
+    {
+      var curr-offset/ebx: (offset global) <- compute-offset data, curr-index
+      var curr/ebx: (addr global) <- index data, curr-offset
+      var curr-name-ah/eax: (addr handle array byte) <- get curr, name
+      var _curr-name/eax: (addr array byte) <- lookup *curr-name-ah
+      var curr-name/edx: (addr array byte) <- copy _curr-name
+      var x/eax: int <- copy xmin
+      x, y <- draw-text-wrapping-right-then-down screen, curr-name, xmin, ymin, xmax, ymax, x, y, 0x2a/fg=orange, 0x12/bg=almost-black
+      x, y <- draw-text-wrapping-right-then-down screen, " <- ", xmin, ymin, xmax, ymax, x, y, 7/fg=grey, 0x12/bg=almost-black
+      var curr-value/edx: (addr handle cell) <- get curr, value
+      var s-storage: (stream byte 0x100)
+      var s/ebx: (addr stream byte) <- address s-storage
+      print-cell curr-value, s, 0/no-trace
+      x, y <- draw-stream-wrapping-right-then-down screen, s, xmin, ymin, xmax, ymax, x, y, 0x3/fg=cyan, 0x12/bg=almost-black
+    }
+    curr-index <- decrement
+    y <- increment
+    loop
+  }
 }
 
 fn append-primitive _self: (addr global-table), name: (addr array byte) {
am <vc@akkartik.com> 2016-03-09 03:40:41 -0800 2745' href='/akkartik/mu/commit/html/024jump.cc.html?h=main&id=c0e9154d6a1fa116871794a161c6f75a71742ed4'>c0e9154d ^
90560d71 ^
e6056999 ^
4690ce81 ^
672e3e50 ^

672e3e50 ^

4690ce81 ^
672e3e50 ^

c5ffb6e1 ^
4690ce81 ^
c5ffb6e1 ^
9570363a ^
c5ffb6e1 ^

9570363a ^
c5ffb6e1 ^

672e3e50 ^


76755b28 ^

4690ce81 ^


9542bb11 ^

4690ce81 ^

9542bb11 ^

76755b28 ^


4690ce81 ^
65361948 ^
e8b1d3ff ^
76755b28 ^
e8b1d3ff ^
672e3e50 ^

c5ffb6e1 ^

76755b28 ^
672e3e50 ^

4690ce81 ^
672e3e50 ^
c5ffb6e1 ^
672e3e50 ^


c5ffb6e1 ^


672e3e50 ^



76755b28 ^

4690ce81 ^


9542bb11 ^

4690ce81 ^

9542bb11 ^

4690ce81 ^

9542bb11 ^

76755b28 ^


4690ce81 ^
65361948 ^
4690ce81 ^
76755b28 ^
672e3e50 ^

e8b1d3ff ^
76755b28 ^
e8b1d3ff ^
672e3e50 ^


4690ce81 ^

9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^
9570363a ^
c5ffb6e1 ^
672e3e50 ^

4690ce81 ^

9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^




76755b28 ^

4690ce81 ^


9542bb11 ^

4690ce81 ^

9542bb11 ^

4690ce81 ^

9542bb11 ^

76755b28 ^


4690ce81 ^
65361948 ^
4690ce81 ^
76755b28 ^
672e3e50 ^

e8b1d3ff ^
76755b28 ^
e8b1d3ff ^
672e3e50 ^


4690ce81 ^
9570363a ^

672e3e50 ^
9570363a ^
672e3e50 ^
9570363a ^
c5ffb6e1 ^
672e3e50 ^

4690ce81 ^
9570363a ^

672e3e50 ^
9570363a ^
672e3e50 ^
9570363a ^
672e3e50 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183