summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-2bit-vi.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/lcd-2bit-vi.c')
-rw-r--r--firmware/drivers/lcd-2bit-vi.c113
1 files changed, 0 insertions, 113 deletions
diff --git a/firmware/drivers/lcd-2bit-vi.c b/firmware/drivers/lcd-2bit-vi.c
index 423f4536d4..b969c93216 100644
--- a/firmware/drivers/lcd-2bit-vi.c
+++ b/firmware/drivers/lcd-2bit-vi.c
@@ -455,10 +455,6 @@ void LCDFN(drawpixel)(int x, int y)
455{ 455{
456 if ( ((unsigned)x < (unsigned)CURRENT_VP->width) 456 if ( ((unsigned)x < (unsigned)CURRENT_VP->width)
457 && ((unsigned)y < (unsigned)CURRENT_VP->height) 457 && ((unsigned)y < (unsigned)CURRENT_VP->height)
458#if defined(HAVE_VIEWPORT_CLIP)
459 && ((unsigned)x < (unsigned)LCDM(WIDTH))
460 && ((unsigned)y < (unsigned)LCDM(HEIGHT))
461#endif
462 ) 458 )
463 LCDFN(pixelfuncs)[CURRENT_VP->drawmode](CURRENT_VP->x+x, CURRENT_VP->y+y); 459 LCDFN(pixelfuncs)[CURRENT_VP->drawmode](CURRENT_VP->x+x, CURRENT_VP->y+y);
464} 460}
@@ -530,10 +526,6 @@ void LCDFN(drawline)(int x1, int y1, int x2, int y2)
530 { 526 {
531 if ( ((unsigned)x < (unsigned)CURRENT_VP->width) 527 if ( ((unsigned)x < (unsigned)CURRENT_VP->width)
532 && ((unsigned)y < (unsigned)CURRENT_VP->height) 528 && ((unsigned)y < (unsigned)CURRENT_VP->height)
533#if defined(HAVE_VIEWPORT_CLIP)
534 && ((unsigned)x < (unsigned)LCDM(WIDTH))
535 && ((unsigned)y < (unsigned)LCDM(HEIGHT))
536#endif
537 ) 529 )
538 pfunc(CURRENT_VP->x + x, CURRENT_VP->y + y); 530 pfunc(CURRENT_VP->x + x, CURRENT_VP->y + y);
539 531
@@ -585,20 +577,6 @@ void LCDFN(hline)(int x1, int x2, int y)
585 x2 += CURRENT_VP->x; 577 x2 += CURRENT_VP->x;
586 y += CURRENT_VP->y; 578 y += CURRENT_VP->y;
587 579
588#if defined(HAVE_VIEWPORT_CLIP)
589 /********************* Viewport on screen clipping ********************/
590 /* nothing to draw? */
591 if (((unsigned)y >= (unsigned) LCDM(HEIGHT)) || (x1 >= LCDM(WIDTH))
592 || (x2 < 0))
593 return;
594
595 /* clipping */
596 if (x1 < 0)
597 x1 = 0;
598 if (x2 >= LCDM(WIDTH))
599 x2 = LCDM(WIDTH)-1;
600#endif
601
602 width = x2 - x1 + 1; 580 width = x2 - x1 + 1;
603 581
604 bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode]; 582 bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode];
@@ -644,20 +622,6 @@ void LCDFN(vline)(int x, int y1, int y2)
644 y2 += CURRENT_VP->y; 622 y2 += CURRENT_VP->y;
645 x += CURRENT_VP->x; 623 x += CURRENT_VP->x;
646 624
647#if defined(HAVE_VIEWPORT_CLIP)
648 /********************* Viewport on screen clipping ********************/
649 /* nothing to draw? */
650 if (( (unsigned) x >= (unsigned)LCDM(WIDTH)) || (y1 >= LCDM(HEIGHT))
651 || (y2 < 0))
652 return;
653
654 /* clipping */
655 if (y1 < 0)
656 y1 = 0;
657 if (y2 >= LCDM(HEIGHT))
658 y2 = LCDM(HEIGHT)-1;
659#endif
660
661 bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode]; 625 bfunc = LCDFN(blockfuncs)[CURRENT_VP->drawmode];
662 dst = LCDFB(x,y1>>3); 626 dst = LCDFB(x,y1>>3);
663 stride_dst = CURRENT_VP->buffer->stride; 627 stride_dst = CURRENT_VP->buffer->stride;
@@ -728,31 +692,6 @@ void LCDFN(fillrect)(int x, int y, int width, int height)
728 x += CURRENT_VP->x; 692 x += CURRENT_VP->x;
729 y += CURRENT_VP->y; 693 y += CURRENT_VP->y;
730 694
731#if defined(HAVE_VIEWPORT_CLIP)
732 /********************* Viewport on screen clipping ********************/
733 /* nothing to draw? */
734 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT))
735 || (x + width <= 0) || (y + height <= 0))
736 return;
737
738 /* clip image in viewport in screen */
739 if (x < 0)
740 {
741 width += x;
742 x = 0;
743 }
744 if (y < 0)
745 {
746 height += y;
747 y = 0;
748 }
749 if (x + width > LCDM(WIDTH))
750 width = LCDM(WIDTH) - x;
751 if (y + height > LCDM(HEIGHT))
752 height = LCDM(HEIGHT) - y;
753#endif
754
755
756 if (CURRENT_VP->drawmode & DRMODE_INVERSEVID) 695 if (CURRENT_VP->drawmode & DRMODE_INVERSEVID)
757 { 696 {
758 if ((CURRENT_VP->drawmode & DRMODE_BG) && !backdrop) 697 if ((CURRENT_VP->drawmode & DRMODE_BG) && !backdrop)
@@ -857,32 +796,6 @@ void ICODE_ATTR LCDFN(mono_bitmap_part)(const unsigned char *src, int src_x,
857 x += CURRENT_VP->x; 796 x += CURRENT_VP->x;
858 y += CURRENT_VP->y; 797 y += CURRENT_VP->y;
859 798
860#if defined(HAVE_VIEWPORT_CLIP)
861 /********************* Viewport on screen clipping ********************/
862 /* nothing to draw? */
863 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT))
864 || (x + width <= 0) || (y + height <= 0))
865 return;
866
867 /* clip image in viewport in screen */
868 if (x < 0)
869 {
870 width += x;
871 src_x -= x;
872 x = 0;
873 }
874 if (y < 0)
875 {
876 height += y;
877 src_y -= y;
878 y = 0;
879 }
880 if (x + width > LCDM(WIDTH))
881 width = LCDM(WIDTH) - x;
882 if (y + height > LCDM(HEIGHT))
883 height = LCDM(HEIGHT) - y;
884#endif
885
886 src += stride * (src_y >> 3) + src_x; /* move starting point */ 799 src += stride * (src_y >> 3) + src_x; /* move starting point */
887 src_y &= 7; 800 src_y &= 7;
888 y -= src_y; 801 y -= src_y;
@@ -1027,32 +940,6 @@ void ICODE_ATTR LCDFN(bitmap_part)(const FBFN(data) *src, int src_x,
1027 x += CURRENT_VP->x; 940 x += CURRENT_VP->x;
1028 y += CURRENT_VP->y; 941 y += CURRENT_VP->y;
1029 942
1030#if defined(HAVE_VIEWPORT_CLIP)
1031 /********************* Viewport on screen clipping ********************/
1032 /* nothing to draw? */
1033 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT))
1034 || (x + width <= 0) || (y + height <= 0))
1035 return;
1036
1037 /* clip image in viewport in screen */
1038 if (x < 0)
1039 {
1040 width += x;
1041 src_x -= x;
1042 x = 0;
1043 }
1044 if (y < 0)
1045 {
1046 height += y;
1047 src_y -= y;
1048 y = 0;
1049 }
1050 if (x + width > LCDM(WIDTH))
1051 width = LCDM(WIDTH) - x;
1052 if (y + height > LCDM(HEIGHT))
1053 height = LCDM(HEIGHT) - y;
1054#endif
1055
1056 src += stride * (src_y >> 3) + src_x; /* move starting point */ 943 src += stride * (src_y >> 3) + src_x; /* move starting point */
1057 src_y &= 7; 944 src_y &= 7;
1058 y -= src_y; 945 y -= src_y;