about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-05-29 16:10:05 -0700
committerKartik Agaram <vc@akkartik.com>2020-05-29 16:24:31 -0700
commit99558d26d1b785bbf9afaffe4699f2cd49605134 (patch)
tree6d315a7f8a31141e5efa8493d6612c6c4e77a794
parent05fa1791c5ca74ec2c7b7bb3af25b06844676b46 (diff)
downloadmu-99558d26d1b785bbf9afaffe4699f2cd49605134.tar.gz
6435
-rw-r--r--apps/browse.mu15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/browse.mu b/apps/browse.mu
index 271d08d8..879d8bf4 100644
--- a/apps/browse.mu
+++ b/apps/browse.mu
@@ -8,7 +8,7 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int {
   enable-screen-grid-mode
   enable-keyboard-immediate-mode
   {
-    render file, 5, 5, 30, 30
+    render file, 0x20, 0x30  # nrows, ncols
     var key/eax: byte <- read-key
     compare key, 0x71  # 'q'
     loop-if-!=
@@ -18,7 +18,18 @@ fn main args: (addr array (addr array byte)) -> exit-status/ebx: int {
   exit-status <- copy 0
 }
 
-fn render in: (addr buffered-file), toprow: int, leftcol: int, botrow: int, rightcol: int {
+fn render in: (addr buffered-file), nrows: int, ncols: int {
+  # hardcoded parameter: text-width
+  var toprow/eax: int <- copy 2
+  var botrow/ecx: int <- copy toprow
+  botrow <- add nrows
+  var leftcol/edx: int <- copy 5
+  var rightcol/ebx: int <- copy leftcol
+  rightcol <- add ncols
+  render-page in, toprow, leftcol, botrow, rightcol
+}
+
+fn render-page in: (addr buffered-file), toprow: int, leftcol: int, botrow: int, rightcol: int {
   clear toprow, leftcol, botrow, rightcol
   # render screen rows
   var row/ecx: int <- copy toprow