about summary refs log tree commit diff stats
path: root/prototypes/browse/25-soft-newlines/screen-position-state.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-06-05 23:41:13 -0700
committerKartik Agaram <vc@akkartik.com>2020-06-05 23:41:13 -0700
commitb244fe88b38c3a4c9cb8ccb6211aa0c33e392d6c (patch)
treebe4d94e091dabc95c1dfcc61e59d154ab3305d28 /prototypes/browse/25-soft-newlines/screen-position-state.mu
parent3e33219b0701b330359f140b03da5cea10bae804 (diff)
downloadmu-b244fe88b38c3a4c9cb8ccb6211aa0c33e392d6c.tar.gz
6487 - browse: support soft newlines
I'm not bothering with this for bold regions just yet. Might need rethinking,
given how ugly this is.
Diffstat (limited to 'prototypes/browse/25-soft-newlines/screen-position-state.mu')
-rw-r--r--prototypes/browse/25-soft-newlines/screen-position-state.mu13
1 files changed, 10 insertions, 3 deletions
diff --git a/prototypes/browse/25-soft-newlines/screen-position-state.mu b/prototypes/browse/25-soft-newlines/screen-position-state.mu
index 62161108..dcf3722a 100644
--- a/prototypes/browse/25-soft-newlines/screen-position-state.mu
+++ b/prototypes/browse/25-soft-newlines/screen-position-state.mu
@@ -15,9 +15,9 @@ fn init-screen-position-state _self: (addr screen-position-state) {
   #   page-margin
   #   page-width
   var self/esi: (addr screen-position-state) <- copy _self
-  var nrows/eax: int <- copy 0
-  var ncols/ecx: int <- copy 0
-  nrows, ncols <- screen-size
+  var nrows/eax: int <- copy 0xa
+  var ncols/ecx: int <- copy 0x20
+  nrows, ncols <- screen-size  # Comment this out to debug with a tiny page. You'll also need to adjust rightcol below.
   var dest/edx: (addr int) <- copy 0
   # self->nrows = nrows
   dest <- get self, nrows
@@ -45,6 +45,7 @@ fn start-drawing _self: (addr screen-position-state) {
   copy-to *tmp, 5  # left-margin
   # self->rightcol = self->leftcol + page-width
   tmp <- get self, rightcol
+#?   copy-to *tmp, 0x1f  # ncols - 1
   copy-to *tmp, 0x45  # left-margin + page-width
   # self->row = self->toprow
   tmp <- get self, toprow
@@ -113,6 +114,12 @@ fn next-page _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
+#?   # temporary: stop
+#?   tmp <- get self, ncols
+#?   tmp2 <- copy *tmp
+#?   tmp <- get self, rightcol
+#?   copy-to *tmp, tmp2
+  # real: multiple pages
   # self->leftcol = self->rightcol + page-margin
   tmp <- get self, rightcol
   tmp2 <- copy *tmp