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

📄 osd1.c

📁 Sunplus 8202S source code.
💻 C
📖 第 1 页 / 共 5 页
字号:
// initialize (3dsound)osd-printing function
//
void osd_init_ampvol(void)
{
    osd_puts("osd_init_ampvol\n");
    __osd_init();    

    // setup region 7
    region[7].osd_w = 36*4;
    region[7].osd_h = OSD_FONT_HEIGHT+5;
    osd_create_region1(&region[7], 65,  114+4+40, NULL,OSD_FORMAT_4COLOR,OSD_INTERLACED);
    
    // setup region 6
    region[6].osd_w = 36*4;
    region[6].osd_h = OSD_FONT_HEIGHT+5;
    osd_create_region1(&region[6], 65,  100+4+40, &region[7],OSD_FORMAT_4COLOR,OSD_INTERLACED);
    
    // setup region 5
    region[5].osd_w = 36*4;
    region[5].osd_h = OSD_FONT_HEIGHT+5;
    osd_create_region1(&region[5], 65,  86+4+40, &region[6],OSD_FORMAT_4COLOR,OSD_INTERLACED);
    
    // setup region 4
    region[4].osd_w = 36*4;
    region[4].osd_h = OSD_FONT_HEIGHT+5;
    osd_create_region1(&region[4], 65,  72+4+40, &region[5],OSD_FORMAT_4COLOR,OSD_INTERLACED);
    
    // setup region 3
    region[3].osd_w = 36*4;
    region[3].osd_h = OSD_FONT_HEIGHT+5;
    osd_create_region1(&region[3], 65,  58+4+40, &region[4],OSD_FORMAT_4COLOR,OSD_INTERLACED);
    
    // setup region 2
    region[2].osd_w = 36*4;
    region[2].osd_h = OSD_FONT_HEIGHT+5;
    osd_create_region1(&region[2], 65,  44+4+40, &region[3],OSD_FORMAT_4COLOR,OSD_INTERLACED);
    
    // setup region 1
    region[1].osd_w = 36*4;
    region[1].osd_h = OSD_FONT_HEIGHT+5;
    osd_create_region1(&region[1], 65,  30+4+40, &region[2],OSD_FORMAT_4COLOR,OSD_INTERLACED);
    
    // setup region 0
    header_id = SETUP_HEADER
    region[0].osd_w = 38*8;
    region[0].osd_h = 1*(OSD_FONT_HEIGHT+2);
    osd_create_region1(&region[0], 26,  16+4, &region[1], OSD_FORMAT_16COLOR, OSD_INTERLACED);//nono 2-3-11 14:03 for yuxing
    
    osd_active_regions = 8;
    osd_init__();
}
#endif//SVA_SAMPLE
*/


//zhaoyanhua add this function to set NEW osd region for NEW_STYLE SETUP. 3-7-14 17:35
#ifdef NEW_STYLE_SETUP
void    osd_init_hand_ICON_for_NTSC(void)//NTSC
{
    osd_puts("osd_init_hand_ICON\n");
    __osd_init();

   #if 0
    //region 2
    header_id = SETUP_HEADER;
    region[2].osd_w = 160;//64;//40-8;                  //35 English Characters
    region[2].osd_h = 80;//40+14;//12 lines
    osd_create_region1(&region[2], 30, 210,  NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    //SetOsdCol(2,2,0,0x1e1e1e00);//Initial color index is 0,but not transparent. zhaoyanhua 3-7-11 13:41
   // osd_tog_region(2,OSD_OFF);
    #endif
    //setup menu
    header_id = SETUP_HEADER;
    region[1].osd_w = 38*8;//22*8;                  //35 English Characters
    region[1].osd_h = 11*SETUP_BTN_HEIGHT;//9*SETUP_BTN_HEIGHT+24 ;//9*SETUP_BTN_HEIGHT;//7*SETUP_BTN_HEIGHT;//6*SETUP_BTN_HEIGHT+8;   //12 lines
    osd_create_region1(&region[1], 26/*110,115*/, 62/*50*/, NULL,OSD_FORMAT_16COLOR, OSD_INTERLACED);//60//54
    SetOsdCol(1,1,0,0x1e1e1e00);//Initial color index is 0,but not transparent. zhaoyanhua 3-7-11 13:41
    //osd_tog_region(1,OSD_OFF);

    //region 0
    header_id = SETUP_HEADER;
    region[0].osd_w = 160;//64;//40-8;                  //35 English Characters
    region[0].osd_h = 76;//40+14;//12 lines
    osd_create_region1(&region[0], 130,  24, &region[1], OSD_FORMAT_16COLOR, OSD_INTERLACED);
    SetOsdCol(0,0,0,0x1e1e1e00);//Initial color index is 0,but not transparent. zhaoyanhua 3-7-11 13:41
    osd_tog_region(0,OSD_OFF);

    osd_active_regions = 2;
    osd_init__();
//  ENABLE_OSD();
}

void    osd_init_hand_ICON_for_PAL(void)//for PAL
{
    __osd_init();

   
    //setup menu
    header_id = SETUP_HEADER;
    region[1].osd_w = 38*8;//22*8;                  //35 English Characters
//gerry for DVD disc,maybe need test,2003-12-31 18:06
//    region[1].osd_h = 13*SETUP_BTN_HEIGHT+10;//9*SETUP_BTN_HEIGHT+24 ;//9*SETUP_BTN_HEIGHT;//7*SETUP_BTN_HEIGHT;//6*SETUP_BTN_HEIGHT+8;   //12 lines
    region[1].osd_h = 11*SETUP_BTN_HEIGHT;

    osd_create_region1(&region[1], 26/*110,115*/, 78-2-2/*50*/, NULL,OSD_FORMAT_16COLOR, OSD_INTERLACED);//60//54//nono 20030804
    SetOsdCol(1,1,0,0x1e1e1e00);//Initial color index is 0,but not transparent. zhaoyanhua 3-7-11 13:41
    //osd_tog_region(1,OSD_OFF);

    //region 0
    header_id = SETUP_HEADER;
    region[0].osd_w = 160;//64;//40-8;                  //35 English Characters
    region[0].osd_h = 76;//40+14;//12 lines
    osd_create_region1(&region[0], 130,  35-5, &region[1], OSD_FORMAT_16COLOR, OSD_INTERLACED);//nono 20030804
    SetOsdCol(0,0,0,0x1e1e1e00);//Initial color index is 0,but not transparent. zhaoyanhua 3-7-11 13:41
    osd_tog_region(0,OSD_OFF);

    osd_active_regions = 2;
    osd_init__();
//  ENABLE_OSD();
}


void
osd_init_setup(void)
{
    osd_puts("osd_init_setup\n");
    __osd_init();
    
    header_id = SETUP_HEADER;
    
    region[1].osd_w = 35*8;                  //35 English Characters
    region[1].osd_h = 12*SETUP_BTN_HEIGHT;   //12 lines
    #ifdef SETUP_ADJUST_LOCATION_WHEN_PAL
    if(tv_format==MODE_PAL)                  //lizhx       2004/05/21
            osd_create_region1(&region[1], 45,  (23+22), NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    else
    #endif
    osd_create_region1(&region[1], 45,  23, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    SetOsdCol(1,1,0,0x1e1e1e00);//Initial color index is 0,but not transparent. zhaoyanhua 3-7-11 13:41
    
    region[0].osd_w = 8;                  //35 English Characters
    region[0].osd_h = 8+4;   //12 lines
     #ifdef SETUP_ADJUST_LOCATION_WHEN_PAL
    if(tv_format==MODE_PAL)                  //lizhx       2004/05/21
            osd_create_region1(&region[0], 38,  (2+22), &region[1], OSD_FORMAT_16COLOR, OSD_INTERLACED);
    else
    #endif
            osd_create_region1(&region[0], 38,  2,&region[1], OSD_FORMAT_16COLOR, OSD_INTERLACED);
    osd_tog_region(0,OSD_OFF);
    
    osd_active_regions = 2;
    ENABLE_OSD();
}


#elif defined(SOFT_MENU)//Modifed by ChenZhao on 2004-9-2 14:23 WP
void
osd_init_setup(void)
{
	UINT16 screen_h,screen_w;
    osd_puts("osd_init_setup\n");
    __osd_init();

    header_id = SETUP_HEADER;
    region[SETUP_REGION].osd_w = SETUP_REGION_WIDTH;    //35 English Characters
    region[SETUP_REGION].osd_h = SETUP_REGION_HEIGHT;   //12 lines
    if(getVPP_TVsystem())//(TV_FORMAT_PAL==tv_format)//Modifed by chenzhao on 2004-11-16 24:50   
    	{
    	screen_h=288;
		screen_w=352;
    	}
	else
		{
		screen_h=240;
		screen_w=360;//Modifed by chenzhao on 2004-11-16 24:55   
		}
    osd_create_region1(&region[SETUP_REGION],(screen_w-SETUP_REGION_WIDTH)/2,(screen_h-SETUP_REGION_HEIGHT/2)/2, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    //osd_create_region1(&region[SETUP_REGION], SETUP_REGION_X,  SETUP_REGION_Y, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
	osd_draw_rect(0,0,SETUP_REGION_WIDTH<<1,SETUP_REGION_HEIGHT,SETUP_BGCOLOR);
		osd_active_regions = 1;
		ENABLE_OSD();
	}
#else

// for supporting 16_bit OSD
#ifdef SUPPORT_16BIT_OSD
#include "OSD_16BDC.c"
#endif


void
osd_init_setup(void)
{
    osd_puts("osd_init_setup\n");
    __osd_init();

#ifdef QSI_SETUP_MENU_DESIGN//liweihua 2004-7-5 9:46
    header_id = QSI_SETUP_HEADER;
#else
    header_id = SETUP_HEADER;
#endif
#ifdef NEW_SETUP_OSD         // majinping 2002-05-02 for new setup menu
    region[0].osd_w = 37*8;                  //35 English Characters    
    region[0].osd_h = 13*SETUP_BTN_HEIGHT;   //13 lines
    #ifdef SETUP_ADJUST_LOCATION_WHEN_PAL
    if(tv_format==MODE_PAL) 
       osd_create_region1(&region[0], 30, (15+22), NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);    
    else
    #endif
    osd_create_region1(&region[0], 30, 15, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);    
#else    
    #ifdef SUPPORT_FUNCTION_MENU
    #ifdef SUPPORT_DISPLAY_MENU
    if(In_Display_Menu())
    {
      region[0].osd_w = 20*8;                 //15 English Characters
      region[0].osd_h = 10*SETUP_BTN_HEIGHT;   //9 lines
      osd_create_region1(&region[0], 38,  32, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    }
    else
    #endif
    if(full_scrn&SETUP_PLUS)
    {
      region[0].osd_w = 32*8;                 //32 English Characters
      region[0].osd_h = 6*SETUP_BTN_HEIGHT;   //5 lines
      osd_create_region1(&region[0], 38,  32, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    }
    else
    {
    #endif
    region[0].osd_w = 35*8;                  //35 English Characters
    region[0].osd_h = 12*SETUP_BTN_HEIGHT;   //12 lines
    #ifdef SETUP_ADJUST_LOCATION_WHEN_PAL
    if(tv_format==MODE_PAL)                  //lizhx       2004/05/21
       osd_create_region1(&region[0], 38,  (24+22), NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    else
    #endif
    osd_create_region1(&region[0], 38,  24, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    #ifdef SUPPORT_FUNCTION_MENU
    }
    #endif //end #ifdef SUPPORT_FUNCTION_MENU
#endif 

    osd_active_regions = 1;
    ENABLE_OSD();
}

#endif //end NEW_STYLE_SETUP

//fengjl add for bbk's new setup 3-11-10 16:57
#if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD)       
void osd_init_bbk_setup(void)  
{   
    #define SETUP_HL_COLOR      5
    
    osd_puts("osd_init_setup\n");
    __osd_init();    
   
    header_id =SETUP_HEADER;
    region[1].osd_w = 32*8;                  //33 English Characters
    region[1].osd_h = 6*SETUP_BTN_HEIGHT;   //6 lines

    osd_create_region1(&region[1], 53, 4*SETUP_BTN_HEIGHT-9, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
    //SetOsdCol(1,1,0,0x1e1e1ef0);//black zhaoyanhua add 2003-12-2 14:21 
     SetOsdCol(1,1,0,0x757575f0);
    SetOsdCol(1,1,SETUP_HL_COLOR,0xa346ffff);
    //SetOsdCol(1,1,0,0x1e1e1ecd);//Initial color index is 0,but not transparent. zhaoyanhua 3-7-11 13:41
    
    header_id =BBK_SETUP_256HEADER;
    region[0].osd_w = 32*16;                  //33 English Characters
    region[0].osd_h = 5*SETUP_BTN_HEIGHT;   //6 lines
    osd_create_region1(&region[0], 53, 1*SETUP_BTN_HEIGHT+10, &region[1], OSD_FORMAT_256COLOR, OSD_INTERLACED);
    //SetOsdCol(0,0,0,0x1e1e1ecd);
    SetOsdCol(0,0,0,0x757575f0);// black zhaoyanhua add 2003-12-2 14:20
     
    osd_active_regions = 2;
    ENABLE_OSD(); 
    osd_init__();    
    
    osd_draw_icon_bbk(4,20,0);
    osd_draw_icon_bbk(68,23,1);         
}
void osd_draw_icon_bbk(int xStart, int yStart,int index)
{
    BYTE    *icon_bbk;
    UINT32  *pTopLine, *pBtmLine;
    UINT32  iDispLoc, iIconLoc;
    int     need_gray=0;

    int     i, j, k;
    int     iFontWidth, iFontHigh;
    int     iRegionWidth = region[0].osd_w;

    osd_tog_region(0, OSD_ON);  
    
    //initialize buffer start
    pTopLine = (UINT32 *)get_osdbuf_region_ptr(0,0);   // region 0 top
    pBtmLine = (UINT32 *)get_osdbuf_region_ptr(0,1);   // region 0 bot

    iIconLoc = 0;
    
    //skip n blank line on top(in pixel)
    //for interlace mode, we will skip n/2 blank lines, for example 4/2=2
    yStart+=2;
     
    {
        UINT32 pixel4;
        UINT32 pos;
        
        iIconLoc++;        
        icon_bbk = Pic_table[index];
       // icon_bbk = get_font_entry(2, index);

        //start to process
        pos = 2;
        
        //get icon information
                
        iFontWidth  =(int) icon_bbk[0];
        iFontHigh   = (int)icon_bbk[1];
               
        for (j=0; j<iFontHigh; j++) 
        {
            int yy;
            UINT32 *pp;
            yy = (p_scan) ? yStart : yStart>>1;
            pp = (yStart&1) ? pBtmLine : pTopLine;
            
            iDispLoc = (yy*iRegionWidth*2/8) + (xStart);
            for (i=0; i<(iFontWidth/4); i++) // every 4-bytes a time, every 1-pixels a byte
            {
                pixel4=0; 
               
                for (k=0;k<4;k++)
                {                    
                    unsigned curByte = icon_bbk[++pos];
                 
                    pixel4 = pixel4 | (curByte<<8*k);    
                }
                pp[iDispLoc+i] =  pixel4;
            }
            yStart++;
        }//for icon heigh  
    }

    timeout_osd[0] = 0;
}
#endif  // end bbk's new setup

#ifdef ROLL_SHOW_SETUP

/****************************************
FUNC:  similar to osd_draw_hline_region();
       difference: write button data to BUFFER not 
                    to SCREEN
        
Creator :zhaoyanhua 
Date:    2003-8-15 15:49
****************************************/
void MoveRect2buf(int xStart, int xEnd, int yStart, unsigned color, int yLen, int r)
{
    UINT8   *buf;
    int  i, j;
    //UINT8   *pTopLine, *pBtmLine;
    int     iRegionWidth  = region[r].osd_w;
    int     iRegionHeight = region[r].osd_h;
    UINT32   iDispLoc = 0;  
    
    
     buf = (UINT8 *)(SDRAM_BASE + P_BIDIR_LUMA*1024 + yStart*iRegionWidth );
    // setup color pixel (only support 16-color here)
    color &= 0x0f;
    //ButtonC = (color | (color<<4) | (color<<8) |color<<12)| (color<<16)|(color<<20) |(color<<24) | (color<<28));
    color =(color | (color<<4));
    
    for (j = 0; j < yLen; j++ )
    { 
        iDispLoc = j * iRegionWidth  ;
        for (i = xStart/2; i< (xEnd/2); i++) //draw one line
            buf[iDispLoc + i]= color;
    }
     
}

/***************************************
FUNC: 
      write string data to BUFFER not to SCREEN

⌨️ 快捷键说明

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