2018-10-03 02:53:55 +02:00
|
|
|
#include <stdint.h>
|
2018-10-03 09:16:54 +02:00
|
|
|
#include <string.h>
|
2018-10-03 02:53:55 +02:00
|
|
|
|
|
|
|
#define CEILDIV(x, y) (((x)+((y)-1))/(y))
|
|
|
|
|
|
|
|
#if FB_DEPTH==1
|
|
|
|
|
|
|
|
#define FB_WIDTH_BYTES CEILDIV(FB_WIDTH, 8)
|
|
|
|
#define FRAMEBUFFER uint8_t framebuffer[FB_HEIGHT][FB_WIDTH_BYTES];
|
|
|
|
#define FB_SET(w,h,c) if (c) { \
|
2018-10-03 09:16:54 +02:00
|
|
|
framebuffer[h][(w)>>3] |= (1 << ((w) & 7)); \
|
2018-10-03 02:53:55 +02:00
|
|
|
} else { \
|
2018-10-03 09:16:54 +02:00
|
|
|
framebuffer[h][(w)>>3] &= ~(1 << ((w) & 7)); \
|
2018-10-03 02:53:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#elif FB_DEPTH==8
|
|
|
|
|
|
|
|
#define FRAMEBUFFER uint8_t framebuffer][FB_HEIGHT][FB_WIDTH];
|
|
|
|
#define FB_SET(w,h,c) framebuffer[h][w] = c
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DONT_DECLARE_FRAMEBUFFER
|
|
|
|
extern FRAMEBUFFER
|
|
|
|
#endif
|
2018-10-03 09:16:54 +02:00
|
|
|
|
|
|
|
void fb_fill(uint8_t c);
|
|
|
|
void fb_shift();
|