📄 password.c
字号:
/*
* Terry,2003/8/20 06:43PM
* This file is about password.
*/
#ifdef PARENT_PWD_DEFAULT_NULL//libing 2005-5-28 00:28
#include "setup.h"
#include "setup_VA.h"
#endif
#if defined(SDRAM_16Mb_Mode)//&&defined(NEW_STYLE_SETUP)//zhaoyanhua add 2003-11-10 16:33
#include "memmap.h"
#include "memmap0.h"
#endif
#ifdef SHOW_12_BOOKMARK//libing 2005-6-29 21:59
extern void cancel_bookmark();
#endif
#ifdef DVD_5_DISC_RESUME//lijd 2005-6-22 16:38
extern void Clear5DVDResumeInfo(void);
#endif
#ifdef TEST_VFD_PANNEL_AND_KEY//lijd 2005-5-8 14:02
BYTE Test_Front_Panel_flag=0;
const BYTE oritron_test_panel_password[5]=ORITRON_TEST_PANEL_PASSWORD;
BYTE op_test_panel_count=0;
#endif
const BYTE Custm_Password[PASSWORD_TOTAL_DIGITAL]=SUPER_PASSWORD; //defined in user_init.h, Jeff 20020606
#ifdef PULIANG_PASSWORD //yaowh add 04-12-22
#define REGION_CODE_PSW {IRC_8,IRC_2,IRC_0,IRC_0}
#define FIRM_WARE_VER_PSW {IRC_UP,IRC_DOWN,IRC_LEFT,IRC_RIGHT}
#define SUPER_PASSWORD {IRC_1,IRC_0,IRC_0,IRC_4}
BYTE custm_count_1 = 0;
BYTE custm_count_2 = 0;
const BYTE Custm_Password_1[4]=FIRM_WARE_VER_PSW;
const BYTE Custm_Password_2[4]=REGION_CODE_PSW;
extern void osd_print_region2(t_osd_region *p, const char *s0, BYTE y_start,BYTE x_start);
#endif
#ifdef USER_VERSION_INFORMATION//eastech
#define VERSION_INFORMATION {IRC_1,IRC_2,IRC_3}
const BYTE Custm_version[3]=VERSION_INFORMATION;
BYTE temp_data[4];
BYTE enter_display_flag=0;
#define VERSION_INFORMATION_STRING "VER 040727 1"
BYTE version_count=0;
#endif
#ifdef MIDI_EJECT_PASSWORD //ouyang add for eject password 2004-11-20 15:10
#define MIDI_OPEN_PASSWORD {IRC_6,IRC_6,IRC_7,IRC_7}
const BYTE midi_open_password[4]=MIDI_OPEN_PASSWORD;
BYTE temp_num[4];
//BYTE enter_display_flag=0;
BYTE midi_open_count=0;
#endif
#ifdef AD_TCL//2004-3-22 12:55 lijd
const BYTE inter_Pass[4]=INTER_PASSWORD; //defined in user_init.h, Jeff 20020606
const BYTE macro_Pass[4]=MACRO_PASSWORD; //defined in user_init.h, Jeff 20020606
BYTE inter_count = 0;
BYTE macro_count = 0;
#endif
#ifdef SUPPORT_PASSWD2
const BYTE Custm_Password1[4]=SUPER_PASSWORD1;//defined in user_init.h, Jeff 20020606
#endif
#ifdef QSI_PLATFORM //qsi: added by johnson 20040713
void display_custm_menu(void);
enum {
VER_SHOW_VIA_NORMAL=0,
VER_SHOW_VIA_SPECIAL, // for internal
VER_SHOW_MAX
};
static BYTE version_show_entry;
BYTE is_show_full_qsi_version(void)
{
return(version_show_entry==VER_SHOW_VIA_SPECIAL);
}
void display_custm_menu_full(void)
{
version_show_entry = VER_SHOW_VIA_SPECIAL;
//display_custm_menu();
setup_ShowCUSTMMsg();
}
#endif
//#define SUPPORT_PASSWD3 //for testing
#ifdef SUPPORT_PASSWD3
#ifndef SUPER_PASSWORD3
#define SUPER_PASSWORD3 {IRC_1,IRC_5,IRC_9,IRC_7} //define super password when open tray
#endif
UINT8 setup_audio_mode,custm_count3=0;
const BYTE Custm_Password3[4]=SUPER_PASSWORD3;//defined in user_init.h, Jeff 20020606
#endif
#ifdef WATCH_LOADER_ID
const BYTE Loader_Password[4]={IRC_1,IRC_2,IRC_3,IRC_4}; //defined in user_init.h, Jeff 20020606
#endif
#ifdef DVD_SERVO
extern const BYTE Servo_Password[8]; // kernel/hwif.c
extern BYTE *GetServoCodeVersion();
#endif
#if defined (SUPPORT_SPG_GAME) && !defined (DVDRELEASE) && defined (SPG_ICE)
const BYTE ICE_Password[4]={IRC_9,IRC_9,IRC_9,IRC_2};
static BYTE ICEId_count=0;
#endif
BYTE custm_count = 0;
#ifdef SUPPORT_PASSWD2
BYTE custm_count1 = 0;
BYTE only_disp_setup_menu = 0;
#endif
#ifdef DVD_SERVO
BYTE servo_count=0; //Jeff 20030818
#endif
#ifdef WATCH_LOADER_ID
static BYTE LoaderId_count=0;
#endif
//=============================================
//for DVD_SETUP_REENG //added by JS //20040728
#ifdef DVD_SETUP_REENG
void display_custm_menu(void)
{
//printf("display_custm_menu\n");
full_scrn=(SETUP|CUSTM);
read_custm_setup_select();
#if defined(SDRAM_16Mb_Mode)//&&defined(NEW_STYLE_SETUP)
//NOTE:
//when SDRAM_16M_Mode,ShowTitle() may destroyed
// OSD memory. So must evaluate osd_base_addr again.
//zhaoyanhua add 2003-11-10 17:06
regs0->osd_base_addr=OSD_BASE_USE_ADDR;//P_BIDIR_LUMA;
#endif
ShowSetupPage(0);
//Maoyong added for IR U/D/L/R/Sel proc func setting 2004-9-24 9:12
SetFullscrnCmdFuncPtr( setup_func_up, setup_func_down, setup_func_left,
setup_func_right, setup_func_select);
}
#else
void display_custm_menu(void)
{
index_y=3;
full_scrn=(SETUP|CUSTM);
read_custm_setup_select();
#if defined(SDRAM_16Mb_Mode)//&&defined(NEW_STYLE_SETUP)
//NOTE:
//when SDRAM_16M_Mode,ShowTitle() may destroyed
// OSD memory. So must evaluate osd_base_addr again.
//zhaoyanhua add 2003-11-10 17:06
regs0->osd_base_addr=OSD_BASE_USE_ADDR;//P_BIDIR_LUMA;
#endif
#ifdef SETUP_TAB
#ifdef SOFT_MENU//Modifed by ChenZhao on 2004-9-11 13:58 WP
osd_init_setup();
ShowSetupPage(REFRESH_CUSTM);
#else
ShowSetupPage(1);
#endif
#else
ShowSetupPage();
#endif
//Maoyong added for IR U/D/L/R/Sel proc func setting 2004-9-24 9:12
SetFullscrnCmdFuncPtr( setup_func_up, setup_func_down, setup_func_left,
setup_func_right, setup_func_select);
#ifdef SUPPORT_PASSWD2
custm_count1=0;
#endif
custm_count=0;
}
#endif //endo of DVD_SETUP_REENG
#ifdef ORITRON_PASSWORD//libing 2005-4-25 10:07
#define __palette4F(G,B,R,A) \
( ((UINT32)((G)&0xff)<<24)|((UINT32)((B)&0xff)<<16)|((UINT32)((R)&0xff)<<8)|(A&0xff) )
#define ORITRON_MAX_NUMBER 5
#ifdef ORITRON_TRAY_PASSWORD
extern void show_pwd_ui(void);
const BYTE oritron_tray_password[ORITRON_MAX_NUMBER]=ORITRON_TRAY_LOCK_PASSWORD;
BYTE op_tray_count = 0;
#endif//#ifdef ORITRON_TRAY_PASSWORD
#ifdef ORITRON_PARENTAL_PASSWORD
const BYTE oritron_parent_password[ORITRON_MAX_NUMBER]=ORITRON_PARENT_PASSWORD;
BYTE op_parent_count = 0;
#endif//#ifdef ORITRON_PARENTAL_PASSWORD
#ifdef ORITRON_SET_DEFAULT
const BYTE oritron_set_default_password[ORITRON_MAX_NUMBER]=ORITRON_SET_DEFAULT_PASSWORD;
BYTE op_set_default_count = 0;
#endif
#ifdef ORITRON_TRAY_PASSWORD
void display_pwd_menu(void)
{
full_scrn=(SETUP|TRAY_PWD);
show_pwd_ui();
SetFullscrnCmdFuncPtr( ircmd_null, ircmd_null, tray_pwd_left,tray_pwd_right,tray_pwd_select);
op_tray_count = 0;
}
#endif//#ifdef ORITRON_TRAY_PASSWORD
static inline void oritron_chk_password(UINT8 rx)
{
if( (play_state==VCD_STATE_IDLE)||(play_state==VCD_STATE_STOP)||(play_state==VCD_STATE_OPEN) )
{
#ifdef ORITRON_TRAY_PASSWORD
if (full_scrn&TRAY_PWD)
{
op_tray_count = 0;
}
if (full_scrn&SETUP)
{
custm_count=0;
}
if(rx==oritron_tray_password[op_tray_count])
{
op_tray_count++;
if(op_tray_count>=ORITRON_MAX_NUMBER)
{
#ifdef ORITRON_TRAY_PASSWORD
display_pwd_menu();
#endif
#ifdef TEST_VFD_PANNEL_AND_KEY//lijd 2005-5-8 14:03
Test_Front_Panel_flag=0;
#endif
return;
}
}
else
{
op_tray_count=0;
}
if(rx==Custm_Password[custm_count])
{
custm_count++;
if(custm_count>=PASSWORD_TOTAL_DIGITAL)
{
display_custm_menu();
return;
}
}
else
{
custm_count=0;
}
#endif
#ifdef ORITRON_SET_DEFAULT
if(rx==oritron_set_default_password[op_set_default_count])
{
op_set_default_count++;
if(op_set_default_count>=ORITRON_MAX_NUMBER)
{
PrintOsdMsg(STR_OS_SET_DEFAULT , REGION2, 2, 0);
set_default_value();
run_set_variable();
run_save_total_sel();
rep_mode = REPEAT_IDLE;//libing 2005-6-29 21:42
rep_ab_mode = REPEAT_AB_IDLE;
prog_func_clear();
shuffle_flag=0;
cancel_bookmark();
#ifdef DVD_5_DISC_RESUME//lijd 2005-6-22 16:38
Clear5DVDResumeInfo();
#endif
delay_srv_10ms(20);
call_ir_func(IRC_POWER);
return;
}
}else
{
op_set_default_count = 0;
}
#endif
#ifdef ORITRON_PARENTAL_PASSWORD
if(rx==oritron_parent_password[op_parent_count])
{
op_parent_count++;
if(op_parent_count>=ORITRON_MAX_NUMBER)
{
PrintOsdMsg(STR_OS_CLAER_PWD , REGION2, 2, 0);
UserSet.parent_passwd = DEFAULT_PASSWORD;
UserSet.parental_ststus = 1;
op_parent_pwd_flag = 1;
setup_VA[SETUP_VA_PASSWORD] = 2+1;
run_set_variable();
run_save_total_sel();
return;
}
}
else
{
op_parent_count = 0;
}
#endif
#ifdef TEST_VFD_PANNEL_AND_KEY //test front pannel password lijd 2005-5-8 14:05
if(rx==oritron_test_panel_password[op_test_panel_count])
{
op_test_panel_count++;
printf("==========76==============\n");
if(op_test_panel_count>=ORITRON_MAX_NUMBER)
{
printf("==========88==============\n");
op_test_panel_count=0;
Test_Front_Panel_flag=1;
return;
}
}
else
{
op_test_panel_count=0;
}
#endif
} //if( (play_state==VCD_STATE_IDLE)||(play_state==VCD_STATE_OPEN) )
#ifdef TEST_VFD_PANNEL_AND_KEY//lijd 2005-5-8 14:05
else
{
Test_Front_Panel_flag=0;
}
#endif
}
#endif//#ifdef ORITRON_PASSWORD//libing 2005-4-25 10:07
static inline void standard_chk_password(UINT8 rx)
{
if( (play_state==VCD_STATE_IDLE)||(play_state==VCD_STATE_OPEN) )
{
if (full_scrn&SETUP)
{
custm_count=0;
#ifdef SUPPORT_PASSWD2
custm_count1=0;
#endif
}
if(rx==Custm_Password[custm_count])
{
custm_count++;
if(custm_count>=PASSWORD_TOTAL_DIGITAL)
{
#ifdef QSI_PLATFORM //qsi: added by johnson 20040713
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -