-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathring0_test.htll
More file actions
85 lines (64 loc) · 1.5 KB
/
ring0_test.htll
File metadata and controls
85 lines (64 loc) · 1.5 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
; build in funcs names
; _htll_draw
; _htll_clear
; _htll_get_key
; _htll_draw_char
; _htll_display_clock
; board size
int maxX := 79 ; 0..79 (80 wide)
int maxY := 49 ; 0..49 (50 high)
; player x y pos and color of the player
int x := 0
int y := 0
int playerColor := 15
togo mainLoop ; main loop of the game
_htll_clear(1)
; --- Draw the letters (lowercase) ---
; h (Char ID 104 = 72 + 32)
_htll_draw_char(38, 12, 104, 15) ; x, y, char, color
; e (Char ID 101 = 69 + 32)
_htll_draw_char(39, 12, 101, 15)
; l (Char ID 108 = 76 + 32)
_htll_draw_char(40, 12, 108, 15)
; l (Char ID 108)
_htll_draw_char(41, 12, 108, 15)
; o (Char ID 111 = 79 + 32)
_htll_draw_char(42, 12, 111, 15)
; Display the clock
; x = 72
; y = 0
; color = 15 (White on Black)
; utc_dir = 1 (+)
; utc_val = 2 (+2 hours from hardware time)
; is_12h = 1 (Use 12-hour AM/PM format)
_htll_display_clock(72, 0, 15, 1, 2, 1)
_htll_draw(x, y, playerColor)
draw_all()
; wait
Loop, 400000 {}
_htll_get_key()
if (rax = 17) { ; up
if (y > 0) {
y--
}
goto mainLoop
}
if (rax = 31) { ; down
if (y < maxY) {
y++
}
goto mainLoop
}
if (rax = 30) { ; left
if (x > 0) {
x--
}
goto mainLoop
}
if (rax = 32) { ; right
if (x < maxX) {
x++
}
goto mainLoop
}
goto mainLoop