📄 exper.lst
字号:
620 1 }
621 /*
622 void CloseAllOSDWindow()
623 {
624 uchar i;
625 for(i=0;i<4;i++)
626 {
627 CloseOSDWindow(i);
628 }
629 }*/
630 void InitOSD()
631 {
632 1 switch(Freqflag)
633 1 {
634 2 case 1:
635 2 //Initmoudletest31();
636 2 InitOSD31();
637 2 break;
638 2 case 2:
639 2 //Initmoudletest47();
640 2 InitOSD47();
641 2 break;
642 2 case 3:
643 2 //Initmoudletest63();
644 2 InitOSD63();
645 2 break;
646 2 case 4:
647 2 //Initmoudletest95();
648 2 InitOSD95();
649 2 break;
650 2 }
651 1 }
652 void InitOSD63()
653 {
654 1 uchar i;
655 1 uchar buf[4];
656 1
657 1 SendOSDCmd(15,16,0); //Defint the row to row spacing
658 1 ClearOSD();
659 1 VertPosition=85;
660 1 HorrPosition=42;
661 1 ChHeight=0x30;
662 1 SendOSDCmd(15,12,VertPosition);
663 1 SendOSDCmd(15,13,HorrPosition);
664 1 SendOSDCmd(15,14,ChHeight);
665 1 SendOSDCmd(15,15,HORRAddDec);
666 1 SendOSDCmd(15,18,0x4c|VCOAddDec);//0x4c--Select 12*18 font size and accept positive Hsync or
667 1 // Vsync input
668 1 SendOSDCmd(15,19,0); //Define the color of bordering or shadowing on characters
669 1 SendOSDCmd(15,20,0x0); //Define the self-test pattern polarity
670 1 SendOSDCmd(15,21,0); //Determine the shadow width of windows
671 1 SendOSDCmd(15,22,0); //Determine the shadow height of windows
C51 COMPILER V7.06 EXPER 06/08/2006 15:01:13 PAGE 12
672 1
673 1 buf[0]=0x7a;
674 1 buf[2]=30; // column
675 1 buf[3]=0x10; //Select background color bits and no double size of characters
676 1 for(i=0;i<=14;i++) // row value(0-14
677 1 { //
678 2 buf[1]= ( 0x80 | i ); //
679 2 SendIIC(buf,4); //
680 2 } // Row Attribute
681 1 for(i=0;i<4;i++)
682 1 CloseOSDWindow(i);
683 1 }
684 void InitOSD31()
685 {
686 1 uchar i;
687 1 uchar buf[4];
688 1
689 1 SendOSDCmd(15,16,0); //Defint the row to row spacing
690 1 ClearOSD();
691 1 VertPosition=36;
692 1 HorrPosition=45;
693 1 ChHeight=0x05;
694 1 SendOSDCmd(15,12,VertPosition);
695 1 SendOSDCmd(15,13,HorrPosition);
696 1 SendOSDCmd(15,14,ChHeight);
697 1 SendOSDCmd(15,15,HORRAddDec);
698 1 SendOSDCmd(15,18,0x4c|VCOAddDec);//0x4c--Select 12*18 font size and accept positive Hsync or
699 1 // Vsync input
700 1 SendOSDCmd(15,19,0); //Define the color of bordering or shadowing on characters
701 1 SendOSDCmd(15,20,0x0); //Define the self-test pattern polarity
702 1 SendOSDCmd(15,21,0); //Determine the shadow width of windows
703 1 SendOSDCmd(15,22,0); //Determine the shadow height of windows
704 1
705 1 buf[0]=0x7a;
706 1 buf[2]=30; // column
707 1 buf[3]=0x10; //Select background color bits and no double size of characters
708 1 for(i=0;i<=14;i++) // row value(0-14
709 1 { //
710 2 buf[1]= ( 0x80 | i ); //
711 2 SendIIC(buf,4); //
712 2 } // Row Attribute
713 1 for(i=0;i<4;i++)
714 1 CloseOSDWindow(i);
715 1 }
716 void InitOSD47()
717 {
718 1 uchar i;
719 1 uchar buf[4];
720 1
721 1 SendOSDCmd(15,16,0); //Defint the row to row spacing
722 1 ClearOSD();
723 1 VertPosition=55;
724 1 HorrPosition=44;
725 1 ChHeight=0x30;
726 1 SendOSDCmd(15,12,VertPosition);
727 1 SendOSDCmd(15,13,HorrPosition);
728 1 SendOSDCmd(15,14,ChHeight);
729 1 SendOSDCmd(15,15,HORRAddDec);
730 1 SendOSDCmd(15,18,0x4c|VCOAddDec);//0x4c--Select 12*18 font size and accept positive Hsync or
731 1 // Vsync input
732 1 SendOSDCmd(15,19,0); //Define the color of bordering or shadowing on characters
733 1 SendOSDCmd(15,20,0x0); //Define the self-test pattern polarity
C51 COMPILER V7.06 EXPER 06/08/2006 15:01:13 PAGE 13
734 1 SendOSDCmd(15,21,0); //Determine the shadow width of windows
735 1 SendOSDCmd(15,22,0); //Determine the shadow height of windows
736 1
737 1 buf[0]=0x7a;
738 1 buf[2]=30; // column
739 1 buf[3]=0x10; //Select background color bits and no double size of characters
740 1 for(i=0;i<=14;i++) // row value(0-14
741 1 { //
742 2 buf[1]= ( 0x80 | i ); //
743 2 SendIIC(buf,4); //
744 2 } // Row Attribute
745 1 for(i=0;i<4;i++)
746 1 CloseOSDWindow(i);
747 1 }
748 void InitOSD95()
749 {
750 1 uchar i;
751 1 uchar buf[4];
752 1
753 1 SendOSDCmd(15,16,0); //Defint the row to row spacing
754 1 ClearOSD();
755 1 VertPosition=95;
756 1 HorrPosition=42;
757 1 ChHeight=0x30;
758 1 SendOSDCmd(15,12,VertPosition);
759 1 SendOSDCmd(15,13,HorrPosition);
760 1 SendOSDCmd(15,14,ChHeight);
761 1 SendOSDCmd(15,15,HORRAddDec);
762 1 SendOSDCmd(15,18,0x4c|VCOAddDec);//0x4c--Select 12*18 font size and accept positive Hsync or
763 1 // Vsync input
764 1 SendOSDCmd(15,19,0); //Define the color of bordering or shadowing on characters
765 1 SendOSDCmd(15,20,0x0); //Define the self-test pattern polarity
766 1 SendOSDCmd(15,21,0); //Determine the shadow width of windows
767 1 SendOSDCmd(15,22,0); //Determine the shadow height of windows
768 1
769 1 buf[0]=0x7a;
770 1 buf[2]=30; // column
771 1 buf[3]=0x10; //Select background color bits and no double size of characters
772 1 for(i=0;i<=14;i++) // row value(0-14
773 1 { //
774 2 buf[1]= ( 0x80 | i ); //
775 2 SendIIC(buf,4); //
776 2 } // Row Attribute
777 1 for(i=0;i<4;i++)
778 1 CloseOSDWindow(i);
779 1 }
780
781 // Turn On/OFF OSD, status==0: off, status==1: on
782 void TurnOSD(bit status)
783 {
784 1 OSD_C17 &=0x80;
785 1 OSD_C17 |= ( ( (uchar ) status ) <<7 ) ;
786 1 OSD_C17 |= 0x40;
787 1 OSD_C17 |= 0x20;
788 1 //OSD_C17 |=0x78;
789 1 SendOSDCmd(15,17,OSD_C17);
790 1 OSD_status=status;
791 1 }
792
793 // Clear all RAM data, attribute and close all windows
794 void ClearOSD()
795 {
C51 COMPILER V7.06 EXPER 06/08/2006 15:01:13 PAGE 14
796 1 uchar i;
797 1 bit j;
798 1
799 1 for(i=0;i<4;i++)
800 1 CloseOSDWindow(i);
801 1
802 1 j=OSD_status;
803 1
804 1 SendOSDCmd(15,17,2); //Set RAMCLR
805 1 delay(1);
806 1 SendOSDCmd(15,17,0);
807 1
808 1 TurnOSD(j);
809 1 gotoxy(0,0);
810 1
811 1 }
812
813 // Set virtual cursor location to ( x,y )
814 void gotoxy(uchar x, uchar y)
815 {
816 1 CursorX=x; //column
817 1 CursorY=y; //row
818 1 }
819 /*
820 // Put a byte in hex onto OSD screen
821 void PutHex(uchar da, uchar color)
822 {
823 uchar buf[3];
824
825 buf[2]=0;
826 buf[0]=( (da>>4) & 0x0f ) + 0x30;
827 buf[1]=( da&0x0f ) +0x30;
828 if( buf[0]>0x39 )
829 buf[0]+=7;
830 if( buf[1]>0x39 )
831 buf[1]+=7;
832 print(buf,color);
833 }
834 */
835
836 void Putuserchar(uchar da, uchar color)
837 {
838 1 if (da<252)
839 1 PutChar(da,color);
840 1 else
841 1 PutPage2Char(da-148,color);
842 1
843 1 }
844
845
846 // Put a char in hex onto OSD screen
847 void PutChar(uchar da, uchar color)
848 {
849 1 uchar buf[4];
850 1 buf[0]=0x7a;
851 1 buf[1]=CursorY|0x80;
852 1 buf[2]=CursorX;
853 1 buf[3]=da;
854 1 SendIIC(buf,4);
855 1
856 1 buf[1]|=0xa0;
857 1 buf[3]=color;
C51 COMPILER V7.06 EXPER 06/08/2006 15:01:13 PAGE 15
858 1 SendIIC(buf,4);
859 1
860 1 CursorX++;
861 1 if(CursorX>29)
862 1 {
863 2 CursorX=0;
864 2 CursorY++;
865 2 }
866 1 if(CursorY>14)
867 1 CursorY=0;
868 1
869 1
870 1 }
871 void PutCharVert(uchar da, uchar color)
872 {
873 1 uchar buf[4];
874 1 buf[0]=0x7a;
875 1 buf[1]=CursorY|0x80;
876 1 buf[2]=CursorX;
877 1 buf[3]=da;
878 1 SendIIC(buf,4);
879 1
880 1 buf[1]|=0xa0;
881 1 buf[3]=color;
882 1 SendIIC(buf,4);
883 1
884 1 CursorY++;
885 1 if(CursorY>14)
886 1 {
887 2 CursorY=0;
888 2 CursorX++;
889 2 }
890 1 if(CursorX>29)
891 1 CursorX=0;
892 1 }
893 /*
894 // Print a string stored in string[], with attribute
895 void print(uchar *string, uchar attribute)
896 {
897 uchar i=0;
898 uchar buf[4];
899 buf[0]=0x7a;
900 while(string[i]!=0)
901 {
902 if( string[i] =='\n')
903 {
904 CursorX=0;
905 CursorY++;
906 if(CursorY>14)
907 CursorY=14;
908 }
909 else
910 {
911 buf[1]=CursorY|0x80;
912 buf[2]=CursorX;
913 buf[3]=string[i];
914 SendIIC(buf,4);
915 buf[1]|=0xa0;
916 buf[3]=attribute;
917 SendIIC(buf,4);
918 CursorX++;
919 if(CursorX>29)
C51 COMPILER V7.06 EXPER 06/08/2006 15:01:13 PAGE 16
920 {
921 CursorX=0;
922 CursorY++;
923 }
924 if(CursorY>14)
925 CursorY=0;
926 }
927 i++;
928 }
929 } */
930 /*
931 uchar WaitDDC1Header()
932 {
933 uchar i;
934 int j;
935 XRAM[HV_INTFLG]=0xfe; //clear Vsync
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -