📄 osdadjust.bak
字号:
/*
$Workfile: OsdAdjust.c $
$Revision: 1.30 $
$Date: Jul 15 2004 11:30:16 $
*/
//******************************************************************
//
// Copyright (C) 2002. GENESIS MICROCHIP INC.
// All rights reserved. No part of this program may be reproduced.
//
// Genesis Microchip Corp., 2150 Gold Street
// Alviso, CA 95002 USA
// Genesis Microchip Inc., 165 Commerce Valley Dr. West
// Thornhill, Ontario, Canada, L3T 7V8
//
//================================================================
//
// MODULE: OsdAdjust.c
//
// USAGE : This module contains osd adjuster functions
//
//
//******************************************************************
#include ".\inc\all.h"
#include "math.h"
//******************************************************************
// L O C A L D E F I N I T I O N S
//******************************************************************
#define xDEBUG_OSD
// flags of vertical and horizontal positionings
#define H_POS_ADJ 1
#define V_POS_ADJ 0
// floating window parameters
#define NO_SYNC_OSD_MAX_X NUM_OSD_POSITIONS
#define NO_SYNC_OSD_MIN_X 1
#define NO_SYNC_OSD_MAX_Y NUM_OSD_POSITIONS
#define NO_SYNC_OSD_MIN_Y 1
#define NO_SYNC_OSD_X_STEPS 1
#define NO_SYNC_OSD_Y_STEPS 1
#define FLOATING_RATE_UNIT_MS 20
#define FLOATING_RATE_PREF 1
//******************************************************************
// G L O B A L V A R I A B L E S
//******************************************************************
BYTE ROM SM_EventTable[] =
{
OE_EnterState,
OE_ExitState,
OE_TransitionComplete,
OE_AnyEvent
};
BOOL m_UseAudio =0; //lyh 9.20 1 是有声音,0是没有声音菜单
#define LITTE_BOARD 1//lyh 20060619 1是小板,0是大板的声音
extern DWORD D_PrevSysTimer; // prev. time
//******************************************************************
// C O D E
//******************************************************************
static BYTE __near calcExtraTime(void)
{
DWORD D_CurTime = gm_ReadSystemTime(); // current time
// if CheckOSDTimers() hasn't been run in a while (after a long Auto Adjust
// for instance) then see how much time we should add to our new timer
// so it doesn't time out early. Otherwise if D_PrevSysTimer is 2 seconds
// away from D_CurTime, then when ChckOSDTimers() runs, we'll lose 2 seconds
// off our time.
return (BYTE)(labs(D_CurTime - D_PrevSysTimer) / (W_OsdTimerResolution * 10));
}
void far ResetOSDTimer()
{
#ifdef DEBUG_OSD
gm_Print("Reset osd timer", 0);
#endif
// if CheckOSDTimers() hasn't been run in a while (after a long Auto Adjust
// for instance) then see how much time we should add to our new timer
// so it doesn't time out early. Otherwise if D_PrevSysTimer is 2 seconds
// away from D_CurTime, then when ChckOSDTimers() runs, we'll lose 2 seconds
// off our time.
gW_OsdTimers[B_OSD_TimeoutTid] = UserPrefOSDTimeout + calcExtraTime();
}
void far ResetTimer()
{
OsdTimerData Un_Timer;
Un_Timer.D_Value = gm_OsdGetCurrentSATOffsetDWord();
gW_OsdTimers[(Un_Timer.OsdTimer.TimerId & TIMER_ID_MASK)] = Un_Timer.OsdTimer.TimerVal + calcExtraTime();
#ifdef DEBUG_OSD
gm_Print("ResetTimer %d", Un_Timer.OsdTimer.TimerId & TIMER_ID_MASK);
gm_Print("Timer Count = %d", gW_OsdTimers[Un_Timer.OsdTimer.TimerId & TIMER_ID_MASK]);
#endif
}
void far SetPowerOnFlag()
{
UserPrefSwitches |= PowerOn;
#ifdef DEBUG_OSD
gm_Print("PowerOnFlag = %d", UserPrefSwitches);
#endif
}
void far ClearPowerOnFlag()
{
UserPrefSwitches &= ~PowerOn;
#ifdef DEBUG_OSD
gm_Print("PowerOnFlag = %d", UserPrefSwitches);
#endif
}
BYTE far GetPowerOnFlag(void)
{
#ifdef NVRAM_BLOCK_ModeIndependentUserPreferences_WB_Used
return(UserPrefSwitches & PowerOn);
#else // if not stored in NVRAM then always come on when power restored.
return gmd_TRUE;
#endif //NVRAM_BLOCK_ModeIndependentUserPreferences_WB_Used
}
void far RequestSoftPowerOff()
{
SendMsg(&PowerHandlerQ, MTP_SOFTKEY_OFF);
#ifdef DEBUG_OSD
gm_Print ("RequestSoftPowerOff",0);
#endif
}
void far RequestSoftPowerOn()
{
SendMsg(&PowerHandlerQ, MTP_SOFTKEY_ON);
#ifdef DEBUG_OSD
gm_Print ("RequestSoftPowerOn",0);
#endif
}
void far RequestNoSyncSleep()
{
#ifdef DEBUG_OSD
gm_Print ("RequestNoSyncSleep",0);
#endif
}
void far SendPowerDownMessage()
{
SendMsg(&PowerHandlerQ, MTP_POWER_DOWN);
#ifdef DEBUG_OSD
gm_Print ("SendPowerDownMessage",0);
#endif
}
void far SetSplashScreenOff()
{
SystemFlags.SplashScreen = gmd_FALSE;
InitModeHandler();
}
#ifdef Action_AdjustOsdHPos_WB_Used
void far AdjustOsdHPos()
{
PositionAdjDialog (H_POS_ADJ, ADJV_HPosOSD);
#ifdef DEBUG_OSD
gm_Print ("AdjustOsdHPos",0);
#endif
}
#endif
#ifdef Action_AdjustOsdVPos_WB_Used
void far AdjustOsdVPos()
{
PositionAdjDialog (V_POS_ADJ, ADJV_VPosOSD);
#ifdef DEBUG_OSD
gm_Print ("AdjustOsdHPos",0);
#endif
}
#endif
void far AdjustOsdHVPos()
{
PositionAdjDialog (H_POS_ADJ, ADJV_HPosOSD);
#ifdef DEBUG_OSD
gm_Print ("AdjustOsdHVPos",0);
#endif
}
#ifdef Action_StartFloating_WB_Used
void far OsdFloating(void)
{
static WORD B_OsdXDirection = NO_SYNC_OSD_X_STEPS;
static WORD B_OsdYDirection = NO_SYNC_OSD_Y_STEPS;
UserPrefMenuXPos += B_OsdXDirection;
UserPrefMenuYPos += B_OsdYDirection;
if(((UserPrefMenuXPos + NO_SYNC_OSD_X_STEPS) > NO_SYNC_OSD_MAX_X) ||
((UserPrefMenuXPos - NO_SYNC_OSD_X_STEPS) < NO_SYNC_OSD_MIN_X))
B_OsdXDirection = -B_OsdXDirection;
if(((UserPrefMenuYPos + NO_SYNC_OSD_Y_STEPS) > NO_SYNC_OSD_MAX_Y) ||
((UserPrefMenuYPos - NO_SYNC_OSD_Y_STEPS)< NO_SYNC_OSD_MIN_Y))
B_OsdYDirection = -B_OsdYDirection;
PositionAdjDialog (H_POS_ADJ, ADJV_MenuXPos);
}
#endif
#ifdef Action_DoAutoConfig_WB_Used
void far DoAutoConfig()
{
#ifdef DEBUG_OSD
gm_Print ("DoAutoConfig",0);
#endif
}
#endif
//
// Audio adjusters
//
#ifdef Action_AdjustAudioBalance_WB_Used
void far AdjustAudioBalance()
{
#ifdef DEBUG_OSD
gm_Print ("AdjustAudioBalance",0);
#endif
}
#endif
#ifdef Action_AdjustAudioVolume_WB_Used
#if LITTE_BOARD //lyh 20060619, 1 for little board
code unsigned char Volume_Table[]=
{
78,
76,
74,
72,
70,
68,
66,
64,
62,
60,
58,
56,
54,
52,
50,
48,
46,
44,
42,
40,
38,
36,
34,
32,
30,
28,
26,
24,
22,
20,
18,
16,
14
};
/*
{
0x7b,0x77,0x73,0x6f,0x6c,0x68,0x64,0x60,0x5d,0x59,
0x55,0x52,0x4e,0x4b,0x47,0x44,0x40,0x3d,0x3a,0x36,
0x33,0x30,0x2d,0x2a,0x26,0x23,0x20,0x1d,0x19,0x17,
0x14,0x11,0xe
};
*/
/*
{
0x60,0x5e,0x5c,0x5a,0x58,0x56,0x54,0x52,0x50,0x4e,
0x4c,0x4a,0x48,0x46,0x44,0x42,0x40,0x3e,0x3c,0x3a,
0x38,0x36,0x34,0x32,0x30,0x2e,0x2c,0x2a,0x28,0x26,
0x24,0x22,0x20
}; //-20
*/
#else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -