diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-06-29 19:21:43 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-06-29 19:21:43 -0700 |
commit | 8bd3c2b5a83d9e8b97472311491010d66a7b7584 (patch) | |
tree | 02354322b48589ec70da06211433aa36c50d758b | |
parent | 6c7f7abdb867084f1e7555105cfa140eae4f6372 (diff) | |
download | mu-8bd3c2b5a83d9e8b97472311491010d66a7b7584.tar.gz |
6601
34 files changed, 182 insertions, 182 deletions
diff --git a/103screen.subx b/103screen.subx index 0c893ec7..116d0320 100644 --- a/103screen.subx +++ b/103screen.subx @@ -88,7 +88,7 @@ $clear-screen:end: c3/return # row and col count from the top-left as (1, 1) -move-cursor: # row: int, column: int +move-cursor-on-screen: # row: int, column: int # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -109,7 +109,7 @@ move-cursor: # row: int, column: int (write %ecx "H") # flush (write-stream 2 %ecx) -$move-cursor:end: +$move-cursor-on-screen:end: # . reclaim locals 81 0/subop/add %esp 0x2c/imm32 # . restore registers @@ -154,20 +154,20 @@ $print-byte-to-screen:end: c3/return # just because Mu has no support for global variables yet -write-int32-hex-to-screen: # n: int +print-int32-hex-to-screen: # n: int # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # (write-int32-hex-buffered Stdout *(ebp+8)) (flush Stdout) -$write-int32-hex-to-screen:end: +$print-int32-hex-to-screen:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -reset-formatting: +reset-formatting-on-screen: # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -176,13 +176,13 @@ reset-formatting: (write 2 "(B") (write 2 Esc) (write 2 "[m") -$reset-formatting:end: +$reset-formatting-on-screen:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -start-color: # fg: int, bg: int +start-color-on-screen: # fg: int, bg: int # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -207,7 +207,7 @@ start-color: # fg: int, bg: int (write %ecx "m") # flush (write-stream 2 %ecx) -$start-color:end: +$start-color-on-screen:end: # . reclaim locals 81 0/subop/add %esp 0x2c/imm32 # . restore registers @@ -217,73 +217,73 @@ $start-color:end: 5d/pop-to-ebp c3/return -start-bold: +start-bold-on-screen: # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # (write 2 Esc) (write 2 "[1m") -$start-bold:end: +$start-bold-on-screen:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -start-underline: +start-underline-on-screen: # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # (write 2 Esc) (write 2 "[4m") -$start-underline:end: +$start-underline-on-screen:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -start-reverse-video: +start-reverse-video-on-screen: # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # (write 2 Esc) (write 2 "[7m") -$start-reverse-video:end: +$start-reverse-video-on-screen:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return # might require enabling blinking in your terminal program -start-blinking: +start-blinking-on-screen: # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # (write 2 Esc) (write 2 "[5m") -$start-blinking:end: +$start-blinking-on-screen:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -hide-cursor: +hide-cursor-on-screen: # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp # (write 2 Esc) (write 2 "[?25l") -$hide-cursor:end: +$hide-cursor-on-screen:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp c3/return -show-cursor: +show-cursor-on-screen: # . prologue 55/push-ebp 89/<- %ebp 4/r32/esp @@ -292,7 +292,7 @@ show-cursor: (write 2 "[?12l") (write 2 Esc) (write 2 "[?25h") -$show-cursor:end: +$show-cursor-on-screen:end: # . epilogue 89/<- %esp 5/r32/ebp 5d/pop-to-ebp diff --git a/apps/browse.mu b/apps/browse.mu index 7b402e33..70c9ca86 100644 --- a/apps/browse.mu +++ b/apps/browse.mu @@ -65,7 +65,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color 0xec, 7 # 236 = darkish gray + start-color-on-screen 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -86,7 +86,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= @@ -116,7 +116,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '*' - start-bold + start-bold-on-screen copy-to *state, 1 break $update-attributes:check-state } @@ -124,7 +124,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '_' - start-bold + start-bold-on-screen copy-to *state, 1 break $update-attributes:check-state } @@ -136,7 +136,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '*' - reset-formatting + reset-formatting-on-screen copy-to *state, 0 break $update-attributes:check-state } @@ -144,7 +144,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '_' - reset-formatting + reset-formatting-on-screen copy-to *state, 0 break $update-attributes:check-state } @@ -159,7 +159,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/apps/tui.mu b/apps/tui.mu index cde83b2b..ac92d1fc 100644 --- a/apps/tui.mu +++ b/apps/tui.mu @@ -9,12 +9,12 @@ fn main -> exit-status/ebx: int { var ncols/ecx: int <- copy 0 nrows, ncols <- screen-size enable-screen-grid-mode - move-cursor 5, 35 - start-color 1, 0x7a - start-blinking + move-cursor-on-screen 5, 35 + start-color-on-screen 1, 0x7a + start-blinking-on-screen print-string-to-screen "Hello world!" - reset-formatting - move-cursor 6, 35 + reset-formatting-on-screen + move-cursor-on-screen 6, 35 print-string-to-screen "tty dimensions: " print-int32-to-screen nrows print-string-to-screen " rows, " diff --git a/prototypes/browse/10.mu b/prototypes/browse/10.mu index 5c760de4..cd0f748b 100644 --- a/prototypes/browse/10.mu +++ b/prototypes/browse/10.mu @@ -44,7 +44,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color 0xec, 7 # 236 = darkish gray + start-color-on-screen 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -64,7 +64,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= @@ -95,7 +95,7 @@ $check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $check-state } @@ -103,7 +103,7 @@ $check-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $check-state } @@ -115,7 +115,7 @@ $check-state: { { break-if-!= # r->current-state == 1 && c == '*' => normal text - reset-formatting + reset-formatting-on-screen copy-to *state, 0 break $check-state } @@ -123,7 +123,7 @@ $check-state: { { break-if-!= # r->current-state == 1 && c == '_' => normal text - reset-formatting + reset-formatting-on-screen copy-to *state, 0 break $check-state } @@ -138,7 +138,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/11.mu b/prototypes/browse/11.mu index ab7585b0..b4fa36ce 100644 --- a/prototypes/browse/11.mu +++ b/prototypes/browse/11.mu @@ -42,7 +42,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color 0xec, 7 # 236 = darkish gray + start-color-on-screen 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -64,7 +64,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col $char-loop: { compare col, rightcol break-if->= @@ -79,7 +79,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $update-attributes:check-state } @@ -87,7 +87,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $update-attributes:check-state } @@ -99,8 +99,8 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '*' => normal text - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 break $update-attributes:check-state } @@ -108,8 +108,8 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 1 && c == '_' => normal text - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 break $update-attributes:check-state } @@ -134,7 +134,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/12.mu b/prototypes/browse/12.mu index 60d169c8..a8ba3f99 100644 --- a/prototypes/browse/12.mu +++ b/prototypes/browse/12.mu @@ -41,7 +41,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color 0xec, 7 # 236 = darkish gray + start-color-on-screen 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -63,7 +63,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col $char-loop: { compare col, rightcol break-if->= @@ -78,7 +78,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $update-attributes:check-state } @@ -86,7 +86,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $update-attributes:check-state } @@ -100,8 +100,8 @@ $update-attributes:check-state: { # r->current-state == 1 && c == '*' => print c, then normal text print-byte-to-screen c col <- increment - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -111,8 +111,8 @@ $update-attributes:check-state: { # r->current-state == 1 && c == '_' => print c, then normal text print-byte-to-screen c col <- increment - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -137,7 +137,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/13.mu b/prototypes/browse/13.mu index a4d2801e..48e9c112 100644 --- a/prototypes/browse/13.mu +++ b/prototypes/browse/13.mu @@ -41,7 +41,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color 0xec, 7 # 236 = darkish gray + start-color-on-screen 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -63,7 +63,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col $char-loop: { compare col, rightcol break-if->= @@ -78,7 +78,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $update-attributes:check-state } @@ -86,7 +86,7 @@ $update-attributes:check-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $update-attributes:check-state } @@ -101,8 +101,8 @@ $update-attributes:check-state: { # r->current-state == 1 && c == '*' => print c, then normal text print-byte-to-screen c col <- increment - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -112,8 +112,8 @@ $update-attributes:check-state: { # r->current-state == 1 && c == '_' => print c, then normal text print-byte-to-screen c col <- increment - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -138,7 +138,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/14.mu b/prototypes/browse/14.mu index cb76d673..9bcc3751 100644 --- a/prototypes/browse/14.mu +++ b/prototypes/browse/14.mu @@ -39,7 +39,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color 0xec, 7 # 236 = darkish gray + start-color-on-screen 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -61,7 +61,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col $char-loop: { compare col, rightcol break-if->= @@ -76,7 +76,7 @@ $change-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $change-state } @@ -84,7 +84,7 @@ $change-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $change-state } @@ -99,8 +99,8 @@ $change-state: { # r->current-state == 1 && c == '*' => print c, then normal text print-byte-to-screen c col <- increment - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -110,8 +110,8 @@ $change-state: { # r->current-state == 1 && c == '_' => print c, then normal text print-byte-to-screen c col <- increment - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -136,7 +136,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/15-headers-broken.mu b/prototypes/browse/15-headers-broken.mu index 65fbda44..59566e56 100644 --- a/prototypes/browse/15-headers-broken.mu +++ b/prototypes/browse/15-headers-broken.mu @@ -49,7 +49,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color 0xec, 7 # 236 = darkish gray + start-color-on-screen 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -71,7 +71,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col $char-loop: { compare col, rightcol break-if->= @@ -86,7 +86,7 @@ $change-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $change-state } @@ -94,7 +94,7 @@ $change-state: { { break-if-!= # r->current-state == 0 && c == '_' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 break $change-state } @@ -123,8 +123,8 @@ $change-state: { # r->current-state == 1 && c == '*' => print c, then normal text print-byte-to-screen c col <- increment - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -134,8 +134,8 @@ $change-state: { # r->current-state == 1 && c == '_' => print c, then normal text print-byte-to-screen c col <- increment - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray copy-to *state, 0 loop $char-loop } @@ -150,8 +150,8 @@ $change-state: { var s/eax: (addr boolean) <- get r, start-of-line? copy-to *s, 1 # true # switch to normal text - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray # no need to print newlines break $char-loop } @@ -178,7 +178,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/16-screen-state-broken.mu b/prototypes/browse/16-screen-state-broken.mu index 089887e7..d0817bdf 100644 --- a/prototypes/browse/16-screen-state-broken.mu +++ b/prototypes/browse/16-screen-state-broken.mu @@ -68,8 +68,8 @@ fn render-normal in: (addr buffered-file), state: (addr screen-position-state) { # if (c == EOF) break compare c, 0xffffffff # EOF marker break-if-= - # if (c == '*') start-bold, render-until-asterisk(in, state), reset - # else if (c == '_') start-bold, render-until-underscore(in, state), reset + # if (c == '*') start-bold-on-screen, render-until-asterisk(in, state), reset + # else if (c == '_') start-bold-on-screen, render-until-underscore(in, state), reset # else if (c == '#') compute-color, start color, render-header-line(in, state), reset # else add-char(state, c) } diff --git a/prototypes/browse/17-file-state-broken/main.mu b/prototypes/browse/17-file-state-broken/main.mu index fc22d9ea..44eccc2e 100644 --- a/prototypes/browse/17-file-state-broken/main.mu +++ b/prototypes/browse/17-file-state-broken/main.mu @@ -44,8 +44,8 @@ fn render-normal fs: (addr file-state), state: (addr screen-position-state) { # if (c == EOF) break compare c, 0xffffffff # EOF marker break-if-= - # if (c == '*') start-bold, render-until-asterisk(fs, state), reset - # else if (c == '_') start-bold, render-until-underscore(fs, state), reset + # if (c == '*') start-bold-on-screen, render-until-asterisk(fs, state), reset + # else if (c == '_') start-bold-on-screen, render-until-underscore(fs, state), reset # else if (c == '#' and fs is at start of line) compute-color, start color, render-header-line(fs, state), reset # else add-char(state, c) } diff --git a/prototypes/browse/19/screen-position-state.mu b/prototypes/browse/19/screen-position-state.mu index bd11b551..99d51a4a 100644 --- a/prototypes/browse/19/screen-position-state.mu +++ b/prototypes/browse/19/screen-position-state.mu @@ -131,5 +131,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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/20/screen-position-state.mu b/prototypes/browse/20/screen-position-state.mu index a85bc4a5..187b81b6 100644 --- a/prototypes/browse/20/screen-position-state.mu +++ b/prototypes/browse/20/screen-position-state.mu @@ -140,5 +140,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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/21/screen-position-state.mu b/prototypes/browse/21/screen-position-state.mu index 2a4b4327..841b70d8 100644 --- a/prototypes/browse/21/screen-position-state.mu +++ b/prototypes/browse/21/screen-position-state.mu @@ -139,5 +139,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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/22/screen-position-state.mu b/prototypes/browse/22/screen-position-state.mu index 8c72168d..2201e019 100644 --- a/prototypes/browse/22/screen-position-state.mu +++ b/prototypes/browse/22/screen-position-state.mu @@ -159,5 +159,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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/23-multiple-pages/screen-position-state.mu b/prototypes/browse/23-multiple-pages/screen-position-state.mu index 41ad877d..a8faf9fd 100644 --- a/prototypes/browse/23-multiple-pages/screen-position-state.mu +++ b/prototypes/browse/23-multiple-pages/screen-position-state.mu @@ -160,5 +160,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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/24-bold/main.mu b/prototypes/browse/24-bold/main.mu index 8dfc2b9d..2362e695 100644 --- a/prototypes/browse/24-bold/main.mu +++ b/prototypes/browse/24-bold/main.mu @@ -43,7 +43,7 @@ $render-normal:body: { compare c, 0x2a # '*' { break-if-!= - start-bold + start-bold-on-screen render-until-asterisk fs, state normal-text loop $render-normal:body @@ -52,11 +52,11 @@ $render-normal:body: { compare c, 0x5f # '_' { break-if-!= - start-color 0xec, 7 # 236 = darkish gray - start-bold + start-color-on-screen 0xec, 7 # 236 = darkish gray + start-bold-on-screen render-until-underscore fs, state - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray loop $render-normal:body } # @@ -115,6 +115,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/24-bold/screen-position-state.mu b/prototypes/browse/24-bold/screen-position-state.mu index 41ad877d..a8faf9fd 100644 --- a/prototypes/browse/24-bold/screen-position-state.mu +++ b/prototypes/browse/24-bold/screen-position-state.mu @@ -160,5 +160,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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/25-soft-newlines/main.mu b/prototypes/browse/25-soft-newlines/main.mu index 7db4050c..ef1a898f 100644 --- a/prototypes/browse/25-soft-newlines/main.mu +++ b/prototypes/browse/25-soft-newlines/main.mu @@ -87,7 +87,7 @@ $render-normal:flush-buffered-newline: { compare c, 0x2a # '*' { break-if-!= - start-bold + start-bold-on-screen render-until-asterisk fs, state normal-text loop $render-normal:loop @@ -96,11 +96,11 @@ $render-normal:flush-buffered-newline: { compare c, 0x5f # '_' { break-if-!= - start-color 0xec, 7 # 236 = darkish gray - start-bold + start-color-on-screen 0xec, 7 # 236 = darkish gray + start-bold-on-screen render-until-underscore fs, state - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray loop $render-normal:loop } # @@ -159,6 +159,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/25-soft-newlines/screen-position-state.mu b/prototypes/browse/25-soft-newlines/screen-position-state.mu index 51f7e7c8..afaf713e 100644 --- a/prototypes/browse/25-soft-newlines/screen-position-state.mu +++ b/prototypes/browse/25-soft-newlines/screen-position-state.mu @@ -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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/26-headers/main.mu b/prototypes/browse/26-headers/main.mu index 8ce29b8e..68b662bf 100644 --- a/prototypes/browse/26-headers/main.mu +++ b/prototypes/browse/26-headers/main.mu @@ -96,7 +96,7 @@ $render-normal:flush-buffered-newline: { compare c, 0x2a # '*' { break-if-!= - start-bold + start-bold-on-screen render-until-asterisk fs, state normal-text loop $render-normal:loop @@ -105,11 +105,11 @@ $render-normal:flush-buffered-newline: { compare c, 0x5f # '_' { break-if-!= - start-color 0xec, 7 # 236 = darkish gray - start-bold + start-color-on-screen 0xec, 7 # 236 = darkish gray + start-bold-on-screen render-until-underscore fs, state - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray loop $render-normal:loop } # @@ -169,32 +169,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 + start-bold-on-screen compare header-level, 1 { break-if-!= - start-color 0xa0, 7 + start-color-on-screen 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color 0x7c, 7 + start-color-on-screen 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color 0x58, 7 + start-color-on-screen 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color 0x34, 7 + start-color-on-screen 0x34, 7 break $start-heading:body } - start-color 0xe8, 7 + start-color-on-screen 0xe8, 7 } } @@ -247,6 +247,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/26-headers/screen-position-state.mu b/prototypes/browse/26-headers/screen-position-state.mu index 51f7e7c8..afaf713e 100644 --- a/prototypes/browse/26-headers/screen-position-state.mu +++ b/prototypes/browse/26-headers/screen-position-state.mu @@ -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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/27/main.mu b/prototypes/browse/27/main.mu index ea471c8b..8f698454 100644 --- a/prototypes/browse/27/main.mu +++ b/prototypes/browse/27/main.mu @@ -103,7 +103,7 @@ $render-normal:flush-buffered-newline: { compare c, 0x2a # '*' { break-if-!= - start-bold + start-bold-on-screen render-until-asterisk fs, state normal-text loop $render-normal:loop @@ -112,11 +112,11 @@ $render-normal:flush-buffered-newline: { compare c, 0x5f # '_' { break-if-!= - start-color 0xec, 7 # 236 = darkish gray - start-bold + start-color-on-screen 0xec, 7 # 236 = darkish gray + start-bold-on-screen render-until-underscore fs, state - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray loop $render-normal:loop } # @@ -176,32 +176,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 + start-bold-on-screen compare header-level, 1 { break-if-!= - start-color 0xa0, 7 + start-color-on-screen 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color 0x7c, 7 + start-color-on-screen 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color 0x58, 7 + start-color-on-screen 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color 0x34, 7 + start-color-on-screen 0x34, 7 break $start-heading:body } - start-color 0xe8, 7 + start-color-on-screen 0xe8, 7 } } @@ -254,6 +254,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/27/screen-position-state.mu b/prototypes/browse/27/screen-position-state.mu index 51f7e7c8..afaf713e 100644 --- a/prototypes/browse/27/screen-position-state.mu +++ b/prototypes/browse/27/screen-position-state.mu @@ -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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/28/main.mu b/prototypes/browse/28/main.mu index 398890f3..f61e80f9 100644 --- a/prototypes/browse/28/main.mu +++ b/prototypes/browse/28/main.mu @@ -104,7 +104,7 @@ $render-normal:flush-buffered-newline: { compare c, 0x2a # '*' { break-if-!= - start-bold + start-bold-on-screen render-until-asterisk fs, state normal-text break $render-normal:loop-body @@ -113,11 +113,11 @@ $render-normal:flush-buffered-newline: { compare c, 0x5f # '_' { break-if-!= - start-color 0xec, 7 # 236 = darkish gray - start-bold + start-color-on-screen 0xec, 7 # 236 = darkish gray + start-bold-on-screen render-until-underscore fs, state - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray break $render-normal:loop-body } # @@ -178,32 +178,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 + start-bold-on-screen compare header-level, 1 { break-if-!= - start-color 0xa0, 7 + start-color-on-screen 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color 0x7c, 7 + start-color-on-screen 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color 0x58, 7 + start-color-on-screen 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color 0x34, 7 + start-color-on-screen 0x34, 7 break $start-heading:body } - start-color 0xe8, 7 + start-color-on-screen 0xe8, 7 } } @@ -256,6 +256,6 @@ fn first-arg args-on-stack: (addr array (addr array byte)) -> out/eax: (addr arr } fn normal-text { - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/28/screen-position-state.mu b/prototypes/browse/28/screen-position-state.mu index 51f7e7c8..afaf713e 100644 --- a/prototypes/browse/28/screen-position-state.mu +++ b/prototypes/browse/28/screen-position-state.mu @@ -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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/29/main.mu b/prototypes/browse/29/main.mu index 5bbb0586..067e21ff 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 + start-bold-on-screen 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 0xec, 7 # 236 = darkish gray - start-bold + start-color-on-screen 0xec, 7 # 236 = darkish gray + start-bold-on-screen render-until-underscore fs, state - reset-formatting - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 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 + start-bold-on-screen compare header-level, 1 { break-if-!= - start-color 0xa0, 7 + start-color-on-screen 0xa0, 7 break $start-heading:body } compare header-level, 2 { break-if-!= - start-color 0x7c, 7 + start-color-on-screen 0x7c, 7 break $start-heading:body } compare header-level, 3 { break-if-!= - start-color 0x58, 7 + start-color-on-screen 0x58, 7 break $start-heading:body } compare header-level, 4 { break-if-!= - start-color 0x34, 7 + start-color-on-screen 0x34, 7 break $start-heading:body } - start-color 0xe8, 7 + start-color-on-screen 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 - start-color 0xec, 7 # 236 = darkish gray + reset-formatting-on-screen + start-color-on-screen 0xec, 7 # 236 = darkish gray } diff --git a/prototypes/browse/29/screen-position-state.mu b/prototypes/browse/29/screen-position-state.mu index 51f7e7c8..afaf713e 100644 --- a/prototypes/browse/29/screen-position-state.mu +++ b/prototypes/browse/29/screen-position-state.mu @@ -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 *r *c + move-cursor-on-screen *r *c } diff --git a/prototypes/browse/4-render-page.mu b/prototypes/browse/4-render-page.mu index 2799acc7..57f6063b 100644 --- a/prototypes/browse/4-render-page.mu +++ b/prototypes/browse/4-render-page.mu @@ -21,7 +21,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= @@ -44,7 +44,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/5.mu b/prototypes/browse/5.mu index 67a1498e..118325e0 100644 --- a/prototypes/browse/5.mu +++ b/prototypes/browse/5.mu @@ -21,7 +21,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= @@ -46,7 +46,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/6.mu b/prototypes/browse/6.mu index 8acccddb..4e1f33db 100644 --- a/prototypes/browse/6.mu +++ b/prototypes/browse/6.mu @@ -32,7 +32,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= @@ -57,7 +57,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/7.mu b/prototypes/browse/7.mu index b4118e29..4012eef5 100644 --- a/prototypes/browse/7.mu +++ b/prototypes/browse/7.mu @@ -36,7 +36,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= @@ -61,7 +61,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/8-multiple-pages.mu b/prototypes/browse/8-multiple-pages.mu index 01361738..c6453d48 100644 --- a/prototypes/browse/8-multiple-pages.mu +++ b/prototypes/browse/8-multiple-pages.mu @@ -52,7 +52,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= @@ -77,7 +77,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= diff --git a/prototypes/browse/9-bold.mu b/prototypes/browse/9-bold.mu index e9e6f313..aec805c8 100644 --- a/prototypes/browse/9-bold.mu +++ b/prototypes/browse/9-bold.mu @@ -39,7 +39,7 @@ fn render in: (addr buffered-file), nrows: int, ncols: int { var leftcol/edx: int <- copy 5 # page-margin var rightcol/ebx: int <- copy leftcol rightcol <- add 0x40 # page-width = 64 characters - start-color 0xec, 7 # 236 = darkish gray + start-color-on-screen 0xec, 7 # 236 = darkish gray { compare rightcol, ncols break-if->= @@ -59,7 +59,7 @@ $line-loop: { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= @@ -90,7 +90,7 @@ $check-state: { { break-if-!= # r->current-state == 0 && c == '*' => bold text - start-bold + start-bold-on-screen copy-to *state, 1 } break $check-state @@ -101,7 +101,7 @@ $check-state: { { break-if-!= # r->current-state == 1 && c == '*' => normal text - reset-formatting + reset-formatting-on-screen copy-to *state, 0 } } @@ -114,7 +114,7 @@ fn clear toprow: int, leftcol: int, botrow: int, rightcol: int { compare row, botrow break-if->= var col/edx: int <- copy leftcol - move-cursor row, col + move-cursor-on-screen row, col { compare col, rightcol break-if->= |