5 #include "ProgramVector.h"
6 #include "PatchProcessor.h"
7 #include "ServiceCall.h"
11 static void onDrawCallback(uint8_t* pixels, uint16_t width, uint16_t height){
21 void* drawArgs[] = {(
void*)SYSTEM_FUNCTION_DRAW, (
void*)&
onDrawCallback};
22 getProgramVector()->serviceCall(OWL_SERVICE_REGISTER_CALLBACK, drawArgs, 2);
36 if(x >= width || y >= height)
38 uint8_t ucByteOffset = 0;
39 uint16_t usiArrayLoc = 0;
41 usiArrayLoc = (y/8)+(x*8);
43 ucByteOffset = y-((uint8_t)(y/8)*8);
45 return pixels[usiArrayLoc] & (1 << ucByteOffset);
51 if(x < width && y < height){
52 uint8_t ucByteOffset = 0;
53 uint16_t usiArrayLoc = 0;
55 usiArrayLoc = (y/8)+(x*8);
57 ucByteOffset = y-((uint8_t)(y/8)*8);
60 pixels[usiArrayLoc] &= ~(1 << ucByteOffset);
62 pixels[usiArrayLoc] |= (1 << ucByteOffset);
68 if(x < width && y < height){
69 uint8_t ucByteOffset = 0;
70 uint16_t usiArrayLoc = 0;
72 usiArrayLoc = (y/8)+(x*8);
74 ucByteOffset = y-((uint8_t)(y/8)*8);
75 uint8_t pixel = (1 << ucByteOffset);
77 if(pixels[usiArrayLoc] & pixel)
78 pixels[usiArrayLoc] &= ~pixel;
80 pixels[usiArrayLoc] |= pixel;
98 memset(pixels, c ==
WHITE ? 0xff : 0x00, height*width/8);
static void onDrawCallback(uint8_t *pixels, uint16_t width, uint16_t height)
PatchProcessor * getInitialisingPatchProcessor()
Abstract base class for patches that use a monochrome screen.
uint16_t getScreenWidth()
virtual ~MonochromeScreenPatch()
uint16_t getScreenHeight()
virtual void processScreen(MonochromeScreenBuffer &screen)=0
void setPixel(unsigned int x, unsigned int y, Colour c)
Colour getPixel(unsigned int x, unsigned int y)
void invertPixel(unsigned int x, unsigned int y)
void fade(uint16_t steps)
void setBuffer(uint8_t *buffer)