📄 t101_util.lst
字号:
575 2
576 2 #ifdef T515
case Scale1_1:
#ifdef KVGA
if(m_cStandard)
I2CWriteByte(TW101+4,0x2E,0x8A); //0x82); //setup video decoder h start == 130
else
I2CWriteByte(TW101+4,0x2E,0x84); //0x82); //setup video decoder h start == 130
#endif
#ifdef WVGA
I2CWriteByte(TW101+4,0x2E,0x88); //0x82); //setup video decoder h start == 130
#endif
#ifdef WXGA
#ifdef AU_12
I2CWriteByte(TW101+4,0x2E,0x94);//Kuo 0x88 0x94
#else
I2CWriteByte(TW101+4,0x2E,0x76);
#endif
#endif
#ifdef AU_12
I2CWriteByte(TW101+4,0x2F,0x3a); //0x50); //Setup video decoder h active 720
#else
I2CWriteByte(TW101+4,0x2F,0x50); //0x50); //Setup video decoder h active 720 玡狠
#endif
// I2CWriteByte(TW101+4,0x30, 0x24); //setup video decoder v start
// I2CWriteByte(TW101+4,0x31, 0x61); //Setup video decoder v active 480
if(!m_cStandard)
{
m_wVRes=240-2*DELAY_LINES;
#ifdef AU_12
m_wHRes=698;
#endif
#ifdef KVGA
C51 COMPILER V7.06 T101_UTIL 06/16/2005 10:05:39 PAGE 11
m_wVRes=240; //ruby 2004-08-18
Hcut=10;
m_wHRes=720-2*Hcut;
#else
m_wHRes=706;
#endif
}
else
{
m_wVRes=240;
#ifdef AU_12
m_wHRes=698;
#endif
#ifdef KVGA
m_wVRes=280; //ruby 2004-08-18
Hcut=10;
m_wHRes=720-2*Hcut;
#else
m_wHRes=704;
#endif
}
I2CWriteByte(TW101,0xDC, (m_wHRes));//Kuo
I2CWriteByte(TW101,0xDD, (m_wHRes)>>8);
// if(!m_cStandard)
I2CWriteByte(TW101,0xDE, ((V_Size)&0xFF));
// else
// I2CWriteByte(TW101,0xDE, ((MV_Size)&0xff));
I2CWriteByte(TW101,0xDF, (V_Size>>8));
#ifdef T100
I2CWriteByte(TW101,0x30,0x8b);
I2CWriteByte(TW101,0x40,Hcut); //Ruby 2004-08-23 0x00);
I2CWriteByte(TW101,0x70,0x90);
#endif
I2CWriteByte(TW101,0xB2, 0x23);
break;
#endif
660 2 }
661 1 I2CWriteByte(TW101,0x54,m_wHRes);
662 1 I2CWriteByte(TW101,0x55,m_wHRes>>8);
663 1 I2CWriteByte(TW101,0x56,m_wVRes);
664 1 I2CWriteByte(TW101,0x57,m_wVRes>>8);
665 1 SetNTSC_PAL();
666 1 #ifdef T515
if((m_cScaleratio== Scale1_1)&&((m_cSource&0x0F)>=isrc_T515_CVIDEO1))
I2CWriteByte(TW101,0xB2, 0x23);
#endif
670 1 return 1;
671 1 }
672
673 extern uCHAR cPAL_Dot,cNTSC_Dot;
674
C51 COMPILER V7.06 T101_UTIL 06/16/2005 10:05:39 PAGE 12
675 void SetNTSC_PAL(void)//0:NTSC
676 {
677 1 if(!m_cStandard)
678 1 {
679 2 I2CWriteByte(TW101+4,0x01, 0x0d);// 2004-10-16 0x03); //0x03
680 2 I2CWriteByte(TW101+4,0x0c, 0x8a);
681 2 I2CWriteByte(TW101+4,0x18, 0x21);
682 2 I2CWriteByte(TW101+4,0x19, 0xf0);
683 2 I2CWriteByte(TW101+4,0x1a, 0x7c);
684 2 I2CWriteByte(TW101+4,0x1b, 0x1f);
685 2
686 2 I2CWriteByte(TW101+4,0x30, 0x28);// 2004-10-16 0x24);// 0x22);//+DELAY_LINES);
687 2 I2CWriteByte(TW101+4,0x31, 0x61);
688 2 I2CWriteByte(TW101+4,0x82, 0x42);
689 2 #ifndef DISPLAY_FUNC
I2CWriteByte(TW101,0x84, 0x00);
I2CWriteByte(TW101,0x85, 0x01);
I2CWriteByte(TW101,0xb8, 0x10);
I2CWriteByte(TW101,0xb9, 0x05);
#endif
695 2 #ifdef T100
696 2 if((m_cSource&0x0F)==isrcSVIDEO)
697 2 {
698 3 I2CWriteByte(TW101+4,0x0F,0x0f); // for color bar clear 2004-10-07 01 --> color bar clear
- 0C --> player clear
699 3 }
700 2 else
701 2 {
702 3 I2CWriteByte(TW101+4,0x0F,0x0f); // for color bar clear 2004-10-07 01 --> color bar clear
- 0C --> player clear
703 3 }
704 2 #endif
705 2 }
706 1 else
707 1 {
708 2 I2CWriteByte(TW101+4,0x01,0x0c );//Color
709 2 // I2CWriteByte(TW101+4,0x01, 0x00);
710 2 I2CWriteByte(TW101+4,0x0c, 0x67);
711 2 I2CWriteByte(TW101+4,0x18, 0x2a);
712 2 I2CWriteByte(TW101+4,0x19, 0x09);
713 2 I2CWriteByte(TW101+4,0x1a, 0x8a);
714 2 I2CWriteByte(TW101+4,0x1b, 0xcb);
715 2
716 2 I2CWriteByte(TW101+4,0x30,0x2E);// 0x2a);//+DELAY_LINES);
717 2 #ifdef WVGA
I2CWriteByte(TW101+4,0x30,0x30);
#endif
720 2 I2CWriteByte(TW101+4,0x31, 0xc1);
721 2 I2CWriteByte(TW101+4,0x82, 0x52);
722 2 #ifndef DISPLAY_FUNC
I2CWriteByte(TW101,0x84, 0xff);
I2CWriteByte(TW101,0x85, 0x0f);
I2CWriteByte(TW101,0xb8, 0x10);
I2CWriteByte(TW101,0xb9, 0x06);
#endif
728 2 #ifdef T100
729 2 if((m_cSource&0x0F)==isrcSVIDEO)
730 2 {
731 3 I2CWriteByte(TW101+4,0x0F,0x0f); // for color bar clear 2004-10-07 01 --> color bar clear
- 0C --> player clear
732 3 }
733 2 else
C51 COMPILER V7.06 T101_UTIL 06/16/2005 10:05:39 PAGE 13
734 2 {
735 3 I2CWriteByte(TW101+4,0x0F,0x0f); // for color bar clear 2004-10-07 01 --> color bar clear
- 0C --> player clear
736 3 }
737 2 #endif
738 2 }
739 1 Scaling(); //??
740 1 #ifdef DISPLAY_FUNC
741 1 DisplayProcess(); //????
742 1 if(m_cStandard)
743 1 {
744 2 I2CWriteByte(TW101, 0xb8, (I2CReadByte(TW101, 0xb8)-cPAL_Dot));
745 2 }
746 1 else
747 1 {
748 2 I2CWriteByte(TW101, 0xb8, (I2CReadByte(TW101, 0xb8)-cNTSC_Dot));
749 2 }
750 1 #endif
751 1 #ifdef T515
if((m_cScaleratio== Scale1_1)&&((m_cSource&0x0F)>=isrc_T515_CVIDEO1))
{
I2CWriteByte(TW101,0xB2, 0x23);
}
#endif
757 1 }
758
759 void Scaling(void)
760 {
761 1 switch(m_cScaleratio)
762 1 {
763 2 case ScaleFULL:
764 2 //Horizontal
765 2 m_wBuff[0] = (float)m_wHRes/DWHSZ * 0x8000;
766 2
767 2 I2CWriteByte(TW101, SC_HOR_H1, (uCHAR)m_wBuff[0]);
768 2 I2CWriteByte(TW101, SC_HOR_H2, (uCHAR)(m_wBuff[0]>>8));
769 2 //Vertical
770 2 m_wBuff[0] = (float)m_wVRes/DWVSZ * 0x8000;
771 2 I2CWriteByte(TW101, SC_VER_V1, (uCHAR)m_wBuff[0]);
772 2 I2CWriteByte(TW101, SC_VER_V2, (uCHAR)(m_wBuff[0]>>8));
773 2 break;
774 2 case Scale4_3:
775 2 //Horizontal
776 2 m_wBuff[0] = (float)m_wHRes/H_Size43 * 0x8000;
777 2 I2CWriteByte(TW101, SC_HOR_H1, (uCHAR)m_wBuff[0]);
778 2 I2CWriteByte(TW101, SC_HOR_H2, (uCHAR)(m_wBuff[0]>>8));
779 2 //Vertical
780 2 m_wBuff[0] = (float)m_wVRes/DWVSZ * 0x8000;
781 2 I2CWriteByte(TW101, SC_VER_V1, (uCHAR)m_wBuff[0]);
782 2 I2CWriteByte(TW101, SC_VER_V2, (uCHAR)(m_wBuff[0]>>8));
783 2 break;
784 2 #ifdef T515
case Scale1_1:
//Horizontal
//Horizontal
m_wBuff[0] = 0x7fff;
I2CWriteByte(TW101, SC_HOR_H1, (uCHAR)m_wBuff[0]);
I2CWriteByte(TW101, SC_HOR_H2, (uCHAR)(m_wBuff[0]>>8));
//Vertical
m_wBuff[0] = (float)m_wVRes/DWVSZ * 0x8000;
I2CWriteByte(TW101, SC_VER_V1, (uCHAR)m_wBuff[0]);
C51 COMPILER V7.06 T101_UTIL 06/16/2005 10:05:39 PAGE 14
I2CWriteByte(TW101, SC_VER_V2, (uCHAR)(m_wBuff[0]>>8));
break;
#endif
798 2 }
799 1 }
800
801
802
803
804 void Set_Reslolution(void)
805 {
806 1 if(!m_cStandard)
807 1 {
808 2 I2CWriteByte(TW101+4,0x00, cSVideo&0x01);
809 2 I2CWriteByte(TW101+4,0x03, cSVideo&0x03);
810 2 #ifdef KVGA
811 2 m_wVTotal=525;
812 2 #endif
813 2 #ifdef WVGA
m_wVTotal=((525/3)*82)/27;
#endif
816 2 #ifdef WXGA
m_wVTotal=525;
#endif
819 2 }
820 1 else
821 1 {
822 2 #ifdef KVGA
823 2 m_wVTotal=625;
824 2 #endif
825 2 #ifdef WVGA
m_wVTotal=(625*45)/44;
#endif
828 2 #ifdef WXGA
m_wVTotal=625;
#endif
831 2 if(cSVideo)
832 2 {
833 3 I2CWriteByte(TW101+4,0x00, 0x33);
834 3 I2CWriteByte(TW101+4,0x03, 0x03);
835 3 }
836 2 else
837 2 {
838 3 I2CWriteByte(TW101+4,0x00, 0x32);
839 3 I2CWriteByte(TW101+4,0x03, 0x00);
840 3 }
841 2 }
842 1
843 1 }
844
845 void Detect_NTSCPAL(void)
846 {
847 1 //PAL_NTSC Changed Detect----2004.5.11
848 1 uCHAR j=0x0f;
849 1 //Kuo
850 1 m_wBuff[2]+=1;
851 1 // if(m_wBuff[2]==DETECT_TIMER)
852 1 {
853 2 m_wBuff[2]=0x00;
854 2 // for(m_cBuff[1]=0;m_cBuff[1]<1;m_cBuff[1]++)
855 2 {
856 3 //temp=I2CReadByte(TW515, 0x5c);
C51 COMPILER V7.06 T101_UTIL 06/16/2005 10:05:39 PAGE 15
857 3 #ifdef T515
if((m_cSource&0x0f) >= isrc_T515_CVIDEO1)
{
m_cBuff[0] = I2CReadByte(TW515, 0x5c);
m_cBuff[0] = m_cBuff[0]&0x04;//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -