From 70bf904c1ceb17e2c9883d888eb4cfa82940f719 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Tue, 5 Jul 2011 15:48:26 +0200 Subject: [PATCH] Fix invaders font, simple patch to spaceinvaders.c to see if it renders ok --- firmware/applications/spaceinvaders.c | 6 ++++-- firmware/lcd/fonts/invaders.c | 15 ++++++++------- tools/font/bdf/invaders.xbdf | 10 +++++----- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/firmware/applications/spaceinvaders.c b/firmware/applications/spaceinvaders.c index 111388f..599a665 100644 --- a/firmware/applications/spaceinvaders.c +++ b/firmware/applications/spaceinvaders.c @@ -184,11 +184,13 @@ void draw_status() { void draw_sprite(char x, char y) { - for (int dx=0; dx<8; dx++){ + font = &Font_Invaders; + DoString(x,y-1,"C"); +/* for (int dx=0; dx<8; dx++){ for(int dy=0; dy<8; dy++){ lcdSetPixel(x+dx,y+dy, true); } - } + } */ } void check_end() { diff --git a/firmware/lcd/fonts/invaders.c b/firmware/lcd/fonts/invaders.c index 66cc010..55974f1 100644 --- a/firmware/lcd/fonts/invaders.c +++ b/firmware/lcd/fonts/invaders.c @@ -40,7 +40,7 @@ const uint8_t InvadersBitmaps[] = { 0x9c, /* * *** */ - /* Char 67 is 8px wide @ 29 */ + /* Char 67 is 9px wide @ 29 */ 0xff, 0, 0, /* rawmode, preblank, postblank */ 0x58, /* * ** */ 0xbc, /* * **** */ @@ -50,9 +50,10 @@ const uint8_t InvadersBitmaps[] = { 0x36, /* ** ** */ 0x1c, /* *** */ 0xb8, /* * *** */ + 0x40, /* * */ - /* Char 85 is 16px wide @ 40 */ + /* Char 85 is 16px wide @ 41 */ 0xff, 0, 0, /* rawmode, preblank, postblank */ 0x20, /* * */ 0x30, /* ** */ @@ -72,7 +73,7 @@ const uint8_t InvadersBitmaps[] = { 0x20, /* * */ - /* Char 97 is 11px wide @ 59 */ + /* Char 97 is 11px wide @ 60 */ 0xff, 0, 0, /* rawmode, preblank, postblank */ 0x9e, /* * **** */ 0x38, /* *** */ @@ -87,7 +88,7 @@ const uint8_t InvadersBitmaps[] = { 0x9e, /* * **** */ - /* Char 98 is 12px wide @ 73 */ + /* Char 98 is 12px wide @ 74 */ 0xff, 0, 0, /* rawmode, preblank, postblank */ 0x1c, /* *** */ 0x5e, /* * **** */ @@ -103,7 +104,7 @@ const uint8_t InvadersBitmaps[] = { 0x1c, /* *** */ - /* Char 99 is 8px wide @ 88 */ + /* Char 99 is 8px wide @ 89 */ 0xff, 0, 0, /* rawmode, preblank, postblank */ 0x98, /* * ** */ 0x5c, /* * *** */ @@ -121,7 +122,7 @@ const uint8_t InvadersBitmaps[] = { const FONT_CHAR_INFO InvadersLengths[] = { {14}, /* A */ {15}, /* B */ - {11}, /* C */ + {12}, /* C */ {19}, /* U */ {14}, /* a */ {15}, /* b */ @@ -145,5 +146,5 @@ const struct FONT_DEF Font_Invaders = { * Name: Invaders * Height: 8 px (1 bytes) * Maximum width: 16 px - * Storage size: 106 bytes (compressed by -24%) + * Storage size: 107 bytes (compressed by -24%) */ diff --git a/tools/font/bdf/invaders.xbdf b/tools/font/bdf/invaders.xbdf index d4dc95c..41f522f 100644 --- a/tools/font/bdf/invaders.xbdf +++ b/tools/font/bdf/invaders.xbdf @@ -41,11 +41,11 @@ ENDCHAR STARTCHAR alien3-1 ENCODING 67 XBITMAP -...xx... -..xxxx.. -.xxxxxx. -xx.xx.xx -xxxxxxxx +...xx.... +..xxxx... +.xxxxxx.. +xx.xx.xx. +xxxxxxxx. .x.xxx.x. x.......x .x.....x.