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.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/firmware/drivers/lcd-2bit-vi.c b/firmware/drivers/lcd-2bit-vi.c
index 035e8b6d0d..c09bbce2e0 100644
--- a/firmware/drivers/lcd-2bit-vi.c
+++ b/firmware/drivers/lcd-2bit-vi.c
@@ -437,7 +437,7 @@ void LCDFN(clear_viewport)(void)
437 lastmode = CURRENT_VP->drawmode; 437 lastmode = CURRENT_VP->drawmode;
438 438
439 /* Invert the INVERSEVID bit and set basic mode to SOLID */ 439 /* Invert the INVERSEVID bit and set basic mode to SOLID */
440 CURRENT_VP->drawmode = (~lastmode & DRMODE_INVERSEVID) | 440 CURRENT_VP->drawmode = (~lastmode & DRMODE_INVERSEVID) |
441 DRMODE_SOLID; 441 DRMODE_SOLID;
442 442
443 LCDFN(fillrect)(0, 0, CURRENT_VP->width, CURRENT_VP->height); 443 LCDFN(fillrect)(0, 0, CURRENT_VP->width, CURRENT_VP->height);
@@ -452,7 +452,7 @@ void LCDFN(clear_viewport)(void)
452/* Set a single pixel */ 452/* Set a single pixel */
453void LCDFN(drawpixel)(int x, int y) 453void LCDFN(drawpixel)(int x, int y)
454{ 454{
455 if ( ((unsigned)x < (unsigned)CURRENT_VP->width) 455 if ( ((unsigned)x < (unsigned)CURRENT_VP->width)
456 && ((unsigned)y < (unsigned)CURRENT_VP->height) 456 && ((unsigned)y < (unsigned)CURRENT_VP->height)
457#if defined(HAVE_VIEWPORT_CLIP) 457#if defined(HAVE_VIEWPORT_CLIP)
458 && ((unsigned)x < (unsigned)LCDM(WIDTH)) 458 && ((unsigned)x < (unsigned)LCDM(WIDTH))
@@ -527,7 +527,7 @@ void LCDFN(drawline)(int x1, int y1, int x2, int y2)
527 527
528 for (i = 0; i < numpixels; i++) 528 for (i = 0; i < numpixels; i++)
529 { 529 {
530 if ( ((unsigned)x < (unsigned)CURRENT_VP->width) 530 if ( ((unsigned)x < (unsigned)CURRENT_VP->width)
531 && ((unsigned)y < (unsigned)CURRENT_VP->height) 531 && ((unsigned)y < (unsigned)CURRENT_VP->height)
532#if defined(HAVE_VIEWPORT_CLIP) 532#if defined(HAVE_VIEWPORT_CLIP)
533 && ((unsigned)x < (unsigned)LCDM(WIDTH)) 533 && ((unsigned)x < (unsigned)LCDM(WIDTH))
@@ -567,13 +567,13 @@ void LCDFN(hline)(int x1, int x2, int y)
567 x1 = x2; 567 x1 = x2;
568 x2 = x; 568 x2 = x;
569 } 569 }
570 570
571 /******************** In viewport clipping **********************/ 571 /******************** In viewport clipping **********************/
572 /* nothing to draw? */ 572 /* nothing to draw? */
573 if (((unsigned)y >= (unsigned)CURRENT_VP->height) || (x1 >= CURRENT_VP->width) 573 if (((unsigned)y >= (unsigned)CURRENT_VP->height) || (x1 >= CURRENT_VP->width)
574 || (x2 < 0)) 574 || (x2 < 0))
575 return; 575 return;
576 576
577 if (x1 < 0) 577 if (x1 < 0)
578 x1 = 0; 578 x1 = 0;
579 if (x2 >= CURRENT_VP->width) 579 if (x2 >= CURRENT_VP->width)
@@ -589,8 +589,8 @@ void LCDFN(hline)(int x1, int x2, int y)
589 /* nothing to draw? */ 589 /* nothing to draw? */
590 if (((unsigned)y >= (unsigned) LCDM(HEIGHT)) || (x1 >= LCDM(WIDTH)) 590 if (((unsigned)y >= (unsigned) LCDM(HEIGHT)) || (x1 >= LCDM(WIDTH))
591 || (x2 < 0)) 591 || (x2 < 0))
592 return; 592 return;
593 593
594 /* clipping */ 594 /* clipping */
595 if (x1 < 0) 595 if (x1 < 0)
596 x1 = 0; 596 x1 = 0;
@@ -642,14 +642,14 @@ void LCDFN(vline)(int x, int y1, int y2)
642 y1 += CURRENT_VP->y; 642 y1 += CURRENT_VP->y;
643 y2 += CURRENT_VP->y; 643 y2 += CURRENT_VP->y;
644 x += CURRENT_VP->x; 644 x += CURRENT_VP->x;
645 645
646#if defined(HAVE_VIEWPORT_CLIP) 646#if defined(HAVE_VIEWPORT_CLIP)
647 /********************* Viewport on screen clipping ********************/ 647 /********************* Viewport on screen clipping ********************/
648 /* nothing to draw? */ 648 /* nothing to draw? */
649 if (( (unsigned) x >= (unsigned)LCDM(WIDTH)) || (y1 >= LCDM(HEIGHT)) 649 if (( (unsigned) x >= (unsigned)LCDM(WIDTH)) || (y1 >= LCDM(HEIGHT))
650 || (y2 < 0)) 650 || (y2 < 0))
651 return; 651 return;
652 652
653 /* clipping */ 653 /* clipping */
654 if (y1 < 0) 654 if (y1 < 0)
655 y1 = 0; 655 y1 = 0;
@@ -707,7 +707,7 @@ void LCDFN(fillrect)(int x, int y, int width, int height)
707 if ((width <= 0) || (height <= 0) || (x >= CURRENT_VP->width) 707 if ((width <= 0) || (height <= 0) || (x >= CURRENT_VP->width)
708 || (y >= CURRENT_VP->height) || (x + width <= 0) || (y + height <= 0)) 708 || (y >= CURRENT_VP->height) || (x + width <= 0) || (y + height <= 0))
709 return; 709 return;
710 710
711 if (x < 0) 711 if (x < 0)
712 { 712 {
713 width += x; 713 width += x;
@@ -726,14 +726,14 @@ void LCDFN(fillrect)(int x, int y, int width, int height)
726 /* adjust for viewport */ 726 /* adjust for viewport */
727 x += CURRENT_VP->x; 727 x += CURRENT_VP->x;
728 y += CURRENT_VP->y; 728 y += CURRENT_VP->y;
729 729
730#if defined(HAVE_VIEWPORT_CLIP) 730#if defined(HAVE_VIEWPORT_CLIP)
731 /********************* Viewport on screen clipping ********************/ 731 /********************* Viewport on screen clipping ********************/
732 /* nothing to draw? */ 732 /* nothing to draw? */
733 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT)) 733 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT))
734 || (x + width <= 0) || (y + height <= 0)) 734 || (x + width <= 0) || (y + height <= 0))
735 return; 735 return;
736 736
737 /* clip image in viewport in screen */ 737 /* clip image in viewport in screen */
738 if (x < 0) 738 if (x < 0)
739 { 739 {
@@ -855,14 +855,14 @@ void ICODE_ATTR LCDFN(mono_bitmap_part)(const unsigned char *src, int src_x,
855 /* adjust for viewport */ 855 /* adjust for viewport */
856 x += CURRENT_VP->x; 856 x += CURRENT_VP->x;
857 y += CURRENT_VP->y; 857 y += CURRENT_VP->y;
858 858
859#if defined(HAVE_VIEWPORT_CLIP) 859#if defined(HAVE_VIEWPORT_CLIP)
860 /********************* Viewport on screen clipping ********************/ 860 /********************* Viewport on screen clipping ********************/
861 /* nothing to draw? */ 861 /* nothing to draw? */
862 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT)) 862 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT))
863 || (x + width <= 0) || (y + height <= 0)) 863 || (x + width <= 0) || (y + height <= 0))
864 return; 864 return;
865 865
866 /* clip image in viewport in screen */ 866 /* clip image in viewport in screen */
867 if (x < 0) 867 if (x < 0)
868 { 868 {
@@ -1029,10 +1029,10 @@ void ICODE_ATTR LCDFN(bitmap_part)(const FBFN(data) *src, int src_x,
1029#if defined(HAVE_VIEWPORT_CLIP) 1029#if defined(HAVE_VIEWPORT_CLIP)
1030 /********************* Viewport on screen clipping ********************/ 1030 /********************* Viewport on screen clipping ********************/
1031 /* nothing to draw? */ 1031 /* nothing to draw? */
1032 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT)) 1032 if ((x >= LCDM(WIDTH)) || (y >= LCDM(HEIGHT))
1033 || (x + width <= 0) || (y + height <= 0)) 1033 || (x + width <= 0) || (y + height <= 0))
1034 return; 1034 return;
1035 1035
1036 /* clip image in viewport in screen */ 1036 /* clip image in viewport in screen */
1037 if (x < 0) 1037 if (x < 0)
1038 { 1038 {