about summary refs log tree commit diff stats
path: root/shell/main.mu
blob: 04055b8858c5039de1a876df5bfe9c4c9fdb8c69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Experimental Mu shell
# Currently based on Lisp.

fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
  var env-storage: environment
  var env/esi: (addr environment) <- address env-storage
  initialize-environment env
  load-state env, data-disk
  $main:loop: {
    render-environment screen, env
    # no way to quit right now; just reboot
    {
      var key/eax: byte <- read-key keyboard
      compare key, 0
      loop-if-=
      var key/eax: grapheme <- copy key
      edit-environment env, key, data-disk
    }
    loop
  }
}