UiCustom.c
上传用户:hjhsjcl
上传日期:2020-09-25
资源大小:11378k
文件大小:3k
源码类别:

压缩解压

开发平台:

C++ Builder

  1. /*==========================================================================
  2. Copyright (c) 2006 ALi Corporation. All Rights Reserved
  3. File: UiAmuse.c
  4. content: user interface for Amuse module
  5. History: Created by Vicky2006/3/1
  6. ==========================================================================*/
  7. #define _UI_AMUSE_H_
  8. #include <DP8051XP.H>
  9. #include "TypeDef.h"
  10. #include "Const.h"
  11. #include "Reg5661.h"
  12. #include "Key.h"
  13. #include "Common.h"
  14. #include "SaveSetting.h"
  15. #include "FileSystem.h"
  16. #include "NandFlash.h"
  17. #include "ExtCodec.h"
  18. #include "IntCodec.h"
  19. #include "UiCommon.h"
  20. #include "SysStrDef.h"
  21. #include "OledString.h"
  22. #include "IconDefine.h"
  23. #include "OLED.h"
  24. #include "UICustom.h"
  25. CBYTE cbStringAmuse[]={'C','U','S','T','O'};
  26. /*--------------------------------------------------------------------------
  27. Description:
  28. Main program for TARGET Amuse
  29. Arguments:
  30. Global arguments:
  31. Returns: 
  32. --------------------------------------------------------------------------*/
  33. XBYTE xbKeyFlag = FALSE;
  34. #include "uiGame.C"
  35. main(void)
  36. {
  37. #define DEBUG_SHOWICON 1
  38. #define DEBUG_SHOWSTR 1
  39. BYTE bKey;
  40. //tne 2005/08/24 //use bKey for temp variable to get RTC counter
  41. bKey=obDCV_INT_FLAG;
  42. #if(SETTING_FOR_ICE_START)
  43. SettingForIceStart();
  44. //SM Clock
  45. obCLKSMDIVF=0x01;
  46. obCLKSMCTRL=0xC8; //147/3=49
  47. NandInit();
  48. KeyInit();
  49. #if(!OLED_USE_SM_INTERFEACE)
  50. OledCtrlEn();
  51. obPARLCD = 0x31;  //Select Parallel Mode & Give CS Hight
  52. obMODSEL2 |= LCD_PAR_EN; //LCD Parallel mode enable
  53. obCLKLCDCTRL |= (LCD_CLK_EN | LCD_CLK_3000); //LCD Enable & Set Clock 3MHz
  54. OledCtrlDis();
  55. #endif
  56. OledInit() ;
  57.         FontTableInit();
  58. LoadStringTableIndex();
  59. LoadTransTableIndex();
  60. EnableTimer0();
  61. gxbExtRtc=0;
  62. #endif
  63. SetSysSpeed(0x08);
  64. OLED_DISP_MASK_INIT();
  65. gfTransparent = TRUE;  //TONY060515
  66. gxwFGColor = OLED_WHITE;
  67. OLED_CLEAR_ALL(); 
  68. EX0=1;
  69. EA=1;
  70. #if(USE_SYS_STR_UNICODE)
  71. gxfSourceUnicode=STRING_TYPE_UNICODE;
  72. #else
  73. gxfSourceUnicode=STRING_TYPE_ASCII;
  74. #endif
  75. #if(SYS_USE_KEY_HOLD)
  76. gfLastKeyLocked=KEY_UNLOCK;
  77. #endif
  78. UI_SET_DEFAULT();
  79. #if 0  //TONY060515
  80. #if(DEBUG_SHOWICON)
  81. OledShowNumber(gxbDeviceMode, 0,LINE3, 3);
  82. #endif
  83. #if(DEBUG_SHOWSTR)
  84. #define sizeof_cbStringAmuse 5
  85. StrShowString(cbStringAmuse,0,LINE0,sizeof_cbStringAmuse);
  86. #endif
  87. #endif
  88. NandPrivateEn(); 
  89. ReadSettingData(FS_DATA_0_0);
  90. NandPrivateDis(); 
  91.         // UI_SHOW_BATTERY();   //TONY060515
  92. InitGameMode();
  93. while(1)
  94. {
  95. KeyGet(bKey);
  96. UiNormalCheck();
  97. UiCheckBackLight(bKey);
  98. Game_KeyDown(bKey);   //TONY060515
  99. Game_TimerOut();
  100. if(xbKeyFlag == TRUE)
  101. {
  102. bKey = KEY_INVALID;
  103. }
  104. switch (bKey)
  105. {
  106. #if(UI_USE_MODE_KEY)
  107. if(gc_GameName ==SELECT_GAME_MENU )
  108. {
  109. //case KEY_FUNC_LONG:
  110. case KEY_FUNC_LONG_BREAK:
  111. gxbSettingBuffer[SETTING_CURRENT_MODE]=SAVE_AND_PLAY; //vicky060302#1   
  112. gxbSettingBuffer[SETTING_NEXT_MODE]=SAVE_AND_SEL_MODE;
  113. gxbSettingBuffer[SETTING_DISPLAY_SWAPING]=TRUE;
  114. gxbLastErrCode=ERR_NO_ERROR;
  115. SaveSetting();
  116. break;
  117. }
  118. #endif
  119. }
  120. }
  121. }
  122. #if(UI_USE_ALARM_DISPLAY)
  123. //tne 2007/01/15 #1 move to UiCommon.c
  124. //API void UiShowWakeUp(void)
  125. #endif