unstdio.org

Not your standard io.

Playing With the Display Buffer

| Comments

I got a chance to play around a bit with the display buffer on Wednesday. The Ninja badge buffer images and Ladyada’s images are stored and written into the buffer differently. The ones in the ST7565 Library fill the buffer using 8 bits at a time drawing down to left. For example; 10000000, 01000000, 00100000 (0x80, 0x40, 0x20) would draw a diagonal line down 3 pixels wide. This is different from the way other code writes to it. I was able to go through and view all of the characters that are in the badge. There was one that was kind of confusing, echelon….what?

Here is the Ninja character that is displayed on the badge.

unsigned char ninja_large[] = {
 50, 46,
 0xfe, 0xfe, 0xfc, 0xf9, 0xf2, 0xf0, 0xf1, 0xf1,   /* 0x0 */
 0xf1, 0xf1, 0xe3, 0xe0, 0xe0, 0xc0, 0x80, 0x80,   /* 0x8 */
 0x03, 0x03, 0x01, 0x00, 0x00, 0x80, 0x80, 0xc0,   /* 0x10 */
 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0x18 */
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0x20 */
 0xff, 0xff, 0xfe, 0xfc, 0xf9, 0xf0, 0xe0, 0xe1,   /* 0x28 */
 0xe3, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 0x30 */
 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfc, 0xf8,   /* 0x38 */
 0xf8, 0xf0, 0xf0, 0x70, 0x0c, 0x02, 0x01, 0x00,   /* 0x40 */
 0x80, 0xc0, 0xe0, 0x20, 0x60, 0x60, 0x20, 0xe0,   /* 0x48 */
 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0x50 */
 0xff, 0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xcd,   /* 0x58 */
 0x9b, 0x37, 0x6f, 0xdf, 0xbf, 0x7f, 0xff, 0xff,   /* 0x60 */
 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 0x68 */
 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,   /* 0x70 */
 0x10, 0x0c, 0x03, 0x01, 0x00, 0x00, 0x00, 0x80,   /* 0x78 */
 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x48, 0xd0,   /* 0x80 */
 0xc0, 0xe0, 0xfc, 0xf4, 0xf0, 0xf0, 0xe0, 0xc0,   /* 0x88 */
 0x80, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff, 0xff,   /* 0x90 */
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0x98 */
 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 0xa0 */
 0xff, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x0f, 0x0f,   /* 0xa8 */
 0x0f, 0x0c, 0x38, 0xf0, 0x00, 0x00, 0x00, 0x00,   /* 0xb0 */
 0x00, 0x01, 0x00, 0x00, 0x00, 0xf0, 0xfe, 0x13,   /* 0xb8 */
 0x41, 0x21, 0x83, 0x07, 0x07, 0x0f, 0x3f, 0xff,   /* 0xc0 */
 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0xc8 */
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0xd0 */
 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 0xd8 */
 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xc0,   /* 0xe0 */
 0x00, 0x08, 0x10, 0x10, 0x08, 0x00, 0x0f, 0x7f,   /* 0xe8 */
 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x10,   /* 0xf0 */
 0x88, 0x90, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0xf8 */
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0x100 */
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,   /* 0x108 */
 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,   /* 0x110 */
 0xf8, 0xf0, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00,   /* 0x118 */
 0x00, 0x00, 0x00, 0x04, 0x3c, 0xfc, 0xfc, 0xfc,   /* 0x120 */
 0xfc, 0xfc, 0xfc, 0x0c, 0x04, 0x04, 0x04, 0x04,   /* 0x128 */
 0x04, 0x04, 0x04, 0x84, 0xc4, 0xe4, 0xf4, 0xfc,   /* 0x130 */
 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc,   /* 0x138 */
 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc,   /* 0x140 */
 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

I will have more time to work with this over the weekend. I need to get my hands on a official Ninja badge to figure out the way the application is supposed to work.