diff --git a/src/Makefile b/src/Makefile index cf7402e70..918cd0107 100644 --- a/src/Makefile +++ b/src/Makefile @@ -569,12 +569,12 @@ sticks.lbm: sticks_4x1.xbm s9xsplash.lbm: s9xsplash.xbm @echo @echo "Convert splash from xbm to lbm:" - $(IMG2LBM) $< $@ img + $(IMG2LBM) $< $@ imgc asterisk.lbm: asterisk.xbm @echo @echo "Convert asterisk from xbm to lbm:" - $(IMG2LBM) $< $@ img + $(IMG2LBM) $< $@ imgc # Eye candy. # AVR Studio 3.x does not check make's exit code but relies on diff --git a/src/asterisk.lbm b/src/asterisk.lbm index 72b02a422..6e78c3ff5 100644 --- a/src/asterisk.lbm +++ b/src/asterisk.lbm @@ -1,5 +1,6 @@ -27,32, -0xe0,0xf8,0xfc,0xfc,0xfc,0x7c,0x78,0x78,0x70,0x70,0x60,0xe0,0xc0,0xc0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0xff,0xff,0xff,0xff,0xff,0xfc,0xf0,0xc0,0x00,0x00,0x80,0x87,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfc,0xfc,0xf8,0xf8,0xf0,0xf0,0xe0, -0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf3,0xe1,0xe1,0xe1,0xe1,0xf3,0xff,0x7f,0x3f,0x3f,0x1f,0x0f,0x0f,0x07,0x03,0x03,0x01,0x00, -0x07,0x1f,0x3f,0x3f,0x3f,0x3f,0x1f,0x1f,0x0f,0x07,0x07,0x03,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +27,32,1, +0x00,0xe0,0xf8,0xf0,0xfc,0x03,0x7c,0x78,0x78,0x70,0x70,0x60,0xe0,0xc0,0xc0,0x80,0x80, +0xf0,0x00,0x0b,0xf0,0xff,0x05,0xfc,0xf0,0xf0,0x01,0xc0,0x00,0x00,0x80,0x87,0xf0,0xff,0x06,0xfe,0xfe,0xfc,0xfc,0xf8,0xf8,0xf0,0xf0, +0xe0,0xf0,0xff,0x09,0xf3,0xf0,0xe1,0x04,0xf3,0xff,0x7f,0x3f,0x3f,0x1f,0x0f,0x0f,0x07,0x03,0x03,0x01, +0x00,0x07,0x1f,0xf0,0x3f,0x04,0x1f,0x1f,0x0f,0x07,0x07,0x03,0x01,0x01, +0xf0,0x00,0x0d, \ No newline at end of file diff --git a/src/font.lbm b/src/font.lbm index 68c7242dc..fcdd7d148 100644 --- a/src/font.lbm +++ b/src/font.lbm @@ -1,6 +1,6 @@ -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6f,0x00,0x00,0x07,0x00,0x07,0x00,0x18,0x30,0x18,0x0c,0x06,0x08,0x7f,0x7f,0x7f,0x08,0x23,0x13,0x08,0x64,0x62,0x36,0x49,0x55,0x22,0x50,0x00,0x05,0x03,0x00,0x00,0x00,0x1c,0x22,0x41,0x00,0x00,0x41,0x22,0x1c,0x00,0x14,0x08,0x3e,0x08,0x14,0x08,0x08,0x3e,0x08,0x08,0x00,0x50,0x30,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x00,0x60,0x60,0x00,0x00,0x20,0x10,0x08,0x04,0x02, -0x00,0x3e,0x41,0x41,0x3e,0x00,0x00,0x42,0x7f,0x40,0x00,0x62,0x51,0x49,0x46,0x00,0x41,0x49,0x49,0x36,0x00,0x18,0x14,0x12,0x7f,0x00,0x27,0x45,0x45,0x39,0x00,0x3e,0x49,0x49,0x32,0x00,0x01,0x79,0x05,0x03,0x00,0x36,0x49,0x49,0x36,0x00,0x06,0x49,0x29,0x1e,0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x56,0x36,0x00,0x00,0x08,0x14,0x22,0x41,0x14,0x14,0x14,0x14,0x14,0x41,0x22,0x14,0x08,0x00,0x02,0x01,0x51,0x09,0x06, -0x06,0x09,0x09,0x06,0x00,0x7e,0x09,0x09,0x09,0x7e,0x7f,0x49,0x49,0x49,0x36,0x3e,0x41,0x41,0x41,0x22,0x7f,0x41,0x41,0x22,0x1c,0x7f,0x49,0x49,0x49,0x41,0x7f,0x09,0x09,0x09,0x01,0x3e,0x41,0x49,0x49,0x7a,0x7f,0x08,0x08,0x08,0x7f,0x00,0x41,0x7f,0x41,0x00,0x20,0x40,0x41,0x3f,0x01,0x7f,0x08,0x14,0x22,0x41,0x7f,0x40,0x40,0x40,0x40,0x7f,0x02,0x0c,0x02,0x7f,0x7f,0x04,0x08,0x10,0x7f,0x3e,0x41,0x41,0x41,0x3e, -0x7f,0x09,0x09,0x09,0x06,0x3e,0x41,0x51,0x21,0x5e,0x7f,0x09,0x19,0x29,0x46,0x26,0x49,0x49,0x49,0x32,0x01,0x01,0x7f,0x01,0x01,0x3f,0x40,0x40,0x40,0x3f,0x1f,0x20,0x40,0x20,0x1f,0x3f,0x40,0x30,0x40,0x3f,0x63,0x14,0x08,0x14,0x63,0x07,0x08,0x70,0x08,0x07,0x61,0x51,0x49,0x45,0x43,0x00,0x7f,0x41,0x41,0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x41,0x41,0x7f,0x00,0x04,0x02,0x01,0x02,0x04,0x40,0x40,0x40,0x40,0x40, -0x00,0x01,0x02,0x04,0x00,0x20,0x54,0x54,0x54,0x78,0x7f,0x48,0x44,0x44,0x38,0x38,0x44,0x44,0x44,0x20,0x38,0x44,0x44,0x48,0x7f,0x38,0x54,0x54,0x54,0x18,0x08,0x7e,0x09,0x01,0x02,0x0c,0x52,0x52,0x52,0x3e,0x7f,0x08,0x04,0x04,0x78,0x00,0x44,0x7d,0x40,0x00,0x20,0x40,0x44,0x3d,0x00,0x7f,0x10,0x28,0x44,0x00,0x00,0x41,0x7f,0x40,0x00,0x7c,0x04,0x18,0x04,0x78,0x7c,0x08,0x04,0x04,0x78,0x38,0x44,0x44,0x44,0x38, -0x7c,0x14,0x14,0x14,0x08,0x08,0x14,0x14,0x18,0x7c,0x7c,0x08,0x04,0x04,0x08,0x48,0x54,0x54,0x54,0x20,0x04,0x3f,0x44,0x40,0x20,0x3c,0x40,0x40,0x20,0x7c,0x1c,0x20,0x40,0x20,0x1c,0x3c,0x40,0x20,0x40,0x3c,0x44,0x28,0x10,0x28,0x44,0x0c,0x50,0x50,0x50,0x3c,0x44,0x64,0x54,0x4c,0x44,0x00,0x08,0x36,0x41,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x41,0x36,0x08,0x00,0x08,0x08,0x22,0x1c,0x08,0x08,0x1c,0x22,0x08,0x08, +0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6f,0x00,0x00,0x07,0x00,0x07,0x00,0x18,0x30,0x18,0x0c,0x06,0x08,0x7f,0x7f,0x7f,0x08,0x23,0x13,0x08,0x64,0x62,0x36,0x49,0x55,0x22,0x50,0x00,0x05,0x03,0x00,0x00,0x00,0x1c,0x22,0x41,0x00,0x00,0x41,0x22,0x1c,0x00,0x14,0x08,0x3e,0x08,0x14,0x08,0x08,0x3e,0x08,0x08,0x00,0x50,0x30,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x00,0x60,0x60,0x00,0x00,0x20,0x10,0x08,0x04,0x02, +0x00,0x3e,0x41,0x41,0x3e,0x00,0x00,0x42,0x7f,0x40,0x00,0x62,0x51,0x49,0x46,0x00,0x41,0x49,0x49,0x36,0x00,0x18,0x14,0x12,0x7f,0x00,0x27,0x45,0x45,0x39,0x00,0x3e,0x49,0x49,0x32,0x00,0x01,0x79,0x05,0x03,0x00,0x36,0x49,0x49,0x36,0x00,0x06,0x49,0x29,0x1e,0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x56,0x36,0x00,0x00,0x08,0x14,0x22,0x41,0x14,0x14,0x14,0x14,0x14,0x41,0x22,0x14,0x08,0x00,0x02,0x01,0x51,0x09,0x06, +0x06,0x09,0x09,0x06,0x00,0x7e,0x09,0x09,0x09,0x7e,0x7f,0x49,0x49,0x49,0x36,0x3e,0x41,0x41,0x41,0x22,0x7f,0x41,0x41,0x22,0x1c,0x7f,0x49,0x49,0x49,0x41,0x7f,0x09,0x09,0x09,0x01,0x3e,0x41,0x49,0x49,0x7a,0x7f,0x08,0x08,0x08,0x7f,0x00,0x41,0x7f,0x41,0x00,0x20,0x40,0x41,0x3f,0x01,0x7f,0x08,0x14,0x22,0x41,0x7f,0x40,0x40,0x40,0x40,0x7f,0x02,0x0c,0x02,0x7f,0x7f,0x04,0x08,0x10,0x7f,0x3e,0x41,0x41,0x41,0x3e, +0x7f,0x09,0x09,0x09,0x06,0x3e,0x41,0x51,0x21,0x5e,0x7f,0x09,0x19,0x29,0x46,0x26,0x49,0x49,0x49,0x32,0x01,0x01,0x7f,0x01,0x01,0x3f,0x40,0x40,0x40,0x3f,0x1f,0x20,0x40,0x20,0x1f,0x3f,0x40,0x30,0x40,0x3f,0x63,0x14,0x08,0x14,0x63,0x07,0x08,0x70,0x08,0x07,0x61,0x51,0x49,0x45,0x43,0x00,0x7f,0x41,0x41,0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x41,0x41,0x7f,0x00,0x04,0x02,0x01,0x02,0x04,0x40,0x40,0x40,0x40,0x40, +0x00,0x01,0x02,0x04,0x00,0x20,0x54,0x54,0x54,0x78,0x7f,0x48,0x44,0x44,0x38,0x38,0x44,0x44,0x44,0x20,0x38,0x44,0x44,0x48,0x7f,0x38,0x54,0x54,0x54,0x18,0x08,0x7e,0x09,0x01,0x02,0x0c,0x52,0x52,0x52,0x3e,0x7f,0x08,0x04,0x04,0x78,0x00,0x44,0x7d,0x40,0x00,0x20,0x40,0x44,0x3d,0x00,0x7f,0x10,0x28,0x44,0x00,0x00,0x41,0x7f,0x40,0x00,0x7c,0x04,0x18,0x04,0x78,0x7c,0x08,0x04,0x04,0x78,0x38,0x44,0x44,0x44,0x38, +0x7c,0x14,0x14,0x14,0x08,0x08,0x14,0x14,0x18,0x7c,0x7c,0x08,0x04,0x04,0x08,0x48,0x54,0x54,0x54,0x20,0x04,0x3f,0x44,0x40,0x20,0x3c,0x40,0x40,0x20,0x7c,0x1c,0x20,0x40,0x20,0x1c,0x3c,0x40,0x20,0x40,0x3c,0x44,0x28,0x10,0x28,0x44,0x0c,0x50,0x50,0x50,0x3c,0x44,0x64,0x54,0x4c,0x44,0x00,0x08,0x36,0x41,0x00,0x00,0x00,0x7f,0x00,0x00,0x00,0x41,0x36,0x08,0x00,0x08,0x08,0x22,0x1c,0x08,0x08,0x1c,0x22,0x08,0x08, diff --git a/src/lcd.cpp b/src/lcd.cpp index 92926cba7..4f789d7dc 100644 --- a/src/lcd.cpp +++ b/src/lcd.cpp @@ -54,12 +54,22 @@ void lcd_img(uint8_t x, uint8_t y, const pm_uchar * img, uint8_t idx, uint8_t mo const pm_uchar *q = img; uint8_t w = pgm_read_byte(q++); uint8_t hb = (pgm_read_byte(q++)+7)/8; + bool comp = pgm_read_byte(q++); bool inv = (mode & INVERS) ? true : (mode & BLINK ? BLINK_ON_PHASE : false); q += idx*w*hb; + uint8_t ocur=0, b; for (uint8_t yb = 0; yb < hb; yb++) { uint8_t *p = &displayBuf[ (y / 8 + yb) * DISPLAY_W + x ]; for (uint8_t i=0; i 4: rows = int(sys.argv[4]) - f.write("%d,%d,\n" % (width, height/rows)) + f.write("%d,%d,0,\n" % (width, height/rows)) for y in range(0, height, 8): for x in range(width): value = 0 @@ -21,6 +21,42 @@ if sys.argv[3] == "img": value += 1 << z f.write("0x%02x," % value) f.write("\n") + +elif sys.argv[3] == "imgc": + rows = 1 + if len(sys.argv) > 4: + rows = int(sys.argv[4]) + f.write("%d,%d,1,\n" % (width, height/rows)) + val=0 + ocur=0 + for y in range(0, height, 8): + for x in range(width): + value = 0 + for z in range(8): + if image.pixel(x, y+z) == Qt.qRgb(0, 0, 0): + value += 1 << z + if (val==value) & (ocur<255): + ocur+=1 + else: + if ocur>1: + if ocur>2: + f.write("0xf0,0x%02x,0x%02x," % (val,ocur)) + else: + f.write("0x%02x,0x%02x," % (val,val)) + else: + if val!=0xf0: + f.write("0x%02x," % val) + else: + f.write("0xf0,0xf0,0x01,") + val=value + ocur=1 + f.write("\n") + if ocur>0: + if ocur>1: f.write("0xf0,0x%02x,0x%02x," % (val,ocur)) + else: + if val!=0xf0: f.write("0x%02x," % val) + else: f.write("0xf0,0xf0,0x01,") + elif sys.argv[3] == "char": for y in range(0, height, 8): for x in range(width):