From 6b343a82f29b6dea219504504244591c3042df43 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 1 Aug 2020 23:06:41 -0700 Subject: 6699 - start building out fake screen We now have all existing apps and prototypes going through the dependency-injected wrapper, even though it doesn't actually implement the fake screen yet. --- prototypes/browse/29/file-state.mu | 2 +- prototypes/browse/29/main.mu | 26 +++++++++++++------------- prototypes/browse/29/screen-position-state.mu | 8 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'prototypes/browse/29') diff --git a/prototypes/browse/29/file-state.mu b/prototypes/browse/29/file-state.mu index 0047b2c0..544c7832 100644 --- a/prototypes/browse/29/file-state.mu +++ b/prototypes/browse/29/file-state.mu @@ -39,6 +39,6 @@ fn dump in: (addr buffered-file) { var c/eax: byte <- read-byte-buffered in compare c, 0xffffffff # EOF marker break-if-= - print-byte-to-screen c + print-byte 0, c loop } diff --git a/prototypes/browse/29/main.mu b/prototypes/browse/29/main.mu index 067e21ff..748bdaed 100644 --- a/prototypes/browse/29/main.mu +++ b/prototypes/browse/29/main.mu @@ -113,7 +113,7 @@ $render-normal:whitespace-separated-regions: { compare c, 0x2a # '*' { break-if-!= - start-bold-on-screen + start-bold 0 render-until-asterisk fs, state normal-text break $render-normal:loop-body @@ -122,11 +122,11 @@ $render-normal:whitespace-separated-regions: { compare c, 0x5f # '_' { break-if-!= - start-color-on-screen 0xec, 7 # 236 = darkish gray - start-bold-on-screen + start-color 0, 0xec, 7 # 236 = darkish gray + start-bold 0 render-until-underscore fs, state - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray break $render-normal:loop-body } } @@ -188,32 +188,32 @@ $render-header-line:body: { # colors for a light background, going from bright to dark (meeting up with bold-text) fn start-heading header-level: int { $start-heading:body: { - start-bold-on-screen + start-bold 0 compare header-level, 1 { break-if-!= - start-color-on-screen 0xa0, 7 + start-color 0, 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color-on-screen 0x7c, 7 + start-color 0, 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color-on-screen 0x58, 7 + start-color 0, 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color-on-screen 0x34, 7 + start-color 0, 0x34, 7 break $start-heading:body } - start-color-on-screen 0xe8, 7 + start-color 0, 0xe8, 7 } } @@ -266,6 +266,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting-on-screen - start-color-on-screen 0xec, 7 # 236 = darkish gray + reset-formatting 0 + start-color 0, 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/29/screen-position-state.mu b/prototypes/browse/29/screen-position-state.mu index afaf713e..dec8b502 100644 --- a/prototypes/browse/29/screen-position-state.mu +++ b/prototypes/browse/29/screen-position-state.mu @@ -17,7 +17,7 @@ fn init-screen-position-state _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self 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. + nrows, ncols <- screen-size 0 # 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 @@ -39,7 +39,7 @@ 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 + clear-screen 0 # self->leftcol = page-margin tmp <- get self, leftcol copy-to *tmp, 5 # left-margin @@ -72,7 +72,7 @@ $add-char:body: { break $add-char:body } # print c - print-byte-to-screen c + print-byte 0, c # self->col++ var tmp/eax: (addr int) <- get self, col increment *tmp @@ -167,5 +167,5 @@ fn reposition-cursor _self: (addr screen-position-state) { var self/esi: (addr screen-position-state) <- copy _self var r/eax: (addr int) <- get self, row var c/ecx: (addr int) <- get self, col - move-cursor-on-screen *r *c + move-cursor 0, *r *c } -- cgit 1.4.1-2-gfad0