about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-12 17:49:48 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-12 17:50:30 -0700
commit85bcf050e7cff660f7e3fafbbc2e9a95b78dcc39 (patch)
tree98c5e86884efabfd9da9e5fc2e656f572b9742af
parent9b5b3bccd188af4dd76d9e177652ddc727357ebe (diff)
downloadmu-85bcf050e7cff660f7e3fafbbc2e9a95b78dcc39.tar.gz
.
-rw-r--r--shell/sandbox.mu30
1 files changed, 14 insertions, 16 deletions
diff --git a/shell/sandbox.mu b/shell/sandbox.mu
index 4b746be0..aa082349 100644
--- a/shell/sandbox.mu
+++ b/shell/sandbox.mu
@@ -259,27 +259,25 @@ fn render-screen screen: (addr screen), _target-screen: (addr screen), xmin: int
   var target-screen/esi: (addr screen) <- copy _target-screen
   var to-y/edi: int <- copy ymin
   # text data
+  var width/ebx: (addr int) <- get target-screen, width
+  var height/edx: (addr int) <- get target-screen, height
+  var from-y/ecx: int <- copy 0
   {
-    var height/edx: (addr int) <- get target-screen, height
-    var from-y/ecx: int <- copy 0
+    compare from-y, *height
+    break-if->=
+    var from-x/edx: int <- copy 0
+    var to-x/eax: int <- copy xmin
     {
-      compare from-y, *height
+      compare from-x, *width
       break-if->=
-      var width/edx: (addr int) <- get target-screen, width
-      var from-x/ebx: int <- copy 0
-      var to-x/eax: int <- copy xmin
-      {
-        compare from-x, *width
-        break-if->=
-        print-screen-cell-of-fake-screen screen, target-screen, from-x, from-y, to-x, to-y
-        from-x <- increment
-        to-x <- increment
-        loop
-      }
-      from-y <- increment
-      to-y <- increment
+      print-screen-cell-of-fake-screen screen, target-screen, from-x, from-y, to-x, to-y
+      from-x <- increment
+      to-x <- increment
       loop
     }
+    from-y <- increment
+    to-y <- increment
+    loop
   }
   # pixel data
   {