diff options
Diffstat (limited to 'prototypes/tile')
-rw-r--r-- | prototypes/tile/1.mu | 4 | ||||
-rw-r--r-- | prototypes/tile/10.mu | 6 | ||||
-rw-r--r-- | prototypes/tile/11.mu | 4 | ||||
-rw-r--r-- | prototypes/tile/2.mu | 2 | ||||
-rw-r--r-- | prototypes/tile/4.mu | 4 | ||||
-rw-r--r-- | prototypes/tile/5.mu | 4 | ||||
-rw-r--r-- | prototypes/tile/6.mu | 4 | ||||
-rw-r--r-- | prototypes/tile/7.mu | 4 | ||||
-rw-r--r-- | prototypes/tile/8.mu | 4 | ||||
-rw-r--r-- | prototypes/tile/9.mu | 9 |
10 files changed, 23 insertions, 22 deletions
diff --git a/prototypes/tile/1.mu b/prototypes/tile/1.mu index 4c0f8a6d..4d0a7969 100644 --- a/prototypes/tile/1.mu +++ b/prototypes/tile/1.mu @@ -14,7 +14,7 @@ fn main -> exit-status/ebx: int { move-cursor 0, 5, 5 print-string 0, "_________" enable-keyboard-immediate-mode - var dummy/eax: byte <- read-key + var dummy/eax: grapheme <- read-key-from-real-keyboard var row/eax: int <- copy 5 { compare row, 0xe # 15 @@ -24,7 +24,7 @@ fn main -> exit-status/ebx: int { sleep 0 0x5f5e100 # 100ms loop } - var dummy/eax: byte <- read-key + var dummy/eax: grapheme <- read-key-from-real-keyboard enable-keyboard-type-mode clear-screen 0 exit-status <- copy 0 diff --git a/prototypes/tile/10.mu b/prototypes/tile/10.mu index 73ce73ff..6f971b1c 100644 --- a/prototypes/tile/10.mu +++ b/prototypes/tile/10.mu @@ -63,14 +63,14 @@ fn interactive -> exit-status/ebx: int { $main:loop: { # process key { - var c/eax: byte <- read-key + var c/eax: grapheme <- read-key-from-real-keyboard compare c, 4 # ctrl-d break-if-= $main:loop process c, root, cursor } # render tree var _root-addr/eax: (addr cell) <- lookup root-handle - var root-addr/ecx: (addr cell) <- copy _root-addr + root-addr <- copy _root-addr var cursor-addr/eax: (addr cell) <- lookup *cursor render root-addr, cursor-addr loop @@ -84,7 +84,7 @@ $main:loop: { # Tree mutations ####################################################### -fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) { +fn process c: grapheme, root: (addr handle cell), cursor: (addr handle cell) { $process:body: { # if c == 'h' move cursor to its parent if possible { diff --git a/prototypes/tile/11.mu b/prototypes/tile/11.mu index 8d3593e3..82de9fda 100644 --- a/prototypes/tile/11.mu +++ b/prototypes/tile/11.mu @@ -63,7 +63,7 @@ fn interactive -> exit-status/ebx: int { $main:loop: { # process key { - var c/eax: byte <- read-key + var c/eax: grapheme <- read-key-from-real-keyboard compare c, 4 # ctrl-d break-if-= $main:loop process c, root, cursor @@ -84,7 +84,7 @@ $main:loop: { # Tree mutations ####################################################### -fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) { +fn process c: grapheme, root: (addr handle cell), cursor: (addr handle cell) { $process:body: { # if c == 'h' move cursor to its parent if possible { diff --git a/prototypes/tile/2.mu b/prototypes/tile/2.mu index 79b9ed99..6339d61e 100644 --- a/prototypes/tile/2.mu +++ b/prototypes/tile/2.mu @@ -32,7 +32,7 @@ fn main -> exit-status/ebx: int { # wait for a key { enable-keyboard-immediate-mode - var dummy/eax: byte <- read-key + var dummy/eax: grapheme <- read-key-from-real-keyboard enable-keyboard-type-mode } # clean up diff --git a/prototypes/tile/4.mu b/prototypes/tile/4.mu index bd2bd77c..6e2a57b7 100644 --- a/prototypes/tile/4.mu +++ b/prototypes/tile/4.mu @@ -9,7 +9,7 @@ fn main -> exit-status/ebx: int { clear-screen 0 enable-keyboard-immediate-mode - var dummy/eax: byte <- read-key + var dummy/eax: grapheme <- read-key-from-real-keyboard draw-box 5, 5, 0x23, 0x23 # 35, 35 sleep 0 0x5f5e100 # 100ms sleep 0 0x5f5e100 # 100ms @@ -17,7 +17,7 @@ fn main -> exit-status/ebx: int { sleep 0 0x5f5e100 # 100ms sleep 0 0x5f5e100 # 100ms draw-box 5, 5, 0x23, 0xaf # 35, 175 - var dummy/eax: byte <- read-key + var dummy/eax: grapheme <- read-key-from-real-keyboard enable-keyboard-type-mode clear-screen 0 exit-status <- copy 0 diff --git a/prototypes/tile/5.mu b/prototypes/tile/5.mu index a49c4922..58d94636 100644 --- a/prototypes/tile/5.mu +++ b/prototypes/tile/5.mu @@ -31,7 +31,7 @@ fn main -> exit-status/ebx: int { $main:loop: { # process key { - var c/eax: byte <- read-key + var c/eax: grapheme <- read-key-from-real-keyboard compare c, 4 # ctrl-d break-if-= $main:loop process c, root, cursor @@ -50,7 +50,7 @@ $main:loop: { # Tree mutations ####################################################### -fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) { +fn process c: grapheme, root: (addr handle cell), cursor: (addr handle cell) { var c1/eax: (addr handle cell) <- copy cursor var c2/eax: (addr cell) <- lookup *c1 create-child c2 diff --git a/prototypes/tile/6.mu b/prototypes/tile/6.mu index ee7ef8c0..be95dead 100644 --- a/prototypes/tile/6.mu +++ b/prototypes/tile/6.mu @@ -58,7 +58,7 @@ fn interactive -> exit-status/ebx: int { $main:loop: { # process key { - var c/eax: byte <- read-key + var c/eax: grapheme <- read-key-from-real-keyboard compare c, 4 # ctrl-d break-if-= $main:loop process c, root, cursor @@ -77,7 +77,7 @@ $main:loop: { # Tree mutations ####################################################### -fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) { +fn process c: grapheme, root: (addr handle cell), cursor: (addr handle cell) { # increase depth by 1 var c1/ecx: (addr handle cell) <- copy cursor var c2/eax: (addr cell) <- lookup *c1 diff --git a/prototypes/tile/7.mu b/prototypes/tile/7.mu index 92b92b34..e2e7aff0 100644 --- a/prototypes/tile/7.mu +++ b/prototypes/tile/7.mu @@ -62,7 +62,7 @@ fn interactive -> exit-status/ebx: int { $main:loop: { # process key { - var c/eax: byte <- read-key + var c/eax: grapheme <- read-key-from-real-keyboard compare c, 4 # ctrl-d break-if-= $main:loop process c, root, cursor @@ -81,7 +81,7 @@ $main:loop: { # Tree mutations ####################################################### -fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) { +fn process c: grapheme, root: (addr handle cell), cursor: (addr handle cell) { var c1/ecx: (addr handle cell) <- copy cursor var c2/eax: (addr cell) <- lookup *c1 create-child c2 diff --git a/prototypes/tile/8.mu b/prototypes/tile/8.mu index c64a1577..526df803 100644 --- a/prototypes/tile/8.mu +++ b/prototypes/tile/8.mu @@ -62,7 +62,7 @@ fn interactive -> exit-status/ebx: int { $main:loop: { # process key { - var c/eax: byte <- read-key + var c/eax: grapheme <- read-key-from-real-keyboard compare c, 4 # ctrl-d break-if-= $main:loop process c, root, cursor @@ -81,7 +81,7 @@ $main:loop: { # Tree mutations ####################################################### -fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) { +fn process c: grapheme, root: (addr handle cell), cursor: (addr handle cell) { var c1/ecx: (addr handle cell) <- copy cursor var c2/eax: (addr cell) <- lookup *c1 create-child c2 diff --git a/prototypes/tile/9.mu b/prototypes/tile/9.mu index 69360b2e..ab143e25 100644 --- a/prototypes/tile/9.mu +++ b/prototypes/tile/9.mu @@ -60,14 +60,15 @@ fn interactive -> exit-status/ebx: int { $main:loop: { # process key { - var c/eax: byte <- read-key + var c/eax: grapheme <- read-key-from-real-keyboard compare c, 4 # ctrl-d break-if-= $main:loop process c, root, cursor } # render tree - root-addr <- lookup root-handle - cursor-addr <- lookup *cursor + var _root-addr/eax: (addr cell) <- lookup root-handle + root-addr <- copy _root-addr + var cursor-addr/eax: (addr cell) <- lookup *cursor render root-addr, cursor-addr loop } @@ -80,7 +81,7 @@ $main:loop: { # Tree mutations ####################################################### -fn process c: byte, root: (addr handle cell), cursor: (addr handle cell) { +fn process c: grapheme, root: (addr handle cell), cursor: (addr handle cell) { $process:body: { # if c == 'h' move cursor to its parent if possible { |