about summary refs log tree commit diff stats
path: root/shell
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-04-16 20:12:10 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-04-16 20:26:56 -0700
commit21a6f5539b4317f5334d2d2449d6dbdabd86f738 (patch)
tree01d1944de7f7f654521519a1cac478be8d9d0c95 /shell
parentcec0d9553babfd80dc694b10a5ed3cfaef086706 (diff)
downloadmu-21a6f5539b4317f5334d2d2449d6dbdabd86f738.tar.gz
data.img now has more than one sector of data
Diffstat (limited to 'shell')
-rw-r--r--shell/evaluate.mu2
-rw-r--r--shell/main.mu9
2 files changed, 6 insertions, 5 deletions
diff --git a/shell/evaluate.mu b/shell/evaluate.mu
index ebdbe486..36662d42 100644
--- a/shell/evaluate.mu
+++ b/shell/evaluate.mu
@@ -394,7 +394,7 @@ fn push-bindings _params-ah: (addr handle cell), _args-ah: (addr handle cell), o
 fn lookup-symbol sym: (addr cell), out: (addr handle cell), env-h: (handle cell), globals: (addr global-table), trace: (addr trace), screen-cell: (addr handle cell), keyboard-cell: (addr handle cell) {
   # trace sym
   {
-    var stream-storage: (stream byte 0x100)
+    var stream-storage: (stream byte 0x200)  # pessimistically sized just for the large alist loaded from disk in `main`
     var stream/ecx: (addr stream byte) <- address stream-storage
     write stream, "look up "
     var sym2/eax: (addr cell) <- copy sym
diff --git a/shell/main.mu b/shell/main.mu
index 8abc6ed1..d8fa0963 100644
--- a/shell/main.mu
+++ b/shell/main.mu
@@ -30,9 +30,10 @@ fn load-state data-disk: (addr disk), _sandbox: (addr sandbox), globals: (addr g
   var _data/eax: (addr gap-buffer) <- lookup *data-ah
   var data/esi: (addr gap-buffer) <- copy _data
   # data-disk -> stream
-  var s-storage: (stream byte 0x200)
+  var s-storage: (stream byte 0x400)  # space for 2/sectors
   var s/ebx: (addr stream byte) <- address s-storage
-  load-sector data-disk, 0/lba, s
+  load-sectors data-disk, 0/lba, 2/sectors, s
+#?   draw-stream-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, s, 7/fg, 0/bg
   # stream -> gap-buffer
   load-gap-buffer-from-stream data, s
   clear-stream s
@@ -93,11 +94,11 @@ fn store-state data-disk: (addr disk), sandbox: (addr sandbox), globals: (addr g
     break-if-!=
     return
   }
-  var stream-storage: (stream byte 0x200)
+  var stream-storage: (stream byte 0x400)  # space enough for 2/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-sector data-disk, 0/lba, stream
+  store-sectors data-disk, 0/lba, 2/sectors, stream
 }