osdgame_if.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /******************************************************************************/
  2. /**
  3. *
  4. * \file osdgame_if.h
  5. *
  6. *
  7. * \brief The header file for the declaration of the osd game Interface API Functions and Data Structures. \n
  8. *
  9. * \note Copyright (c) 2009 Sunmedia Technology Co., Ltd. \n
  10. * All rights reserved.
  11. *
  12. *
  13. * author xy.zhu@sunmedia.com.cn
  14. *
  15. ******************************************************************************/
  16. #ifndef _OSDGAME_IF_H
  17. #define _OSDGAME_IF_H
  18. #ifdef OSDGAME_IF_IMPLEMENTATION
  19. #define EBD_IF_EXTERN
  20. #else
  21. #define EBD_IF_EXTERN extern
  22. #endif
  23. #define USER_NAME_LEN (4)
  24. #define DEFAULT_SCORE_LIST_NUM (5)
  25. /*
  26. For the boxman game.
  27. The Apis.
  28. */
  29. #ifdef CONFIG_OSDGAME_BOXMAN_SUPPORT
  30. #define BOX_MAN_SYSINFO_SIZE (152)
  31. #else
  32. #define BOX_MAN_SYSINFO_SIZE (0)
  33. #endif
  34. #ifdef CONFIG_OSDGAME_TETRIS_SUPPORT
  35. #define RUSSIA_SYSINFO_SIZE (1 + 1 + 1 + 1+ USER_NAME_LEN * DEFAULT_SCORE_LIST_NUM + 2 * DEFAULT_SCORE_LIST_NUM + 2)//speed, difficult, listnum, aligned, score_list, aligned
  36. #else
  37. #define RUSSIA_SYSINFO_SIZE (0)
  38. #endif
  39. #ifdef CONFIG_OSDGAME_HITRAT_SUPPORT
  40. #define HITRAT_SYSINFO_SIZE (1 + 1 + 2+ USER_NAME_LEN * DEFAULT_SCORE_LIST_NUM + 2 * DEFAULT_SCORE_LIST_NUM + 2)//level, list_num, aligner, score_list, aligned
  41. #else
  42. #define HITRAT_SYSINFO_SIZE (0)
  43. #endif
  44. #ifdef CONFIG_OSDGAME_SUDOKU_SUPPORT
  45. #define SUDOKU_SYSINFO_SIZE (1 + 1 + 2)//Level, count, aligned
  46. #else
  47. #define SUDOKU_SYSINFO_SIZE (0)
  48. #endif
  49. #ifdef CONFIG_OSDGAME_GOBANG_SUPPORT
  50. #define GOBANG_SYSINFO_SIZE (4)// Reserved 4 bytes for future
  51. #else
  52. #define GOBANG_SYSINFO_SIZE (0)
  53. #endif
  54. #define OSDGAME_USERDATE_LEN (RUSSIA_SYSINFO_SIZE + BOX_MAN_SYSINFO_SIZE + HITRAT_SYSINFO_SIZE + SUDOKU_SYSINFO_SIZE + GOBANG_SYSINFO_SIZE)
  55. #define MESSAGE_QUEUE_TYPE_GAMEDRV (1<<25)
  56. typedef enum
  57. {
  58. GAME_RESPOND_N32GAME_RUNNING_DONE = 1,
  59. GAME_RESPOND_N32GAME_RUNNING_MPG,
  60. GAME_RESPOND_N32GAME_RUNNING_MPG_DONE,
  61. GAME_RESPOND_NESGAME_RUNNING_DONE,
  62. GAME_RESPOND_NESGAME_HOMEMENU_DONE,
  63. GAME_RESPOND_GOTO_HOMEMENU,
  64. GAME_RESPOND_NESGAME_POWER_DONE,
  65. GAME_RESPOND_NESGAME_EJECT_DONE,
  66. GAME_RESPOND_OSDGAME_RUNNING_DONE,
  67. GAME_RESPOND_MDGAME_RUNNING_DONE,
  68. GAME_RESPOND_RUNNING_EBOOK,
  69. GAME_RESPOND_RUNNING_KARAOKE,
  70. GAME_RESPOND_RUNNING_KARAOKE_NES,
  71. GAME_RESPOND_RUNNING_DONE_BY_READ_ERROR,
  72. GAME_RESPOND_RUNNING_DONE_BY_UNSUPPORT_GAME,
  73. GAME_RESPOND_OSDGAME_NAME_EDIT,
  74. GAME_RESPOND_OSDGAME_EXIT_GAME,
  75. GAME_RESPOND_MAX
  76. }GAME_RESPOND_Message_t;
  77. typedef enum _OsdGame_Type_e
  78. {
  79. OSDGAMA_GOBANG = 1,
  80. OSDGAMA_SUDOKU,
  81. OSDGAMA_BOXMAN,
  82. OSDGAMA_RUSSIA,
  83. OSDGAMA_HITRAT,
  84. } OsdGame_Type_e;
  85. typedef enum _OSDGAME_NATIVEGAME_E_
  86. {
  87. NUM_EVENT_0 = 0,
  88. NUM_EVENT_1,
  89. NUM_EVENT_2,
  90. NUM_EVENT_3,
  91. NUM_EVENT_4,
  92. NUM_EVENT_5,
  93. NUM_EVENT_6,
  94. NUM_EVENT_7,
  95. NUM_EVENT_8,
  96. NUM_EVENT_9,
  97. LEFT_EVENT,
  98. RIGHT_EVENT,
  99. UP_EVENT,
  100. DN_EVENT,
  101. PAGEUP_EVENT,
  102. PAGEDN_EVENT,
  103. SELECT_EVENT,
  104. RETURN_EVENT,
  105. UPDATE_UI_EVENT,
  106. UPDATE_PIC_EVENT,
  107. TIMER_EVENT,
  108. UPDATE_TIMER_COUNT,
  109. EXIT_EVENT,
  110. DELETE_EVENT,
  111. BOSS_QUEUE_EVENT,
  112. MAX_EVENT_NUM
  113. }OSDGAME_NATIVEGAME_E;
  114. #define OSDGAME_MESSAGE_MASK (0x0000FFFF)
  115. #define OSDGAME_MESSAGE_TYPE_MASK (0xFFFF0000)
  116. #define OSDGAME_GLOBAL_EVENT_TYPE (1<<31)
  117. #define OSDGAME_INTERNAL_MESSAGE_TYPE (1<<28)
  118. #define OSDGAME_TASKCREATE_FAIL 0
  119. #define OSDGAME_TASKCREATE_SUCCESS 1
  120. typedef struct _OSDGAME_MessageBody_t
  121. {
  122. UINT32 dMessage;
  123. UINT32 dParam;
  124. UINT32 dParam2;
  125. } OSDGAME_MessageBody_t;
  126. #define OSDGAME_APP_MESSAGE_BODY_SIZE (sizeof(OSDGAME_MessageBody_t))
  127. typedef int (*OSD_Game_EventCallback) (GAME_RESPOND_Message_t dGMWCallbackType, UINT32 dParam);
  128. extern OSD_Game_EventCallback g_pfOsdGameCallback;
  129. typedef struct _OsdGameParaStructure_t
  130. {
  131. UINT8 u8FontSize;
  132. bool bIsFullScreen;
  133. OsdGame_Type_e bOsdType;
  134. GL_Queue_t* pIRMSGQueueHandle;
  135. OSD_Game_EventCallback pfEvenCallback;
  136. } OsdGameParaStructure_t;
  137. /****************************IR PART***********************************************/
  138. /**************************** return value define*************************************/
  139. #define OSDGAME_IF_SUCCESSFUL (0)
  140. #define OSDGAME_IF_FAIL (-1)
  141. #define OSDGAME_IF_ERROE_PROCESS (-2)
  142. #define OSDGAME_IF_ERROE_QUEUE_CREAT_FAIL (-3)
  143. /****************************FUNCTION PART****************************************/
  144. /**************************************************************************************/
  145. /******************************************************************************************/
  146. /**fun: int OsdGame_Initilaize(OsdGame_Type_e bOsdType,GL_Queue_t* pIRMSGQueueHandle, GL_Queue_t* pNavQueueHandle);
  147. *
  148. * \brief Play OsdGame API
  149. * \param bOsdType:OsdGame type:Gobang Sudoku Hitrat Russia Boxman
  150. * \param pIRMSGQueueHandle: ir_event QueueHandle
  151. * \param pfEvenCallback: game driver Respond MSG Handle
  152. *
  153. * \return OSDGAME_IF_SUCCESSFUL if the gamedriver is initialized.
  154. *
  155. * \note You must creat two message queue (IRMsgHandle & NavMsgHandle) and set this message handle to gamedriver.\n
  156. * When game is running,you must send Ir event message to pIRMSGQueueHandle,receive nav message from pNavQueueHandle.\n
  157. * The message body definetion defined in this *.h file too.
  158. *
  159. *\author xy.zhu@sunmedia.com.cn
  160. ******************************************************************************************/
  161. /*******************************************************************************************************************/
  162. EBD_IF_EXTERN int OsdGame_Initilaize(OsdGameParaStructure_t* tParaStructure);
  163. EBD_IF_EXTERN UINT8 *OsdGame_GetGameDataAddr(void);//jgliu 2009-12-08 add for game saving
  164. EBD_IF_EXTERN void OsdGame_Reset(void);//jgliu 2009-12-08 add for game saving
  165. EBD_IF_EXTERN void OsdGame_Exit(void);//2010/01/12 yhong 0077217 When Timer Wake at Game, System block.
  166. EBD_IF_EXTERN void OsdGame_SetFontBmpSize(UINT8 u8Width,UINT8 u8Height);
  167. EBD_IF_EXTERN int OsdGame_GetExitTime(void);//jgliu 2010-06-24 add for mantis:92771
  168. EBD_IF_EXTERN void OsdGame_ExitGame(void);
  169. //fanzhang add 2010/09/08 for mantis bug 104051 start {
  170. EBD_IF_EXTERN void OsdGame_SetTransparency(UINT8 bValue);
  171. EBD_IF_EXTERN UINT8 OsdGame_GetTransparency(void);
  172. //fanzhang add 2010/09/08 for mantis bug 104051 end }
  173. #endif //_OSDGAME_IF_H