summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-2bit-vert.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-2bit-vert.c')
-rw-r--r--firmware/drivers/lcd-2bit-vert.c111
1 files changed, 0 insertions, 111 deletions
diff --git a/firmware/drivers/lcd-2bit-vert.c b/firmware/drivers/lcd-2bit-vert.c
index a059e3b512..4ce9960419 100644
--- a/firmware/drivers/lcd-2bit-vert.c
+++ b/firmware/drivers/lcd-2bit-vert.c
@@ -422,10 +422,6 @@ void lcd_drawpixel(int x, int y)
422{ 422{
423 if ( ((unsigned)x < (unsigned)lcd_current_viewport->width) 423 if ( ((unsigned)x < (unsigned)lcd_current_viewport->width)
424 && ((unsigned)y < (unsigned)lcd_current_viewport->height) 424 && ((unsigned)y < (unsigned)lcd_current_viewport->height)
425#if defined(HAVE_VIEWPORT_CLIP)
426 && ((unsigned)x < (unsigned)LCD_WIDTH)
427 && ((unsigned)y < (unsigned)LCD_HEIGHT)
428#endif
429 ) 425 )
430 lcd_pixelfuncs[lcd_current_viewport->drawmode](lcd_current_viewport->x + x, lcd_current_viewport->y + y); 426 lcd_pixelfuncs[lcd_current_viewport->drawmode](lcd_current_viewport->x + x, lcd_current_viewport->y + y);
431} 427}
@@ -497,10 +493,6 @@ void lcd_drawline(int x1, int y1, int x2, int y2)
497 { 493 {
498 if ( ((unsigned)x < (unsigned)lcd_current_viewport->width) 494 if ( ((unsigned)x < (unsigned)lcd_current_viewport->width)
499 && ((unsigned)y < (unsigned)lcd_current_viewport->height) 495 && ((unsigned)y < (unsigned)lcd_current_viewport->height)
500#if defined(HAVE_VIEWPORT_CLIP)
501 && ((unsigned)x < (unsigned)LCD_WIDTH)
502 && ((unsigned)y < (unsigned)LCD_HEIGHT)
503#endif
504 ) 496 )
505 pfunc(lcd_current_viewport->x + x, lcd_current_viewport->y + y); 497 pfunc(lcd_current_viewport->x + x, lcd_current_viewport->y + y);
506 498
@@ -552,20 +544,6 @@ void lcd_hline(int x1, int x2, int y)
552 x2 += lcd_current_viewport->x; 544 x2 += lcd_current_viewport->x;
553 y += lcd_current_viewport->y; 545 y += lcd_current_viewport->y;
554 546
555#if defined(HAVE_VIEWPORT_CLIP)
556 /********************* Viewport on screen clipping ********************/
557 /* nothing to draw? */
558 if (((unsigned)y >= (unsigned) LCD_HEIGHT) || (x1 >= LCD_WIDTH)
559 || (x2 < 0))
560 return;
561
562 /* clipping */
563 if (x1 < 0)
564 x1 = 0;
565 if (x2 >= LCD_WIDTH)
566 x2 = LCD_WIDTH-1;
567#endif
568
569 width = x2 - x1 + 1; 547 width = x2 - x1 + 1;
570 548
571 bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; 549 bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode];
@@ -611,20 +589,6 @@ void lcd_vline(int x, int y1, int y2)
611 y2 += lcd_current_viewport->y; 589 y2 += lcd_current_viewport->y;
612 x += lcd_current_viewport->x; 590 x += lcd_current_viewport->x;
613 591
614#if defined(HAVE_VIEWPORT_CLIP)
615 /********************* Viewport on screen clipping ********************/
616 /* nothing to draw? */
617 if (( (unsigned) x >= (unsigned)LCD_WIDTH) || (y1 >= LCD_HEIGHT)
618 || (y2 < 0))
619 return;
620
621 /* clipping */
622 if (y1 < 0)
623 y1 = 0;
624 if (y2 >= LCD_HEIGHT)
625 y2 = LCD_HEIGHT-1;
626#endif
627
628 bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode]; 592 bfunc = lcd_blockfuncs[lcd_current_viewport->drawmode];
629 dst = FBADDR(x,y1>>2); 593 dst = FBADDR(x,y1>>2);
630 stride_dst = lcd_current_viewport->buffer->stride; 594 stride_dst = lcd_current_viewport->buffer->stride;
@@ -693,30 +657,6 @@ void lcd_fillrect(int x, int y, int width, int height)
693 x += lcd_current_viewport->x; 657 x += lcd_current_viewport->x;
694 y += lcd_current_viewport->y; 658 y += lcd_current_viewport->y;
695 659
696#if defined(HAVE_VIEWPORT_CLIP)
697 /********************* Viewport on screen clipping ********************/
698 /* nothing to draw? */
699 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
700 || (x + width <= 0) || (y + height <= 0))
701 return;
702
703 /* clip image in viewport in screen */
704 if (x < 0)
705 {
706 width += x;
707 x = 0;
708 }
709 if (y < 0)
710 {
711 height += y;
712 y = 0;
713 }
714 if (x + width > LCD_WIDTH)
715 width = LCD_WIDTH - x;
716 if (y + height > LCD_HEIGHT)
717 height = LCD_HEIGHT - y;
718#endif
719
720 if (lcd_current_viewport->drawmode & DRMODE_INVERSEVID) 660 if (lcd_current_viewport->drawmode & DRMODE_INVERSEVID)
721 { 661 {
722 if ((lcd_current_viewport->drawmode & DRMODE_BG) && !lcd_backdrop) 662 if ((lcd_current_viewport->drawmode & DRMODE_BG) && !lcd_backdrop)
@@ -819,32 +759,6 @@ void ICODE_ATTR lcd_mono_bitmap_part(const unsigned char *src, int src_x,
819 x += lcd_current_viewport->x; 759 x += lcd_current_viewport->x;
820 y += lcd_current_viewport->y; 760 y += lcd_current_viewport->y;
821 761
822#if defined(HAVE_VIEWPORT_CLIP)
823 /********************* Viewport on screen clipping ********************/
824 /* nothing to draw? */
825 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
826 || (x + width <= 0) || (y + height <= 0))
827 return;
828
829 /* clip image in viewport in screen */
830 if (x < 0)
831 {
832 width += x;
833 src_x -= x;
834 x = 0;
835 }
836 if (y < 0)
837 {
838 height += y;
839 src_y -= y;
840 y = 0;
841 }
842 if (x + width > LCD_WIDTH)
843 width = LCD_WIDTH - x;
844 if (y + height > LCD_HEIGHT)
845 height = LCD_HEIGHT - y;
846#endif
847
848 src += stride * (src_y >> 3) + src_x; /* move starting point */ 762 src += stride * (src_y >> 3) + src_x; /* move starting point */
849 src_y &= 7; 763 src_y &= 7;
850 y -= src_y; 764 y -= src_y;
@@ -1018,31 +932,6 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
1018 x += lcd_current_viewport->x; 932 x += lcd_current_viewport->x;
1019 y += lcd_current_viewport->y; 933 y += lcd_current_viewport->y;
1020 934
1021#if defined(HAVE_VIEWPORT_CLIP)
1022 /********************* Viewport on screen clipping ********************/
1023 /* nothing to draw? */
1024 if ((x >= LCD_WIDTH) || (y >= LCD_HEIGHT)
1025 || (x + width <= 0) || (y + height <= 0))
1026 return;
1027
1028 /* clip image in viewport in screen */
1029 if (x < 0)
1030 {
1031 width += x;
1032 src_x -= x;
1033 x = 0;
1034 }
1035 if (y < 0)
1036 {
1037 height += y;
1038 src_y -= y;
1039 y = 0;
1040 }
1041 if (x + width > LCD_WIDTH)
1042 width = LCD_WIDTH - x;
1043 if (y + height > LCD_HEIGHT)
1044 height = LCD_HEIGHT - y;
1045#endif
1046 src += stride * (src_y >> 2) + src_x; /* move starting point */ 935 src += stride * (src_y >> 2) + src_x; /* move starting point */
1047 src_y &= 3; 936 src_y &= 3;
1048 y -= src_y; 937 y -= src_y;