-
Notifications
You must be signed in to change notification settings - Fork 1
/
console.yabal
58 lines (47 loc) · 1.17 KB
/
console.yabal
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
var font = include_font("./font/RobotoMono-Regular.ttf;Size=10");
var screen = create_pointer(53871, 1);
var screenWidth = 108;
var screenHeight = 108;
var currentX = 0;
var currentY = 0;
void render_char(int screenX, int screenY, int character) {
var width = 8;
var height = 8;
var offset = character * width * height;
for (var y = 0; y < height; y++) {
for (var x = 0; x < width; x++) {
var pixel = font[offset + y * width + x];
if (pixel > 0) {
screen[(screenY + y) * screenWidth + (screenX + x)] = pixel;
}
}
}
}
void write_char(int character) {
render_char(currentX, currentY, character);
currentX += 8;
if (currentX >= 104) {
currentX = 0;
currentY += 8;
}
}
void write_string(int[] str) {
for (var i = 0; true; i++) {
var c = str[i];
if (c == 0xFFFF) {
break;
}
write_char(c);
}
}
void reset_screen() {
for (var i = 0; i < 108 * 108; i++) {
screen[i] = 0;
}
}
while (true) {
currentX = 0;
currentY = 0;
write_string("abcdefghijklmnopqrstuvwxyz0123456789");
asm { VBUF }
}