2014-12-11 23:14:23 +03:00
|
|
|
#include "defines.h"
|
|
|
|
|
2014-12-14 20:05:58 +03:00
|
|
|
// Enable scancodes for event loop
|
2014-12-11 23:14:23 +03:00
|
|
|
inline void enable_scancode() {
|
|
|
|
__asm__ __volatile__("int $0x40"::"a"(66),"b"(1),"c"(1));
|
|
|
|
}
|
|
|
|
|
2014-12-14 20:05:58 +03:00
|
|
|
// Clear key buffer
|
2014-12-11 23:14:23 +03:00
|
|
|
inline void clear_key_buffer() {
|
|
|
|
int i = 0;
|
|
|
|
for (i = 0; i < 120; i++)
|
|
|
|
__menuet__getkey();
|
|
|
|
}
|
|
|
|
|
2014-12-14 20:05:58 +03:00
|
|
|
// Wait for screen draw (vertical sync)
|
2014-12-11 23:14:23 +03:00
|
|
|
inline void vsync() {
|
|
|
|
__asm__ __volatile__("int $0x40"::"a"(18),"b"(14));
|
|
|
|
}
|
2014-12-18 01:42:18 +03:00
|
|
|
|
|
|
|
// Get text length in pixels
|
|
|
|
inline __u32 text_length_px(__u32 len)
|
|
|
|
{
|
|
|
|
return len * FONT_WIDTH + len;
|
|
|
|
}
|