#include "draw.h"
#include <stdlib.h>
+#include "font.h"
extern uint8_t* screen_buffer;
extern uint8_t hres_bytes;
}
}
+void draw_char ( uint8_t pos_x, uint8_t pos_y, uint8_t ch)
+{
+ for ( int h = 0; h < font_height; h++ )
+ {
+ uint8_t fl = pgm_read_byte(&( font[ch-32][h]));
+ fl = fl<<(8-font_width);
+
+ for ( int p = 0; p < font_width; p++ )
+ {
+ uint8_t ft = fl<<p;
+ ft = ft & 0x80;
+ ft = ft>>7;
+ set_pixel( pos_x+p, pos_y+h, ft);
+ }
+ }
+
+}
+
+void draw_string ( uint8_t pos_x, uint8_t pos_y, const char *text)
+{
+ for (int i = 0; text[i] != 0; i++)
+ {
+ draw_char( pos_x+(font_width*i)+1, pos_y, text[i]);
+ }
+}
+