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

📄 osd1.c

📁 Sunplus 8202S source code.
💻 C
📖 第 1 页 / 共 5 页
字号:
/*
** 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

⌨️ 快捷键说明

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