2024-10-13 16:15:10 -05:00
|
|
|
.{memory, log, string, buffer, math} := @use("../../../libraries/stn/src/lib.hb")
|
|
|
|
render := @use("../../../libraries/render/src/lib.hb")
|
|
|
|
Color := render.Color
|
|
|
|
Vec2 := math.Vec2
|
2024-10-12 07:35:49 -05:00
|
|
|
|
|
|
|
main := fn(): void {
|
2024-10-13 16:15:10 -05:00
|
|
|
input := @as(u8, 0)
|
2024-10-12 07:35:49 -05:00
|
|
|
output_buffer := memory.request_page(1)
|
|
|
|
input_buffer := buffer.search("XKeyboard\0")
|
2024-10-13 16:15:10 -05:00
|
|
|
|
|
|
|
render.init()
|
|
|
|
|
2024-10-12 07:35:49 -05:00
|
|
|
loop {
|
2024-10-13 16:15:10 -05:00
|
|
|
render.clear(render.black)
|
|
|
|
render.put_vline(100, 255, 128, Color.(255, 255, 255, 255))
|
|
|
|
render.put_hline(64, 100 - 64, 164, Color.(255, 255, 255, 255))
|
|
|
|
render.put_trirect(Vec2(int).(128, 128 + 256), Vec2(int).(256, -256), Color.(147, 147, 147, 255), Color.(107, 107, 107, 255))
|
|
|
|
render.put_filled_rect(Vec2(int).(128 + 32, 128 + 32), Vec2(int).(256 - 64, 256 - 64), Color.(127, 127, 127, 127))
|
|
|
|
render.sync()
|
|
|
|
|
|
|
|
buffer.recv(input_buffer, &input, 1)
|
|
|
|
if input != 0 {
|
|
|
|
log.info(string.display_int(input, output_buffer))
|
|
|
|
input = 0
|
2024-10-12 07:35:49 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|