2017-02-19 23:55:54 +00:00
|
|
|
#ifndef __PHYSICALDISPLAY_H
|
|
|
|
#define __PHYSICALDISPLAY_H
|
|
|
|
|
|
|
|
#include <string.h> // strncpy
|
|
|
|
|
2017-02-26 16:00:41 +00:00
|
|
|
#include "vmdisplay.h" // FIXME: for AiieRect
|
|
|
|
|
2017-02-19 23:55:54 +00:00
|
|
|
class PhysicalDisplay {
|
|
|
|
public:
|
|
|
|
PhysicalDisplay() { overlayMessage[0] = '\0'; }
|
|
|
|
virtual ~PhysicalDisplay() {};
|
|
|
|
|
2018-02-07 15:20:26 +00:00
|
|
|
virtual void flush() = 0; // flush any pending drawings
|
2017-02-19 23:55:54 +00:00
|
|
|
virtual void redraw() = 0; // total redraw, assuming nothing
|
2020-07-07 01:31:37 +00:00
|
|
|
virtual void blit() = 0; // blit everything to the display (including UI area)
|
|
|
|
virtual void blit(AiieRect r) = 0; // blit a piece of the VM area to the display
|
2017-02-19 23:55:54 +00:00
|
|
|
|
2021-01-21 02:16:32 +00:00
|
|
|
virtual void drawImageOfSizeAt(const uint8_t *img, uint16_t sizex, uint16_t sizey, uint16_t wherex, uint16_t wherey) = 0;
|
2017-02-19 23:55:54 +00:00
|
|
|
|
2021-01-21 02:16:32 +00:00
|
|
|
virtual void drawCharacter(uint8_t mode, uint16_t x, uint16_t y, char c) = 0;
|
|
|
|
virtual void drawString(uint8_t mode, uint16_t x, uint16_t y, const char *str) = 0;
|
2020-07-06 20:46:14 +00:00
|
|
|
virtual void debugMsg(const char *msg) { strncpy(overlayMessage, msg, sizeof(overlayMessage));overlayMessage[strlen(overlayMessage)] = 0; }
|
2017-02-19 23:55:54 +00:00
|
|
|
|
2018-01-07 19:43:17 +00:00
|
|
|
virtual void drawPixel(uint16_t x, uint16_t y, uint16_t color) = 0;
|
|
|
|
virtual void drawPixel(uint16_t x, uint16_t y, uint8_t r, uint8_t g, uint8_t b) = 0;
|
|
|
|
|
2018-02-18 01:44:04 +00:00
|
|
|
virtual void drawUIPixel(uint16_t x, uint16_t y, uint16_t color) = 0;
|
|
|
|
|
2021-01-09 12:14:14 +00:00
|
|
|
virtual void clrScr(uint8_t coloridx) = 0;
|
2018-02-07 15:20:26 +00:00
|
|
|
|
2018-02-18 01:44:04 +00:00
|
|
|
// methods to draw in to the buffer - not directly to the screen.
|
|
|
|
|
|
|
|
// First, methods that expect *us* to pixel-double the width...
|
|
|
|
virtual void cacheDoubleWidePixel(uint16_t x, uint16_t y, uint8_t color) = 0;
|
|
|
|
virtual void cache2DoubleWidePixels(uint16_t x, uint16_t y, uint8_t colorA, uint8_t colorB) = 0;
|
|
|
|
|
|
|
|
// Then the direct-pixel methods
|
|
|
|
virtual void cachePixel(uint16_t x, uint16_t y, uint8_t color) = 0;
|
|
|
|
|
2017-02-19 23:55:54 +00:00
|
|
|
protected:
|
|
|
|
char overlayMessage[40];
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|