UiCustom.c
资源名称:SDK_M5661.rar [点击查看]
上传用户:hjhsjcl
上传日期:2020-09-25
资源大小:11378k
文件大小:3k
源码类别:
压缩解压
开发平台:
C++ Builder
- /*==========================================================================
- Copyright (c) 2006 ALi Corporation. All Rights Reserved
- File: UiAmuse.c
- content: user interface for Amuse module
- History: Created by Vicky2006/3/1
- ==========================================================================*/
- #define _UI_AMUSE_H_
- #include <DP8051XP.H>
- #include "TypeDef.h"
- #include "Const.h"
- #include "Reg5661.h"
- #include "Key.h"
- #include "Common.h"
- #include "SaveSetting.h"
- #include "FileSystem.h"
- #include "NandFlash.h"
- #include "ExtCodec.h"
- #include "IntCodec.h"
- #include "UiCommon.h"
- #include "SysStrDef.h"
- #include "OledString.h"
- #include "IconDefine.h"
- #include "OLED.h"
- #include "UICustom.h"
- CBYTE cbStringAmuse[]={'C','U','S','T','O'};
- /*--------------------------------------------------------------------------
- Description:
- Main program for TARGET Amuse
- Arguments:
- Global arguments:
- Returns:
- --------------------------------------------------------------------------*/
- XBYTE xbKeyFlag = FALSE;
- #include "uiGame.C"
- main(void)
- {
- #define DEBUG_SHOWICON 1
- #define DEBUG_SHOWSTR 1
- BYTE bKey;
- //tne 2005/08/24 //use bKey for temp variable to get RTC counter
- bKey=obDCV_INT_FLAG;
- #if(SETTING_FOR_ICE_START)
- SettingForIceStart();
- //SM Clock
- obCLKSMDIVF=0x01;
- obCLKSMCTRL=0xC8; //147/3=49
- NandInit();
- KeyInit();
- #if(!OLED_USE_SM_INTERFEACE)
- OledCtrlEn();
- obPARLCD = 0x31; //Select Parallel Mode & Give CS Hight
- obMODSEL2 |= LCD_PAR_EN; //LCD Parallel mode enable
- obCLKLCDCTRL |= (LCD_CLK_EN | LCD_CLK_3000); //LCD Enable & Set Clock 3MHz
- OledCtrlDis();
- #endif
- OledInit() ;
- FontTableInit();
- LoadStringTableIndex();
- LoadTransTableIndex();
- EnableTimer0();
- gxbExtRtc=0;
- #endif
- SetSysSpeed(0x08);
- OLED_DISP_MASK_INIT();
- gfTransparent = TRUE; //TONY060515
- gxwFGColor = OLED_WHITE;
- OLED_CLEAR_ALL();
- EX0=1;
- EA=1;
- #if(USE_SYS_STR_UNICODE)
- gxfSourceUnicode=STRING_TYPE_UNICODE;
- #else
- gxfSourceUnicode=STRING_TYPE_ASCII;
- #endif
- #if(SYS_USE_KEY_HOLD)
- gfLastKeyLocked=KEY_UNLOCK;
- #endif
- UI_SET_DEFAULT();
- #if 0 //TONY060515
- #if(DEBUG_SHOWICON)
- OledShowNumber(gxbDeviceMode, 0,LINE3, 3);
- #endif
- #if(DEBUG_SHOWSTR)
- #define sizeof_cbStringAmuse 5
- StrShowString(cbStringAmuse,0,LINE0,sizeof_cbStringAmuse);
- #endif
- #endif
- NandPrivateEn();
- ReadSettingData(FS_DATA_0_0);
- NandPrivateDis();
- // UI_SHOW_BATTERY(); //TONY060515
- InitGameMode();
- while(1)
- {
- KeyGet(bKey);
- UiNormalCheck();
- UiCheckBackLight(bKey);
- Game_KeyDown(bKey); //TONY060515
- Game_TimerOut();
- if(xbKeyFlag == TRUE)
- {
- bKey = KEY_INVALID;
- }
- switch (bKey)
- {
- #if(UI_USE_MODE_KEY)
- if(gc_GameName ==SELECT_GAME_MENU )
- {
- //case KEY_FUNC_LONG:
- case KEY_FUNC_LONG_BREAK:
- gxbSettingBuffer[SETTING_CURRENT_MODE]=SAVE_AND_PLAY; //vicky060302#1
- gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_SEL_MODE;
- gxbSettingBuffer[SETTING_DISPLAY_SWAPING]=TRUE;
- gxbLastErrCode=ERR_NO_ERROR;
- SaveSetting();
- break;
- }
- #endif
- }
- }
- }
- #if(UI_USE_ALARM_DISPLAY)
- //tne 2007/01/15 #1 move to UiCommon.c
- //API void UiShowWakeUp(void)
- #endif