📄 dvd_prm.c
字号:
/*****************************************************************************
******************************************************************************
** **
** Copyright (c) 2002 Videon Central, Inc. **
** All rights reserved. **
** **
** The computer program contained herein contains proprietary information **
** which is the property of Videon Central, Inc. The program may be used **
** and/or copied only with the written permission of Videon Central, Inc. **
** or in accordance with the terms and conditions stipulated in the **
** agreement/contract under which the programs have been supplied. **
** **
******************************************************************************
*****************************************************************************/
/**
* @file dvd_prm.c
*
* The GPRM (General Parameter) and SPRM (System Parameter) interface is implemented here.
*
* $Id: dvd_prm.c,v 1.29 2007/01/26 22:46:35 rbehe Exp $
*/
#include "vdvd_types.h"
#include "dvd_vmgi.h"
#include "dvd_prm.h"
#include "pgc_play.h"
#include "nav_task.h"
#include "dbgprint.h"
#include "loader_app.h"
#include "pe_app.h"
#ifdef DMALLOC
#include "dmalloc.h"
#endif
#define DEBUG_DVD_PRM DBG_ERROR /* set the debug level for prints, 0 for no prints */
#define DBG_ON(x) (DEBUG_DVD_PRM >= x) /* local macro for deciding if should print */
USHORT sprm[NUM_SPRM];
struct _gprm_struct gprm[NUM_GPRM];
extern LOADER_HANDLE tLoader;
extern DVD_SYSTEM_PARAMS dvd_system_params;
extern BOOLEAN fParental_Play;
UBYTE lang_string[140][2] = {{' ', ' '}, {'e', 'n'}, {'f', 'r'}, {'e', 's'},
{'i', 't'}, {'d', 'e'}, {'n', 'l'}, {'p', 't'},
{'z', 'h'}, {'j', 'a'}, {'t', 'h'}, {'s', 'v'},
{'n', 'o'}, {'d', 'a'}, {'f', 'i'}, {'i', 'w'},
{' ', ' '}, {'a', 'a'}, {'a', 'b'}, {'a', 'f'},
{'a', 'm'}, {'a', 'r'}, {'a', 's'}, {'a', 'y'},
{'a', 'z'}, {'b', 'a'}, {'b', 'e'}, {'b', 'g'},
{'b', 'h'}, {'b', 'i'}, {'b', 'n'}, {'b', 'o'},
{'b', 'r'}, {'c', 'a'}, {'c', 'o'}, {'c', 's'},
{'c', 'y'}, {'d', 'z'}, {'e', 'l'}, {'e', 'o'},
{'e', 't'}, {'e', 'u'}, {'f', 'a'}, {'f', 'j'},
{'f', 'o'}, {'f', 'y'}, {'g', 'a'}, {'g', 'd'},
{'g', 'l'}, {'g', 'n'}, {'g', 'u'}, {'h', 'a'},
{'h', 'i'}, {'h', 'r'}, {'h', 'u'}, {'h', 'y'},
{'i', 'a'}, {'i', 'e'}, {'i', 'k'}, {'i', 'n'},
{'i', 's'}, {'j', 'i'}, {'j', 'w'}, {'k', 'a'},
{'k', 'k'}, {'k', 'l'}, {'k', 'm'}, {'k', 'n'},
{'k', 'o'}, {'k', 's'}, {'k', 'u'}, {'k', 'y'},
{'l', 'a'}, {'l', 'n'}, {'l', 'o'}, {'l', 't'},
{'l', 'v'}, {'m', 'g'}, {'m', 'i'}, {'m', 'k'},
{'m', 'l'}, {'m', 'n'}, {'m', 'o'}, {'m', 'r'},
{'m', 's'}, {'m', 't'}, {'m', 'y'}, {'n', 'a'},
{'n', 'e'}, {'o', 'c'}, {'o', 'm'}, {'o', 'r'},
{'p', 'a'}, {'p', 'l'}, {'p', 's'}, {'p', 't'},
{'q', 'u'}, {'r', 'm'}, {'r', 'n'}, {'r', 'o'},
{'r', 'u'}, {'r', 'w'}, {'s', 'a'}, {'s', 'd'},
{'s', 'g'}, {'s', 'h'}, {'s', 'i'}, {'s', 'k'},
{'s', 'l'}, {'s', 'm'}, {'s', 'n'}, {'s', 'o'},
{'s', 'q'}, {'s', 'r'}, {'s', 's'}, {'s', 't'},
{'s', 'u'}, {'s', 'w'}, {'t', 'a'}, {'t', 'e'},
{'t', 'g'}, {'t', 'i'}, {'t', 'k'}, {'t', 'l'},
{'t', 'n'}, {'t', 'o'}, {'t', 'r'}, {'t', 's'},
{'t', 't'}, {'t', 'w'}, {'u', 'k'}, {'u', 'r'},
{'u', 'z'}, {'v', 'i'}, {'v', 'o'}, {'w', 'o'},
{'x', 'h'}, {'y', 'o'}, {'z', 'u'}, {' ', ' '}};
UBYTE country_string[16][2] = {{' ', ' '}, {'U', 'S'}, {'J', 'P'}, {' ', ' '},
{' ', ' '}, {' ', ' '}, {' ', ' '}, {' ', ' '},
{' ', ' '}, {' ', ' '}, {' ', ' '}, {' ', ' '},
{' ', ' '}, {' ', ' '}, {' ', ' '}, {' ', ' '}};
/**
* Name: set_hl_btnn_sprm
*
* Arguments: hl_btnn - the new SPRM_HL_BTNN value
*
* Returns: None
*
* Functionality:
* Sets the HL_BTTN in SPRM(8).
*/
void set_hl_btnn_sprm(UBYTE hl_btnn)
{
/* check for invalid highlight button number */
if ( (hl_btnn == 0) || (hl_btnn > 36) )
{
hl_btnn = 1;
}
/* update sprm */
set_sprm( SPRM_HL_BTNN, (USHORT) (((USHORT) hl_btnn) << 10) );
}
/**
* Name: set_sprm
*
* Description: set system parameter value
*
* Arguments: sprmn - system parameter number (0 based)
* value - the value to the assigned
*
* Returns: nothing
*
* Functionality:
* The provider may control the Player by setting the value of SPRMs using
* the Navigation Commands. These parameters may be accessed by the
* Navigation Commands.
*/
void set_sprm(UBYTE sprmn, USHORT value)
{
if (sprmn > MAX_SPRMN)
{
return;
}
sprm[sprmn] = value;
}
/**
* Name: modify_sprm
*
* Description: modify system parameter value
*
* Arguments: sprmn - system parameter number (0 based)
* mask - the value of the AND mask to apply
* value - the value to OR after applying the AND mask
*
* Returns: nothing
*/
void modify_sprm(UBYTE sprmn, USHORT mask, USHORT value)
{
if (sprmn > MAX_SPRMN)
{
return;
}
sprm[sprmn] &= mask;
sprm[sprmn] |= value;
}
/**
* Name: get_sprm
*
* Description: get system parameter value
*
* Arguments: sprmn - system parameter number (0 based)
*
* Returns: the current value assigned
*/
USHORT get_sprm(UBYTE sprmn)
{
if (sprmn > MAX_SPRMN)
{
return (0);
}
return (sprm[sprmn]);
}
/**
* Name: set_gprm
*
* Description: set general parameter value and mode
*
* Arguments: gprmn - general parameter number (0 based)
* mode - operation mode (0-register mode, 1-counter mode)
* value - the value to the assigned
*
* Returns: nothing
*
* Functionality:
* The provider may use these general parameters to memorize the user's
* operational history and to modify player's behavior.
*/
void set_gprm(UBYTE gprmn, UBYTE mode, USHORT value)
{
if (gprmn > MAX_GPRMN)
return;
gprm[gprmn].mode = mode;
gprm[gprmn].value = value;
}
/**
* Name: get_gprm
*
* Description: get general parameter value
*
* Arguments: gprmn - general parameter number (0 based)
*
* Returns: the current value
*/
USHORT get_gprm(UBYTE gprmn)
{
if (gprmn > MAX_GPRMN)
return (0);
return (gprm[gprmn].value);
}
/**
* Name: modify_gprm
*
* Description: modify general parameter value
*
* Arguments: gprmn - general parameter number (0 based)
* mask - the value of the AND mask to apply
* value - the value to OR after applying the AND mask
*
* Returns: nothing
*/
void modify_gprm(UBYTE gprmn, USHORT mask, USHORT value)
{
if (gprmn > MAX_GPRMN)
return;
gprm[gprmn].value &= mask;
gprm[gprmn].value |= value;
}
/**
* Name: gprm_init
*
* Description: initialize general parameter values and modes
*
* Arguments: none
*
* Returns: nothing
*
* Pseudocode: All GPRMs shall be set to zero and in register mode in
* the following conditions:
* 1) at initial access
* 2) when Title_Play(), PTT_Play() or Time_Play() is
* executed in all Domains and Stop State
* 3) when Menu_Call() is executed in Stop State
*/
void gprm_init(void)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -