https://github.com/akkartik/mu/blob/main/apps/ex13.mu
1
2
3
4
5
6
7
8
9
10
11 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
12 var img-storage: image
13 var img/esi: (addr image) <- address img-storage
14 load-image img, data-disk
15 render-image screen, img, 0/x, 0/y, 0x300/width, 0x300/height
16 }
17
18 fn load-image self: (addr image), data-disk: (addr disk) {
19 var s-storage: (stream byte 0x200000)
20 var s/ebx: (addr stream byte) <- address s-storage
21 load-sectors data-disk, 0/lba, 0x1000/sectors, s
22 initialize-image self, s
23 }