summary refs log tree commit diff stats
path: root/pkg/unsplash/unsplash.go
blob: 689f8c45c156a7b83822a068a9a000b3b76a9faa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
generated by cgit-pink 1.4.1-2-gfad0 (git 2.36.2.497.gbbea4dcf42) at 2024-06-26 07:28:40 +0000
 


th, 0x2f/screen-height-without-menu
    {
      var key/eax: byte <- read-key keyboard
      compare key, 0
      loop-if-=
      # no way to quit right now; just reboot
      edit-sandbox sandbox, key, globals, screen, keyboard, data-disk
    }
    loop
  }
}

# Read a null-terminated sequence of keys from disk and load them into
# sandbox.
fn load-sandbox data-disk: (addr disk), _self: (addr sandbox) {
  var self/esi: (addr sandbox) <- copy _self
  var s-storage: (stream byte 0x200)
  var s/ebx: (addr stream byte) <- address s-storage
  load-sector data-disk, 0/lba, s
  {
    var done?/eax: boolean <- stream-empty? s
    compare done?, 0/false
    break-if-!=
    var key/eax: byte <- read-byte s
    compare key, 0/null
    break-if-=
    edit-sandbox self, key, 0/no-globals, 0/no-screen, 0/no-keyboard, 0/no-disk
    loop
  }
}