📄 osd1.c
字号:
/*
* Function Description:
* when the disc which has been recorded is distinguished,
* before resume play ,show message.
*/
void osd_init_record()
{
osd_puts("osd_init_record()\n");
osd_init_regions( sizeof(osd_hdr_record)/sizeof(osd_hdr_record[0]), (_t_osd_hdr *)&osd_hdr_record);
//osd_draw_region_rect(0, 0, 20, 14, 6, 1);
SetOsdCol(0,0,0,0x1e1e1ef0);//3-11-21 9:25张宇P
}
#endif
//
// FUNCTION
// osd_init_prog()
//
const _t_osd_hdr osd_hdr_prog[] = {
#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
#ifdef OSD_BMP_PROG
{37*8, 20, 31, 37+7+17+6+131, BMP_REGION_F_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED}, // 5
{37*8, 262, 31, 37+7+17+6, BMP_REGION_E_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED}, // 4
{37*8, 12, 31, 37+7+17, BMP_REGION_D_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED}, // 3
{37*8, 34, 31, 37+7, BMP_REGION_B_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED}, // 2
{37*8, 14, 31, 37, BMP_REGION_A_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED}, // 1
#else
{36*4, OSD_FONT_HEIGHT+8, 32, 150+4+4+4, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 7
{36*4, OSD_FONT_HEIGHT*2, 32, 126+4+4+4, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 6
{36*4, OSD_FONT_HEIGHT*2, 32, 102+4+4+4, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 5
{36*4, OSD_FONT_HEIGHT*2, 32, 78+4+4+4, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 4
{36*4, OSD_FONT_HEIGHT*2, 32, 54+4+4+4, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 3
{36*4, OSD_FONT_HEIGHT+8, 32, 42+4+4, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 2
{5*4, OSD_FONT_HEIGHT+8, 32, 30+4, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 1
#endif
#ifdef SDRAM_16Mb_Mode//terry,2003/12/10 03:34PM
{38*4, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED} // 0
#elif defined(OSD_BMP_DISPLAY)
{360, OSD_FONT_HEIGHT+8 , 0, 20, BMP_DISPLAY_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED} // 0
#else
{38*8, OSD_FONT_HEIGHT, 26, 20, SETUP_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED} // 0
#endif//#ifdef SDRAM_16Mb_Mode
};
void osd_init_prog(void)
{
osd_puts("osd_init_prog()\n");
osd_init_regions( sizeof(osd_hdr_prog)/sizeof(osd_hdr_prog[0]), (_t_osd_hdr *)&osd_hdr_prog);
#ifdef CD_PLAYER //liweihua add 2003-9-11
if(cd_type_loaded == CDDA)
{
SetOsdCol(0,0,0,0x1e1e1e00);
SetOsdCol(0,0,5,__palette4F(128,64,255,0xff));
SetOsdCol(0,0,8,__palette4F(128,255,0,0xff));
SetOsdCol(0,0,9,__palette4F(128,255,0,0xff));
}
#endif
}
//
// FUNCTION
// osd_init_music
//
// DESCRIPTION
// initialize (3dsound)osd-printing function
//
const _t_osd_hdr osd_hdr_music[] = {
#ifdef DISP_REGION_BOTTOM
{360, OSD_FONT_HEIGHT+8 , 10, 216, BMP_DISPLAY_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED}, // 6 for cdrom display
#endif
#ifdef OSD_BMP_SOUND
{288, 20, 35, 58+7+17 +6+107, BMP_REGION_F_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 5, used as bmp sound region E
{288, 214, 35, 58+7+17 +6, BMP_REGION_E_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 4 ,used as bmp sound region D
{288, 12, 35, 58+7+17, BMP_REGION_D_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 3 ,used as bmp sound region C
{288, 34, 35, 58+7, BMP_REGION_B_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 2 ,used as bmp sound region B
{288, 14, 35, 58, BMP_REGION_A_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 1 ,used as bmp sound region A
#else//OSD_BMP_SOUND
#ifdef DYNAMIC_SPECTRUM //fengjl add 3-11-30 17:34
{29*8,(OSD_FONT_HEIGHT+8)*7,64, 110,SETUP_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 3
#else
{29*8,(OSD_FONT_HEIGHT+8)*7,64, 64+4,SETUP_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 3
#endif
#if (defined DIV_GOTO_DISPLAY) && (defined BBK_DVD) //zhaoyanhua add 2003-11-10 11:52
{36*5+16, OSD_FONT_HEIGHT+6, 32, 46, SETUP_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED}, // 2
#else
{29*8,OSD_FONT_HEIGHT+12, 64, 46+4,SETUP_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 2
#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
#endif//OSD_BMP_SOUND
#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_music(void)
{
osd_puts("osd_init_music\n");
osd_init_regions( sizeof(osd_hdr_music)/sizeof(osd_hdr_music[0]), (_t_osd_hdr *)&osd_hdr_music);
#ifdef DIV_GOTO_DISPLAY//zhaoyanhua add 03-10-22 13:17
SetOsdCol(2,2,0,0x1e1e1e00);//region 2 transent.
SetOsdCol(2,2,10,0x1e1e1ee0);
//SetOsdCol(0,0,0,0x1e1e1ea0);
#endif//end DIV_GOTO_DISPLAY
#ifdef CD_PLAYER //liweihua add 2003-9-11
if(cd_type_loaded == CDDA)
{
SetOsdCol(0,1,0,0x1e1e1e00);
SetOsdCol(1,1,3,__palette4F(128,255,0,0xff));
SetOsdCol(0,0,5,__palette4F(128,64,255,0xff));
SetOsdCol(0,0,8,__palette4F(128,255,0,0xff));
SetOsdCol(0,0,9,__palette4F(128,255,0,0xff));
}
#endif
}
#ifdef DOUBLE_TITLE //susu add 2003-8-20 14:43
const _t_osd_hdr osd_hdr_double_title[] = {
#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
{36*4*2,OSD_FONT_HEIGHT+5,32,34, SETUP_HEADER, OSD_FORMAT_16COLOR,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_double_title(void)
{
osd_puts("osd_init_double_title\n");
osd_init_regions( sizeof(osd_hdr_double_title)/sizeof(osd_hdr_double_title[0]), (_t_osd_hdr *)&osd_hdr_double_title);
}
#endif
#ifndef NES_USE_GRAPH
#ifdef OSD_PAL_RGB_16b
void CreateNesOsd(int x,int y,int w,int h,UINT16 *pPalette)
#else
void CreateNesOsd(int x,int y,int w,int h,UINT32 *pPalette)
#endif
{
osd_puts("osd_init_nes\n");
__osd_init();
header_id = NES_HEADER;
osd__pal[header_id] = pPalette;
//setup region 1
region[1].osd_w = w;
region[1].osd_h = h;
osd_create_region1(®ion[1], x, y, NULL, OSD_FORMAT_256COLOR, OSD_NONINTERLACED);
//setup region 0
region[0].osd_w = w;
region[0].osd_h = h;
osd_create_region1(®ion[0], x, y, ®ion[1], OSD_FORMAT_256COLOR, OSD_NONINTERLACED);
osd_active_regions = 2;
ENABLE_OSD();
}
#endif
#ifdef CD_PLAYER//liweihua 2003-9-3
void osd_init_cdplayer(void)
{
__osd_init();
#ifdef VIRTUAL_KEYBOARD
header_id = KEYBOARD_HEADER;
region[4].osd_w = 64*3;
region[4].osd_h = (OSD_FONT_HEIGHT+8)*6;
osd_create_region1(®ion[4], 256, 168, NULL,OSD_FORMAT_256COLOR,OSD_INTERLACED);
#endif
//setup region 2(for cd player setting)
header_id = EQ_HEADER;
region[3].osd_w = 38*4-44;
region[3].osd_h = (OSD_FONT_HEIGHT+8)*6;
osd_create_region1(®ion[3], 32+60+37, 72, ®ion[4],OSD_FORMAT_16COLOR,OSD_INTERLACED);
//region2
header_id = NORMAL_HEADER;
region[2].osd_w = 36*4;
region[2].osd_h = OSD_FONT_HEIGHT;
osd_create_region1(®ion[2], 32, 42+4, ®ion[3],OSD_FORMAT_4COLOR,OSD_INTERLACED);
// setup region 1
header_id = NORMAL_HEADER;
region[1].osd_w = 36*4;
region[1].osd_h = OSD_FONT_HEIGHT;
osd_create_region1(®ion[1], 32, 34, ®ion[2],OSD_FORMAT_4COLOR,OSD_INTERLACED);
SetOsdCol(1,1,3,__palette4F(128,255,0,0xff));
// setup region 0
header_id = SETUP_HEADER;
region[0].osd_w = 38*8;
region[0].osd_h = OSD_FONT_HEIGHT;
osd_create_region1(®ion[0], 24+2, 20, ®ion[1], OSD_FORMAT_16COLOR, OSD_INTERLACED);
SetOsdCol(0,4,0,0x1e1e1e00);
SetOsdCol(0,0,5,__palette4F(128,64,255,0xff));
SetOsdCol(0,0,8,__palette4F(128,255,0,0xff));
SetOsdCol(0,0,9,__palette4F(128,255,0,0xff));
osd_init__();
}
#endif
#ifdef VIRTUAL_KEYBOARD //liweihua add 03-8-15
const _t_osd_hdr osd_keyboard[] = {
#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*3, (OSD_FONT_HEIGHT+8)*6,256,168, KEYBOARD_HEADER, OSD_FORMAT_256COLOR,OSD_INTERLACED}, // 4
#ifdef NINTAUS_DVD //Maoyong 2004.03.11
{160, 140,256,154, KEYBOARD_HEADER, OSD_FORMAT_256COLOR,OSD_INTERLACED}, // 4//20040225
#else
{160, 140,256,168, KEYBOARD_HEADER, OSD_FORMAT_256COLOR,OSD_INTERLACED}, // 4//20040225
#endif
#ifdef CD_PLAYER
{38*4-44,(OSD_FONT_HEIGHT+8)*6,32+60+37,72, EQ_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 3
#endif
{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_keyboard(void)
{
osd_puts("osd_init_key\n");
osd_init_regions( sizeof(osd_keyboard)/sizeof(osd_keyboard[0]), (_t_osd_hdr *)&osd_keyboard);
#ifdef CD_PLAYER
SetOsdCol(4,4,0,0x1e1e1e00);
#else
SetOsdCol(3,3,0,0x1e1e1e00);
#endif
}
#endif
#ifdef PMP_UI//liweihua 204-12-28
const _t_osd_hdr osd_pmp[] = {
{38*8,(OSD_FONT_HEIGHT+8)*10,32,46, EQ_HEADER, OSD_FORMAT_16COLOR,OSD_INTERLACED}, // 3
// 2
{36*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 1
#ifndef OSD_BMP
{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_pmp(void)
{
osd_puts("osd_init_pmp\n");
osd_init_regions( sizeof(osd_pmp)/sizeof(osd_pmp[0]), (_t_osd_hdr *)&osd_pmp);
SetOsdCol(2,2,0,0x1e1e1e00);
}
#endif
#ifdef REALCOLOR_SCREENSAVER
const _t_osd_hdr osd_screensaver[] = {
{60*3, (OSD_FONT_HEIGHT+9)*6,2,2, SCREENSAVER_HEADER, OSD_FORMAT_256COLOR,OSD_INTERLACED}, // 1
};
void osd_init_screensaver(void)
{
osd_puts("osd_init_key\n");
osd_init_regions( sizeof(osd_screensaver)/sizeof(osd_screensaver[0]), (_t_osd_hdr *)&osd_screensaver);
SetOsdCol(0,0,0,0x000ff);
}
#endif
/*
* Draw BMP on osd region r with 256 colors.
* The bmp image data and platte was made by image processing software.
*/
void osd_draw_256color_bmp(int xStart, int yStart,BYTE* bmp, BYTE r)
{
//BYTE *pIcon;
UINT32 *pTopLine, *pBtmLine;
UINT32 iDispLoc;
int i, j, k;
int iFontWidth, iFontHigh;
int iRegionWidth = region[r].osd_w;
osd_tog_region(r, OSD_ON);
iRegionWidth = region[r].osd_w;
//initialize buffer start
pTopLine = (UINT32 *)get_osdbuf_region_ptr(r,0); // region r top
pBtmLine = (UINT32 *)get_osdbuf_region_ptr(r,1); // region r bot
//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;
//get Keyboard bmp information
iFontWidth = bmp[0];
iFontHigh = bmp[1];
//start to process
pos = 2;
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-pixel a byte
{
pixel4=0;
// 0x12345678 ==> 0x78563412
for (k=0;k<4;k++)
{
unsigned curByte = bmp[pos++];
pixel4 = pixel4 | (curByte<<8*k);
}
pp[iDispLoc+i] = pixel4;
}
yStart++;
}//for key heigh
timeout_osd[r] = 0;
}
#ifdef NEW_PARENTAL_GUI//zhaoyanhua add for BBK DVD 2003-11-28 10:49
const _t_osd_hdr osd_hdr_parental[] = {
// {38*8, OSD_FONT_HEIGHT*4, 32,46 , SETUP_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED} , // 2
//{36*4, OSD_FONT_HEIGHT, 32, 34, NORMAL_HEADER, OSD_FORMAT_4COLOR, OSD_INTERLACED}, // 1
{38*6, OSD_FONT_HEIGHT*6, 80, 67, SETUP_HEADER, OSD_FORMAT_16COLOR, OSD_INTERLACED} // 0
};
void osd_init_parental_gui(void)
{
osd_init_regions( sizeof(osd_hdr_parental)/sizeof(osd_hdr_parental[0]), (_t_osd_hdr *)&osd_hdr_parental);
}
#endif
/* freyman marked 2004-3-23 15:11 for no use
#ifdef SVA_SAMPLE
//
// FUNCTION
// osd_init_ampvol
//
// DESCRIPTION
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -