https://github.com/akkartik/mu/blob/main/apps/ex10.mu
1
2
3
4
5
6
7
8
9
10
11
12 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
13
14 $main:event-loop: {
15 var dx/eax: int <- copy 0
16 var dy/ecx: int <- copy 0
17 dx, dy <- read-mouse-event
18 {
19 compare dx, 0
20 break-if-!=
21 compare dy, 0
22 break-if-!=
23 loop $main:event-loop
24 }
25 {
26 var dummy1/eax: int <- copy 0
27 var dummy2/ecx: int <- copy 0
28 dummy1, dummy2 <- draw-text-wrapping-right-then-down-over-full-screen screen, " ", 0/x, 0x10/y, 0x31/fg, 0/bg
29 }
30 {
31 var dummy/ecx: int <- copy 0
32 dx, dummy <- draw-int32-decimal-wrapping-right-then-down-over-full-screen screen, dx, 0/x, 0x10/y, 0x31/fg, 0/bg
33 }
34 {
35 var dummy/eax: int <- copy 0
36 dummy, dy <- draw-int32-decimal-wrapping-right-then-down-over-full-screen screen, dy, 5/x, 0x10/y, 0x31/fg, 0/bg
37 }
38 loop
39 }
40 }