⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcdmem.lst

📁 Keil C下通过的UCGUI,UCGUI的移植源代码
💻 LST
📖 第 1 页 / 共 4 页
字号:
 621   3          }
 622   2          break;
 623   2        case LCD_DRAWMODE_TRANS:
 624   2          switch (Diff&7) {
 625   3          case 0:
 626   3            goto WriteTBit0;
 627   3          case 1:
 628   3            goto WriteTBit1;
 629   3          case 2:
 630   3            goto WriteTBit2;
 631   3          case 3:
 632   3            goto WriteTBit3;
 633   3          case 4:
 634   3            goto WriteTBit4;
 635   3          case 5:   
 636   3            goto WriteTBit5;
 637   3          case 6:   
 638   3            goto WriteTBit6;
 639   3          case 7:   
 640   3            goto WriteTBit7;
 641   3          }
 642   2          break;
 643   2        case LCD_DRAWMODE_XOR:
 644   2          switch (Diff&7) {
 645   3          case 0:   
 646   3            goto WriteXBit0;
 647   3          case 1:   
 648   3            goto WriteXBit1;
 649   3          case 2:
 650   3            goto WriteXBit2;
 651   3          case 3:
 652   3            goto WriteXBit3;
 653   3          case 4:
 654   3            goto WriteXBit4;
 655   3          case 5:   
 656   3            goto WriteXBit5;
 657   3          case 6:   
 658   3            goto WriteXBit6;
 659   3          case 7:   
 660   3            goto WriteXBit7;
 661   3          }
 662   2        }
 663   1      /*
 664   1              Write with transparency
 665   1      */
 666   1        WriteTBit0:
 667   1          if (pixels&(1<<7)) SETPIXEL(x+0, y, Index1);
 668   1          if (!--xsize)
 669   1            return;
 670   1        WriteTBit1:
 671   1          if (pixels&(1<<6)) SETPIXEL(x+1, y, Index1);
 672   1          if (!--xsize)
 673   1            return;
 674   1        WriteTBit2:
C51 COMPILER V8.05a   LCDMEM                                                               04/11/2008 14:19:25 PAGE 12  

 675   1          if (pixels&(1<<5)) SETPIXEL(x+2, y, Index1);
 676   1          if (!--xsize)
 677   1            return;
 678   1        WriteTBit3:
 679   1          if (pixels&(1<<4)) SETPIXEL(x+3, y, Index1);
 680   1          if (!--xsize)
 681   1            return;
 682   1        WriteTBit4:
 683   1          if (pixels&(1<<3)) SETPIXEL(x+4, y, Index1);
 684   1          if (!--xsize)
 685   1            return;
 686   1        WriteTBit5:
 687   1          if (pixels&(1<<2)) SETPIXEL(x+5, y, Index1);
 688   1          if (!--xsize)
 689   1            return;
 690   1        WriteTBit6:
 691   1          if (pixels&(1<<1)) SETPIXEL(x+6, y, Index1);
 692   1          if (!--xsize)
 693   1            return;
 694   1        WriteTBit7:
 695   1          if (pixels&(1<<0)) SETPIXEL(x+7, y, Index1);
 696   1          if (!--xsize)
 697   1            return;
 698   1          x+=8;
 699   1          pixels = *(++p);
 700   1          goto WriteTBit0;
 701   1      
 702   1      /*
 703   1              Write without transparency
 704   1      */
 705   1        WriteBit0:
 706   1          SETPIXEL(x+0, y, (pixels&(1<<7)) ? Index1 : Index0);
 707   1          if (!--xsize)
 708   1            return;
 709   1        WriteBit1:
 710   1          SETPIXEL(x+1, y, (pixels&(1<<6)) ? Index1 : Index0);
 711   1          if (!--xsize)
 712   1            return;
 713   1        WriteBit2:
 714   1          SETPIXEL(x+2, y, (pixels&(1<<5)) ? Index1 : Index0);
 715   1          if (!--xsize)
 716   1            return;
 717   1        WriteBit3:
 718   1          SETPIXEL(x+3, y, (pixels&(1<<4)) ? Index1 : Index0);
 719   1          if (!--xsize)
 720   1            return;
 721   1        WriteBit4:
 722   1          SETPIXEL(x+4, y, (pixels&(1<<3)) ? Index1 : Index0);
 723   1          if (!--xsize)
 724   1            return;
 725   1        WriteBit5:
 726   1          SETPIXEL(x+5, y, (pixels&(1<<2)) ? Index1 : Index0);
 727   1          if (!--xsize)
 728   1            return;
 729   1        WriteBit6:
 730   1          SETPIXEL(x+6, y, (pixels&(1<<1)) ? Index1 : Index0);
 731   1          if (!--xsize)
 732   1            return;
 733   1        WriteBit7:
 734   1          SETPIXEL(x+7, y, (pixels&(1<<0)) ? Index1 : Index0);
 735   1          if (!--xsize)
 736   1            return;
C51 COMPILER V8.05a   LCDMEM                                                               04/11/2008 14:19:25 PAGE 13  

 737   1          x+=8;
 738   1          pixels = *(++p);
 739   1          goto WriteBit0;
 740   1      /*
 741   1              Write XOR mode
 742   1      */
 743   1        WriteXBit0:
 744   1          if (pixels&(1<<7))
 745   1            XORPIXEL(x+0, y);
 746   1          if (!--xsize)
 747   1            return;
 748   1        WriteXBit1:
 749   1          if (pixels&(1<<6))
 750   1            XORPIXEL(x+1, y);
 751   1          if (!--xsize)
 752   1            return;
 753   1        WriteXBit2:
 754   1          if (pixels&(1<<5))
 755   1            XORPIXEL(x+2, y);
 756   1          if (!--xsize)
 757   1            return;
 758   1        WriteXBit3:
 759   1          if (pixels&(1<<4))
 760   1            XORPIXEL(x+3, y);
 761   1          if (!--xsize)
 762   1            return;
 763   1        WriteXBit4:
 764   1          if (pixels&(1<<3))
 765   1            XORPIXEL(x+4, y);
 766   1          if (!--xsize)
 767   1            return;
 768   1        WriteXBit5:
 769   1          if (pixels&(1<<2))
 770   1            XORPIXEL(x+5, y);
 771   1          if (!--xsize)
 772   1            return;
 773   1        WriteXBit6:
 774   1          if (pixels&(1<<1))
 775   1            XORPIXEL(x+6, y);
 776   1          if (!--xsize)
 777   1            return;
 778   1        WriteXBit7:
 779   1          if (pixels&(1<<0))
 780   1            XORPIXEL(x+7, y);
 781   1          if (!--xsize)
 782   1            return;
 783   1          x+=8;
 784   1          pixels = *(++p);
 785   1          goto WriteXBit0;
 786   1      }
 787          
 788          
 789          /*
 790              *********************************************
 791              *                                           *
 792              *      Draw Bitmap 2 BPP, optimized
 793              *                                           *
 794              *********************************************
 795          */
 796          
 797          #if (LCD_MAX_LOG_COLORS > 2)
 798          
C51 COMPILER V8.05a   LCDMEM                                                               04/11/2008 14:19:25 PAGE 14  

 799          #if  (!LCD_SWAP_XY)
 800          
 801          static void  DrawBitLine2BPP(int x, int y, U8 const*p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans) {
 802   1        PIXELCOLOR pixels;
 803   1      /*
 804   1         Jump to right entry point
 805   1      */
 806   1        pixels = *p;
 807   1        if (GUI_Context.DrawMode & LCD_DRAWMODE_TRANS) {
 808   2          switch (Diff&3) {
 809   3          case 0:
 810   3            goto WriteTBit0;
 811   3          case 1:
 812   3            goto WriteTBit1;
 813   3          case 2:
 814   3            goto WriteTBit2;
 815   3          default:
 816   3            goto WriteTBit3;
 817   3          }
 818   2        } else {
 819   2          switch (Diff&3) {
 820   3          case 0:
 821   3            goto WriteBit0;
 822   3          case 1:
 823   3            goto WriteBit1;
 824   3          case 2:
 825   3            goto WriteBit2;
 826   3          default:
 827   3            goto WriteBit3;
 828   3          }
 829   2        }
 830   1      /*
 831   1              Write without transparency
 832   1      */
 833   1      WriteBit0:
 834   1        SETPIXELFAST(x+0, y, *(pTrans+(pixels>>6)));
 835   1        if (!--xsize)
 836   1          return;
 837   1      WriteBit1:
 838   1        SETPIXELFAST(x+1, y, *(pTrans+(3&(pixels>>4))));
 839   1        if (!--xsize)
 840   1          return;
 841   1      WriteBit2:
 842   1        SETPIXELFAST(x+2, y, *(pTrans+(3&(pixels>>2))));
 843   1        if (!--xsize)
 844   1          return;
 845   1      WriteBit3:
 846   1        SETPIXELFAST(x+3, y, *(pTrans+(3&(pixels))));
 847   1        if (!--xsize)
 848   1          return;
 849   1        pixels = *(++p);
 850   1        x+=4;
 851   1        goto WriteBit0;
 852   1      /*
 853   1              Write with transparency
 854   1      */
 855   1      WriteTBit0:
 856   1        if (pixels&(3<<6))
 857   1          SETPIXELFAST(x+0, y, *(pTrans+(pixels>>6)));
 858   1        if (!--xsize)
 859   1          return;
 860   1      WriteTBit1:
C51 COMPILER V8.05a   LCDMEM                                                               04/11/2008 14:19:25 PAGE 15  

 861   1        if (pixels&(3<<4))
 862   1          SETPIXELFAST(x+1, y, *(pTrans+(3&(pixels>>4))));
 863   1        if (!--xsize)
 864   1          return;
 865   1      WriteTBit2:
 866   1        if (pixels&(3<<2))
 867   1          SETPIXELFAST(x+2, y, *(pTrans+(3&(pixels>>2))));
 868   1        if (!--xsize)
 869   1          return;
 870   1      WriteTBit3:
 871   1        if (pixels&(3<<0))
 872   1          SETPIXELFAST(x+3, y, *(pTrans+(3&(pixels))));
 873   1        if (!--xsize)
 874   1          return;
 875   1        pixels = *(++p);
 876   1        x+=4;
 877   1        goto WriteTBit0;
 878   1      }
 879          
 880          #else
              
              /*
                  *********************************************
                  *                                           *
                  *      Draw Bitmap 2 BPP, not optimized
                  *                                           *
                  *********************************************
              */
              
              static void  DrawBitLine2BPP(int x, int y, U8 const*p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans) {
                LCD_PIXELINDEX pixels;
              /*
              // Jump to right entry point
              */
                pixels = *p;
                if (GUI_Context.DrawMode & LCD_DRAWMODE_TRANS) switch (Diff&3) {
                case 0:
                  goto WriteTBit0;
                case 1:
                  goto WriteTBit1;
                case 2:
                  goto WriteTBit2;
                default:
                  goto WriteTBit3;
                } else switch (Diff&3) {
                case 0:
                  goto WriteBit0;
                case 1:
                  goto WriteBit1;
                case 2:
                  goto WriteBit2;
                default:
                  goto WriteBit3;
                }
              /*
                      Write without transparency
              */
              WriteBit0:
                SETPIXEL(x+0, y, *(pTrans+(pixels>>6)));
                if (!--xsize)
                  return;
              WriteBit1:
C51 COMPILER V8.05a   LCDMEM                                                               04/11/2008 14:19:25 PAGE 16  

                SETPIXEL(x+1, y, *(pTrans+(3&(pixels>>4))));
                if (!--xsize)
                  return;
              WriteBit2:
                SETPIXEL(x+2, y, *(pTrans+(3&(pixels>>2))));
                if (!--xsize)
                  return;
              WriteBit3:
                SETPIXEL(x+3, y, *(pTrans+(3&(pixels))));
                if (!--xsize)
                  return;
                pixels = *(++p);
                x+=4;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -