summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-h100-remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-h100-remote.c')
-rw-r--r--firmware/drivers/lcd-h100-remote.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index f7b3c21f48..0c71f0b168 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -65,8 +65,8 @@
65 65
66/*** globals ***/ 66/*** globals ***/
67 67
68unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH] 68fb_remote_data lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH]
69 IBSS_ATTR; 69 IBSS_ATTR;
70 70
71static int drawmode = DRMODE_SOLID; 71static int drawmode = DRMODE_SOLID;
72static int xmargin = 0; 72static int xmargin = 0;
@@ -686,35 +686,35 @@ static void nopixel(int x, int y)
686 (void)y; 686 (void)y;
687} 687}
688 688
689lcd_pixelfunc_type* const lcd_remote_pixelfuncs[8] = { 689lcd_remote_pixelfunc_type* const lcd_remote_pixelfuncs[8] = {
690 flippixel, nopixel, setpixel, setpixel, 690 flippixel, nopixel, setpixel, setpixel,
691 nopixel, clearpixel, nopixel, clearpixel 691 nopixel, clearpixel, nopixel, clearpixel
692}; 692};
693 693
694static void flipblock(unsigned char *address, unsigned mask, unsigned bits) 694static void flipblock(fb_remote_data *address, unsigned mask, unsigned bits)
695 ICODE_ATTR; 695 ICODE_ATTR;
696static void flipblock(unsigned char *address, unsigned mask, unsigned bits) 696static void flipblock(fb_remote_data *address, unsigned mask, unsigned bits)
697{ 697{
698 *address ^= bits & mask; 698 *address ^= bits & mask;
699} 699}
700 700
701static void bgblock(unsigned char *address, unsigned mask, unsigned bits) 701static void bgblock(fb_remote_data *address, unsigned mask, unsigned bits)
702 ICODE_ATTR; 702 ICODE_ATTR;
703static void bgblock(unsigned char *address, unsigned mask, unsigned bits) 703static void bgblock(fb_remote_data *address, unsigned mask, unsigned bits)
704{ 704{
705 *address &= bits | ~mask; 705 *address &= bits | ~mask;
706} 706}
707 707
708static void fgblock(unsigned char *address, unsigned mask, unsigned bits) 708static void fgblock(fb_remote_data *address, unsigned mask, unsigned bits)
709 ICODE_ATTR; 709 ICODE_ATTR;
710static void fgblock(unsigned char *address, unsigned mask, unsigned bits) 710static void fgblock(fb_remote_data *address, unsigned mask, unsigned bits)
711{ 711{
712 *address |= bits & mask; 712 *address |= bits & mask;
713} 713}
714 714
715static void solidblock(unsigned char *address, unsigned mask, unsigned bits) 715static void solidblock(fb_remote_data *address, unsigned mask, unsigned bits)
716 ICODE_ATTR; 716 ICODE_ATTR;
717static void solidblock(unsigned char *address, unsigned mask, unsigned bits) 717static void solidblock(fb_remote_data *address, unsigned mask, unsigned bits)
718{ 718{
719 unsigned data = *address; 719 unsigned data = *address;
720 720
@@ -722,30 +722,30 @@ static void solidblock(unsigned char *address, unsigned mask, unsigned bits)
722 *address = data ^ (bits & mask); 722 *address = data ^ (bits & mask);
723} 723}
724 724
725static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) 725static void flipinvblock(fb_remote_data *address, unsigned mask, unsigned bits)
726 ICODE_ATTR; 726 ICODE_ATTR;
727static void flipinvblock(unsigned char *address, unsigned mask, unsigned bits) 727static void flipinvblock(fb_remote_data *address, unsigned mask, unsigned bits)
728{ 728{
729 *address ^= ~bits & mask; 729 *address ^= ~bits & mask;
730} 730}
731 731
732static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) 732static void bginvblock(fb_remote_data *address, unsigned mask, unsigned bits)
733 ICODE_ATTR; 733 ICODE_ATTR;
734static void bginvblock(unsigned char *address, unsigned mask, unsigned bits) 734static void bginvblock(fb_remote_data *address, unsigned mask, unsigned bits)
735{ 735{
736 *address &= ~(bits & mask); 736 *address &= ~(bits & mask);
737} 737}
738 738
739static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) 739static void fginvblock(fb_remote_data *address, unsigned mask, unsigned bits)
740 ICODE_ATTR; 740 ICODE_ATTR;
741static void fginvblock(unsigned char *address, unsigned mask, unsigned bits) 741static void fginvblock(fb_remote_data *address, unsigned mask, unsigned bits)
742{ 742{
743 *address |= ~bits & mask; 743 *address |= ~bits & mask;
744} 744}
745 745
746static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) 746static void solidinvblock(fb_remote_data *address, unsigned mask, unsigned bits)
747 ICODE_ATTR; 747 ICODE_ATTR;
748static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits) 748static void solidinvblock(fb_remote_data *address, unsigned mask, unsigned bits)
749{ 749{
750 unsigned data = *address; 750 unsigned data = *address;
751 751
@@ -753,7 +753,7 @@ static void solidinvblock(unsigned char *address, unsigned mask, unsigned bits)
753 *address = data ^ (bits & mask); 753 *address = data ^ (bits & mask);
754} 754}
755 755
756lcd_blockfunc_type* const lcd_remote_blockfuncs[8] = { 756lcd_remote_blockfunc_type* const lcd_remote_blockfuncs[8] = {
757 flipblock, bgblock, fgblock, solidblock, 757 flipblock, bgblock, fgblock, solidblock,
758 flipinvblock, bginvblock, fginvblock, solidinvblock 758 flipinvblock, bginvblock, fginvblock, solidinvblock
759}; 759};
@@ -785,7 +785,7 @@ void lcd_remote_drawline(int x1, int y1, int x2, int y2)
785 int d, dinc1, dinc2; 785 int d, dinc1, dinc2;
786 int x, xinc1, xinc2; 786 int x, xinc1, xinc2;
787 int y, yinc1, yinc2; 787 int y, yinc1, yinc2;
788 lcd_pixelfunc_type *pfunc = lcd_remote_pixelfuncs[drawmode]; 788 lcd_remote_pixelfunc_type *pfunc = lcd_remote_pixelfuncs[drawmode];
789 789
790 deltax = abs(x2 - x1); 790 deltax = abs(x2 - x1);
791 deltay = abs(y2 - y1); 791 deltay = abs(y2 - y1);
@@ -851,9 +851,9 @@ void lcd_remote_drawline(int x1, int y1, int x2, int y2)
851void lcd_remote_hline(int x1, int x2, int y) 851void lcd_remote_hline(int x1, int x2, int y)
852{ 852{
853 int x; 853 int x;
854 unsigned char *dst, *dst_end; 854 fb_remote_data *dst, *dst_end;
855 unsigned mask; 855 unsigned mask;
856 lcd_blockfunc_type *bfunc; 856 lcd_remote_blockfunc_type *bfunc;
857 857
858 /* direction flip */ 858 /* direction flip */
859 if (x2 < x1) 859 if (x2 < x1)
@@ -888,9 +888,9 @@ void lcd_remote_hline(int x1, int x2, int y)
888void lcd_remote_vline(int x, int y1, int y2) 888void lcd_remote_vline(int x, int y1, int y2)
889{ 889{
890 int ny; 890 int ny;
891 unsigned char *dst; 891 fb_remote_data *dst;
892 unsigned mask, mask_bottom; 892 unsigned mask, mask_bottom;
893 lcd_blockfunc_type *bfunc; 893 lcd_remote_blockfunc_type *bfunc;
894 894
895 /* direction flip */ 895 /* direction flip */
896 if (y2 < y1) 896 if (y2 < y1)
@@ -946,10 +946,10 @@ void lcd_remote_drawrect(int x, int y, int width, int height)
946void lcd_remote_fillrect(int x, int y, int width, int height) 946void lcd_remote_fillrect(int x, int y, int width, int height)
947{ 947{
948 int ny; 948 int ny;
949 unsigned char *dst, *dst_end; 949 fb_remote_data *dst, *dst_end;
950 unsigned mask, mask_bottom; 950 unsigned mask, mask_bottom;
951 unsigned bits = 0; 951 unsigned bits = 0;
952 lcd_blockfunc_type *bfunc; 952 lcd_remote_blockfunc_type *bfunc;
953 bool fillopt = false; 953 bool fillopt = false;
954 954
955 /* nothing to draw? */ 955 /* nothing to draw? */
@@ -1000,7 +1000,7 @@ void lcd_remote_fillrect(int x, int y, int width, int height)
1000 memset(dst, bits, width); 1000 memset(dst, bits, width);
1001 else 1001 else
1002 { 1002 {
1003 unsigned char *dst_row = dst; 1003 fb_remote_data *dst_row = dst;
1004 1004
1005 dst_end = dst_row + width; 1005 dst_end = dst_row + width;
1006 do 1006 do
@@ -1043,9 +1043,9 @@ void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y,
1043 int stride, int x, int y, int width, int height) 1043 int stride, int x, int y, int width, int height)
1044{ 1044{
1045 int shift, ny; 1045 int shift, ny;
1046 unsigned char *dst, *dst_end; 1046 fb_remote_data *dst, *dst_end;
1047 unsigned mask, mask_bottom; 1047 unsigned mask, mask_bottom;
1048 lcd_blockfunc_type *bfunc; 1048 lcd_remote_blockfunc_type *bfunc;
1049 1049
1050 /* nothing to draw? */ 1050 /* nothing to draw? */
1051 if ((width <= 0) || (height <= 0) || (x >= LCD_REMOTE_WIDTH) 1051 if ((width <= 0) || (height <= 0) || (x >= LCD_REMOTE_WIDTH)
@@ -1070,9 +1070,9 @@ void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y,
1070 if (y + height > LCD_REMOTE_HEIGHT) 1070 if (y + height > LCD_REMOTE_HEIGHT)
1071 height = LCD_REMOTE_HEIGHT - y; 1071 height = LCD_REMOTE_HEIGHT - y;
1072 1072
1073 src += stride * (src_y >> 3) + src_x; /* move starting point */ 1073 src += stride * (src_y >> 3) + src_x; /* move starting point */
1074 src_y &= 7; 1074 src_y &= 7;
1075 y -= src_y; 1075 y -= src_y;
1076 dst = &lcd_remote_framebuffer[y>>3][x]; 1076 dst = &lcd_remote_framebuffer[y>>3][x];
1077 shift = y & 7; 1077 shift = y & 7;
1078 ny = height - 1 + shift + src_y; 1078 ny = height - 1 + shift + src_y;
@@ -1092,7 +1092,7 @@ void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y,
1092 else 1092 else
1093 { 1093 {
1094 const unsigned char *src_row = src; 1094 const unsigned char *src_row = src;
1095 unsigned char *dst_row = dst; 1095 fb_remote_data *dst_row = dst;
1096 1096
1097 dst_end = dst_row + width; 1097 dst_end = dst_row + width;
1098 do 1098 do
@@ -1122,7 +1122,7 @@ void lcd_remote_bitmap_part(const unsigned char *src, int src_x, int src_y,
1122 do 1122 do
1123 { 1123 {
1124 const unsigned char *src_col = src++; 1124 const unsigned char *src_col = src++;
1125 unsigned char *dst_col = dst++; 1125 fb_remote_data *dst_col = dst++;
1126 unsigned mask_col = mask; 1126 unsigned mask_col = mask;
1127 unsigned data = 0; 1127 unsigned data = 0;
1128 1128