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

📄 tw88.lst

📁 此程序为twell8806驱动程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
 614          //                              Panel Setting
 615          //=============================================================================
 616          #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV )
 617          
 618          BYTE IsBypassmode(void)
 619          {
 620   1              BYTE dat;
 621   1      
 622   1              dat = ReadDecoder(TW88_XYSCALEHI) & 0x10;       // Zoom by-pass
 623   1              return dat;
 624   1      }
 625          /*
 626          BYTE IsInteraced(void)
 627          {
 628                  if( ReadDecoder(0x42) & 0x80 ) return 1;
 629                  return 0;
 630          }
 631          */
 632          WORD GetHstart(void)
 633          {
 634   1              WORD hstart;
 635   1      
 636   1              WriteDecoder(0x5b, 0x80);
 637   1              hstart = (WORD)ReadDecoder(0x58) << 8;
 638   1              hstart += ReadDecoder(0x57);
 639   1      
 640   1              return hstart;
 641   1      }
 642          
 643          WORD GetVstart(void)
 644          {
 645   1              WORD vstart;
 646   1      
 647   1              WriteDecoder(0x5b, 0xa0);
 648   1              vstart = (WORD)ReadDecoder(0x58) << 8;
 649   1              vstart += ReadDecoder(0x57);
 650   1      
 651   1              return vstart;
 652   1      }
 653          
 654          
 655          
 656          WORD GetVend(void)
 657          {
 658   1              WORD vend;
 659   1      
 660   1              WriteDecoder(0x5b, 0xb0);
 661   1              vend = (WORD)ReadDecoder(0x5a) << 8;
 662   1              vend += ReadDecoder(0x59);
 663   1      
 664   1              return vend;
 665   1      }
 666          
 667          /**** Not used
 668          void MaskOnSYNCInt()
 669          {
 670                  BYTE val;
 671          
 672                  val = 0xfc;
 673                  WriteDecoder(0xb2, val);        //IRQ mask
 674                  dPrintf("\r\nDisableSYNCint:->%02x", val);
 675          }
C51 COMPILER V7.50   TW88                                                                  08/20/2007 10:23:35 PAGE 12  

 676          ****/
 677          
 678          void MaskOffSYNCInt()
 679          {
 680   1              BYTE val;
 681   1      
 682   1              val = 0xfc;
 683   1              WriteDecoder(0xd2, val);        //IRQ mask
 684   1              
 685   1              #ifdef DEBUG_TW88
                      dPrintf("\r\nEnableSYNCint:->%02x", (WORD)val);
                      #endif
 688   1      
 689   1              WriteDecoder(0xd2, 0xcc);
 690   1      
 691   1              #ifdef DEBUG_TW88
                      dPrintf("\r\nEnableSYNCint:->%02x", (WORD)0xcc);
                      #endif
 694   1      }
 695          
 696          
 697          void MakeStartInt(void)
 698          {
 699   1              MaskOffSYNCInt();
 700   1      
 701   1              WriteDecoder(0xd3, 0x02);                                       // IRQ mask 2
 702   1              WriteDecoder(0x4e, ReadDecoder(0x4e) | 0x08);   // IRQ pin, active low
 703   1              WriteDecoder(0x5b, 0x01);                                       // Start measure
 704   1              WriteDecoder(0x5b, 0x00);                                       // clear measure
 705   1              WriteDecoder(0x5c, 0x07);                                       // change error tolerance and enable V/HSYNC change/loss detection
 706   1      
 707   1              SetEnDet();                                                             // Set enable-detection
 708   1      }
 709          
 710          void Clear_bypass()
 711          {
 712   1              BYTE dat;
 713   1      
 714   1              dat = ReadDecoder(TW88_XYSCALEHI);      
 715   1              WriteDecoder(TW88_XYSCALEHI, dat & 0xef);       // xxx0 xxxx
 716   1      }
 717          
 718          
 719          WORD GetHactiveStart(void)
 720          {
 721   1              WORD buf;
 722   1              BYTE val;
 723   1      
 724   1              val = ReadDecoder(0x49);        
 725   1              buf = (WORD)(val & 0x07) << 8;
 726   1              buf += ReadDecoder(0x47);
 727   1      
 728   1              return buf;
 729   1      }
 730          
 731          /**** Not used */
 732          WORD GetHactiveEnd(void)
 733          {
 734   1              WORD buf;
 735   1              BYTE val;
 736   1      
 737   1              val = ReadDecoder(0x49);
C51 COMPILER V7.50   TW88                                                                  08/20/2007 10:23:35 PAGE 13  

 738   1              buf = (WORD)(val & 0xf0) << 4;
 739   1              buf += ReadDecoder(0x48);
 740   1      
 741   1              return buf;
 742   1      }
 743          /****/
 744          
 745          //#ifdef DEBUG_TW88
 746          WORD GetVactiveStart(void)
 747          {
 748   1              WORD buf;
 749   1              BYTE val;
 750   1      
 751   1              val = ReadDecoder(0x4d);                        // high 2 bits
 752   1              buf = (WORD)(val & 0x03) << 8;
 753   1              buf |= ReadDecoder(0x4a);                       // Vactive Odd field Line start position
 754   1      
 755   1              return buf;
 756   1      }
 757          //#endif
 758          
 759          /**** Not used 
 760          WORD GetVactiveLen(void)
 761          {
 762                  WORD buf;
 763                  BYTE val;
 764          
 765                  val = ReadDecoder(0x4d);                        // high 3 bits
 766                  buf = (val & 0x70) << 4;
 767                  buf |= ReadDecoder(0x4c);
 768          
 769                  return buf;
 770          }
 771          ***/
 772          //-------------------------------------------------------------------
 773          //                  Set Active Region Functions
 774          //-------------------------------------------------------------------
 775          void SetHactiveStart(WORD hstart)
 776          {
 777   1              BYTE val;
 778   1      
 779   1              // TW8804 write LSByte first
 780   1              val = ReadDecoder(0x49);
 781   1              val = val & 0xf8;
 782   1              val = val | (hstart>>8);
 783   1      
 784   1              WriteDecoder(0x49, val);
 785   1              WriteDecoder(0x47, (BYTE)hstart);
 786   1      }
 787          
 788          void SetHactiveEnd(WORD hend)
 789          {
 790   1              BYTE    val, buf;
 791   1      
 792   1              // TW8804 write LSByte first
 793   1              buf = (BYTE)(hend>>8)<<4;
 794   1              val = ReadDecoder(0x49);
 795   1              val = val & 0x0f;
 796   1              val = val | buf;
 797   1              
 798   1              WriteDecoder(0x49, val);
 799   1              WriteDecoder(0x48, (BYTE)hend);
C51 COMPILER V7.50   TW88                                                                  08/20/2007 10:23:35 PAGE 14  

 800   1      }
 801          
 802          void SetVactiveStart(WORD vstart)
 803          {
 804   1              BYTE val, v_h, v_l;
 805   1      
 806   1              // TW8804 write LSByte first
 807   1              v_l = (BYTE)vstart;
 808   1              v_h = (BYTE)(vstart>>8);
 809   1      
 810   1              val = ReadDecoder(0x4d);        // high 2 bits
 811   1              val = (val & 0xf0);
 812   1              val = val | (v_h<<2);
 813   1              val = val | v_h;
 814   1              WriteDecoder(0x4d, val);
 815   1      
 816   1              WriteDecoder(0x4a, v_l);        // Vactive Odd field Line start position
 817   1              WriteDecoder(0x4b, v_l);        // Vactive Even field Line start position
 818   1      }
 819          
 820          void SetVactiveLen(WORD van)
 821          {
 822   1      //      WORD vstop;
 823   1              BYTE val, buf;
 824   1      
 825   1              van += 10;                                                      // HHY add 1, because of bottom line garbage
 826   1      
 827   1              // TW8804 write LSByte first
 828   1              buf = (BYTE)(van>>8) << 4;
 829   1              val = ReadDecoder(0x4d);
 830   1              val = val & 0x8f;
 831   1              val = val | buf;
 832   1              WriteDecoder(0x4d, val);
 833   1              WriteDecoder(0x4c, (BYTE)van);          
 834   1                                              
 835   1      }
 836          
 837          #include "osdmenu.h"
 838          extern CODE struct RegisterInfo UserRange;
 839          extern CODE struct RegisterInfo PanelContrastRange;
 840          extern CODE struct RegisterInfo PanelBrightnessRange;
 841          extern CODE struct RegisterInfo PanelSharpnessRange;
 842          extern CODE struct RegisterInfo PanelHueRange;
 843          extern CODE struct RegisterInfo PanelSaturationRange;
 844          
 845          void GetInitPanelAttribute1(void)
 846          {
 847   1              BYTE rdata;
 848   1              int     regv;
 849   1      
 850   1              rdata = GetPanelContrastEE();
 851   1              Mapping1( rdata, &UserRange ,&regv, &PanelContrastRange);
 852   1              SetRGBContrast( GetPCColorTempModeEE(), (BYTE)regv );
 853   1      
 854   1              rdata = GetPanelBrightnessEE() ;
 855   1              Mapping1( rdata, &UserRange , &regv,   &PanelBrightnessRange );
 856   1              SetPanelBrightnessReg(RED,   (BYTE)regv);
 857   1              SetPanelBrightnessReg(GREEN, (BYTE)regv);
 858   1              SetPanelBrightnessReg(BLUE,  (BYTE)regv);
 859   1      }
 860          
 861          #endif // SUPPORT_PC
C51 COMPILER V7.50   TW88                                                                  08/20/2007 10:23:35 PAGE 15  

 862          
 863          void DefaultPanelAttributeForVideo(void)
 864          {
 865   1              BYTE rdata;
 866   1      
 867   1              SelectPanelAttrRegGroup(GROUP_RGB);
 868   1              rdata = GetAttributesFromNTSCSettings(0x70);
 869   1              SetPanelHueReg( (ReadDecoder(0x70) & 0xc0) | (rdata & 0x3f) );
 870   1      
 871   1              rdata = GetAttributesFromNTSCSettings(0x71);
 872   1              SetPanelContrastReg(RED,  rdata);
 873   1      
 874   1              rdata = GetAttributesFromNTSCSettings(0x72);
 875   1              SetPanelContrastReg(GREEN,rdata);
 876   1      
 877   1              rdata = GetAttributesFromNTSCSettings(0x73);
 878   1              SetPanelContrastReg(BLUE, rdata);
 879   1      
 880   1              rdata = GetAttributesFromNTSCSettings(0x74);
 881   1              SetPanelBrightnessReg(RED,  rdata);
 882   1      
 883   1              rdata = GetAttributesFromNTSCSettings(0x75);
 884   1              SetPanelBrightnessReg(GREEN,rdata);
 885   1      
 886   1              rdata = GetAttributesFromNTSCSettings(0x76);
 887   1              SetPanelBrightnessReg(BLUE, rdata);
 888   1      
 889   1              //rdata = GetAttributesFromNTSCSettings(0x77);
 890   1              //SetPanelSharpnessReg( rdata );
 891   1      
 892   1              SelectPanelAttrRegGroup(GROUP_YCbCr);
 893   1              SetPanelSaturationReg(U_SAT, 0x80);
 894   1              SetPanelSaturationReg(V_SAT, 0x80);
 895   1              //SelectPanelAttrRegGroup(GROUP_RGB);
 896   1      
 897   1      }
 898          
 899          #ifdef SUPPORT_PC
 900          
 901          //=============================================================================
 902          //                          Invert Polarity Functions
 903          //=============================================================================
 904          void InvertHSYNCPolarity(void)
 905          {
 906   1              BYTE val;
 907   1      
 908   1              val = ReadDecoder(0x40);
 909   1              if( val & 0x04 ) {
 910   2                      val &= 0xfb;
 911   2      
 912   2                      #ifdef DEBUG_PC
                              dPuts("\r\nInvert H Pol: N->P ");
                              #endif
 915   2      
 916   2              }
 917   1              else {
 918   2                      val |= 0x04;
 919   2                      
 920   2                      #ifdef DEBUG_PC
                              dPuts("\r\nInvert H Pol: P->N ");
                              #endif
 923   2      
C51 COMPILER V7.50   TW88                                                                  08/20/2007 10:23:35 PAGE 16  

 924   2              }

⌨️ 快捷键说明

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