void draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t c)
{
- if (x0 > hres_bytes*8 || y0 > VRES || x1 > hres_bytes*8 || y1 > VRES)
+ if (x0 > hres_bytes*8 || y0 > VRES) // || x1 > hres_bytes*8 || y1 > VRES)
return;
int dx, dy, sx, sy, err, p;
{
sp(x0, y0, c);
if ( ( x0 == x1 ) && ( y0 == y1 ) ) return;
+ if ( x0 > hres_bytes*8 || y0 > VRES ) return;
+
p = 2 * err;
if ( p > -dy )
{
_draw_circle(x0, y0, radius, c, c);
}
+void draw_8bpp_bitmap( uint8_t pos_x, uint8_t pos_y, uint8_t width, uint8_t height, const uint8_t* image )
+{
+ for ( int v = 0; v < height; v++ )
+ {
+ for ( int h = 0; h < width; h++ )
+ {
+ uint8_t t = image[v*width+h];
+ set_pixel( pos_x + h, pos_y + v, t);
+ }
+ }
+}
+
+void pgm_draw_8bpp_bitmap( uint8_t pos_x, uint8_t pos_y, uint8_t width, uint8_t height, const uint8_t* image )
+{
+ for ( int v = 0; v < height; v++ )
+ {
+ for ( int h = 0; h < width; h++ )
+ {
+ uint8_t t = pgm_read_byte(&(image[v*width+h]));
+ set_pixel( pos_x + h, pos_y + v, t);
+ }
+ }
+}