aboutsummaryrefslogtreecommitdiffstats
path: root/dogs.c
diff options
context:
space:
mode:
Diffstat (limited to 'dogs.c')
-rw-r--r--dogs.c109
1 files changed, 56 insertions, 53 deletions
diff --git a/dogs.c b/dogs.c
index 9b341f3..12482f5 100644
--- a/dogs.c
+++ b/dogs.c
@@ -191,6 +191,7 @@ void draw_pixel(int x, int y, bool state)
{
if (x < 0 || y < 0 || x >= DISP_WIDTH || y >= DISP_HEIGHT)
return;
+ y = DISP_HEIGHT - 1 - y;
if (state)
dogs_buffer[y / 8 * DISP_WIDTH + x] |= (1 << (y % 8));
else
@@ -236,94 +237,94 @@ static const unsigned char draw_number_bitmaps[10][10] = {
0b00011000,
},
{ 8, 8, // '1'
+ 0b01111100,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00010000,
+ 0b00010100,
0b00011000,
- 0b00101000,
- 0b00001000,
- 0b00001000,
- 0b00001000,
- 0b00001000,
- 0b00001000,
- 0b00111110,
},
{ 8, 8, // '2'
- 0b00011000,
- 0b00100100,
- 0b01000010,
- 0b00000010,
- 0b00000100,
+ 0b01111110,
0b00001000,
0b00010000,
- 0b01111110,
+ 0b00100000,
+ 0b01000000,
+ 0b01000010,
+ 0b00100100,
+ 0b00011000,
},
{ 8, 8, // '3'
- 0b00111000,
- 0b01000100,
- 0b00000010,
+ 0b00011100,
+ 0b00100010,
+ 0b01000000,
+ 0b00100000,
0b00111100,
- 0b00000100,
- 0b00000010,
- 0b01000100,
- 0b00111000,
+ 0b01000000,
+ 0b00100010,
+ 0b00011100,
},
{ 8, 8, // '4'
- 0b00000100,
- 0b00001100,
- 0b00010100,
+ 0b00100000,
+ 0b00100000,
+ 0b00100000,
+ 0b00111110,
0b00100100,
- 0b01111100,
- 0b00000100,
- 0b00000100,
- 0b00000100,
+ 0b00101000,
+ 0b00110000,
+ 0b00100000,
},
{ 8, 8, // '5'
- 0b01111110,
+ 0b00011100,
+ 0b00100010,
0b01000000,
- 0b01111000,
- 0b00000100,
- 0b00000010,
+ 0b01000000,
+ 0b00100000,
+ 0b00011110,
0b00000010,
- 0b01000100,
- 0b00111000,
+ 0b01111110,
},
{ 8, 8, // '6'
- 0b00011100,
- 0b00100000,
- 0b01000000,
- 0b01011100,
- 0b01100010,
- 0b01000010,
- 0b00100100,
0b00011000,
- },
- { 8, 8, // '7'
- 0b01111110,
+ 0b00100100,
+ 0b01000010,
+ 0b01000110,
+ 0b00111010,
0b00000010,
0b00000100,
+ 0b00111000,
+ },
+ { 8, 8, // '7'
+ 0b00001000,
+ 0b00001000,
+ 0b00001000,
0b00001000,
0b00010000,
- 0b00010000,
- 0b00010000,
- 0b00010000,
+ 0b00100000,
+ 0b01000000,
+ 0b01111110,
},
{ 8, 8, // '8'
0b00011000,
0b00100100,
0b01000010,
- 0b00111100,
0b00100100,
+ 0b00111100,
0b01000010,
0b00100100,
0b00011000,
},
{ 8, 8, // '9'
- 0b00011000,
- 0b00100100,
- 0b01000010,
+ 0b00011100,
0b00100010,
- 0b00011110,
- 0b00000010,
+ 0b01000000,
+ 0b01111000,
0b01000100,
- 0b00111000,
+ 0b01000010,
+ 0b00100100,
+ 0b00011000,
},
};
@@ -335,6 +336,8 @@ void draw_number(int x, int y, int number)
int count;
for (count = 0; tmp; count++)
tmp /= 10;
+ if (count == 0)
+ count = 1;
x += count * 8;
do {
x -= 8;