13static uint16_t *
const vram = (uint16_t *)0x8c000000;
14static const constexpr unsigned int width = 320;
15static const constexpr unsigned int height = 528;
17void line(
unsigned int x1,
unsigned int y1,
unsigned int x2,
unsigned int y2, uint16_t color);
18void vline(
unsigned int x,
unsigned int y1,
unsigned int y2, uint16_t color);
19void triangle(
unsigned int x0,
unsigned int y0,
unsigned int x1,
unsigned int y1,
unsigned int x2,
unsigned int y2, uint16_t colorFill, uint16_t colorLine);
20void fillScreen(uint16_t color);
22static inline __attribute__((pure)) uint16_t
constexpr color(uint8_t R, uint8_t G, uint8_t B) {
23 return (((R<<8) & 0xF800) |
28static inline void setPixel(
unsigned int x,
unsigned int y, uint32_t color) {
29 if(x < width && y < height)
30 vram[width*y + x] = color;
41__attribute__((access(write_only, 1), access(write_only, 2)))
43void getKey(uint32_t *key1, uint32_t *key2);
46 KEY_SHIFT = (int)0x80000000,
47 KEY_CLEAR = 0x00020000,
48 KEY_BACKSPACE = 0x00000080,
49 KEY_LEFT = 0x00004000,
50 KEY_RIGHT = 0x00008000,
52 KEY_POWER = 0x00000040,
53 KEY_DIVIDE = 0x40000000,
54 KEY_MULTIPLY = 0x20000000,
55 KEY_SUBTRACT = 0x10000000,
65 KEY_KEYBOARD = (int)0x80000000,
67 KEY_DOWN = 0x00400000,
68 KEY_EQUALS = 0x00000080,
71 KEY_LEFT_BRACKET = 0x00000020,
72 KEY_RIGHT_BRACKET = 0x00000010,
73 KEY_COMMA = 0x00000008,
74 KEY_NEGATIVE = 0x00000004,
90__attribute__((access(write_only, 1), access(write_only, 2)))
92void getKey(Keys1 *key1, Keys2 *key2) {
95 *key1 =
static_cast<Keys1
>(k1);
96 *key2 =
static_cast<Keys2
>(k2);
99static inline __attribute__((pure))
bool constexpr testKey(uint32_t key1, uint32_t, Keys1 key) {
103static inline __attribute__((pure))
bool constexpr testKey(uint32_t, uint32_t key2, Keys2 key) {