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/tile/9.mu | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'prototypes/tile/9.mu') diff --git a/prototypes/tile/9.mu b/prototypes/tile/9.mu index 91637afb..298db795 100644 --- a/prototypes/tile/9.mu +++ b/prototypes/tile/9.mu @@ -71,7 +71,7 @@ $main:loop: { render root-addr, cursor-addr loop } - clear-screen + clear-screen 0 enable-keyboard-type-mode exit-status <- copy 0 } @@ -183,7 +183,7 @@ fn create-child node: (addr cell) { ####################################################### fn render root: (addr cell), cursor: (addr cell) { - clear-screen + clear-screen 0 var depth/eax: int <- tree-depth root var viewport-width/ecx: int <- copy 0x64 # col2 viewport-width <- subtract 5 # col1 @@ -283,11 +283,11 @@ fn draw-box row1: int, col1: int, row2: int, col2: int { fn draw-horizontal-line row: int, col1: int, col2: int { var col/eax: int <- copy col1 - move-cursor-on-screen row, col + move-cursor 0, row, col { compare col, col2 break-if->= - print-string-to-screen "-" + print-string 0, "-" col <- increment loop } @@ -298,8 +298,8 @@ fn draw-vertical-line row1: int, row2: int, col: int { { compare row, row2 break-if->= - move-cursor-on-screen row, col - print-string-to-screen "|" + move-cursor 0, row, col + print-string 0, "|" row <- increment loop } @@ -311,8 +311,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # x = next power-of-2 multiple of _dr after _nr var x/ecx: int <- copy 1 { -#? print-int32-hex-to-screen x -#? print-string-to-screen "\n" +#? print-int32-hex 0, x +#? print-string 0, "\n" var tmp/edx: int <- copy _dr tmp <- multiply x compare tmp, _nr @@ -320,7 +320,7 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { x <- shift-left 1 loop } -#? print-string-to-screen "--\n" +#? print-string 0, "--\n" # min, max = x/2, x var max/ecx: int <- copy x var min/edx: int <- copy max @@ -328,8 +328,8 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { # narrow down result between min and max var i/eax: int <- copy min { -#? print-int32-hex-to-screen i -#? print-string-to-screen "\n" +#? print-int32-hex 0, i +#? print-string 0, "\n" var foo/ebx: int <- copy _dr foo <- multiply i compare foo, _nr @@ -339,9 +339,9 @@ fn try-divide _nr: int, _dr: int -> result/eax: int { } result <- copy i result <- decrement -#? print-string-to-screen "=> " -#? print-int32-hex-to-screen result -#? print-string-to-screen "\n" +#? print-string 0, "=> " +#? print-int32-hex 0, result +#? print-string 0, "\n" } fn test-try-divide-1 { -- cgit 1.4.1-2-gfad0