about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-02-26 09:42:03 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-02-26 09:42:03 -0800
commit4e64c5418b64d53163346939664a8e5ef9145130 (patch)
tree6b2cf8686cbf3552ff87db943098767c1fc04c41
parent89933230fcfb728943d005ce82b02162852bf9fd (diff)
downloadmu-4e64c5418b64d53163346939664a8e5ef9145130.tar.gz
836
-rw-r--r--trace.arc.t12
-rw-r--r--trace.mu4
2 files changed, 9 insertions, 7 deletions
diff --git a/trace.arc.t b/trace.arc.t
index 30601c78..53e14da6 100644
--- a/trace.arc.t
+++ b/trace.arc.t
@@ -25,7 +25,7 @@ schedule:  done with routine")
       (traces:instruction-trace-address-array-address <- parse-traces s:stream-address)
       (len:integer <- length traces:instruction-trace-address-array-address/deref)
       (screen:terminal-address <- init-fake-terminal 70:literal 15:literal)
-      (screen-state:space-address <- screen-state traces:instruction-trace-address-array-address)
+      (screen-state:space-address <- screen-state traces:instruction-trace-address-array-address 30:literal/screen-height)
       (print-traces-collapsed screen-state:space-address screen:terminal-address)
       (1:string-address/raw <- get screen:terminal-address/deref data:offset)
     ])))
@@ -73,7 +73,7 @@ schedule:  done with routine")
       ; position the cursor away from top of screen
       (cursor-down 1:terminal-address/raw)
       (cursor-down 1:terminal-address/raw)
-      (screen-state:space-address <- screen-state traces:instruction-trace-address-array-address)
+      (screen-state:space-address <- screen-state traces:instruction-trace-address-array-address 30:literal/screen-height)
       (print-traces-collapsed screen-state:space-address 1:terminal-address/raw traces:instruction-trace-address-array-address)
       (2:string-address/raw <- get 1:terminal-address/raw/deref data:offset)
     ])))
@@ -132,7 +132,7 @@ schedule:  done with routine")
       ; position the cursor away from top of screen
       (cursor-down 2:terminal-address/raw)
       (cursor-down 2:terminal-address/raw)
-      (3:space-address/raw <- screen-state 1:instruction-trace-address-array-address/raw)
+      (3:space-address/raw <- screen-state 1:instruction-trace-address-array-address/raw 30:literal/screen-height)
       ; draw trace
       (print-traces-collapsed 3:space-address/raw/screen-state 2:terminal-address/raw 1:instruction-trace-address-array-address/raw)
       ; move cursor up
@@ -281,7 +281,7 @@ schedule:  done with routine")
       ; position the cursor away from top of screen
       (cursor-down 2:terminal-address/raw)
       (cursor-down 2:terminal-address/raw)
-      (3:space-address/raw <- screen-state 1:instruction-trace-address-array-address/raw)
+      (3:space-address/raw <- screen-state 1:instruction-trace-address-array-address/raw 30:literal/screen-height)
       ; draw trace
       (print-traces-collapsed 3:space-address/raw/screen-state 2:terminal-address/raw 1:instruction-trace-address-array-address/raw)
       (4:string-address/raw <- get 2:terminal-address/raw/deref data:offset)
@@ -366,7 +366,7 @@ schedule:  done with routine")
       ; position the cursor away from top of screen
       (cursor-down 2:terminal-address/raw)
       (cursor-down 2:terminal-address/raw)
-      (3:space-address/raw <- screen-state 1:instruction-trace-address-array-address/raw)
+      (3:space-address/raw <- screen-state 1:instruction-trace-address-array-address/raw 30:literal/screen-height)
       ; draw trace
       (print-traces-collapsed 3:space-address/raw/screen-state 2:terminal-address/raw 1:instruction-trace-address-array-address/raw)
       ; expand penultimate line
@@ -422,7 +422,7 @@ schedule:  done with routine")
       ; position the cursor away from top of screen
       (cursor-down 2:terminal-address/raw)
       (cursor-down 2:terminal-address/raw)
-      (3:space-address/raw <- screen-state 1:instruction-trace-address-array-address/raw)
+      (3:space-address/raw <- screen-state 1:instruction-trace-address-array-address/raw 30:literal/screen-height)
       ; draw trace
       (print-traces-collapsed 3:space-address/raw/screen-state 2:terminal-address/raw 1:instruction-trace-address-array-address/raw)
       ; expand penultimate line, then move one line down and draw cursor
diff --git a/trace.mu b/trace.mu
index bd8e9ec6..eb25395d 100644
--- a/trace.mu
+++ b/trace.mu
@@ -225,6 +225,7 @@
 (function screen-state [
   (default-space:space-address <- new space:literal 30:literal/capacity)
   (traces:instruction-trace-address-array-address <- next-input)
+  (screen-height:integer <- next-input)  ; 'hardware' limitation
   (app-height:integer <- copy 0:literal)  ; area of the screen we're responsible for; can't be larger than screen-height
   (printed-height:integer <- copy 0:literal)  ; part of screen that currently has text; can't be larger than app-height
   (cursor-row:integer <- copy 0:literal)  ; position of cursor on screen; can't be larger than printed-height + 1
@@ -505,6 +506,7 @@
 (function browse-trace [
   (default-space:space-address <- new space:literal 30:literal/capacity)
   (x:string-address <- next-input)
+  (screen-height:integer <- next-input)
 ;?   ($start-tracing) ;? 1
 ;?   (x:string-address <- new
 ;? "schedule: main
@@ -522,7 +524,7 @@
 ;? schedule:  done with routine")
   (s:stream-address <- init-stream x:string-address)
   (traces:instruction-trace-address-array-address <- parse-traces s:stream-address)
-  (0:space-address/names:screen-state <- screen-state traces:instruction-trace-address-array-address)
+  (0:space-address/names:screen-state <- screen-state traces:instruction-trace-address-array-address screen-height:integer)
   (cursor-mode)
   (print-traces-collapsed 0:space-address/screen-state nil:literal/terminal)
   { begin