1
0
mirror of https://github.com/jscrane/r65emu.git synced 2024-06-01 22:41:30 +00:00
r65emu/display.h

46 lines
1.2 KiB
C
Raw Normal View History

2023-07-25 13:10:35 +00:00
#ifndef __DISPLAY_H__
#define __DISPLAY_H__
2018-11-03 13:30:49 +00:00
typedef enum {
2018-11-08 07:34:40 +00:00
portrait, landscape, reverse_portrait, reverse_landscape
2018-11-03 13:30:49 +00:00
} orientation_t;
typedef unsigned colour_t;
const colour_t BLACK = 0x0000;
const colour_t NAVY = 0x000F;
const colour_t DARKGREEN = 0x03E0;
const colour_t DARKCYAN = 0x03EF;
const colour_t MAROON = 0x7800;
const colour_t PURPLE = 0x780F;
const colour_t OLIVE = 0x7BE0;
const colour_t LIGHTGREY = 0xC618;
const colour_t DARKGREY = 0x7BEF;
const colour_t BLUE = 0x001F;
const colour_t GREEN = 0x07E0;
const colour_t CYAN = 0x07FF;
const colour_t RED = 0xF800;
const colour_t MAGENTA = 0xF81F;
const colour_t YELLOW = 0xFFE0;
const colour_t WHITE = 0xFFFF;
const colour_t ORANGE = 0xFDA0;
const colour_t GREENYELLOW = 0xB7E0;
const colour_t PINK = 0xFC9F;
2023-07-25 13:10:35 +00:00
class Display {
2018-11-03 13:30:49 +00:00
public:
2023-07-26 14:32:11 +00:00
void begin(colour_t bg, colour_t fg, orientation_t o);
void begin(colour_t bg, colour_t fg, orientation_t o, unsigned dispx, unsigned dispy);
2018-11-03 13:30:49 +00:00
void clear();
2018-11-12 07:46:21 +00:00
void status(const char *s);
2018-11-03 13:30:49 +00:00
void drawPixel(unsigned x, unsigned y, colour_t col);
2018-11-12 07:46:21 +00:00
void drawString(const char *s, unsigned x, unsigned y);
2018-11-03 13:30:49 +00:00
protected:
2023-07-26 14:32:11 +00:00
unsigned _bg, _fg, _cx, _cy, _dx, _dy, _oxs, _xoff, _yoff;
2018-11-03 13:30:49 +00:00
};
#endif