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

📄 osd1.c

📁 Sunplus 8202S source code.
💻 C
📖 第 1 页 / 共 5 页
字号:
        u = (unsigned) play_icon[entry];
#endif

#ifdef OSD_FONT_COMPRESS            
    return (BYTE *)(decomp_fnTable + u);
#else
    return (BYTE *)u;
#endif
}


UINT8 *
get_osdbuf_region_ptr(int _region, int _field)
{
    UINT8 *p = get_osdbuf_baseptr();
    p = p + (region[_region].osd_header[_field] + OSD_DATA_OFFSET(region[_region].osd_format))*32;
    return  p;
}


#if SUPPORT_OSD
//
// FUNCTION
// reset_osd
//
inline void osd_disable(void)
{
    regs0->osd_en    = 0;
}

inline void osd_enable(void)
{    
#if(!defined(DVB_SETUP)||defined(SUPPORT_DVD_OSD))
    regs0->osd_en    = 1;
#endif
}


void
reset_osd()
{
    osd_disable();
    regs0->osd_tlink_addr = LINK_NULL;
    regs0->osd_blink_addr = LINK_NULL;
}


void
ENABLE_OSD(void)
{
#if(!defined(DVB_SETUP)||defined(SUPPORT_DVD_OSD))
    regs0->osd_tlink_addr  = region[0].osd_header[0];
    regs0->osd_blink_addr  = region[0].osd_header[1];
    osd_enable();
#endif
}


void
DISABLE_OSD(void)
{
    osd_disable(); 
    wait_v_blank();    //20020613 to avoid  noise when 3D_MENU  toggle .
}


void   
__osd_init(void)
{
    int i;
    osd_free = addr_vxvy(0,0);
    header_id = NORMAL_HEADER;
    DISABLE_OSD();

    // reset OSD regions information
    for (i=0;i<MAX_REGION;i++) timeout_osd[i] = 0;
    osd_active_regions = 0;
}


void
osd_init__(void)
{
    ClearOsdMsg(0);
    ENABLE_OSD();        
}

//
// FUNCTION
// osd_init_regions
// initialize OSD regions using _t_osd_hdr table
//
void 
osd_init_regions(int n, const _t_osd_hdr *hdrp)
{
    int i, j;
    void *rgnp;

    __osd_init();        

    rgnp = NULL;
    for (i=0, j=n-1; i<n; i++, j--)
    {
        header_id       = hdrp[i].header_type;
        region[j].osd_w = hdrp[i].width;
        region[j].osd_h = hdrp[i].height;
        osd_create_region1(&region[j],
                hdrp[i].x,  hdrp[i].y,
                rgnp,
                hdrp[i].format,
                hdrp[i].type
        );
        rgnp = &region[j];
    }

    osd_active_regions = n;
    osd_init__();       
}



/***************************************************************
**Function: osd_init_cardswitch()
**Description: initialize the Switch interface.
**Create: wuxiaofeng, 2003-9-01 
***************************************************************/
/*const _t_osd_hdr  osd_cardswitch[] = {
    {64*3, (OSD_FONT_HEIGHT+8)*8, 80, 72, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},       // 3
    {64*3, (OSD_FONT_HEIGHT)*2, 80, 48, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},         // 2
    {36*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},             // 1
    {38*8, OSD_FONT_HEIGHT,   26, 16+4,      SETUP_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED},    // 0
};

void osd_init_cardswitch(void)
{
    osd_puts("osd_cardswitch()\n");
    osd_init_regions( sizeof(osd_cardswitch)/sizeof(osd_cardswitch[0]), (_t_osd_hdr *)&osd_cardswitch);
}
void osd_draw_button(BYTE xStart, BYTE yStart, BYTE xLen, BYTE color, BYTE bDown, BYTE r)
{
        BYTE       buttonC;
        UINT32    xNew, yNew;
    BYTE    region;
    
        buttonC = color;
    region = r;
        xNew = xStart * 16;
        yNew = yStart * SETUP_BTN_HEIGHT+12;    
        osd_draw_region_rect(xNew, yNew, (UINT32)(xLen*16), (UINT32)(SETUP_BTN_HEIGHT), buttonC, region);    
        osd_draw_region_boarder(xNew, yNew, (UINT32)(xNew+xLen*16), (UINT32)(yNew+SETUP_BTN_HEIGHT-2), bDown, region);
}

#endif*/

#if defined(FAT_Write_UI)||defined(FILE_MODE_WRITE)//sunzhh 20041120
const   _t_osd_hdr osd_MediaswitchGUI[] = {
#ifdef DISP_REGION_BOTTOM
    {360, OSD_FONT_HEIGHT+8 , 10, 216, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED},    // 8 for cdrom display region
#endif
    #ifdef CARD_SETUP_TYPE_3 
    {64*2, (OSD_FONT_HEIGHT+8)*9, 50+65, 40, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},     // 3      
    #else
    {64*2, (OSD_FONT_HEIGHT+8)*9, 50+65, 25, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},     // 3
    #endif
    {64*3, (OSD_FONT_HEIGHT)*2,   80,    48, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},     // 2
    {36*4, OSD_FONT_HEIGHT,       32,    34, NORMAL_HEADER,OSD_FORMAT_4COLOR,   OSD_INTERLACED},     // 1
#ifndef OSD_BMP_DISPLAY
    {38*8, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#else
    {360, OSD_FONT_HEIGHT+8 , 0, 20, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#endif//OSD_BMP
};
void osd_init_MediaswitchGUI(void)
{
#ifdef OSDISP                     //2004/10/21 wjzhang , sphe1000B(stb-dvd): turn off the osd display in romcode
	return ;
#endif
    osd_puts("osd_init_key\n");
    osd_init_regions( sizeof(osd_MediaswitchGUI)/sizeof(osd_MediaswitchGUI[0]), (_t_osd_hdr *)&osd_MediaswitchGUI);
}
#endif//#if defined(FAT_Write_UI)//sunzhh 20041120

#if defined(CF_CARD_WRITE)||defined(FAT_Write_UI)||defined(FILE_MODE_WRITE)//liweihua add 2003-10-30 9:15
const   _t_osd_hdr osd_periphGUI[] = {
#ifdef DISP_REGION_BOTTOM
    {360, OSD_FONT_HEIGHT+8 , 10, 216, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED},    // 8 for cdrom display region
#endif
    {64*4, (OSD_FONT_HEIGHT+8)*9, 50, 72, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},       // 3
    {64*3, (OSD_FONT_HEIGHT)*2, 80, 48, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},         // 2
    {36*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},             // 1
#ifndef OSD_BMP_DISPLAY
    {38*8, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#else
    {360, OSD_FONT_HEIGHT+8 , 0, 20, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#endif//OSD_BMP
};
void osd_init_periphGUI(void)
{
    osd_puts("osd_init_key\n");
    osd_init_regions( sizeof(osd_periphGUI)/sizeof(osd_periphGUI[0]), (_t_osd_hdr *)&osd_periphGUI);
}
#endif
#ifdef SUPPORT_OSDID3//liweihua 2003-12-28
const   _t_osd_hdr osd_OSDID3[] = {
#ifdef DISP_REGION_BOTTOM
    {360, OSD_FONT_HEIGHT+8 , 10, 216, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED},    // 8 for cdrom display region
#endif
    {38*8, OSD_FONT_HEIGHT*5, 26, 134, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},  // 3//liweihua mod 2004-1-14 10:26
    {36*4, OSD_FONT_HEIGHT, 32, 46, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 2
    {36*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 1
#ifndef OSD_BMP_DISPLAY
    {38*8, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#else
    {360, OSD_FONT_HEIGHT+8 , 0, 20, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#endif//OSD_BMP
};
void osd_init_OSDID3(void)
{
    osd_puts("osd_init_key\n");
    osd_init_regions( sizeof(osd_OSDID3)/sizeof(osd_OSDID3[0]), (_t_osd_hdr *)&osd_OSDID3);
    SetOsdCol(3,3,0,__palette4F(85,125, 0, 0x80));
    SetOsdCol(3,3,2,__palette4F(255, 132, 255, 0xff));

}
#endif
#ifdef SWITCH_CD_CARD_USB //liweihua mod 2004-6-8 14:45
const   _t_osd_hdr osd_switchGUI[] = {
#ifdef DISP_REGION_BOTTOM
    {360, OSD_FONT_HEIGHT+8 , 10, 216, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED},    // 8 for cdrom display region
#endif
    {64*2, (OSD_FONT_HEIGHT+8)*9, 50+65, 72, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},    // 3
    {64*3, (OSD_FONT_HEIGHT)*2, 80, 48, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},         // 2
    {36*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},             // 1
#ifndef OSD_BMP_DISPLAY
    {38*8, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#else
    {360, OSD_FONT_HEIGHT+8 , 0, 20, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#endif//OSD_BMP_DISPLAY
};
void osd_init_switchGUI(void)
{
    osd_puts("osd_init_key\n");
    osd_init_regions( sizeof(osd_switchGUI)/sizeof(osd_switchGUI[0]), (_t_osd_hdr *)&osd_switchGUI);
}
#endif
//suqiaoli add 2004-3-17
// 2004/09/03 yltseng
#ifdef SUPPORT_OSDSRT
    #ifndef SDRAM_16Mb_Mode
        const   _t_osd_hdr osd_OSDSRT[] = {
#ifdef DISP_REGION_BOTTOM
    {360, OSD_FONT_HEIGHT+8 , 10, 216, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED},    // last region for cdrom display region
#endif
            {38*8, (OSD_FONT_HEIGHT+10)*7, 26, 102, SETUP_HEADER, OSD_FORMAT_16COLOR,   OSD_INTERLACED},    // 3
#ifdef OSD_BMP_REGION1
    {36*4, OSD_FONT_HEIGHT, 32, 56, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},              // 2
    {40*4, OSD_FONT_HEIGHT + 8 , 0, 37, BMP_REGION1_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 1
#else
    {36*4, OSD_FONT_HEIGHT, 32, 56, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},              // 2
            {36*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},             // 1
#endif
#ifndef OSD_BMP_DISPLAY
            {38*8, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}              // 0
#else
    {360, OSD_FONT_HEIGHT+8 , 0, 20, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#endif
        };
    #else
        const   _t_osd_hdr osd_OSDSRT[] = {

            {38*8, OSD_FONT_HEIGHT*2, 26, 182, SETUP_HEADER,  OSD_FORMAT_16COLOR,   OSD_INTERLACED},       // 3
            {36*4, OSD_FONT_HEIGHT,   32, 46,  SETUP_HEADER,  OSD_FORMAT_16COLOR,  OSD_INTERLACED},             // 2
            {18*4, OSD_FONT_HEIGHT,   32, 34,  NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},             // 1
        #ifdef  NEW_DISPLAY_GOTO_OSD
            {16*4, OSD_FONT_HEIGHT,   26, 20,  SETUP_HEADER,  OSD_FORMAT_4COLOR,  OSD_NONINTERLACED}           // 0
            // 0 Temporarily set the last para as non-interlace. wuxiaofeng 2004-06-02
        #else
            {38*4, OSD_FONT_HEIGHT,   26, 20,  SETUP_HEADER,  OSD_FORMAT_4COLOR,  OSD_INTERLACED}              // 0
        #endif
        };
    #endif
void osd_init_OSDSRT(void)
{
    if( (full_scrn==0)||(full_scrn&GOTO)||(full_scrn&MARK)||(full_scrn&SCORE)////nono 4-7-26 10:37;
        ||(full_scrn&PROGRAM) ||(full_scrn&SOUND))//feeling 05-01-06
#if defined(DISP_REGION_BOTTOM) && defined(SUPPORT_FILE_SYSTEM_MODE)
	if(IsOtherStatePlayMode())
#endif
    {
    osd_puts("osd_init_key\n");
    osd_init_regions( sizeof(osd_OSDSRT)/sizeof(osd_OSDSRT[0]), (_t_osd_hdr *)&osd_OSDSRT);
   
    SetOsdCol(3,3,0,__palette4F(30,30, 30, 0));//background color is transparent
    SetOsdCol(3,3,2,__palette4F(255, 132, 255, 0xff));//font color is near to white
    }
}
#endif
//
// FUNCTION
// osd_init()
//
#ifndef SDRAM_16Mb_Mode
const   _t_osd_hdr osd_hdr_0[] = {
#if defined(LARGE_SCORES_DISPLAY)//&& defined(GBM_DVD)
    {24*4, (OSD_FONT_HEIGHT)*6, 120, 80, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},     // 3
#endif

#ifdef DIV_GOTO_DISPLAY    
    {36*5+16, OSD_FONT_HEIGHT+6, 32, 46, SETUP_HEADER, OSD_FORMAT_16COLOR,  OSD_INTERLACED},     // 2//{36*4, OSD_FONT_HEIGHT*2, 32, 46+6, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 2
#else
#ifdef SUPPORT_GPIO_P_SCAN
     {36*3, OSD_FONT_HEIGHT, 80, 46+OSD_FONT_HEIGHT+12+64+24+12, SETUP_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 7
    {36*3, OSD_FONT_HEIGHT, 80, 46+OSD_FONT_HEIGHT+12+64+24, SETUP_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 6
    {36*3, OSD_FONT_HEIGHT, 80, 46+OSD_FONT_HEIGHT+64+24, SETUP_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 5
    {36*3, OSD_FONT_HEIGHT, 80, 46+OSD_FONT_HEIGHT+12+64, SETUP_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 4
    {36*3, OSD_FONT_HEIGHT, 80, 46+OSD_FONT_HEIGHT+64, SETUP_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 3
#endif //#ifdef SUPPORT_GPIO_P_SCAN
    //{36*4, OSD_FONT_HEIGHT, 32, 46, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 2     //mark by liudan,2004-11-16 14:38
#endif//DIV_GOTO_DISPLAY   
#ifdef DISP_REGION_BOTTOM
    {360, OSD_FONT_HEIGHT + 8 , 10, 216, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED},      // 3 for cdrom display
#ifdef SUPPORT_MP4
    {38*8, OSD_FONT_HEIGHT * 6, 26, 134,    SETUP_HEADER,   OSD_FORMAT_16COLOR, OSD_NONINTERLACED},    // 3 for mp4 subtitle
#endif
    {36*4, OSD_FONT_HEIGHT + 8, 0, 56, BMP_REGION1_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 2     //liudan add it,2004-11-17 11:07

#else    
    {36*4, OSD_FONT_HEIGHT, 32, 46, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 2     //liudan add it,2004-11-17 11:07
#endif

#ifdef OSD_BMP_REGION1//libing modify 36*4=>>40*4  2004-11-26 21:19
    {40*4, OSD_FONT_HEIGHT + 8 , 0, 37, BMP_REGION1_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 1
#else
    {36*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 1
#endif

#ifndef OSD_BMP_DISPLAY
    {38*8, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#else
    {360, OSD_FONT_HEIGHT+8 , 0, 20, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#endif//OSD_BMP
};
#else
// 16Mb small-memory mode
const   _t_osd_hdr osd_hdr_0[] = {
    // 2004/11/26 yltseng add region2, in order to show ANGLE
    {4*4, OSD_FONT_HEIGHT, 32, 46, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},      // 2
    {18*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR,  OSD_INTERLACED},     // 1
#ifdef  NEW_DISPLAY_GOTO_OSD
    {16*4, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER,  OSD_FORMAT_4COLOR,  OSD_NONINTERLACED}      // 
    // 0 Temporarily set the last para as non-interlace. wuxiaofeng 2004-06-02
#else
    {38*4, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER,  OSD_FORMAT_4COLOR,  OSD_INTERLACED}      // 0
#endif
};
#endif


void    osd_init(void)
{
    osd_puts("osd_init()\n");
    osd_init_regions( sizeof(osd_hdr_0)/sizeof(osd_hdr_0[0]), (_t_osd_hdr *)&osd_hdr_0);

#ifdef DIV_GOTO_DISPLAY//zhaoyanhua add 03-10-22 13:17
    SetOsdCol(2,2,0,0x1e1e1e00);//region 2 transent.
    SetOsdCol(2,2,10,0x32323290);//REGION2 10 is black. Be same with REIGON1 black color.
    #ifdef NINTAUS_OSD_STR    //2004-2-17 01:31张宇M
    SetOsdCol(2,2,7,0xffffffff);
    #else
    SetOsdCol(2,2,7, 0xa22c8eff);//REGION2 7 is yellow. Be same with REGION1 yellow color. zhaoyanhua add 2003-12-24 11:07
    #endif//SetOsdCol(2,2,7,0x1e1e1ea0);
#endif//end DIV_GOTO_DISPLAY
}


#ifdef  RECORD_KEY//zhaoyanhua add 
const   _t_osd_hdr osd_hdr_record[] = {
#ifdef DISP_REGION_BOTTOM
    {360, OSD_FONT_HEIGHT+8 , 10, 216, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED},    // 8 for cdrom display region
#endif

#ifndef OSD_BMP_DISPLAY
    {38*8, OSD_FONT_HEIGHT*4, 26, 20, SETUP_HEADER,  OSD_FORMAT_16COLOR,  OSD_INTERLACED}      // 0
#else
    {360, OSD_FONT_HEIGHT+8 , 0, 20, BMP_DISPLAY_HEADER,  OSD_FORMAT_16COLOR, OSD_INTERLACED}      // 0
#endif//OSD_BMP
};

⌨️ 快捷键说明

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