summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-24bit.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-24bit.c')
-rw-r--r--firmware/drivers/lcd-24bit.c180
1 files changed, 0 insertions, 180 deletions
diff --git a/firmware/drivers/lcd-24bit.c b/firmware/drivers/lcd-24bit.c
index c3aa27f7ce..279ed5924a 100644
--- a/firmware/drivers/lcd-24bit.c
+++ b/firmware/drivers/lcd-24bit.c
@@ -70,30 +70,6 @@ void lcd_clear_viewport(void)
70 width = lcd_current_viewport->width; 70 width = lcd_current_viewport->width;
71 height = lcd_current_viewport->height; 71 height = lcd_current_viewport->height;
72 72
73#if defined(HAVE_VIEWPORT_CLIP)
74 /********************* Viewport on screen clipping ********************/
75 /* nothing to draw? */
76 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
77 || (x + width <= 0) || (y + height <= 0))
78 return;
79
80 /* clip image in viewport in screen */
81 if (x < 0)
82 {
83 width += x;
84 x = 0;
85 }
86 if (y < 0)
87 {
88 height += y;
89 y = 0;
90 }
91 if (x + width > LCD_WIDTH)
92 width = LCD_WIDTH - x;
93 if (y + height > LCD_HEIGHT)
94 height = LCD_HEIGHT - y;
95#endif
96
97 len = STRIDE_MAIN(width, height); 73 len = STRIDE_MAIN(width, height);
98 step = STRIDE_MAIN(ROW_INC, COL_INC); 74 step = STRIDE_MAIN(ROW_INC, COL_INC);
99 75
@@ -222,30 +198,6 @@ void lcd_fillrect(int x, int y, int width, int height)
222 x += lcd_current_viewport->x; 198 x += lcd_current_viewport->x;
223 y += lcd_current_viewport->y; 199 y += lcd_current_viewport->y;
224 200
225#if defined(HAVE_VIEWPORT_CLIP)
226 /********************* Viewport on screen clipping ********************/
227 /* nothing to draw? */
228 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
229 || (x + width <= 0) || (y + height <= 0))
230 return;
231
232 /* clip image in viewport in screen */
233 if (x < 0)
234 {
235 width += x;
236 x = 0;
237 }
238 if (y < 0)
239 {
240 height += y;
241 y = 0;
242 }
243 if (x + width > LCD_WIDTH)
244 width = LCD_WIDTH - x;
245 if (y + height > LCD_HEIGHT)
246 height = LCD_HEIGHT - y;
247#endif
248
249 /* drawmode and optimisation */ 201 /* drawmode and optimisation */
250 if (lcd_current_viewport->drawmode & DRMODE_INVERSEVID) 202 if (lcd_current_viewport->drawmode & DRMODE_INVERSEVID)
251 { 203 {
@@ -362,32 +314,6 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
362 x += lcd_current_viewport->x; 314 x += lcd_current_viewport->x;
363 y += lcd_current_viewport->y; 315 y += lcd_current_viewport->y;
364 316
365#if defined(HAVE_VIEWPORT_CLIP)
366 /********************* Viewport on screen clipping ********************/
367 /* nothing to draw? */
368 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
369 || (x + width <= 0) || (y + height <= 0))
370 return;
371
372 /* clip image in viewport in screen */
373 if (x < 0)
374 {
375 width += x;
376 src_x -= x;
377 x = 0;
378 }
379 if (y < 0)
380 {
381 height += y;
382 src_y -= y;
383 y = 0;
384 }
385 if (x + width > LCD_WIDTH)
386 width = LCD_WIDTH - x;
387 if (y + height > LCD_HEIGHT)
388 height = LCD_HEIGHT - y;
389#endif
390
391 src += stride * (src_y >> 3) + src_x; /* move starting point */ 317 src += stride * (src_y >> 3) + src_x; /* move starting point */
392 src_y &= 7; 318 src_y &= 7;
393 src_end = src + width; 319 src_end = src + width;
@@ -592,32 +518,6 @@ static void ICODE_ATTR lcd_alpha_bitmap_part_mix(const fb_data* image,
592 x += lcd_current_viewport->x; 518 x += lcd_current_viewport->x;
593 y += lcd_current_viewport->y; 519 y += lcd_current_viewport->y;
594 520
595#if defined(HAVE_VIEWPORT_CLIP)
596 /********************* Viewport on screen clipping ********************/
597 /* nothing to draw? */
598 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
599 || (x + width <= 0) || (y + height <= 0))
600 return;
601
602 /* clip image in viewport in screen */
603 if (x < 0)
604 {
605 width += x;
606 src_x -= x;
607 x = 0;
608 }
609 if (y < 0)
610 {
611 height += y;
612 src_y -= y;
613 y = 0;
614 }
615 if (x + width > LCD_WIDTH)
616 width = LCD_WIDTH - x;
617 if (y + height > LCD_HEIGHT)
618 height = LCD_HEIGHT - y;
619#endif
620
621 /* the following drawmode combinations are possible: 521 /* the following drawmode combinations are possible:
622 * 1) COMPLEMENT: just negates the framebuffer contents 522 * 1) COMPLEMENT: just negates the framebuffer contents
623 * 2) BG and BG+backdrop: draws _only_ background pixels with either 523 * 2) BG and BG+backdrop: draws _only_ background pixels with either
@@ -887,20 +787,6 @@ void lcd_hline(int x1, int x2, int y)
887 x2 += lcd_current_viewport->x; 787 x2 += lcd_current_viewport->x;
888 y += lcd_current_viewport->y; 788 y += lcd_current_viewport->y;
889 789
890#if defined(HAVE_VIEWPORT_CLIP)
891 /********************* Viewport on screen clipping ********************/
892 /* nothing to draw? */
893 if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH)
894 || (x2 < 0))
895 return;
896
897 /* clipping */
898 if (x1 < 0)
899 x1 = 0;
900 if (x2 >= LCD_WIDTH)
901 x2 = LCD_WIDTH-1;
902#endif
903
904 width = x2 - x1 + 1; 790 width = x2 - x1 + 1;
905 791
906 dst = FBADDR(x1 , y); 792 dst = FBADDR(x1 , y);
@@ -944,20 +830,6 @@ void lcd_vline(int x, int y1, int y2)
944 y1 += lcd_current_viewport->y; 830 y1 += lcd_current_viewport->y;
945 y2 += lcd_current_viewport->y; 831 y2 += lcd_current_viewport->y;
946 832
947#if defined(HAVE_VIEWPORT_CLIP)
948 /********************* Viewport on screen clipping ********************/
949 /* nothing to draw? */
950 if (( (unsigned) x >= (unsigned)LCD_WIDTH) || (y1 >= LCD_HEIGHT)
951 || (y2 < 0))
952 return;
953
954 /* clipping */
955 if (y1 < 0)
956 y1 = 0;
957 if (y2 >= LCD_HEIGHT)
958 y2 = LCD_HEIGHT-1;
959#endif
960
961 dst = FBADDR(x , y1); 833 dst = FBADDR(x , y1);
962 dst_end = dst + (y2 - y1) * LCD_WIDTH; 834 dst_end = dst + (y2 - y1) * LCD_WIDTH;
963 835
@@ -1004,32 +876,6 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
1004 x += lcd_current_viewport->x; 876 x += lcd_current_viewport->x;
1005 y += lcd_current_viewport->y; 877 y += lcd_current_viewport->y;
1006 878
1007#if defined(HAVE_VIEWPORT_CLIP)
1008 /********************* Viewport on screen clipping ********************/
1009 /* nothing to draw? */
1010 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
1011 || (x + width <= 0) || (y + height <= 0))
1012 return;
1013
1014 /* clip image in viewport in screen */
1015 if (x < 0)
1016 {
1017 width += x;
1018 src_x -= x;
1019 x = 0;
1020 }
1021 if (y < 0)
1022 {
1023 height += y;
1024 src_y -= y;
1025 y = 0;
1026 }
1027 if (x + width > LCD_WIDTH)
1028 width = LCD_WIDTH - x;
1029 if (y + height > LCD_HEIGHT)
1030 height = LCD_HEIGHT - y;
1031#endif
1032
1033 src += stride * src_y + src_x; /* move starting point */ 879 src += stride * src_y + src_x; /* move starting point */
1034 dst = FBADDR(x, y); 880 dst = FBADDR(x, y);
1035 881
@@ -1078,32 +924,6 @@ void ICODE_ATTR lcd_bitmap_transparent_part(const fb_data *src, int src_x,
1078 x += lcd_current_viewport->x; 924 x += lcd_current_viewport->x;
1079 y += lcd_current_viewport->y; 925 y += lcd_current_viewport->y;
1080 926
1081#if defined(HAVE_VIEWPORT_CLIP)
1082 /********************* Viewport on screen clipping ********************/
1083 /* nothing to draw? */
1084 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
1085 || (x + width <= 0) || (y + height <= 0))
1086 return;
1087
1088 /* clip image in viewport in screen */
1089 if (x < 0)
1090 {
1091 width += x;
1092 src_x -= x;
1093 x = 0;
1094 }
1095 if (y < 0)
1096 {
1097 height += y;
1098 src_y -= y;
1099 y = 0;
1100 }
1101 if (x + width > LCD_WIDTH)
1102 width = LCD_WIDTH - x;
1103 if (y + height > LCD_HEIGHT)
1104 height = LCD_HEIGHT - y;
1105#endif
1106
1107 src += stride * src_y + src_x; /* move starting point */ 927 src += stride * src_y + src_x; /* move starting point */
1108 dst = FBADDR(x, y); 928 dst = FBADDR(x, y);
1109 929