📄 setup.c
字号:
#include "winav.h"#ifndef IMAGE_FRAME_SETUP //CoCo2.38#ifndef SUPPORT_STB#define MAIN_SETUP_DECLARE#include <string.h>#include "ctkav.h"#include "input.h"#include "osd.h"#include "hal.h"#include "cc.h"#include "hal.h"#include "chips.h"#include "navigate.h"#include "infofilter.h"#include "utl.h"#include "SrcFilter.h"#include "gdi.h"#include "fontindex.h" //++CoCo2.37P#include "osd3.h"#include "comutl.h"#include "cell.h"#define BACK_DOOR_DECLARE#include "setup.h"#include "osddsply.h"#include "osdnd.h"#include "osddlg.h"#include "osddivx.h"#include "mmanager.h"#include "romld.h"#include "media.h" //xuli2.53#define SETUP_MAIN_FILE//#include "setupstr.lan"#include "OSDString\\strextrn.h"#ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAMBYTE __bPreCountStop; //Xuli1.26, Save the previous stop mode before entering SETUP to decide if need resume after exit.#endif#define IDENTIFY_STRING "C"#define FRAME_THICKNESS 2#define SETUP_WIDTH 616#define SETUP_HEIGHT 410 #ifdef SUPPORT_CHAR_SUBPICTURE#include "char_subpict.h"#endif// SETUP_FRAME_Y0 should be lower than the upper osd region, otherwise// When input disc, it shows "Loading...".// The strings will cover partial of Setup UI#define SETUP_FRAME_X0 SETUP_GLOBAL_OFFSET_X#define SETUP_FRAME_Y0 SETUP_GLOBAL_OFFSET_Y#define SETUP_FRAME_X1 (SETUP_WIDTH + SETUP_FRAME_X0)#define SETUP_FRAME_Y1 (SETUP_HEIGHT + SETUP_FRAME_Y0) #define CENTER_FRAME_X0 SETUP_FRAME_X0 #define CENTER_FRAME_Y0 (SETUP_FRAME_Y0 + 41) #define CENTER_FRAME_X1 SETUP_FRAME_X1#define CENTER_FRAME_Y1 (SETUP_FRAME_Y1 - 41) #ifdef SUPPORT_SETUP_HORIZONTAL_ICON_MENU#define ICON_FRAME_X0 (22+SETUP_FRAME_X0)//#define ICON_FRAME_Y0 (CENTER_FRAME_Y0 + 5) #define ICON_FRAME_Y0 (CENTER_FRAME_Y0 + 0) #define ICON_FRAME_X1 (ICON_FRAME_X0 + 570)#define ICON_FRAME_Y1 (ICON_FRAME_Y0 + 57) #else#define ICON_FRAME_X0 (5+SETUP_FRAME_X0)#define ICON_FRAME_Y0 (SETUP_FRAME_Y0 + 67) #define ICON_FRAME_X1 (ICON_FRAME_X0 + 76)#define ICON_FRAME_Y1 (ICON_FRAME_Y0 + 274) #endif#define BACKDOOR_DISPLAY_VERSION_START_V 45 #define BACKDOOR_DISPLAY_VERSION_START_H ICON_FRAME_X0 #define VERSION_OFFSET 120#define BACKDOOR_DISPLAY_VERSION_START_H1 (BACKDOOR_DISPLAY_VERSION_START_H + 320) // Brian0.87// We can enter back door when selection bar is on a specified position// BACKDOOR_ENTRY_POINT defines this position#define BACKDOOR_ENTRY_POINT SETUP_MAIN_LANGUAGE#define WRITE_EEPROM_ENABLE// brian.277a-3rd, definition for _SetTestTone function#define MUTE_CHANNEL 0#define L_CHANNEL 1#define R_CHANNEL 2#define C_CHANNEL 3#define LS_CHANNEL 4#define RS_CHANNEL 5#define SW_CHANNEL 6#define SPEAKER_ALL 0x3F // 00111111#define SPEAKER_L 0x01 // 00000001#define SPEAKER_R 0x02 // 00000010#define SPEAKER_C 0x04 // 00000100#define SPEAKER_LS 0x08 // 00001000#define SPEAKER_RS 0x10 // 00010000#define SPEAKER_SW 0x20 // 00100000#define SPEAKER_HIGHLIGHT 0x40 // 01000000#define SPEAKER_CLEAR 0x80 // 10000000#define FORMAT_VERSION 0 #define FORMAT_DATE 1#define FORMAT_NUMBER 2#define DEBUG_MODE_0 0x00000000#define DEBUG_MODE_1 0x00000011#define DEBUG_MODE_2 0x00000022#define DEBUG_MODE_3 0x00001100#define DEBUG_MODE_4 0x00001111#define DEBUG_MODE_5 0x00001122#define DEBUG_MODE_6 0x00002200#define DEBUG_MODE_7 0x00002211#define DEBUG_MODE_8 0x00002222#define DEBUG_MODE_9 0x00400222#define DEBUG_MODE_10 0x00400211#define DEBUG_MODE_11 0x00400200BYTE _bCARDPath, _bNIMPath;#ifndef REMOVE_SETUP_SPEAKER_TESTBYTE _bTestToneStage;DWORD _dwStageCount;BYTE _bDSPTestTone; // record whether we are using DSP test tone micro code or not#endif#define BACKDOOR_DISPLAY_X (460+SETUP_GLOBAL_OFFSET_X) // Brian1.24#define BACKDOOR_DISPLAY_Y (SETUP_FRAME_Y0 + 5) #define BACKDOOR_SERVO_X (300+SETUP_GLOBAL_OFFSET_X) // Brian1.24#define BACKDOOR_SERVO_Y 36#include "disp.h"//***************************************************************************// save to EEPROM info.BYTE __bPassword[SETUP_PASSWORD_NO+1];BYTE __bSetupMode; // = FALSE; put in _INITIAL_Variables_PowerONBYTE __bLanguageCode[4];BYTE _bAudioTypeChange; // = FALSE;BYTE _bVideoSettingChange; // = FALSE;BYTE _bParentalControlChange; // = FALSE;// for SETUP_InputPasswordBYTE __bInputPassword; //=FALSE;BYTE __bInputPasswordIndex; // = 0;BYTE __bSETUPUIStyleChanged = FALSE;BYTE *pbSetupPtr;BYTE i;BYTE _bSetupTemp;#ifdef _DEBUG_INFOBYTE _bEEPROMError = 0;#endif// update Setup info to SPRMextern WORD aPlayIcon[];extern WORD aDirIcon[];extern WORD aColon[];#ifndef NO_DISC_MODE //CoCo2.37pextern WORD __wSPRMs [];#endif //#ifndef NO_DISC_MODE //CoCo2.37pextern BYTE __bNowBTNNumber;extern BYTE __bInvalidRegion;extern BYTE _bShowCEMessage;extern BYTE __bServoRevision[];// wyc2.00-909Sextern BYTE __dwMMJPEGPreview;extern DWORD __dwVersionCard;extern void _SetAudType(BYTE bType); // in CHIPS module#ifndef SUPPORT_ATAPI_SOURCEextern BYTE SRVDBG_PCBNumber(void);extern BYTE SRVDBG_MotorDriver(void);extern BYTE SRVDBG_RFAmpChip(void);extern BYTE SRVDBG_MotorPower(void);#endifvoid _SetAngleMarkTime(void);void _WriteSetupData(BYTE bSetup, BYTE bDefaultPassword);void _SetTestTone(BYTE bChannel);void _SoftVolumeMax(void); // brian.277a-3rdvoid OSDSETUP_Display(void);void OSDSETUP_ProcessSpeaker(void);//CoCo1.11a, for backdoorvoid _OutputAllSWVersion(void);void _OutputVersion(DWORD dwVersion, BIT btFormat);void _TranslateString(BYTE* pbAsciiString);void _ClearVersionRegion(void);//BYTE _GetDebugIndex(void);void _OutputDebugInfo(void);WORD _TranslateNum(BYTE bNum);WORD* _TranslateDebugMode(BYTE bMode); BYTE _GetDebugIndex(DWORD dwMode);void _SetDebugMode(BYTE bIndex);void _GetUsefulDebugMode(BYTE bDIR);DWORD _dwDebugMode;DWORD _dwBackupDebugMode;BYTE _bDebugIndex;BYTE _bPasswordOK=FALSE;//extern WORD aDigit[];extern BYTE _bGDIInit;extern BYTE __bThumbnailRepaint;extern BYTE __bThumbnailMode;extern BYTE DATA _bOSDLang;//CoCo1.11a, for backdoorextern BYTE _bUDEData[6];extern COPYINFO cpinfo ; // Brian1.25//Alan, for drawingWORD _wSetupTemp;WORD _wSetupString[GDI_STRING_LENGTH];PARM_FRAME _SETUP_FrameAttr;PARM_DRAW_STRING _SETUP_StrAttr;PARM_RECT _SETUP_RectAttr;void _SETUP_ShowUI(void);void _SETUP_ClearUI(void);void _SETUP_Exit(void);void _SETUP_NumberToString(WORD wNum);void _SETUP_OutputNumber(WORD wX, WORD wY, WORD wNum, BYTE bTextColor, BYTE bBackgroundColor);void _SETUP_OutputString(WORD wX, WORD wY, BYTE bTextColor, BYTE bBackgroundColor);void _SETUP_InitPalette(void);void _SETUP_DrawSelectString(BYTE bOSDLanguage);void _SETUP_ShowSpeaker(BYTE bLoc);void _SaveDataToSetupInfo(void);void _ProcessBackDoorKey(void);void _SpeakerTest(void);void _SetDownMix(void);void _SetAnalogEnable(void);void _SETUP_FillRect(WORD wLeft, WORD wTop, WORD wRight, WORD wBottom); //CoCo1.20, reduce code size.void _SETUP_DrawFrame(WORD wLeft, WORD wTop, WORD wRight, WORD wBottom); //CoCo1.20, reduce code size.void _SETUP_DrawString(void); //CoCo1.20, reduce code size.void _SETUP_DrawDynamicString(WORD *pwString); //CoCo1.20, reduce code size.#ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAMvoid _SETUP_EnterByPrestop(void);void _SETUP_ExitByResume(void);#endifextern void _InitRect(PURECT pRect, WORD wLeft, WORD wTop, WORD wRight, WORD wBottom); //CoCo1.20, reduce code size.//Alex1.07a, 20031013 SHOW PSCAN PROMPT#if defined (SUPPORT_PSCAN_PROMPT_SETUP) || defined (SUPPORT_PSCAN_PROMPT_OSD)extern BYTE __bOSDPromptPreKey;extern BYTE __bOSDPromptMode;extern BYTE OSDSETUP_InputPscan(BYTE bKey);extern void OSDSETUP_ScreenVideoOutputPscanDlg(void);extern WORD OSDUTL_TransformChar(char chCode);#endif //#if defined (SUPPORT_PSCAN_PROMPT_SETUP) || defined (SUPPORT_PSCAN_PROMPT_OSD)// Brian, support GDI library/*--CoCo1.20, reduce code size.DWORD code _aSpeaker[]={#ifndef REMOVE_SETUP_SPEAKER_TEST#include "bmp/Speaker.txt"#else0x0, 0x00000002, 0x0, 0x0, // dummy, for no speaker case. Set Size to 0, so no data will be download to DRAM#endif};#define GDI_BMP_SPEAKER 0#define GDI_MAX_SETUP_BMP_NUM 1DWORD * _aSetupBMPArray[GDI_MAX_SETUP_BMP_NUM] = { _aSpeaker // 32};*///CoCo1.20, reduce code size.#define GDI_BMP_SPEAKER 0#define GDI_MAX_SETUP_BMP_NUM 1//CoCo1.20, reduce code size.#ifndef REMOVE_SETUP_SPEAKER_TESTDWORD code _aSpeaker[]={#include "bmp/Speaker.txt"};#define GDI_BMP_SPEAKER 0#define GDI_MAX_SETUP_BMP_NUM 1DWORD * _aSetupBMPArray[GDI_MAX_SETUP_BMP_NUM] = { _aSpeaker // 32};#endif //REMOVE_SETUP_SPEAKER_TEST#if (!defined(REMOVE_SETUP_ICON)) || (!defined(REMOVE_SETUP_SPEAKER_TEST))DWORD Palette_Setup[]= {#include "bmp/PalSetup.txt" };#elseDWORD Palette_Setup[]= {0x0 // dummy};#endifGDI_PALETTE_INFO __PaletteInfo_Setup = {95, PAL_ADDR, Palette_Setup};BYTE SETUP_ProcessKey(void){ extern BYTE __bMediaSelectUI; BYTE bKeyStatus; // wyc2.17-909S, support KEY_DISPLAY as SETUP key.#ifdef SUPPORT_DISPLAY_KEY_DO_SETUP if ((__btPlaying == FALSE) && (__btPause == FALSE) && (__bModeCmd == KEY_STOP)) { if (__bKey == KEY_DISPLAY) __bKey = KEY_SETUP; }#endif // if ((__bSetupMode == FALSE) && (__bKey!=KEY_SETUP)) { // If not in SETUP mode now, and Key is not SETUP // just return, process as normal keys return KEY_BYPASS; //FALSE; } bKeyStatus = INVALID_KEY;#ifdef SUPPORT_USB_SOURCE if(__bChooseMedia == MEDIA_SELECT_USB) //xuli2.53 { if ((__bKey == KEY_OPEN_CLOSE) || (__bKey == KEY_FUNCTION)) return KEY_NO_KEY; //xuli2.53 }#endif // if ((__bKey == KEY_POWER) || (__bKey == KEY_OPEN_CLOSE)) { __bSetupMode = FALSE; //Brian1.05 //_bDoBackDoor = FALSE; if (_bDoBackDoor) _ExitBackDoor(); __bInputPassword = FALSE;#if defined (SUPPORT_PSCAN_PROMPT_SETUP) || defined (SUPPORT_PSCAN_PROMPT_OSD) // Brian1.07a, cancel PScan prompt __bOSDPromptMode = FALSE;#endif //Brian0.86-2, clear the region and inform OSD _SETUP_ClearUI(); return KEY_BYPASS; //TRUE;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -