osd1.c
上传用户:caisangzi8
上传日期:2013-10-25
资源大小:15756k
文件大小:222k
- /*
- ** FILE
- ** osd1.c
- **
- ** DESCRIPTION
- ** control OSD interface.
- **
- ** Maintain by all
- ** History :
- ** 2003.03.10 terry , check all function on disable osd mode
- ** 2003/9/26 03:38PM, terry,define osdbuf replacement linebuf when debug mode
- ** 2003-08-29 15:18, wangfeng For new setup menu
- ** 2005-1-18 8:48, wanghaoying moved some code about OP_UI to a file in the folder "higui"
- ** Note : all functions must make the same function name to osd2.c
- **
- */
- #include "config.h"
- #include "regmap.h"
- #include "global.h"
- #include "memmap.h"
- #include "func.h"
- #include "stdlib.h"
- #include "cfont.h"
- #include "osd.h"
- #include "osdsup.h"
- #include "osdfont.h"
- #include "osd_str.h"
- #include "user_init.h"
- #include "endian.h"
- #include "user_if.h"
- #ifdef OSDISP
- #include "osd_1000isp.c"
- #else
- #include "vpp.h"//opened by liudan 2004-11-17 16:45
- #ifdef SOFT_MENU//Modifed by ChenZhao on 2004-9-6 21:47 WP
- #include "kernel.h"
- #include "setup_def.h"
- #endif//SOFT_MENU
- #ifdef NEWSTYLE_WINDOW //xiongyuyue
- #include "kernel.h"
- #include "osd_arc.h"
- #include "vpp.h"
- #elif defined(SETUP_ADJUST_LOCATION_WHEN_PAL)
- #include "kernel.h"
- #endif
- #ifdef ROLL_SHOW_SETUP //zhaoyanhua add 2003-8-18 11:42
- #include"memmap0.h"
- #endif
- #ifdef SUPPORT_REP_READ
- #include "read.h"
- #endif
- #ifdef SUPPORT_MP4
- #include "drm.h"
- #endif
- #ifdef SUPPORT_DISPLAY_MENU
- #include "setup_def.h"
- #endif
- #ifdef ALWAYS_DISPLAY_OPEN//Jack 20041008
- #include "cd.h"
- #endif
- #ifdef DVB1000_OSD_MENU
- #include "dvbmenu.h"
- #endif
- #ifndef DVDRELEASE
- //#define OSD_DBG 1
- UINT8 osdbuf[100];//terry,2003/9/26 03:37PM
- #else
- #define osdbuf linebuf
- #endif
- #define osd_puts(s) do {} while (0)
- #define osd_printf(s...) do {} while (0)
- #ifdef OSD_DBG
- #undef osd_puts
- #undef osd_printf
- #include "emuio.h"
- #include "sio.h"
- UINT8 lbuf2[128];
- #define osd_puts(s) io_write_wait(s)
- #define osd_printf(s...) do {psprintf(lbuf2, ##s); osd_puts(lbuf2);} while (0)
- #endif
- #ifdef DIV_GOTO_DISPLAY
- extern BYTE SearchPage;
- #endif
- #ifdef NEW_STYLE_SETUP
- #define SETUP_REGION 1
- #else
- #define SETUP_REGION 0
- #endif
- #if !defined(OSD_PAL_16b) || defined(OSD_16b_BUG)
- #define OSD_CLUT_SIZE 4
- #else
- #define OSD_CLUT_SIZE 2
- #endif
- #ifdef SETUP_ON_OPEN_VALID //dingzhy 12/26/2003 9:07PM
- extern BYTE OpenFlag;
- #endif
- #if defined(BBK_NEW_SETUP)&&defined(BBK_DV961_DVD) //axel 2004/1/27 04:48
- #include "icon_bbk.h"
- #endif
- #ifdef ZOOMOUT_JPEG_ROTATE_NOT_SHOW_ZOOM //Maoyong 2004.02.25 for JPEG zoomout not show zoom
- #include "jpegeffect.h"
- /*Maoyong 2004.02.25, when rotate to normal, we also can't show zoom state for a zoomout pic.
- So use old_rotate_mode to compare 'rotate_mode'
- */
- BYTE old_rotate_mode = 0;
- extern UINT16 Is_JPEG_STATE(void);
- #endif
- //#ifdef NEWSTYLE_WINDOW //xiongyuyue
- //xlluo modify for midiplayer draw menurect 04-6-11
- #if (defined(NEWSTYLE_WINDOW)|defined(SUPPORT_MIDI_MENU_SEL))
- /*
- const BYTE arc_tableLT[16][16]={
- {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1},
- {0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,2},
- {0,0,0,0,0,0,0,1,1,2,2,2,2,2,2,2},
- {0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2},
- {0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2},
- {0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2},
- {0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}
- };
- const BYTE arc_tableRT[16][16]=
- {
- {1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0},
- {2,2,2,2,1,1,1,0,0,0,0,0,0,0,0,0},
- {2,2,2,2,2,2,2,1,1,0,0,0,0,0,0,0},
- {2,2,2,2,2,2,2,2,2,1,0,0,0,0,0,0},
- {2,2,2,2,2,2,2,2,2,2,1,0,0,0,0,0},
- {2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1}
- };
- const BYTE arc_tableLB[16][16]=
- {
- {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2},
- {0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2},
- {0,0,0,0,0,1,2,2,2,2,2,2,2,2,2,2},
- {0,0,0,0,0,0,1,2,2,2,2,2,2,2,2,2},
- {0,0,0,0,0,0,0,1,1,2,2,2,2,2,2,2},
- {0,0,0,0,0,0,0,0,0,1,1,1,2,2,2,2},
- {0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1}
- };
- const BYTE arc_tableRB[16][16]=
- {
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0},
- {2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0},
- {2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0},
- {2,2,2,2,2,2,2,2,2,2,1,0,0,0,0,0},
- {2,2,2,2,2,2,2,2,2,1,0,0,0,0,0,0},
- {2,2,2,2,2,2,2,1,1,0,0,0,0,0,0,0},
- {2,2,2,2,1,1,1,0,0,0,0,0,0,0,0,0},
- {1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0}
- };
- */
- const BYTE arc_tableLT[10][10]=
- {
- {0,0,0,0,0,0,0,1,1,1},
- {0,0,0,0,0,1,1,2,2,2},
- {0,0,0,1,1,2,2,2,2,2},
- {0,0,1,2,2,2,2,2,2,2},
- {0,0,1,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2},
- };
- const BYTE arc_tableRT[10][10]=
- {
- {1,1,1,0,0,0,0,0,0,0},
- {2,2,2,1,1,0,0,0,0,0},
- {2,2,2,2,2,1,1,0,0,0},
- {2,2,2,2,2,2,2,1,0,0},
- {2,2,2,2,2,2,2,1,0,0},
- {2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,1},
- };
-
- const BYTE arc_tableLB[10][10]=
- {
- {1,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2},
- {1,2,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2},
- {0,1,2,2,2,2,2,2,2,2},
- {0,0,1,2,2,2,2,2,2,2},
- {0,0,1,2,2,2,2,2,2,2},
- {0,0,0,1,1,2,2,2,2,2},
- {0,0,0,0,0,1,1,2,2,2},
- {0,0,0,0,0,0,0,1,1,1},
- };
- const BYTE arc_tableRB[10][10]=
- {
- {2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,2,1},
- {2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,2,1,0},
- {2,2,2,2,2,2,2,1,0,0},
- {2,2,2,2,2,2,2,1,0,0},
- {2,2,2,2,2,1,1,0,0,0},
- {2,2,2,1,1,0,0,0,0,0},
- {1,1,1,0,0,0,0,0,0,0},
- };
- /*
- const BYTE arc_tableLT[6][6] = {
- {0,0,0,0,1,1},
- {0,0,1,1,2,2},
- {0,1,1,2,2,2},
- {0,1,2,2,2,2},
- {1,2,2,2,2,2},
- {1,2,2,2,2,2},
- };
- const BYTE arc_tableRT[6][6] = {
- {1,1,0,0,0,0},
- {2,2,1,1,0,0},
- {2,2,2,1,1,0},
- {2,2,2,2,1,0},
- {2,2,2,2,2,1},
- {2,2,2,2,2,1},
- };
- const BYTE arc_tableLB[6][6] = {
- {1,2,2,2,2,2},
- {1,2,2,2,2,2},
- {0,1,2,2,2,2},
- {0,1,1,2,2,2},
- {0,0,1,1,2,2},
- {0,0,0,0,1,1},
- };
- const BYTE arc_tableRB[6][6] = {
- {2,2,2,2,2,1},
- {2,2,2,2,2,1},
- {2,2,2,2,1,0},
- {2,2,2,1,1,0},
- {2,2,1,1,0,0},
- {1,1,0,0,0,0},
- }; */
- /*
- const BYTE Arrow_UP[6][6]=
- {
- {0, 0, 0, 0, 0, 0},
- {0, 0, 0, 1, 0, 0},
- {0, 0, 1, 1, 1, 0},
- {0, 1, 1, 1, 1, 1},
- {1, 1, 1, 1, 1, 1},
- {0, 0, 0, 0, 0, 0}
- };
- const BYTE Arrow_DOWN[6][6]=
- {
- {0, 0, 0, 0, 0, 0},
- {1, 1, 1, 1, 1, 1},
- {0, 1, 1, 1, 1, 1},
- {0, 0, 1, 1, 1, 0},
- {0, 0, 0, 1, 0, 0},
- {0, 0, 0, 0, 0, 0}
- };
- const BYTE Arrow_Right[10][10]=
- {
- {1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
- {1, 1, 1, 1, 1, 0, 0, 0, 0, 0},
- {1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
- {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
- {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
- {1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
- {1, 1, 1, 1, 1, 0, 0, 0, 0, 0},
- {1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
- {1, 0, 0, 0, 0, 0, 0, 0, 0, 0}
- };
- const BYTE Arrow_Left[10][10]=
- {
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
- {0, 0, 0, 0, 0, 0, 0, 1, 1, 1},
- {0, 0, 0, 0, 0, 1, 1, 1, 1, 1},
- {0, 0, 0, 1, 1, 1, 1, 1, 1, 1},
- {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
- {1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
- {0, 0, 0, 1, 1, 1, 1, 1, 1, 1},
- {0, 0, 0, 0, 0, 1, 1, 1, 1, 1},
- {0, 0, 0, 0, 0, 0, 0, 1, 1, 1},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
- };
- */
- #endif
- /************************************************************
- Data
- ************************************************************/
- #include "osd_palette.h"
- void osd_DrawLine(UINT32 xStart, UINT32 yStart, UINT32 xEnd, UINT32 yEnd, BYTE color, BYTE lineWidth);
- void osd_DrawRegionLine(UINT32 xStart, UINT32 yStart, UINT32 xEnd, UINT32 yEnd, BYTE color, BYTE lineWidth, BYTE r);
- void osd_print_region2(t_osd_region *p, const char *s0, BYTE y_start,BYTE x_start);
- void osd_draw_rect(UINT32 xStart, UINT32 yStart, UINT32 xLen, UINT32 yLen, BYTE bkColor);
- void osd_draw_region_rect(UINT32 xStart, UINT32 yStart, UINT32 xLen, UINT32 yLen, BYTE bkColor, BYTE r);
- extern UINT8 decomp_fnTable[];
- extern UINT8 osd_temp_buf[];
- //
- // get_font_entry
- //
- UINT8 *
- get_font_entry(int tbl, int entry)
- {
- unsigned u = 0;
- // Modified by yltseng. If no initial value 0, when this entry doesn't exist in all tables,
- // we will return what u contains( it may be any value ).
- // When we call this function, we need to check if the return value is NULL or not.
- if (tbl == 0)
- u = (unsigned) font_table[entry];
- else if (tbl == 1)
- u = (unsigned) font_table2[entry];
- else if (tbl == 2)
- u = (unsigned) setup_icon[entry];
- #ifdef SUPPORT_PLAYBACK_ICON
- else
- 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(®ion[j],
- hdrp[i].x, hdrp[i].y,
- rgnp,
- hdrp[i].format,
- hdrp[i].type
- );
- rgnp = ®ion[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_keyn");
- 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_keyn");
- 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_keyn");
- 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_keyn");
- 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_keyn");
- 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
- };
- /*
- * 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_musicn");
- 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_titlen");
- 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_nesn");
- __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_keyn");
- 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_pmpn");
- 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_keyn");
- 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
- // initialize (3dsound)osd-printing function
- //
- void osd_init_ampvol(void)
- {
- osd_puts("osd_init_ampvoln");
- __osd_init();
- // setup region 7
- region[7].osd_w = 36*4;
- region[7].osd_h = OSD_FONT_HEIGHT+5;
- osd_create_region1(®ion[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(®ion[6], 65, 100+4+40, ®ion[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(®ion[5], 65, 86+4+40, ®ion[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(®ion[4], 65, 72+4+40, ®ion[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(®ion[3], 65, 58+4+40, ®ion[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(®ion[2], 65, 44+4+40, ®ion[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(®ion[1], 65, 30+4+40, ®ion[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(®ion[0], 26, 16+4, ®ion[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_ICONn");
- __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(®ion[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(®ion[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(®ion[0], 130, 24, ®ion[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(®ion[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(®ion[0], 130, 35-5, ®ion[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_setupn");
- __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(®ion[1], 45, (23+22), NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
- else
- #endif
- osd_create_region1(®ion[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(®ion[0], 38, (2+22), ®ion[1], OSD_FORMAT_16COLOR, OSD_INTERLACED);
- else
- #endif
- osd_create_region1(®ion[0], 38, 2,®ion[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_setupn");
- __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(®ion[SETUP_REGION],(screen_w-SETUP_REGION_WIDTH)/2,(screen_h-SETUP_REGION_HEIGHT/2)/2, NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
- //osd_create_region1(®ion[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_setupn");
- __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(®ion[0], 30, (15+22), NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
- else
- #endif
- osd_create_region1(®ion[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(®ion[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(®ion[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(®ion[0], 38, (24+22), NULL, OSD_FORMAT_16COLOR, OSD_INTERLACED);
- else
- #endif
- osd_create_region1(®ion[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_setupn");
- __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(®ion[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(®ion[0], 53, 1*SETUP_BTN_HEIGHT+10, ®ion[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
- Creator: zhaoyanhua
- Date: 2003-8-18 11:46
- ****************************************/
- void MoveString2Buf(BYTE xStart, BYTE yStart,BYTE * str, BYTE fontColor, BYTE bkColor)
- {
- BYTE c;
- BYTE *pFont;
- UINT32 *pTopLine, *pBtmLine;
- int cc;
- UINT32 iStrLoc;
- int iRegionWidth;
- UINT32 *buf;
- cc = xStart*16;//pixels.
- iRegionWidth = region[SETUP_REGION].osd_w;
- // initialize buffer start
- //pTopLine = (UINT32 *)get_osdbuf_region_ptr(SETUP_REGION, 0);
- //pBtmLine = (UINT32 *)get_osdbuf_region_ptr(SETUP_REGION, 1);
- buf= (UINT32 *)(SDRAM_BASE + P_BIDIR_LUMA*1024 + (yStart*SETUP_BTN_HEIGHT+4)*iRegionWidth+ xStart);
- //process each charactor until string ending(' ')
- iStrLoc = 0;
- while ((c = ((BYTE *)str)[iStrLoc]) != ' ')
- {
- int i, j, k;
- int iFontWidth, iFontHigh;
- UINT32 pos;
-
-
- iStrLoc++;
-
- if (c == 'r') { //prefix characher: to use font_table2
- if ( (c = ((BYTE *)str)[iStrLoc])==' ' ) break;
- iStrLoc++;
- if ((pFont = get_font_entry(1,c))==NULL) continue;
- } else {
- //get current char entry
- pFont = get_font_entry(0,c);
- }
-
- //start to process
- pos = 2;
-
- //get font information
- iFontWidth = (int)pFont[0];
- iFontHigh = (int)pFont[1];
-
- //start this character
- for (j=0; j<iFontHigh; j++) {
- UINT32 *pp;
- int yy;
- int iDispLoc;
- yy = j;
- iDispLoc = yy*(iRegionWidth/4) + (cc/8);
-
- //draw top line
- for (i=0; i<iFontWidth/8; i++) {
- unsigned pat;
- unsigned curByte;
- UINT32 pixel8;
-
- pat = pFont[++pos];
- curByte = ((pat&0xc0)>>6) | ((pat&0x30)>>2) | ((pat&0x0c)<<2) | ((pat&0x03)<<6);
- pixel8 = 0;
- for (k=0; k<8; k++) { // for every-bit of pattern
- if ( (1<<k) & curByte ) {
- pixel8 = pixel8 | (fontColor<<(k*4));
- } else {
- pixel8 = pixel8 | (bkColor<<(k*4));
- }
- }
- //pp[iDispLoc+i] = pixel8;
- buf[iDispLoc+i] = pixel8;
- }
- }
- cc+=iFontWidth;
- }
-
- timeout_osd[SETUP_REGION] = 0;
- osd_tog_region(SETUP_REGION, OSD_ON);
- }
- extern BYTE setupItemNum[3];
- //
- // Bytes/Line = 37*16*4/8 = 296
- //
- /****************************************
- FUNC:
- draw the data to the SCREEN from
- BUFFER
-
- BUF: P_BIDIR_LUMA
- EFFECT MODE: h_window .
- INPUT:
- xStart:
- xEnd : unit is char.
-
- Creator :zhaoyanhua
- Date: 2003-8-18 11:51
- *****************************************/
- void MoveBuf2OSD(UINT16 xStart, UINT16 xEnd)
- {
- UINT32 *buf;
- UINT32 *pTopLine, *pBtmLine;
- BYTE i,step;
- UINT32 j, k;
- UINT16 ButtonHight;//one BUTTON HIGHT.
-
- osd_tog_region(SETUP_REGION, OSD_ON);
- buf = (UINT32 *)(SDRAM_BASE + P_BIDIR_LUMA*1024 );
- //buf = (UINT32 *)(osd_temp_buf);
-
- //initialize buffer start
- pTopLine = (UINT32 *)get_osdbuf_region_ptr(SETUP_REGION,0);
- pBtmLine = (UINT32 *)get_osdbuf_region_ptr(SETUP_REGION,1);
- //end=iLine;
- ButtonHight = 32;
- step=1;
- if(p_scan==0)
- {
-
- ButtonHight = 16;
- step=2;
- }
- else
- {
- ButtonHight = 32;
- step=1;
-
- }
- #if 0 //2 BUTTON cocurrently display.
- int m;
- printf("setupItemNum=%dn",setupItemNum[1]);
- for (i = 0; i<ButtonHight; i++)//for (i = 0; i<32/2; i++)
- {
- delay_1ms(10);
- for (m =0; m < (setupItemNum[1]-1); m+=2)
- {
- //NOTE:
- // xStart*16 : pixels
- // xStart*16*4 : bits, one pixel 4 bits.
- // (xStart*16*4)/8 : bytes.
- // ((xStart*16*4)/8)/4 : bytes. unit is 4 BYTES.
- for(j = ((xStart*16*4)/8)/4; j < ((xEnd*16*4)/8)/4; j++)//for(j = ((12)*16*4)/(8*4) ; j < ((12)*16*4)/(8*4)+((15)*16*4)/(8*4) ;j++)
- {// for (j=0; j<76; j++) {
-
- k = step * (m*ButtonHight +i);
- //top area
- pTopLine[76*(m*ButtonHight +i)+j] = buf[76*k + j];
- //bottom area
- pBtmLine[76*(m*ButtonHight +i)+j] = buf[76*(k+1) + j];
-
- }
- }
- }
- #endif
-
- #if 1 //1 BUTTON
- int m;
- //printf("setupItemNum=%dn",setupItemNum[1]);
-
- for (i = 0; i<ButtonHight; i++)//for (i = 0; i<32/2; i++)
- {
- delay_1ms(15);
- for (m =0; m < (setupItemNum[1]-1); m++)
- {
- //NOTE:
- // xStart*16 : pixels
- // xStart*16*4 : bits, one pixel 4 bits.
- // (xStart*16*4)/8 : bytes.
- // ((xStart*16*4)/8)/4 : bytes. unit is 4 BYTES.
- for(j = ((xStart*16*4)/8)/4; j < ((xEnd*16*4)/8)/4; j++)//for(j = ((12)*16*4)/(8*4) ; j < ((12)*16*4)/(8*4)+((15)*16*4)/(8*4) ;j++)
- {// for (j=0; j<76; j++)
- k = step * (m*ButtonHight +i);
- //top area
- pTopLine[76*(m*ButtonHight +i)+j] = buf[76*k + j];
- //bottom area
- pBtmLine[76*(m*ButtonHight +i)+j] = buf[76*(k+1) + j];
-
- }
- }
- }
- #endif
-
- #if 0//Roll display
- for (i=iStartLine; i<iEndLine; i++)
- {
- // k = 24-iLine+step*i;
- k = step*i;
- //NOTE:
- // xStart*16 : pixels
- // xStart*16*4 : bits, one pixel 4 bits.
- // (xStart*16*4)/8 : bytes.
- // ((xStart*16*4)/8)/4 : bytes. unit is 4 BYTES.
- for(j = ((xStart*16*4)/8)/4; j < ((xEnd*16*4)/8)/4; j++)
- {// for (j=0; j<76; j++) {
- //top area
- pTopLine[76*i+j] = buf[76*k + j];
- //bottom area
- pBtmLine[76*i+j] = buf[76*(k+1) + j];
-
- }
- }
- #endif
-
-
- }
- #endif
- //
- // osd_DrawString
- //
- #ifdef SOFT_MENU//Modifed by ChenZhao on 2004-9-6 10:43 WP
- void osd_DrawString(BYTE xStart, BYTE yStart, const BYTE *str, BYTE fontColor, BYTE bkColor)
- {
- osd_DrawString_ori(xStart*8, (yStart*SETUP_BUTTON_HEIGHT), str, fontColor, bkColor);
- }
- #else
- void osd_DrawString(BYTE xStart, BYTE yStart, const BYTE *str, BYTE fontColor, BYTE bkColor)
- {
- osd_DrawString_ori(xStart, (yStart*SETUP_BTN_HEIGHT), str, fontColor, bkColor);
- }
- #endif//SOFT_MENU
- #ifdef SETUPMENU_16Mb_NO_ICON
- void osd_DrawSetupIconString(BYTE xStart, BYTE yStart, const BYTE *str, BYTE fontColor, BYTE bkColor)
- {
- osd_DrawString_ori(xStart, yStart, str, fontColor, bkColor);
- }
- #endif//SETUPMENU_16Mb_NO_ICON
- #ifdef SOFT_MENU//Modifed by ChenZhao on 2004-9-6 10:43 WP
- #include"osd_SFM.c"
-
- #elif defined(USE_SMALL_FONT)
- //libing for small font 2005-1-5 20:52
- void
- osd_DrawString_ori(BYTE xStart, UINT32 yStart, const BYTE *str, BYTE fontColor, BYTE bkColor)
- {
- //libing modify it for zhe smaller font 2004-11-3 13:53
- BYTE c;
- BYTE *pFont;
- UINT16 *pTopLine, *pBtmLine;
- int cc;
- UINT32 iStrLoc;
- int iRegionWidth;
- iRegionWidth = region[SETUP_REGION].osd_w;
- pTopLine = (UINT16 *)get_osdbuf_region_ptr(SETUP_REGION, 0);
- pBtmLine = (UINT16 *)get_osdbuf_region_ptr(SETUP_REGION, 1);
- cc = xStart*16;
- iStrLoc = 0;
- while ((c = ((BYTE *)str)[iStrLoc]) != ' ')
- {
- int i, j, k;
- int iFontWidth, iFontHigh;
- UINT32 pos;
- UINT8 fourbit;
- iStrLoc++;
-
- if (c == 'r') {
- if ( (c = ((BYTE *)str)[iStrLoc])==' ' ) break;
- iStrLoc++;
- if ((pFont = get_font_entry(1,c))==NULL) continue;
- } else {
- pFont = get_font_entry(0,c);
- }
- pos = 2;
- iFontWidth = (int)pFont[0];
- iFontHigh = (int)pFont[1];
- fourbit=1;
- //if(p_scan==0) iFontHigh>>=1;
- for (j=0; j<iFontHigh; j++) {
- UINT16 *pp;
- int yy;
- int iDispLoc;
- yy = 4 + yStart + j;
- pp = (yy&1) ? pBtmLine : pTopLine;
- if (p_scan==0) yy>>=1;
- iDispLoc = yy*(iRegionWidth/2) + (cc/4);
- {
- for (i=0; i<iFontWidth/4; i++)
- {
- unsigned pat;
- unsigned curByte;
- UINT16 pixel4;
- if(fourbit)
- {
- pat = (pFont[++pos])&0xf0;
- fourbit=0;
- }
- else
- {
- pat = (pFont[pos])<<4;
- fourbit=1;
- }
- curByte = ((pat&0xc0)>>6) | ((pat&0x30)>>2);
- pixel4 = 0;//pTopLine[iDispLoc+i];
- for (k=0; k<4; k++) {
- if ((1<<k) & curByte)
- {
- pixel4 = pixel4 | (fontColor<<(k*4));
- } else {
- pixel4 = pixel4 | (bkColor<<(k*4));
- }
- }
- pp[iDispLoc+i] = pixel4;
- }
- }
- } cc+=iFontWidth;
- }
- timeout_osd[SETUP_REGION] = 0;
- osd_tog_region(SETUP_REGION, OSD_ON);
- }
-
- #else
- void
- osd_DrawString_ori(BYTE xStart, UINT32 yStart, const BYTE *str, BYTE fontColor, BYTE bkColor)
- {
- BYTE c;
- BYTE *pFont;
- UINT32 *pTopLine, *pBtmLine;
- int cc;
- UINT32 iStrLoc;
- int iRegionWidth;
- iRegionWidth = region[SETUP_REGION].osd_w;
- // initialize buffer start
- pTopLine = (UINT32 *)get_osdbuf_region_ptr(SETUP_REGION, 0);
- pBtmLine = (UINT32 *)get_osdbuf_region_ptr(SETUP_REGION, 1);
-
- // initialize start position
- cc = xStart*16; //pixels
- //process each charactor until string ending(' ')
- iStrLoc = 0;
- while ((c = ((BYTE *)str)[iStrLoc]) != ' ')
- {
- int i, j, k;
- int iFontWidth, iFontHigh;
- UINT32 pos;
-
- iStrLoc++;
-
- if (c == 'r') { //prefix characher: to use font_table2
- if ( (c = ((BYTE *)str)[iStrLoc])==' ' ) break;
- iStrLoc++;
- if ((pFont = get_font_entry(1,c))==NULL) continue;
- } else {
- //get current char entry
- pFont = get_font_entry(0,c);
- }
-
- //start to process
- pos = 2;
-
- //get font information
- iFontWidth = (int)pFont[0];
- iFontHigh = (int)pFont[1];
-
- //start this character
- for (j=0; j<iFontHigh; j++) {
- UINT32 *pp;
- int yy;
- int iDispLoc;
- // #ifdef OP_UI//liwh add 2004-3-19 16:01
- // #include "menu_def.h"
- // yy = 10 + yStart*(BUTTON_Y_DIFF) + j;
- // #else
- //yy = 4 + yStart*SETUP_BTN_HEIGHT + j;
- yy = 4 + yStart + j;
- // #endif
- //For every string line = 1 blank line(in pixel) + OSD_FONT_HEIGHT-line strings + 1 blank line
- pp = (yy&1) ? pBtmLine : pTopLine;
- if (p_scan==0) yy>>=1; // p-scan
- //in fact,iDispLoc = (yy*iRegionWidth + cc/2)/4;
- //yy*iRegionWidth + cc/2 calculate the positon as the byte.
- //iDispLoc is 32bit.so must "/4".
- //zhaoyanhua note 2003-8-14 15:35
- iDispLoc = yy*(iRegionWidth/4) + (cc/8);
-
- //draw top line
- for (i=0; i<iFontWidth/8; i++) {
- unsigned pat;
- unsigned curByte;
- UINT32 pixel8;
-
- pat = pFont[++pos];
- curByte = ((pat&0xc0)>>6) | ((pat&0x30)>>2) | ((pat&0x0c)<<2) | ((pat&0x03)<<6);
- pixel8 = 0;
- for (k=0; k<8; k++) { // for every-bit of pattern
- if ( (1<<k) & curByte ) {
- pixel8 = pixel8 | (fontColor<<(k*4));
- } else {
- pixel8 = pixel8 | (bkColor<<(k*4));
- }
- }
- pp[iDispLoc+i] = pixel8;
- }
- }
- cc+=iFontWidth;
- }
- timeout_osd[SETUP_REGION] = 0;
- osd_tog_region(SETUP_REGION, OSD_ON);
- }
- #endif /* SOFT_MENU */
- void
- osd_DrawStrings(const t_osd_str *p, BYTE fg, BYTE bg)
- {
- int i;
- for (i=0; p[i].str!=NULL; i++)
- {
- osd_DrawString(p[i].xst, p[i].yst, p[i].str, fg, bg);
- }
- }
- #ifdef OSD_STR_LINE_WRAP
- /*
- * Description:
- * Get next space position
- *
- * INPUT:
- * str: ---> string
- * iStrLoc ---> initial position to search
- *
- *
- * RETURN:
- * if Find next given letter, return its postion
- * else if not find it, it means that the string will be end.
- * so return its total strlen.
- * zhaoyanhua 2004-4-22 9:49
- */
- int FindNextLetter(const BYTE *str, int iStrLoc, BYTE c)
- {
- int i = 0;
- int lenth = strlen(str);
-
- for (i = iStrLoc; i < lenth; i++)
- {
- if (str[i] == c)
- return i;
- }
- return lenth;
- }
- #endif//#ifdef OSD_STR_LINE_WRAP
-
-
- #if defined(USE_SMALL_FONT)
- //libing for small font 2005-1-5 20:52
- void
- osd_DrawRegionString(BYTE xStart, BYTE yStart, const BYTE *str, BYTE fontColor, BYTE bkColor, BYTE r)
- {
- BYTE *pFont, c;//,div=4;
- UINT16 *pTopLine, *pBtmLine;
- UINT32 iStrLoc;
- UINT16 iDispLoc;
- int cc;
- int i, j, k;
- int iFontWidth, iFontHigh;
- int iRegionWidth = region[r].osd_w,iRegionHigh = region[r].osd_h;
- osd_tog_region(r, OSD_ON);
- pTopLine = (UINT16 *)get_osdbuf_region_ptr(r,0);
- pBtmLine = (UINT16 *)get_osdbuf_region_ptr(r,1);
- cc = xStart*16;
- iStrLoc = 0;
- while ( (c = ((BYTE *)str)[iStrLoc]) != ' ' )
- {
- BYTE curByte;
- UINT32 pos;
- int fourbit=1;
- iStrLoc++;
- if (c == 'r')
- {
- if ( (c = ((BYTE *)str)[iStrLoc])==' ' )
- break;
- iStrLoc++;
- if ((pFont = get_font_entry(1,c))==NULL) continue;
- }
- else
- {
- pFont = get_font_entry(0,c);
- }
- pos = 2;
- iFontWidth = (int)pFont[0];
- iFontHigh = (int)pFont[1];
- for (j=0; j<iFontHigh; j++) {
- UINT16 *pp;
- int yy;
- if (iFontWidth==12)
- yy = 4 + (yStart*4) + j +4;
- else
- yy = 4 + (yStart*4) + j;
- pp = (yy&1) ? pBtmLine : pTopLine;
- if (p_scan==0) yy>>=1;
- iDispLoc = yy*(iRegionWidth/2) + (cc/4);
- for (i=0; i<iFontWidth/4; i++) {
- unsigned pat;
- unsigned curByte;
- UINT16 pixel4;
- if(fourbit)
- {
- pat = (pFont[++pos])&0xf0;
- fourbit=0;
- }
- else
- {
- pat = (pFont[pos])<<4;
- fourbit=1;
- }
- curByte = ((pat&0xc0)>>6) | ((pat&0x30)>>2);
- pixel4 = 0;//pTopLine[iDispLoc+i];
- for (k=0; k<4; k++) {
- if ((1<<k) & curByte)
- {
- pixel4 = pixel4 | (fontColor<<(k*4));
- } else {
- pixel4 = pixel4 | (bkColor<<(k*4));
- }
- }
- pp[iDispLoc+i] = pixel4;
- }
- }
- cc+=iFontWidth;
- }
- timeout_osd[r] = 0;
- }
- #else
- void
- osd_DrawRegionString(BYTE xStart, BYTE yStart, const BYTE *str, BYTE fontColor, BYTE bkColor, BYTE r)
- {
- BYTE *pFont, c,div=4;
- UINT32 *pTopLine, *pBtmLine;
- UINT32 iDispLoc, iStrLoc;
- int i, j, k;
- int iFontWidth, iFontHigh;
- int iRegionWidth = region[r].osd_w;
-
- osd_tog_region(r, OSD_ON);
-
- //initialize buffer start
- pTopLine = (UINT32 *)get_osdbuf_region_ptr(r,0);
- pBtmLine = (UINT32 *)get_osdbuf_region_ptr(r,1);
-
- iStrLoc = 0;
- if(p_scan==0)
- div=8;
-
- if (p_scan==1)
- {
- #ifdef NEWSTYLE_WINDOW //xiongyuyue
- if(full_scrn&MESSAGE)
- iDispLoc = (yStart*iRegionWidth/*div*SETUP_BTN_HEIGHT*/) + (xStart);
- else
- #endif
-
- iDispLoc = (yStart*iRegionWidth/*div*SETUP_BTN_HEIGHT*/) + (xStart*16/8)+(iRegionWidth/2);
- }
- else
- {
- #ifdef NEWSTYLE_WINDOW //xiongyuyue
- if(full_scrn&MESSAGE)
- iDispLoc = (yStart*iRegionWidth/2/*div*SETUP_BTN_HEIGHT*/) + (xStart);
- else
- #endif
- iDispLoc = (yStart*iRegionWidth/2/*div*SETUP_BTN_HEIGHT*/) + (xStart*16/8);
- }
- //skip n blank line on top(in pixel)
- //for interlace mode, we will skip n/2 blank lines, for example 4/2=2
- iDispLoc += (iRegionWidth/4 * 2);
-
- //process each charactor until string ending(' ')
- while ( (c = ((BYTE *)str)[iStrLoc]) != ' ' ) {
- BYTE curByte;
- UINT32 pixel8;
- UINT32 pos;
-
- iStrLoc++;
-
- if (c == 'r') { //prefix characher:to use font_table2
- if ( (c = ((BYTE *)str)[iStrLoc])==' ' )
- break;
-
- iStrLoc++;
- if ((pFont = get_font_entry(1,c))==NULL) continue;
- }
- #if defined(NEWSTYLE_WINDOW)||defined(NEW_STYLE_SETUP) || defined(SUPPORT_REP_READ) || defined(DVB1000_OSD_MENU)//maoyong add 0915
- else if(c == 'a')
- {
- if ( (c=((BYTE *)str)[iStrLoc])==' ' ) break;
-
- iStrLoc++;
- if ((pFont = get_font_entry(3,c))==NULL) continue;
- }
- #endif
- #ifdef DVB1000_OSD_MENU //Maoyong 2004-10-26 16:08
- else if(c>='a' && c<='z')
- {
- if(IsOSDChinese())
- pFont = get_font_entry(0, c);
- else
- pFont=get_font_entry(0,c-'a'+0xc0);
- //printf("c=%c,c=%xn",c,c);
- }
- #endif
- else {
- //get current char entry
- pFont = get_font_entry(0,c);
- }
-
- //start to process
- pos = 2;
-
- //get font information
- iFontWidth = (int)pFont[0];
- iFontHigh = (int)pFont[1];
-
- if(p_scan==0)
- iFontHigh>>=1;
-
- //start to draw
- for (j=0; j<iFontHigh; j++) {
- //For every string line = 1 blank line(in pixel) + OSD_FONT_HEIGHT-line strings + 1 blank line
-
- //draw top line
- for (i=0; i<iFontWidth/8; i++) {
- BYTE c;
-
- c = pFont[++pos];
- curByte = ((c&0xc0)>>6) | ((c&0x30)>>2) | ((c&0x0c)<<2) | ((c&0x03)<<6);
- //NOTE:
- //The previous mothod has a problem when show our radio button.
- //When write a char(smaller circle) in another char (bigger circle).
- //smaller circle looks like not a circle but a rect!!!
- //I modify the method to fill the fontcolor and bkcolor.
- //Please don't care about the changes will effect the funciton's original funcitons.
- //zhaoyanhua add 2004-3-19 16:19
-
- //pixel8 = 0;//zhaoyanhua mask 2004-2-27 14:41
- pixel8 = pTopLine[iDispLoc+i];//zhao add 2004-2-27 14:41
-
- for (k=0; k<8; k++) {
- if ( (1<<k) & curByte ) {
-
- //pixel8 = pixel8 | (fontColor<<(k*4));//zhaoyanhua mask 2004-2-27 14:41
- pixel8 = (pixel8 & (~( 0x0f<<k*4))) |(fontColor<<(k*4));//zhao add 2004-2-27 14:41
- } else {
- //pixel8 = pixel8 | (bkColor<<(k*4));//zhaoyanhua mask 2004-2-27 14:41
- if(bkColor != 0)//if color index is 0, no need to change the vlaue fo pixel8
- pixel8 = (pixel8 & (~( 0x0f<<k*4))) | (bkColor<<(k*4));//zhao add 2004-2-27 14:41
-
- }
- }
-
- pTopLine[iDispLoc+i] = pixel8;
- }
-
- if(p_scan==0)
- {
- //draw bottom line
- for (i=0; i<iFontWidth/8; i++) {
- BYTE c;
-
- c = pFont[++pos];
- curByte = ((c&0xc0)>>6) | ((c&0x30)>>2) | ((c&0x0c)<<2) | ((c&0x03)<<6);
- //pixel8 = 0;//zhaoyanhua mask 2004-2-27 14:41
- pixel8 = pBtmLine[iDispLoc+i];//zhao add 2004-2-27 14:41
-
- for (k=0; k<8; k++) {
- if ( (1<<k) & curByte ) {
- //pixel8 = pixel8 | (fontColor<<(k*4));//zhaoyanhua mask 2004-2-27 14:41
- pixel8 = (pixel8 & (~( 0x0f<<k*4))) |(fontColor<<(k*4));//zhao add 2004-2-27 14:41
- } else {
- //pixel8 = pixel8 | (bkColor<<(k*4));//zhaoyanhua mask 2004-2-27 14:41
- if(bkColor != 0)//if color index is 0, no need to change the vlaue fo pixel8
- pixel8 = (pixel8 & (~( 0x0f<<k*4))) | (bkColor<<(k*4));//zhao add 2004-2-27 14:41
-
- }
- }
-
- pBtmLine[iDispLoc+i] = pixel8;
- }
- }
- iDispLoc += (iRegionWidth/4);
-
- }//for charactor heigh
-
- //move to next character and move up to first line of this string
- iDispLoc = iDispLoc + (iFontWidth/8) - (iRegionWidth/4*iFontHigh);
-
- } // end of while ( (c=((BYTE *)str)[unFontLoc])!=' ' )
-
- timeout_osd[r] = 0;
- }
- #endif //#if defined(USE_SMALL_FONT)
- #include "audcodec.h"
- #include "setup_def.h"
- //#define MAX_SETUP_PAGE 6
- //#define MAX_CUSTM_SETUP_PAGE 1
- //#define MAX_PAGE_ITEM 8
- #ifdef SOFT_MENU//Modifed by ChenZhao on 2004-9-1 10:18 WP
- #define AUDPAGE 2
- #else
- #define AUDPAGE 2
- #endif
- #ifdef NO_DIGIT_VIDEO_MENU
- #define VIDEOPAGE 4
- #define MULTISPKPAGE 3 //valid when AC3 or DTS
- #else
- #define VIDEOPAGE 3
- #define MULTISPKPAGE 4 //valid when AC3 or DTS
- #endif
- #define SPDIFSIMULATE 2
- #define AC3DIGITALPAGE 5
- #define SPDIFBITSTREAM 3
- extern UINT8 setup_sel[MAX_SETUP_PAGE + MAX_CUSTM_SETUP_PAGE][MAX_PAGE_ITEM];
- #define SETUP_SPDIF setup_sel[AUDPAGE][0]
- #ifdef NEW_STYLE_SETUP //zhaoyanhua add 2003-07-22 22:21
- void
- osd_DrawIcon(int xStart, int yStart, unsigned index, unsigned page)
- {
- BYTE *pIcon;
- UINT32 *pTopLine, *pBtmLine;
- UINT32 iDispLoc, iIconLoc;
- int need_gray=0;
- int i, j, k;
- int iFontWidth, iFontHigh;
- int iRegionWidth = region[1].osd_w;
- osd_tog_region(1, OSD_ON);
- iRegionWidth = region[1].osd_w;
- //initialize buffer start
- pTopLine = (UINT32 *)get_osdbuf_region_ptr(1,0); // region 0 top
- pBtmLine = (UINT32 *)get_osdbuf_region_ptr(1,1); // region 0 bot
- need_gray = 0;
- 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 pixel8;
- UINT32 pos;
- iIconLoc++;
- pIcon = get_font_entry(2, index);
- //start to process
- pos = 2;
- //get icon information
- iFontWidth = (int)pIcon[0];
- iFontHigh = (int)pIcon[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/2); i++) // every 4-bytes a time, every 2-pixels a byte
- {
- pixel8=0;
- // 0x12345678 ==> 0x78563412
- for (k=0;k<4;k++)
- {
- unsigned curByte = pIcon[++pos];
- if (page!=index)
- {
- if ((curByte&0x0f)==0x04) curByte=(0x00|(curByte&0xf0));
- if ((curByte&0xf0)==0x40) curByte=(0x00|(curByte&0x0f));
- if ((curByte&0x0f)==0x0b) curByte=(0x0c|(curByte&0xf0));
- if ((curByte&0xf0)==0xb0) curByte=(0xc0|(curByte&0x0f));
- }
- if (need_gray==1)
- {
- if ((curByte&0x0f)!=0x01) curByte=(0x0b|(curByte&0xf0));
- if ((curByte&0xf0)!=0x10) curByte=(0xb0|(curByte&0x0f));
- }
- pixel8 = pixel8 | (curByte<<8*k);
- }
- pp[iDispLoc+i] = pixel8;
- }
- yStart++;
- }//for icon heigh
- }
- timeout_osd[1] = 0;
- }
- #else //NORMAL setup MENU
- void
- osd_DrawIcon(int xStart, int yStart, unsigned index, unsigned page)
- {
- BYTE *pIcon;
- UINT32 *pTopLine, *pBtmLine;
- UINT32 iDispLoc, iIconLoc;
- int need_gray=0;
- int i, j, k;
- int iFontWidth, iFontHigh;
- int iRegionWidth = region[0].osd_w;
- #ifdef NO_AUDIO_PAGE//liweihua add for syber 2003-12-30 22:01
- if((index>=2)&&(index<=4))index=index+1;
- #endif
- #ifdef DVB_MENU_SETUP_STYLE
- if(system_state == SYSTEM_TS)
- {
- if(index==3)
- index=index+2;
- }
- else
- {
- if((index>=0)&&(index<=5))
- index+=2;
- }
- #endif
- #ifdef EASTWIN_PORTABLE_DVD
- #ifdef NO_SPEAK_ICON//tulijuan040910
- if((index>=4)&&(index<=5))index=index+1;
- #endif
- #endif
- #ifndef SETUP_ALL_VALID // alan, 2003/7/18 10:49