about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-06 10:54:50 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-06 10:54:50 -0700
commitc4cf38773f9c92ed0d5ebc72165801e581755b2f (patch)
tree208a00f78939c95d785f6b0dfe51085533ed7de0
parentb5d3095c923ba8ce7ee07bc2666e42a9a1f483af (diff)
downloadmu-c4cf38773f9c92ed0d5ebc72165801e581755b2f.tar.gz
more space for definitions
-rw-r--r--shell/data.limg17
-rw-r--r--shell/environment.mu8
-rw-r--r--shell/sandbox.mu2
3 files changed, 16 insertions, 11 deletions
diff --git a/shell/data.limg b/shell/data.limg
index 9e7c1954..fac0e683 100644
--- a/shell/data.limg
+++ b/shell/data.limg
@@ -58,6 +58,10 @@
       (write str c)
       (set c (key keyboard))))
   str))])
+    (wait . [(def (wait keyboard)
+  (while (= 0 (key keyboard))))])
+    (sq . [(def (sq n) (* n n))])
+    (cube . [(def (cube n) (* (* n n) n))])
     (fill_rect . [(def (fill_rect screen x1 y1 x2 y2 color)
   (for y y1 (< y y2) (++ y)
     (hline1 screen y x1 x2 color)))])
@@ -125,16 +129,17 @@
   (for y r (< y ymax) (+= y side)
     (for x r (< x xmax) (+= x side)
       (circle_rainbow screen x y (- r 100) 10)))))))])
-    (task . [(def (task screen)
+    (task . [(def (task screen keyboard)
   (let xmax (width screen)
   (let ymax (height screen)
-  (for y 0 (< y ymax) (+= y 1)
-    (for x 4 (< x xmax) (+= x 1)
+  (for y 0 (< y ymax) (+= y 4)
+    #(wait keyboard)
+    (for x 0 (< x xmax) (+= x 1)
       (pixel screen x y
              # color
-             (+ (* x x) (* y y))))))))])
+             (+ 16 (+ (/ x 4) (cube (/ y 4))))))))))])
     (main . [(def (main screen keyboard)
-  (task screen))])
+  (task screen keyboard))])
   ))
-  (sandbox . (task screen))
+  (sandbox . (task screen keyboard))
 )
diff --git a/shell/environment.mu b/shell/environment.mu
index 4bf90c54..a6e4b316 100644
--- a/shell/environment.mu
+++ b/shell/environment.mu
@@ -329,11 +329,11 @@ fn render-function-modal-menu screen: (addr screen), _self: (addr environment) {
 fn load-state _self: (addr environment), data-disk: (addr disk) {
   var self/esi: (addr environment) <- copy _self
   # data-disk -> stream
-  var s-storage: (stream byte 0x1000)  # space for 8/sectors
+  var s-storage: (stream byte 0x2000)  # space for 16/sectors
   var s/ebx: (addr stream byte) <- address s-storage
   draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "loading sectors from data disk", 3/fg, 0/bg
   move-cursor-to-left-margin-of-next-line 0/screen
-  load-sectors data-disk, 0/lba, 8/sectors, s
+  load-sectors data-disk, 0/lba, 0x10/sectors, s
 #?   draw-stream-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, s, 7/fg, 0xc5/bg=blue-bg
   # stream -> gap-buffer (HACK: we temporarily cannibalize the sandbox's gap-buffer)
   draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, "parsing", 3/fg, 0/bg
@@ -413,11 +413,11 @@ fn store-state data-disk: (addr disk), sandbox: (addr sandbox), globals: (addr g
     break-if-!=
     return
   }
-  var stream-storage: (stream byte 0x1000)  # space enough for 8/sectors
+  var stream-storage: (stream byte 0x2000)  # space enough for 16/sectors
   var stream/edi: (addr stream byte) <- address stream-storage
   write stream, "(\n"
   write-globals stream, globals
   write-sandbox stream, sandbox
   write stream, ")\n"
-  store-sectors data-disk, 0/lba, 8/sectors, stream
+  store-sectors data-disk, 0/lba, 0x10/sectors, stream
 }
diff --git a/shell/sandbox.mu b/shell/sandbox.mu
index 2da99f8d..0aad5b44 100644
--- a/shell/sandbox.mu
+++ b/shell/sandbox.mu
@@ -14,7 +14,7 @@ fn initialize-sandbox _self: (addr sandbox), fake-screen-and-keyboard?: boolean
   var data-ah/eax: (addr handle gap-buffer) <- get self, data
   allocate data-ah
   var data/eax: (addr gap-buffer) <- lookup *data-ah
-  initialize-gap-buffer data, 0x1000/4KB
+  initialize-gap-buffer data, 0x2000/8KB
   #
   var value-ah/eax: (addr handle stream byte) <- get self, value
   populate-stream value-ah, 0x1000/4KB