📄 uimenu.c
字号:
/********************************************************************************
Copyright (c) 2002 Sunplus Technology Co., Ltd.
Module Name: uimenu.c
Function : The UI Menu related functions
Environment: Keil C51 Compiler
Creation : 2002/04/18 yichang
***********************************************************************************/
//version4.0@yichang@0513 for new UI of SPCA533 turnkey
#include "general.h"
#include "main.h"
#include "initio.h"
#include "lcdtv.h"
#include "uiflow.h"
#include "playback.h"
//patch4.4@yichang@0624 for OSD begin
#include "dpof.h"
#include "dosusr.h"
//patch4.4@yichang@0624 for OSD end
//patch4.5@ada@Record DCF file name begin
#include "sdramhw.h"
//patch4.5@ada@Record DCF file name end
//Joe@2003.2.27 11:08 add begin
#include "JoeToEvb.h"
extern xdata UCHAR G_StayInMenu;
//Joe@2003.2.27 11:08 add end
code PUCHAR YES[]={
"Yes",
"Oui",
"Ja",
"Si",
"Si",
"\x01\x12\x01\x13\x01\x14\x01\x15",//J
"\x01\xe0\x01\xe1",//CH
"\x01\xe0\x01\xe1"//TR
};
code PUCHAR NO[]={
"NO",
"Non",
"Nein",
"No",
"No",
"\x01\x14\x01\x15\x01\x14\x01\x15\x01\x16\x01\x17",//J
"\x01\xe2\x01\xe3",//CH
"\x01\xe2\x01\xe3",//TR
};
//=============================================================================
//Symbol
//=============================================================================
extern UCHAR G_AE_com_index;
//-----------------------------------------------------------------------------
//Constant
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//Variable
//-----------------------------------------------------------------------------
xdata unsigned char **G_MenuName;
xdata UCHAR G_MenuOriX;
xdata UCHAR G_MenuOriY;
xdata UCHAR G_MenuWidth;
xdata UCHAR G_MenuHeight;
xdata UCHAR G_ScrollOri;
//herb for TVoutput debug @03/04/18 start
extern xdata UCHAR SmallSizeAvi;
//herb for TVoutput debug @03/04/18 end
//patch4.3@yichang@0611 for version B/C chip co-exist
sfr MemStretch = 0x8E;
//=============================================================================
//void UI_ClearDPOFBar(UCHAR x, UCHAR y)
//=============================================================================
void UI_ClearDPOFBar(UCHAR x, UCHAR y)
{
UCHAR i;
for(i=0;i<3;i++)
{
L2_SetFOSDAttr(y, x+i, 0x00);
L2_SetFOSDIndex(y, x+i, 0x00);
}
}
//=============================================================================
//void UI_UpdateDPOFBar(UCHAR x, UCHAR y, UCHAR attrib)
//=============================================================================
void UI_UpdateDPOFBar(UCHAR x, UCHAR y, UCHAR attrib) USING_0
{
UCHAR i;
for(i=0;i<3;i++)
{
L2_SetFOSDAttr(y, x+i, attrib);
}
UI_PrintOSDNumber(G_DPOF_Qty,x,y,3);
}
//=============================================================================
//UI_SetMenuPalette()
//=============================================================================
void UI_SetMenuPalette() USING_0
{
L2_SetColorPalette(0, 255, 255, 0);
L2_SetColorPalette(1, 255, 0, 0);
L2_SetColorPalette(2, 255, 255, 255);
L2_SetColorPalette(3, 0, 0, 0);
L2_SetColorPalette(4, 0, 0, 255);
L2_SetColorPalette(5, 255, 0, 255);
L2_SetColorPalette(6, 255, 0, 0);
L2_SetColorPalette(7, 200, 255, 200);
L2_SetColorPalette(8, 0, 0, 255);
}
//=============================================================================
//UI_MenuYesNo()
//=============================================================================
void UI_MenuYesNo(UCHAR yes)
{
UCHAR width, height;
//Joe@2003.3.3 20:12 add begin
G_StayInMenu = 1;
//Joe@2003.3.3 20:12 add end
//Joe@2003.2.27 10:21 modify begin
/*if(G_DisplayType <= 7) //TV
{
width = (K_DISPLAY_StnLcdWidth/16)+5;
height = (K_DISPLAY_StnLcdHeight/32);
}
else
{
width = (G_DSPHsize/16);
height = (G_DSPVsize/32);
}
*/
UI_SetMenuPalette();//wendy 2003/12/22
UI_GetFOSDSize(&width, &height);
//Joe@2003.2.27 10:21 modify end
//Joe@2003.3.21 19:49 add chinese menu begin
if(G_Language == 0)
//Joe@2003.3.21 19:49 add chinese menu end
{
if(yes)
{
UI_PrintOSDString("Yes", width/2-4, height/2,UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_HIGHLIGHT_COLOR);
UI_PrintOSDString("No", width/2+2, height/2,UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_DEHIGHLIGHT_COLOR);
}
else
{
UI_PrintOSDString("Yes", width/2-4, height/2,UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_DEHIGHLIGHT_COLOR);
UI_PrintOSDString("No", width/2+2, height/2,UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_HIGHLIGHT_COLOR);
}
}
else
//Joe@2003.3.21 19:49 add chinese menu end
{
if(yes)
{
UI_PrintOSDString(YES[G_Language], width/2-4, height/2,UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_HIGHLIGHT_COLOR);
UI_PrintOSDString(NO[G_Language], width/2+2, height/2,UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_DEHIGHLIGHT_COLOR);
}
else
{
UI_PrintOSDString(YES[G_Language], width/2-4, height/2,UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_DEHIGHLIGHT_COLOR);
UI_PrintOSDString(NO[G_Language], width/2+2, height/2,UI_MENU_BG_COLOR_ON | UI_MENU_BG_HALFTONE_ON | UI_MENU_HIGHLIGHT_COLOR);
}
}
//Joe@2003.3.21 19:50 add chinese menu end
}
//patch4.4@ada@FOSD begin
/*
//=============================================================================
//UI_ShowDeleting()
//=============================================================================
//version4.0@ada@0513 for Play Back
void UI_ShowDeleting(UCHAR OnOff)
{
UCHAR width, height;
//patch4.3@yichang@0611 for version B/C chip co-exist
UCHAR tmp;
tmp = MemStretch;
MemStretch = 0x01;
XBYTE[0x2D18] = 0x00;
MemStretch = tmp;
ClearScreen();
//Joe@2003.2.27 10:21 modify begin
//if(G_DisplayType <= 7) //TV
//{
// width = (K_DISPLAY_StnLcdWidth/16)+5;
// height = (K_DISPLAY_StnLcdHeight/32);
//}
//else
//{
// width = (G_DSPHsize/16);
// height = (G_DSPVsize/32);
//}
UI_GetFOSDSize(&width, &height);
//Joe@2003.2.27 10:21 modify end
if (OnOff)
{
UI_PrintOSDString(" ", 0, 0, UI_MENU_TITLE_TEXT_COLOR);
UI_PrintOSDString(" ", 0, 1, UI_MENU_TITLE_TEXT_COLOR);
UI_PrintOSDString(" Deleting ", 0, 2, UI_MENU_TITLE_TEXT_COLOR);
UI_PrintOSDString(" Files ", 0, 3, UI_MENU_TITLE_TEXT_COLOR);
UI_PrintOSDString(" ", 0, 4, UI_MENU_TITLE_TEXT_COLOR);
}
else
{
UI_PrintOSDString(" ", 0, 0, 0);
UI_PrintOSDString(" ", 0, 1, 0);
UI_PrintOSDString(" ", 0, 2, 0);
UI_PrintOSDString(" ", 0, 3, 0);
UI_PrintOSDString(" ", 0, 4, 0);
}
}
*/
//patch4.4@ada@FOSD end
//parch4.4@ada@MP3 begin
#if (MP3_OPTION)
//=============================================================================
//UI_ShowMp3SongPlaying
//=============================================================================
void UI_ShowMp3SongPlaying(void) USING_0
{
UCHAR width, height;
XBYTE[0x2D18] = 0x00;
L2_SetColorPalette(8,0,0,255);
UI_ClearFOSD(25, 8, 0x08);
//Joe@2003.2.27 10:21 modify begin
/*if(G_DisplayType <= 7) //TV
{
width = (K_DISPLAY_StnLcdWidth/16)+5;
height = (K_DISPLAY_StnLcdHeight/32);
}
else
{
width = (G_DSPHsize/16);
height = (G_DSPVsize/32);
}
*/
UI_GetFOSDSize(&width, &height);
//Joe@2003.2.27 10:21 modify end
L2_CtrlScreen(1);
UI_PrintOSDString("SONG", width / 2 - 3, height / 2 , UI_MENU_BG_COLOR_ON | UI_MENU_TITLE_TEXT_COLOR);
UI_PrintOSDNumber(UI_Mp3NowFileIndex, width / 2 - 3 + 4, height / 2, 4);
}
//=============================================================================
//UI_ShowNoMp3Song
//=============================================================================
void UI_ShowNoMp3Song(void) USING_0
{
UCHAR width, height;
XBYTE[0x2D18] = 0x00;
L2_SetColorPalette(8,0,0,255);
UI_ClearFOSD(25, 8, 0x08);
//Joe@2003.2.27 10:21 modify begin
/*if(G_DisplayType <= 7) //TV
{
width = (K_DISPLAY_StnLcdWidth/16)+5;
height = (K_DISPLAY_StnLcdHeight/32);
}
else
{
width = (G_DSPHsize/16);
height = (G_DSPVsize/32);
}
*/
UI_GetFOSDSize(&width, &height);
//Joe@2003.2.27 10:21 modify end
UI_PrintOSDString("No MP3 Song", width / 2 - 5, height / 2 , UI_MENU_BG_COLOR_ON | UI_MENU_TITLE_TEXT_COLOR);
L2_CtrlScreen(1);
L2_TurnOnOffDisplay(1);
}
#endif
//parch4.4@ada@MP3 end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -