about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--shell/global.mu32
-rw-r--r--shell/print.mu7
2 files changed, 38 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) {
diff --git a/shell/print.mu b/shell/print.mu
index aab6cbfe..3dec6cff 100644
--- a/shell/print.mu
+++ b/shell/print.mu
@@ -40,6 +40,13 @@ fn print-cell _in: (addr handle cell), out: (addr stream byte), trace: (addr tra
     trace-higher trace
     return
   }
+  compare *in-type, 4/primitive
+  {
+    break-if-!=
+    write out, "[primitive]"
+    trace-higher trace
+    return
+  }
 }
 
 # debug helper
.4.3&id=1159f9ec182496ddc5324f23fb1d5eae73fe63e3'>1159f9ec ^
dd4a4145 ^


















































95947388 ^
1159f9ec ^



f7819821 ^



1159f9ec ^
152823d8 ^
1c72dd08 ^


152823d8 ^

1c72dd08 ^

152823d8 ^

1c72dd08 ^


152823d8 ^









1159f9ec ^
1159f9ec ^


dd4a4145 ^
1159f9ec ^
dd4a4145 ^





1159f9ec ^
dd4a4145 ^


1159f9ec ^
dd4a4145 ^


1159f9ec ^
1159f9ec ^


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