about summary refs log tree commit diff stats
path: root/shell
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-04-08 22:19:24 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-04-08 22:19:24 -0700
commitd6d28b8c94b2611407a711899c05eeba86e0be80 (patch)
treeca7d564b1cca7a01f1ae9f097711c181b2f3a555 /shell
parent119aea6d06667c63a9b2225e7f5475cd442096b5 (diff)
downloadmu-d6d28b8c94b2611407a711899c05eeba86e0be80.tar.gz
shell: create space to display globals
Diffstat (limited to 'shell')
-rw-r--r--shell/global.mu4
-rw-r--r--shell/main.mu6
-rw-r--r--shell/sandbox.mu2
3 files changed, 7 insertions, 5 deletions
diff --git a/shell/global.mu b/shell/global.mu
index c87198ee..32142633 100644
--- a/shell/global.mu
+++ b/shell/global.mu
@@ -22,6 +22,10 @@ fn initialize-globals _self: (addr global-table) {
   append-primitive self, "cons"
 }
 
+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
+}
+
 fn append-primitive _self: (addr global-table), name: (addr array byte) {
   var self/esi: (addr global-table) <- copy _self
   var final-index-addr/ecx: (addr int) <- get self, final-index
diff --git a/shell/main.mu b/shell/main.mu
index 29c815dc..04f64011 100644
--- a/shell/main.mu
+++ b/shell/main.mu
@@ -9,11 +9,9 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk)
   var sandbox/esi: (addr sandbox) <- address sandbox-storage
   initialize-sandbox sandbox
   load-sandbox data-disk, sandbox
-  var width/eax: int <- copy 0
-  var height/ecx: int <- copy 0
-  width, height <- screen-size screen
   {
-    render-sandbox screen, sandbox, 2/x, 2/y, width, height
+    render-globals screen, globals, 0/x, 0/y, 0x40/xmax, 0x30/screen-height
+    render-sandbox screen, sandbox, 0x40/x, 0/y, 0x80/screen-width, 0x30/screen-height
     {
       var key/eax: byte <- read-key keyboard
       compare key, 0
diff --git a/shell/sandbox.mu b/shell/sandbox.mu
index 2b612a13..06bf3656 100644
--- a/shell/sandbox.mu
+++ b/shell/sandbox.mu
@@ -39,7 +39,7 @@ fn allocate-sandbox-with _out: (addr handle sandbox), s: (addr array byte) {
 ##
 
 fn render-sandbox screen: (addr screen), _self: (addr sandbox), xmin: int, ymin: int, xmax: int, ymax: int {
-  clear-screen screen
+  clear-rect screen, xmin, ymin, xmax, ymax, 0/bg=black
   var self/esi: (addr sandbox) <- copy _self
   # data
   var data-ah/eax: (addr handle gap-buffer) <- get self, data