about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-06-05 22:09:49 -0700
committerKartik Agaram <vc@akkartik.com>2020-06-05 22:09:49 -0700
commit78b0f06baa7284c15ec512eb4ea25658e8c09684 (patch)
tree5c510c96c09afa279612386cb3a513de623c3e7e
parent8a065c536ef431a36f7940bedc3d2c028baa0a9a (diff)
downloadmu-78b0f06baa7284c15ec512eb4ea25658e8c09684.tar.gz
6480
-rw-r--r--prototypes/browse/23/main.mu2
-rw-r--r--prototypes/browse/23/screen-position-state.mu13
2 files changed, 9 insertions, 6 deletions
diff --git a/prototypes/browse/23/main.mu b/prototypes/browse/23/main.mu
index c936a575..cf2fef0d 100644
--- a/prototypes/browse/23/main.mu
+++ b/prototypes/browse/23/main.mu
@@ -14,6 +14,8 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int {
   {
     render fs, screen-position-state
     var key/eax: byte <- read-key
+    compare key, 0x71  # 'q'
+    loop-if-!=
   }
   enable-keyboard-type-mode
   enable-screen-type-mode
diff --git a/prototypes/browse/23/screen-position-state.mu b/prototypes/browse/23/screen-position-state.mu
index 9f12470a..62161108 100644
--- a/prototypes/browse/23/screen-position-state.mu
+++ b/prototypes/browse/23/screen-position-state.mu
@@ -31,12 +31,6 @@ fn init-screen-position-state _self: (addr screen-position-state) {
   # self->botrow = nrows
   dest <- get self, botrow
   copy-to *dest, nrows
-  # self->leftcol = page-margin
-  dest <- get self, leftcol
-  copy-to *dest, 5  # left-margin
-  # self->rightcol = self->leftcol + page-width
-  dest <- get self, rightcol
-  copy-to *dest, 0x45  # left-margin + page-width
   #
   start-drawing self
 }
@@ -45,6 +39,13 @@ fn start-drawing _self: (addr screen-position-state) {
   var self/esi: (addr screen-position-state) <- copy _self
   var tmp/eax: (addr int) <- copy 0
   var tmp2/ecx: int <- copy 0
+  clear-screen
+  # self->leftcol = page-margin
+  tmp <- get self, leftcol
+  copy-to *tmp, 5  # left-margin
+  # self->rightcol = self->leftcol + page-width
+  tmp <- get self, rightcol
+  copy-to *tmp, 0x45  # left-margin + page-width
   # self->row = self->toprow
   tmp <- get self, toprow
   tmp2 <- copy *tmp