1.1 --- a/stage2/lcd.c Sun Apr 24 16:19:49 2016 +0200
1.2 +++ b/stage2/lcd.c Sun Apr 24 17:06:08 2016 +0200
1.3 @@ -63,6 +63,11 @@
1.4 return (div(r, 255, rmax) << rshift) | (div(g, 255, gmax) << gshift) | (div(b, 255, bmax) << bshift);
1.5 }
1.6
1.7 +u32 get_bitmap_value(unsigned short x, u32 value)
1.8 +{
1.9 + return (value >> (((panel_info.vl_col - 1 - x) * 32) / panel_info.vl_col)) % 2 ? 0xffffffff : 0;
1.10 +}
1.11 +
1.12 static void get_colour(unsigned short h, unsigned short v, u8 rgb[], unsigned short pixel_type)
1.13 {
1.14 unsigned short v_max = panel_info.vl_row;
1.15 @@ -125,7 +130,7 @@
1.16 u8 rgb[3];
1.17
1.18 get_colour(h, v, rgb, pixel_type);
1.19 - set_pixel32(h, v, pixel(rgb[0], rgb[1], rgb[2], 255, 255, 255, 16, 8, 0));
1.20 + set_pixel32(h, v, pixel(rgb[0], rgb[1], rgb[2], 255, 255, 255, 16, 8, 0) | get_bitmap_value(h, pixel_type));
1.21 }
1.22
1.23 static void test_pixel16_565(unsigned short h, unsigned short v, unsigned short pixel_type)
1.24 @@ -133,7 +138,7 @@
1.25 u8 rgb[3];
1.26
1.27 get_colour(h, v, rgb, pixel_type);
1.28 - set_pixel16_565(h, v, pixel(rgb[0], rgb[1], rgb[2], 31, 63, 31, 11, 5, 0));
1.29 + set_pixel16_565(h, v, pixel(rgb[0], rgb[1], rgb[2], 31, 63, 31, 11, 5, 0) | get_bitmap_value(h, pixel_type));
1.30 }
1.31
1.32 static void test_pixel8(unsigned short h, unsigned short v, unsigned short pixel_type)
1.33 @@ -141,7 +146,7 @@
1.34 u8 rgb[3];
1.35
1.36 get_colour(h, v, rgb, pixel_type);
1.37 - set_pixel8(h, v, pixel(rgb[0], rgb[1], rgb[2], 7, 7, 3, 5, 2, 0));
1.38 + set_pixel8(h, v, pixel(rgb[0], rgb[1], rgb[2], 7, 7, 3, 5, 2, 0) | get_bitmap_value(h, pixel_type));
1.39 }
1.40
1.41 static void test_pixel4(unsigned short h, unsigned short v, unsigned short pixel_type)
1.42 @@ -149,7 +154,7 @@
1.43 u8 rgb[3];
1.44
1.45 get_colour(h, v, rgb, pixel_type);
1.46 - set_pixel4(h, v, pixel(rgb[0], rgb[1], rgb[2], 1, 2, 1, 3, 1, 0));
1.47 + set_pixel4(h, v, pixel(rgb[0], rgb[1], rgb[2], 1, 2, 1, 3, 1, 0) | get_bitmap_value(h, pixel_type));
1.48 }
1.49
1.50 void test_pixel(unsigned short h, unsigned short v, unsigned short pixel_type)