Copter.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:127k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  * Filename:
  37.  * ---------
  38.  *  Copter.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *  Maui
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *  Game Copter function.
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  *------------------------------------------------------------------------------
  88.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  89.  *============================================================================
  90.  ****************************************************************************/
  91. #include "MMI_features.h"
  92. #include "GameDefs.h"
  93. #ifdef IS_COPTER_BASE_GAME
  94. #include "GameInc.h"
  95. #include "CopterProts.h"
  96. #include "CopterDefs.h"
  97. #include "gdi_include.h"
  98. #ifdef __MMI_TOUCH_SCREEN__
  99. #include "wgui_touch_screen.h"
  100. #endif 
  101. /***************************************************************************** 
  102. * Define
  103. *****************************************************************************/
  104. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_JET_128x160__)
  105. #define MMI_GX_COPTER_GAME_ORIGIN      (32)     /* where the game really is rendered */
  106. #define MMI_GX_COPTER_SCORE_POSITION_X (10)
  107. #define MMI_GX_COPTER_LCD_HEIGHT       (160)
  108. #define MMI_GX_COPTER_LCD_WIDTH        (128)
  109. #define MMI_GX_COPTER_GAME_HEIGHT      (110)
  110. #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  111. #define MMI_GX_COPTER_GAME_ORIGIN      (17)     /* where the game really is rendered */
  112. #define MMI_GX_COPTER_SCORE_POSITION_X (34)
  113. #define MMI_GX_COPTER_LCD_HEIGHT       (128)
  114. #define MMI_GX_COPTER_LCD_WIDTH        (128)
  115. #define MMI_GX_COPTER_GAME_HEIGHT      (110)
  116. #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  117. #define MMI_GX_COPTER_GAME_ORIGIN      (44)     /* where the game really is rendered */
  118. #define MMI_GX_COPTER_SCORE_POSITION_X (15)
  119. #define MMI_GX_COPTER_LCD_HEIGHT       (220)
  120. #define MMI_GX_COPTER_LCD_WIDTH        (176)
  121. #define MMI_GX_COPTER_GAME_HEIGHT      (151)
  122. #endif 
  123. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_128x128__)
  124. #define MMI_GX_COPTER_SCORE_POSITION_Y (7)
  125. #define MMI_GX_COPTER_TITLE_POSITION_X (70)
  126. #define MMI_GX_COPTER_OBSTACLE_WIDTH   (8)
  127. #define MMI_GX_COPTER_OBSTACLE_HEIGHT  (24)
  128. #define MMI_GX_COPTER_OBSTACLE_SPEED   (3)
  129. #define MMI_GX_COPTER_COPTER_HEIGHT    (12)
  130. #define MMI_GX_COPTER_COPTER_WIDTH     (25)
  131. #define MMI_GX_COPTER_COPTER_X         (14)
  132. #define MMI_GX_COPTER_DIGIT_WIDTH      (4)
  133. #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  134. #define MMI_GX_COPTER_SCORE_POSITION_Y (9)
  135. #define MMI_GX_COPTER_TITLE_POSITION_X (90)
  136. #define MMI_GX_COPTER_OBSTACLE_WIDTH   (11)
  137. #define MMI_GX_COPTER_OBSTACLE_HEIGHT  (33)
  138. #define MMI_GX_COPTER_OBSTACLE_SPEED   (4)
  139. #define MMI_GX_COPTER_COPTER_HEIGHT    (17)
  140. #define MMI_GX_COPTER_COPTER_WIDTH     (35)
  141. #define MMI_GX_COPTER_COPTER_X         (19)
  142. #define MMI_GX_COPTER_DIGIT_WIDTH      (6)
  143. #endif 
  144. #if defined(GDI_USING_LAYER)
  145. #define MMI_GX_COPTER_BACKGROUND_SPEED    (MMI_GX_COPTER_OBSTACLE_SPEED / 2)
  146. #define MMI_GX_COPTER_TRANSPARENT_COLOR   (GDI_COLOR_BLUE)
  147. #define MMI_GX_COPTER_BG_LIST_NUMBER      (4)
  148. #endif /* defined(GDI_USING_LAYER) */ 
  149. #define MMI_GX_COPTER_OBSTACLE_COUNT   (MMI_GX_COPTER_LCD_WIDTH / MMI_GX_COPTER_OBSTACLE_WIDTH + 1)     /* := screen width / obstacle width + 1 */
  150. #define MMI_GX_COPTER_BACK_COLOR       (gui_color(0, 0, 0))
  151. #define MMI_GX_COPTER_BORDER_COLOR     (gui_color(71, 71, 71))
  152. #define MMI_GX_COPTER_LIGHT_BORDER     (gui_color(133, 133, 133))
  153. #define MMI_GX_COPTER_DARK_BORDER      (gui_color(16, 16, 16))
  154. /*
  155.  * Height of elements in screen for 128x160.
  156.  * *  --------------------
  157.  * *  status               (32)           
  158.  * *  --------------------
  159.  * *
  160.  * *  copter space         (110)
  161.  * *
  162.  * *  --------------------
  163.  * *  ground               (18)
  164.  * *  --------------------
  165.  */
  166. /*
  167.  * Height of elements in screen for 128x128.
  168.  * *  --------------------
  169.  * *  status               (17)           
  170.  * *  --------------------
  171.  * *
  172.  * *  copter space         (110)
  173.  * *
  174.  * *  -------------------- (1)
  175.  */
  176. /*
  177.  * Height of elements in screen for 176x220.
  178.  * *  --------------------
  179.  * *  status               (44)           
  180.  * *  --------------------
  181.  * *
  182.  * *  copter space         (151)
  183.  * *
  184.  * *  --------------------
  185.  * *  ground               (25)
  186.  * *  --------------------
  187.  */
  188. #ifdef __MMI_TOUCH_SCREEN__
  189. /* touch screen */
  190. void mmi_copter_pen_down_hdlr(mmi_pen_point_struct pos);
  191. void mmi_copter_pen_up_hdlr(mmi_pen_point_struct pos);
  192. void mmi_copter_pen_repeat_hdlr(mmi_pen_point_struct pos);
  193. #endif /* __MMI_TOUCH_SCREEN__ */ 
  194. /***************************************************************************** 
  195. * MACRO
  196. *****************************************************************************/
  197. #define ERASE_AND_DRAW_OBSTACLES(tmp_node, fill_rect_func, color)                                                    
  198. {                                                                                                                    
  199.    tmp_node = g_gx_copter_context.first_obstacle;                                                                    
  200.    while (1)                                                                                                         
  201.    {                                                                                                                 
  202.       /* erase ceiling obstacles */                                                                                  
  203.       fill_rect_func(   tmp_node->old_position_x,                                                                    
  204.                         tmp_node->old_position_y,                                                                    
  205.                         tmp_node->old_position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1,                                 
  206.                         tmp_node->old_position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT - 1,                                
  207.                         color);                                                                                      
  208.       /* erase floor obstacles */                                                                                    
  209.       fill_rect_func(   tmp_node->old_position_x,                                                                    
  210.                         tmp_node->old_position_y + g_gx_copter_context.space,                                        
  211.                         tmp_node->old_position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1,                                 
  212.                         tmp_node->old_position_y + 2 * MMI_GX_COPTER_OBSTACLE_HEIGHT + g_gx_copter_context.space - 1,
  213.                         color);                                                                                      
  214.       if (tmp_node == g_gx_copter_context.last_obstacle)                                                             
  215.          break;                                                                                                      
  216.       tmp_node = tmp_node->next;                                                                                     
  217.    }                                                                                                                 
  218.                                                                                                                      
  219.    /* draw ceiling and floor obstacles */                                                                            
  220.    tmp_node = g_gx_copter_context.first_obstacle;                                                                    
  221.    while (1)                                                                                                         
  222.    {                                                                                                                 
  223.       /* draw ceiling obstacles */                                                                                   
  224.       gui_show_image(   tmp_node->position_x,                                                                        
  225.                               tmp_node->position_y,                                                                  
  226.                               (PU8)GetImage(IMG_ID_GX_COPTER_OBSTACLE));                                             
  227.       /* draw floor obstacles */                                                                                     
  228.       gui_show_image(   tmp_node->position_x,                                                                        
  229.                               tmp_node->position_y + g_gx_copter_context.space,                                      
  230.                               (PU8)GetImage(IMG_ID_GX_COPTER_OBSTACLE));                                             
  231.       if (tmp_node == g_gx_copter_context.last_obstacle)                                                             
  232.          break;                                                                                                      
  233.       tmp_node = tmp_node->next;                                                                                     
  234.    }                                                                                                                 
  235. }
  236. /***************************************************************************** 
  237. * Typedef 
  238. *****************************************************************************/
  239. /* game context */
  240. typedef struct t_copter_node
  241. {
  242.     S16 position_x;
  243.     S16 position_y;
  244.     S16 old_position_x;
  245.     S16 old_position_y;
  246.     struct t_copter_node *next;
  247. } gx_copter_obstacle_node_struct;
  248. #if defined(GDI_USING_LAYER)
  249. typedef struct t_copter_bg_node
  250. {
  251.     MMI_ID_TYPE image_id;
  252.     struct t_copter_bg_node *next;
  253. } gx_copter_bg_node_struct;
  254. #endif /* defined(GDI_USING_LAYER) */ 
  255. typedef struct
  256. {
  257.     BOOL is_gameover;
  258.     BOOL is_new_game;
  259.     U8 game_level;
  260.     S32 game_grade;
  261.     U16 timer_elapse;
  262.     BOOL key_pressed;
  263.     U32 tick;
  264.     U32 last_sound_playing_tick;
  265.     S16 slope;
  266.     U8 obstacle_period;
  267.     U8 max_period;
  268.     U8 space;
  269.     U8 local_step;
  270.     U8 copter_position_y;
  271.     U8 copter_position_old_y;
  272.     gx_copter_obstacle_node_struct obstacle[MMI_GX_COPTER_OBSTACLE_COUNT];
  273.     gx_copter_obstacle_node_struct single_obstacle;
  274.     gx_copter_obstacle_node_struct *first_obstacle;
  275.     gx_copter_obstacle_node_struct *last_obstacle;
  276. #if defined(GDI_USING_LAYER)
  277.     gdi_handle background;
  278.     gdi_handle foreground;
  279.     gx_copter_bg_node_struct bg_image_list[MMI_GX_COPTER_BG_LIST_NUMBER];
  280.     gx_copter_bg_node_struct *first_bg_image;
  281.     gx_copter_bg_node_struct *last_bg_image;
  282.     S16 first_bg_position_x;
  283. #endif /* defined(GDI_USING_LAYER) */ 
  284. #if defined (__MMI_GAME_MULTICHANNEL_SOUND__)
  285.     S32 background_midi;    /* 1 */
  286.     S32 crash_midi;         /* 4 */
  287.     S32 down_wav;           /* 2 */
  288.     S32 flying_wav;         /* 3 */
  289. #endif /* defined (__MMI_GAME_MULTICHANNEL_SOUND__) */ 
  290. } gx_copter_context_struct;
  291. /***************************************************************************** 
  292. * Local Variable
  293. *****************************************************************************/
  294. static gx_copter_context_struct g_gx_copter_context = 
  295. {
  296.     FALSE,  /* is_gameover */
  297.     TRUE,   /* is_new_game */
  298.     0,      /* game_level */
  299.     0,      /* game_grade */
  300.     100,    /* timer_elapse */
  301.     FALSE,  /* key_pressed */
  302.     0,      /* tick */
  303.     0,      /* slope */
  304.     0,      /* period of obstacle-segment */
  305.     10,     /* max period of segment */
  306.     120,    /* space between floor and ceiliing */
  307.     1,      /* local speed of copter */
  308.     70,     /* initial y position of copter */
  309.     70,     /* y position of copter in the last frame */
  310.     0
  311. };
  312. /***************************************************************************** 
  313. * Local Function
  314. *****************************************************************************/
  315. /* Game framework related functions */
  316. S16 mmi_gx_copter_calc_best_grade(S16 old_grade, S16 new_grade);        /* descide which is best grade */
  317. void mmi_gx_copter_enter_game(void);    /* entry function of the game */
  318. void mmi_gx_copter_exit_game(void);     /* exit function - usually will stop timer and release buffer */
  319. void mmi_gx_copter_draw_gameover(void); /* draw gameover screen */
  320. /* Game play functions */
  321. void mmi_gx_copter_framemove(void);
  322. void mmi_gx_copter_render(void);
  323. void mmi_gx_copter_gameover(void);
  324. void mmi_gx_copter_cyclic_timer(void);
  325. void mmi_gx_copter_init_game(void);     /* draw gameover screen */
  326. void mmi_gx_copter_key_pressed(void);   /* press key */
  327. void mmi_gx_copter_key_released(void);  /* release key */
  328. void mmi_gx_copter_draw_static_background(void);
  329. void mmi_gx_copter_init_obstacle_list(void);
  330. void mmi_gx_copter_draw_crash(void);
  331. void mmi_gx_copter_set_gameover(void);
  332. /* void mmi_gx_copter_resume_bgm(void *info); */
  333. #if defined(GDI_USING_LAYER)
  334. void mmi_gx_copter_draw_background(void);
  335. void mmi_gx_copter_init_background_list(void);
  336. #endif /* defined(GDI_USING_LAYER) */ 
  337. /************************************************************************/
  338. /* Audio [Const]                                                        */
  339. /************************************************************************/
  340. #ifndef __MMI_GAME_MULTICHANNEL_SOUND__
  341. #define COPTERDOWN_DVI     611
  342. #define COPTERFLYING_DVI   530
  343. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  344. /* used in both */
  345. #define COPTERCRASH_MIDI   132
  346. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  347. #define COPTERBACKGROUND_MIDI    1063
  348. #define COPTERDOWN_WAV    2444
  349. #define COPTERFLYING_WAV  2122
  350. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  351. #ifndef __MMI_GAME_MULTICHANNEL_SOUND__
  352. __align(2)
  353.      const U8 CopterDown_dvi[611] = 
  354.      {
  355.          0x77, 0xD7, 0x77, 0x77, 0x0E, 0x08, 0xB7, 0xB7, 0x08, 0x17, 0x8D, 0x00, 0x88, 0x80, 0x80, 0x80,
  356.          0x00, 0x80, 0x11, 0x80, 0x0A, 0x81, 0xBE, 0x80, 0x93, 0x24, 0x88, 0x1F, 0x10, 0x80, 0xA4, 0xB8,
  357.          0x39, 0x31, 0x81, 0xF1, 0x1D, 0x40, 0x08, 0x81, 0xA1, 0xA1, 0xBA, 0x8D, 0x50, 0xA0, 0xA0, 0x89,
  358.          0x2D, 0x50, 0xA0, 0xA0, 0x91, 0x29, 0x79, 0x89, 0x00, 0xB3, 0x01, 0x48, 0x1B, 0x8C, 0xA3, 0xF2,
  359.          0x81, 0x28, 0x2F, 0x88, 0xC1, 0x95, 0x80, 0x29, 0x3A, 0x22, 0xB0, 0x97, 0x80, 0x31, 0x2A, 0x4B,
  360.          0x09, 0xC8, 0xD1, 0x81, 0x80, 0x4C, 0x08, 0x9B, 0x01, 0xF9, 0x29, 0xA1, 0x8D, 0x23, 0xA9, 0x38,
  361.          0x35, 0xAA, 0x31, 0xB5, 0x99, 0x40, 0x9F, 0x2A, 0xB1, 0xE3, 0xA2, 0x29, 0x6B, 0x19, 0xB3, 0xE8,
  362.          0x28, 0x19, 0x79, 0x81, 0x99, 0x03, 0x11, 0x70, 0x08, 0xAA, 0xC1, 0x82, 0x11, 0x1A, 0x9F, 0x08,
  363.          0xA2, 0x84, 0x93, 0x0E, 0x28, 0x88, 0x22, 0xD9, 0x09, 0xA4, 0x11, 0x24, 0x0E, 0x28, 0xB0, 0x11,
  364.          0xC2, 0x9E, 0x10, 0x89, 0x39, 0xA0, 0x8D, 0x33, 0x83, 0x82, 0xE0, 0x8C, 0x59, 0x18, 0x98, 0xF2,
  365.          0x98, 0x33, 0x30, 0x49, 0xEB, 0x98, 0xA3, 0x10, 0x11, 0xAF, 0x29, 0xB2, 0x06, 0x83, 0x1D, 0x29,
  366.          0x0A, 0x93, 0xD5, 0x00, 0x2A, 0x3C, 0x10, 0xB1, 0xC3, 0x91, 0x49, 0x3C, 0x19, 0xC8, 0x91, 0x93,
  367.          0x21, 0x42, 0x18, 0x39, 0x88, 0x90, 0xD4, 0x93, 0xAD, 0x2C, 0x28, 0x9A, 0x97, 0xB1, 0x3A, 0x4D,
  368.          0x1B, 0xA0, 0xE3, 0x00, 0x40, 0x3B, 0x29, 0xD2, 0xA2, 0x84, 0x9A, 0x59, 0x8A, 0x1B, 0xC1, 0xD0,
  369.          0x92, 0x38, 0x38, 0x8D, 0x20, 0xF8, 0x21, 0x94, 0x8C, 0x31, 0xCA, 0x43, 0xB3, 0x8C, 0x31, 0x90,
  370.          0x02, 0xA7, 0xC9, 0x31, 0x0B, 0x2C, 0xA2, 0xF8, 0x81, 0x92, 0x6C, 0x28, 0x9C, 0x82, 0xD3, 0x10,
  371.          0x01, 0x0E, 0x20, 0x98, 0x11, 0xA3, 0x1A, 0x15, 0xAC, 0x30, 0xB8, 0x8B, 0xA7, 0xA9, 0x31, 0x21,
  372.          0x89, 0x1B, 0x73, 0x95, 0xE0, 0x99, 0x09, 0x33, 0xA0, 0x00, 0x40, 0x19, 0x3A, 0xB2, 0xF9, 0x13,
  373.          0xF1, 0x1B, 0x19, 0x8B, 0x83, 0xA8, 0x73, 0x02, 0x08, 0xB9, 0xBC, 0xA9, 0x32, 0x14, 0x19, 0x49,
  374.          0x88, 0x63, 0xA1, 0x9C, 0x86, 0xA9, 0x39, 0x01, 0x80, 0x41, 0xE9, 0x19, 0x87, 0x99, 0x28, 0x9C,
  375.          0x3B, 0x82, 0xA8, 0x07, 0xB8, 0x79, 0x18, 0x0B, 0x92, 0xEA, 0x11, 0x91, 0x2A, 0x23, 0x0B, 0x58,
  376.          0xA8, 0x91, 0xA6, 0xAA, 0x2B, 0x9C, 0x28, 0x17, 0x81, 0x18, 0x99, 0x81, 0x07, 0xA1, 0x0D, 0x2A,
  377.          0x88, 0x26, 0xB2, 0xA9, 0x22, 0x38, 0x59, 0xBA, 0xBC, 0xC1, 0x03, 0x82, 0x2B, 0x2D, 0x3C, 0x04,
  378.          0xD2, 0xA0, 0xA0, 0x38, 0x3B, 0x1F, 0xBA, 0x81, 0x87, 0x88, 0x18, 0xAB, 0x61, 0x81, 0x0C, 0x80,
  379.          0xE9, 0x23, 0x02, 0x2E, 0x89, 0xA9, 0x87, 0x82, 0x18, 0x8B, 0x1A, 0x93, 0x88, 0x22, 0xDC, 0x30,
  380.          0x11, 0x6B, 0x12, 0xC0, 0x82, 0x80, 0x2D, 0x3A, 0xB8, 0xF0, 0xA3, 0x18, 0x78, 0x08, 0x8A, 0xB0,
  381.          0xB9, 0x03, 0xA8, 0x4A, 0x0C, 0x59, 0x83, 0x83, 0x96, 0x99, 0x29, 0x0D, 0x19, 0x80, 0xA5, 0xA2,
  382.          0x41, 0x1A, 0x7C, 0x90, 0xCA, 0x91, 0xBA, 0x50, 0x01, 0x39, 0x01, 0x1B, 0x07, 0x91, 0x05, 0xDB,
  383.          0x39, 0x88, 0x3B, 0x87, 0xE0, 0x01, 0x08, 0x4B, 0x80, 0xD9, 0xB1, 0x91, 0x30, 0x48, 0x98, 0x9A,
  384.          0x15, 0x80, 0x24, 0xD0, 0x2B, 0x20, 0x1A, 0x06, 0xE8, 0x80, 0x18, 0x39, 0xA0, 0xBA, 0x01, 0x08,
  385.          0x26, 0xB8, 0x1B, 0x9A, 0x3B, 0x37, 0xC9, 0x30, 0x10, 0x41, 0x17, 0xA9, 0x9B, 0xA9, 0x09, 0x24,
  386.          0xCB, 0x8B, 0x10, 0x50, 0x24, 0xD9, 0xA9, 0xD9, 0x2A, 0x12, 0xBC, 0x12, 0xA3, 0x73, 0x24, 0x89,
  387.          0xB2, 0xB8, 0x88, 0x0D, 0x11, 0xAB, 0x43, 0x91, 0x64, 0x92, 0x8B, 0x91, 0xBB, 0x29, 0x88, 0x01,
  388.          0x93, 0x00, 0x78, 0x17, 0x80, 0xC8, 0x81, 0x98, 0x49, 0x99, 0x8C, 0x04, 0x00, 0x34, 0xDB, 0x09,
  389.          0xC8, 0x39, 0x02, 0xAE, 0x80, 0xA8, 0x51, 0x11, 0x9B, 0xAB, 0xA8, 0x31, 0x16, 0xC9, 0x08, 0x90,
  390.          0x7A, 0x83, 0xCB, 0x82, 0xA0, 0x70, 0x18, 0x29, 0x80, 0x93, 0xA5, 0x8A, 0x39, 0x1F, 0x38, 0xB0,
  391.          0x90, 0x07, 0x21, 0x68, 0x0B, 0xA9, 0xC2, 0x03, 0x00, 0x1E, 0x18, 0x08, 0x35, 0xB1, 0x9A, 0xC1,
  392.          0x99, 0x42, 0x0C, 0x8D, 0xA9, 0x95, 0x94, 0x21, 0x0C, 0x1D, 0x80, 0xB0, 0xA4, 0xC1, 0x39, 0x6B,
  393.          0x1A, 0x92, 0xC2
  394.      };
  395. __align(2)
  396.      const U8 CopterFlying_dvi[530] = 
  397.      {
  398.          0x77, 0xD7, 0x77, 0x77, 0x0E, 0x08, 0xB7, 0xB7, 0x08, 0x17, 0x8D, 0x01, 0x81, 0xB8, 0x8B, 0x08,
  399.          0x43, 0x21, 0x02, 0x91, 0x2B, 0x80, 0xFD, 0xBC, 0x33, 0x95, 0x99, 0x2D, 0x1A, 0x28, 0xA5, 0xB0,
  400.          0x21, 0x17, 0x88, 0xDA, 0x1B, 0x40, 0x92, 0xB0, 0x30, 0x02, 0xBB, 0x90, 0x52, 0x01, 0xA0, 0x9E,
  401.          0x0C, 0x21, 0x10, 0x89, 0x2A, 0x11, 0x4A, 0x01, 0x58, 0xA9, 0xB8, 0xAA, 0x40, 0xA0, 0x30, 0x1D,
  402.          0xC0, 0x26, 0x88, 0x80, 0xE8, 0x14, 0x8A, 0xC8, 0x89, 0x17, 0xA9, 0x80, 0x0C, 0x21, 0x1B, 0x20,
  403.          0x08, 0x80, 0x19, 0x2C, 0x13, 0x58, 0x19, 0x42, 0xA0, 0x09, 0x39, 0xFA, 0x28, 0x95, 0x8C, 0xAB,
  404.          0x28, 0x89, 0x2D, 0x28, 0x13, 0x28, 0x01, 0x68, 0x99, 0xF3, 0x88, 0x91, 0x21, 0xF0, 0x02, 0x00,
  405.          0xAF, 0x03, 0x93, 0x28, 0x40, 0xB0, 0x95, 0x0A, 0x2A, 0xD9, 0x0B, 0x7B, 0x88, 0x00, 0xB1, 0x80,
  406.          0xAA, 0x19, 0xA3, 0x28, 0x19, 0x17, 0x86, 0x00, 0x84, 0x81, 0x18, 0xC2, 0x08, 0xC3, 0xF8, 0x88,
  407.          0x1A, 0x98, 0xBA, 0x50, 0x0A, 0x23, 0x48, 0x79, 0x0A, 0x10, 0x99, 0x1D, 0x20, 0xD9, 0x18, 0x12,
  408.          0x2C, 0x85, 0x80, 0x83, 0xA8, 0xC6, 0x99, 0x88, 0xE1, 0xC1, 0x88, 0x30, 0x98, 0x59, 0x90, 0x01,
  409.          0x52, 0x80, 0x21, 0x53, 0x1B, 0x9B, 0x30, 0x9C, 0x0D, 0x08, 0x5D, 0x3B, 0x3C, 0xB2, 0xDA, 0x19,
  410.          0xA0, 0xE2, 0x12, 0x59, 0x81, 0xA1, 0x13, 0x33, 0xFF, 0x81, 0x81, 0x19, 0x00, 0x19, 0x88, 0x4C,
  411.          0x2A, 0x80, 0x20, 0x00, 0x61, 0x1A, 0xC9, 0x09, 0xA0, 0xAE, 0xB9, 0x44, 0x88, 0x1C, 0x91, 0x80,
  412.          0x48, 0x33, 0x09, 0x94, 0x34, 0x9B, 0xB0, 0x31, 0x68, 0x31, 0xDD, 0x87, 0xCA, 0xA2, 0x8A, 0x17,
  413.          0xA9, 0x19, 0x8A, 0x86, 0x09, 0x18, 0x08, 0x04, 0x2B, 0x0B, 0xA2, 0x39, 0xC2, 0xBC, 0x2B, 0x4E,
  414.          0x02, 0x31, 0xA0, 0x33, 0xF8, 0x98, 0x15, 0x02, 0xCF, 0xBA, 0x12, 0x33, 0x95, 0xA9, 0x9C, 0x35,
  415.          0xD3, 0x1A, 0x78, 0x82, 0xF9, 0x0A, 0x00, 0x24, 0xA0, 0x09, 0x58, 0x08, 0x8A, 0xD8, 0x90, 0x33,
  416.          0xA2, 0xAE, 0x1A, 0x10, 0x88, 0x20, 0x51, 0x20, 0x83, 0xC9, 0xFB, 0x09, 0x31, 0x21, 0x92, 0xAC,
  417.          0x32, 0x11, 0xAA, 0x9D, 0x13, 0x89, 0x91, 0xCA, 0x83, 0x29, 0xD9, 0x82, 0x87, 0x89, 0x11, 0x11,
  418.          0x99, 0x9C, 0x93, 0x05, 0xA2, 0x0D, 0x18, 0x13, 0xD8, 0x9C, 0x08, 0x02, 0x2A, 0xA8, 0x1E, 0x88,
  419.          0x71, 0x07, 0xA9, 0xA8, 0x09, 0x03, 0x99, 0x20, 0x10, 0x83, 0xA9, 0xF0, 0x98, 0x92, 0x40, 0x51,
  420.          0x99, 0x53, 0x90, 0xD8, 0x88, 0x91, 0xBA, 0x90, 0x2B, 0xE1, 0x28, 0x51, 0xB8, 0x89, 0xB1, 0x27,
  421.          0x14, 0x1B, 0xC2, 0x38, 0x01, 0x2A, 0xAB, 0xE0, 0x23, 0x48, 0x9B, 0x0A, 0x18, 0xBF, 0xA0, 0x25,
  422.          0xE9, 0x08, 0x24, 0x89, 0xB9, 0x0B, 0x25, 0x82, 0xA0, 0x18, 0x10, 0x1D, 0x98, 0x7B, 0x03, 0x01,
  423.          0xA9, 0xA9, 0x78, 0x99, 0x32, 0x8D, 0x9C, 0xAB, 0x91, 0xC9, 0x23, 0xA8, 0x07, 0x81, 0x31, 0x28,
  424.          0x25, 0x28, 0x80, 0x92, 0x87, 0x2A, 0xB0, 0xCB, 0xA8, 0x9F, 0x8A, 0x29, 0x94, 0x6A, 0xA8, 0x88,
  425.          0x29, 0x03, 0x54, 0x9A, 0x08, 0x0A, 0xA3, 0xC1, 0x83, 0x27, 0x84, 0xBD, 0x18, 0x39, 0x87, 0xB9,
  426.          0x28, 0xA2, 0xB9, 0x2C, 0x90, 0x8A, 0x69, 0x00, 0xC4, 0x88, 0x2A, 0x98, 0x16, 0xB8, 0x13, 0x4C,
  427.          0x15, 0xB3, 0x88, 0xB9, 0x68, 0x80, 0xD1, 0x28, 0xAB, 0xD1, 0x89, 0xA2, 0xE8, 0x80, 0x71, 0x81,
  428.          0x29, 0x11, 0xB0, 0xA2, 0xE9, 0x80, 0x18, 0x23, 0x38, 0xC8, 0x1A, 0x27, 0xCE, 0x88, 0x2A, 0x37,
  429.          0x98, 0x08, 0x9A, 0x00, 0x88, 0x11, 0xCA, 0xAD, 0x21, 0x13, 0x0A, 0xAD, 0x14, 0x94, 0x91, 0x8D,
  430.          0x28, 0x21, 0x94, 0x8B, 0x17, 0xA8, 0x19, 0x99, 0xC3, 0xAB, 0x02, 0x4A, 0xA5, 0xAF, 0x19, 0x43,
  431.          0xB3, 0x8E
  432.      };
  433. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  434. __align(2)
  435.      const U8 CopterCrash_midi[132] = 
  436.      {
  437.          0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x03, 0xC0, 0x4D, 0x54, 0x72,
  438.          0x6B, 0x00, 0x00, 0x00, 0x6E, 0x00, 0xFF, 0x03, 0x08, 0x75, 0x6E, 0x74, 0x69, 0x74, 0x6C, 0x65,
  439.          0x64, 0x00, 0xFF, 0x02, 0x16, 0x43, 0x6F, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x63,
  440.          0x20, 0x32, 0x30, 0x30, 0x33, 0x20, 0x62, 0x79, 0x20, 0x43, 0x43, 0x00, 0xFF, 0x01, 0x03, 0x43,
  441.          0x43, 0x0A, 0x00, 0xFF, 0x58, 0x04, 0x04, 0x02, 0x18, 0x08, 0x00, 0xFF, 0x59, 0x02, 0x00, 0x00,
  442.          0x00, 0xFF, 0x51, 0x03, 0x09, 0x27, 0xC0, 0x00, 0xC0, 0x7F, 0x00, 0xB0, 0x07, 0x64, 0x11, 0x90,
  443.          0x28, 0x67, 0x10, 0x2B, 0x67, 0x03, 0x29, 0x7D, 0x1D, 0x26, 0x7F, 0x03, 0x24, 0x6F, 0x9C, 0x45,
  444.          0x29, 0x00, 0x0F, 0x2B, 0x00, 0x82, 0x63, 0x24, 0x00, 0x13, 0x28, 0x00, 0x10, 0x26, 0x00, 0x00,
  445.          0xFF, 0x2F, 0x00
  446.      };
  447. /* /MANISH STARTS */
  448.  #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  449. __align(2)
  450.      const U8 CopterFlying_wav[2122] = 
  451.      {
  452.          0x52, 0x49, 0x46, 0x46, 0x42, 0x08, 0x00, 0x00,
  453.          0x57, 0x41, 0x56, 0x45, 0x66, 0x6D, 0x74, 0x20,
  454.          0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
  455.          0x40, 0x1F, 0x00, 0x00, 0x80, 0x3E, 0x00, 0x00,
  456.          0x02, 0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61,
  457.          0x1E, 0x08, 0x00, 0x00, 0xF3, 0x14, 0xF7, 0x28,
  458.          0xEA, 0x48, 0x86, 0x3F, 0x5F, 0x28, 0x48, 0xF7,
  459.          0x6C, 0xCC, 0xD0, 0xC4, 0x44, 0xBE, 0xB1, 0xC8,
  460.          0x19, 0xE9, 0xAF, 0x0E, 0x98, 0x18, 0x39, 0x30,
  461.          0xAB, 0x45, 0x66, 0x4A, 0xFF, 0x51, 0xD4, 0x49,
  462.          0xA2, 0x37, 0x1B, 0x44, 0x2A, 0x46, 0xC9, 0x44,
  463.          0xD6, 0x2C, 0xFA, 0xE8, 0xC9, 0xCA, 0x17, 0x96,
  464.          0x60, 0xC5, 0x0A, 0xEE, 0xC0, 0x2B, 0xC2, 0x1C,
  465.          0x08, 0x02, 0xBC, 0xF2, 0x25, 0xAE, 0x48, 0xD2,
  466.          0x35, 0xAD, 0x7A, 0xC4, 0xE7, 0xBD, 0x22, 0xDE,
  467.          0x74, 0x14, 0x2E, 0xEC, 0xF3, 0xFA, 0x01, 0xC3,
  468.          0xDF, 0xD6, 0x68, 0xF6, 0xFF, 0x53, 0x03, 0x6D,
  469.          0xA5, 0x5A, 0xD0, 0x4C, 0x72, 0x22, 0x24, 0xD0,
  470.          0x00, 0x80, 0xCA, 0xAD, 0xA1, 0xAA, 0xFC, 0xF5,
  471.          0xC7, 0x2C, 0x61, 0x0F, 0xD3, 0x10, 0x18, 0xE1,
  472.          0x20, 0xE8, 0xE5, 0x14, 0x3E, 0x30, 0xCC, 0x34,
  473.          0x93, 0x12, 0xC8, 0xFC, 0x7B, 0xFA, 0x80, 0xF2,
  474.          0x62, 0x04, 0xB0, 0x23, 0x63, 0x31, 0x65, 0x34,
  475.          0x43, 0x37, 0x4B, 0x28, 0xD7, 0xFE, 0x32, 0xEE,
  476.          0xEF, 0xCA, 0xF9, 0xCD, 0x6C, 0xDE, 0x11, 0xF0,
  477.          0xF7, 0xF7, 0x3B, 0x04, 0x8F, 0xF9, 0xB6, 0xF4,
  478.          0x37, 0xE9, 0xC9, 0xF6, 0xC1, 0xFC, 0xC3, 0x00,
  479.          0xCD, 0xF8, 0xE7, 0x07, 0x75, 0x0E, 0x26, 0x12,
  480.          0x91, 0x10, 0x73, 0x22, 0xE0, 0x18, 0x82, 0x10,
  481.          0x73, 0x0E, 0x5D, 0x00, 0x2E, 0xF8, 0xCF, 0xF0,
  482.          0x71, 0xF2, 0x61, 0xFE, 0x61, 0x00, 0x13, 0xF8,
  483.          0xBF, 0xF9, 0x40, 0x02, 0x78, 0xF7, 0x5B, 0xFA,
  484.          0x1B, 0xFD, 0x31, 0xF2, 0x72, 0x05, 0x1D, 0x0F,
  485.          0xBC, 0x0D, 0x9E, 0x0D, 0x7C, 0x0E, 0x8E, 0x0C,
  486.          0xEF, 0x0B, 0x83, 0xF9, 0x1F, 0x10, 0xF1, 0x19,
  487.          0xF0, 0x08, 0xF9, 0x06, 0x83, 0x08, 0xD9, 0xF0,
  488.          0x57, 0xEB, 0x1E, 0xE8, 0x7D, 0x07, 0xDB, 0x17,
  489.          0x58, 0x06, 0xE9, 0xF4, 0xA3, 0xFA, 0x47, 0xF9,
  490.          0x3C, 0xE0, 0x15, 0xDF, 0xB3, 0xEA, 0x6E, 0xF8,
  491.          0xBE, 0xE4, 0x93, 0xEE, 0xC9, 0xEF, 0x70, 0xF8,
  492.          0xB2, 0xF7, 0x70, 0xF9, 0x1F, 0xFA, 0x77, 0xFA,
  493.          0x79, 0xF5, 0x54, 0xF8, 0xEF, 0xF0, 0x21, 0xF6,
  494.          0xED, 0xFD, 0x08, 0x01, 0x01, 0x00, 0xCA, 0x09,
  495.          0xD6, 0x04, 0x26, 0x09, 0xBB, 0x0E, 0xE9, 0x16,
  496.          0x5E, 0x16, 0x79, 0x12, 0x2B, 0x10, 0x63, 0x10,
  497.          0x8C, 0x0D, 0x79, 0x12, 0xB9, 0x0F, 0xC0, 0x07,
  498.          0x33, 0x06, 0xD9, 0x0A, 0xDE, 0x15, 0xF7, 0x10,
  499.          0xBC, 0x05, 0x65, 0x03, 0xD2, 0xF8, 0x2F, 0xF3,
  500.          0x3D, 0xF2, 0x91, 0xF8, 0x16, 0xF5, 0x13, 0xF4,
  501.          0x63, 0xEB, 0xF6, 0xF1, 0xBC, 0xEF, 0xD3, 0xF4,
  502.          0x43, 0xFB, 0x2D, 0xFE, 0x46, 0xFD, 0x07, 0x00,
  503.          0x41, 0x02, 0x3D, 0x03, 0x10, 0x02, 0x2E, 0x08,
  504.          0x4B, 0x05, 0xAA, 0x03, 0x3D, 0x08, 0xC8, 0xFB,
  505.          0x03, 0xFF, 0x4C, 0xFD, 0xAB, 0x00, 0x89, 0xFC,
  506.          0x56, 0xFF, 0x2C, 0x03, 0x25, 0x05, 0x95, 0xF9,
  507.          0x00, 0x02, 0x67, 0x03, 0x65, 0x04, 0x25, 0x06,
  508.          0x32, 0xED, 0x2C, 0xEA, 0x28, 0xF9, 0xC8, 0xFB,
  509.          0x0C, 0x05, 0x66, 0x02, 0x41, 0x01, 0x01, 0x06,
  510.          0xC6, 0x07, 0xC2, 0x10, 0xEE, 0x12, 0x27, 0x0B,
  511.          0x14, 0x16, 0xCF, 0x0F, 0xA3, 0x0A, 0x91, 0x0B,
  512.          0xCE, 0x04, 0x57, 0x0A, 0xAE, 0x07, 0x47, 0xFF,
  513.          0xBA, 0xF5, 0x77, 0xF8, 0x3F, 0xF1, 0x32, 0x03,
  514.          0x23, 0xFD, 0xE4, 0xFB, 0xA7, 0xFC, 0x88, 0xFC,
  515.          0x9C, 0x00, 0x1D, 0xF8, 0x5A, 0xF9, 0x4B, 0xF9,
  516.          0xF2, 0xF4, 0x29, 0xF1, 0xE1, 0xEE, 0xE9, 0xEF,
  517.          0xDD, 0xF4, 0xD9, 0xF1, 0xEA, 0xF0, 0x5C, 0xF3,
  518.          0x40, 0xF2, 0x20, 0xF3, 0x72, 0xFD, 0x7C, 0xFA,
  519.          0x60, 0x04, 0x13, 0x03, 0x8B, 0x04, 0xA1, 0x05,
  520.          0xD9, 0x0D, 0xAF, 0x0B, 0x10, 0x0E, 0x2F, 0x0E,
  521.          0x0C, 0x0D, 0xEE, 0x0E, 0x01, 0x13, 0x02, 0x0D,
  522.          0x12, 0x0D, 0x26, 0x0D, 0x21, 0x12, 0x80, 0x0C,
  523.          0x27, 0x0C, 0xF6, 0x00, 0x0A, 0x01, 0xC2, 0xFF,
  524.          0x29, 0xFA, 0x47, 0xFE, 0xD1, 0xFC, 0x41, 0xF9,
  525.          0x44, 0xF6, 0xFB, 0xF0, 0x7C, 0xF2, 0xB4, 0xF8,
  526.          0xED, 0xF4, 0x8F, 0xF5, 0x37, 0xFA, 0x6B, 0xFD,
  527.          0xFB, 0xFB, 0x94, 0x00, 0x1E, 0xFF, 0x3E, 0x09,
  528.          0x2F, 0x02, 0xC9, 0x01, 0x4D, 0x04, 0xD2, 0x06,
  529.          0x7E, 0x04, 0x3D, 0x02, 0x78, 0xF9, 0x5F, 0xFD,
  530.          0xA0, 0xFE, 0x1E, 0x02, 0x35, 0xFF, 0xCC, 0xF8,
  531.          0x3B, 0xF7, 0x02, 0xFA, 0x7D, 0xFE, 0x9B, 0x00,
  532.          0x4A, 0xFA, 0x79, 0xFE, 0x48, 0x06, 0x30, 0x05,
  533.          0x6D, 0x07, 0xE0, 0x05, 0x04, 0x0C, 0x51, 0x0A,
  534.          0x21, 0x0A, 0x94, 0x06, 0x6D, 0x0E, 0xD8, 0x04,
  535.          0x6E, 0x02, 0x4E, 0xFD, 0x6C, 0xFC, 0x38, 0xFC,
  536.          0xFA, 0xFE, 0xB6, 0xF4, 0xD0, 0xF9, 0xE4, 0xEE,
  537.          0x85, 0xEC, 0x56, 0xEB, 0x8C, 0xEC, 0xB4, 0xF3,
  538.          0x3C, 0xF3, 0xAA, 0xEF, 0xA9, 0xED, 0xBB, 0xF5,
  539.          0xEB, 0xF6, 0xA0, 0xF4, 0xF5, 0xF7, 0x22, 0xF8,
  540.          0xEB, 0xFB, 0xDC, 0x02, 0xE2, 0x04, 0xAC, 0x02,
  541.          0xA0, 0x05, 0xF3, 0x08, 0xDC, 0x0D, 0x97, 0x15,
  542.          0xA6, 0x0E, 0x23, 0x11, 0x1F, 0x0C, 0x86, 0x09,
  543.          0xD4, 0x0A, 0xB4, 0x0E, 0x68, 0x0A, 0xE8, 0x07,
  544.          0x7F, 0x01, 0xB7, 0x02, 0x63, 0x02, 0x5B, 0x02,
  545.          0xB6, 0xFB, 0xBA, 0x05, 0xD5, 0xFC, 0xBE, 0x05,
  546.          0x4C, 0xFB, 0xAB, 0x04, 0x94, 0x09, 0x07, 0x02,
  547.          0xF5, 0xFD, 0xEE, 0xF2, 0x6C, 0xEE, 0x40, 0xF3,
  548.          0x9C, 0xF4, 0x82, 0xEF, 0xC7, 0xF3, 0x42, 0xE9,
  549.          0x17, 0xF1, 0xF2, 0xF4, 0xED, 0xF1, 0x94, 0xFC,
  550.          0x74, 0x00, 0x8B, 0x01, 0xF4, 0x04, 0x36, 0xFF,
  551.          0x82, 0x06, 0xA0, 0x08, 0xED, 0x0E, 0xBD, 0x15,
  552.          0x17, 0xFE, 0x51, 0xF2, 0xF4, 0xFB, 0xFC, 0xF8,
  553.          0x41, 0x03, 0x8B, 0x00, 0x63, 0xF7, 0x7A, 0x00,
  554.          0x21, 0x01, 0x25, 0x01, 0xBA, 0xFD, 0x14, 0x02,
  555.          0x6E, 0xFF, 0x13, 0xFF, 0xDE, 0xF4, 0xF9, 0xFF,
  556.          0xF4, 0xF7, 0x3E, 0x00, 0xAB, 0x01, 0x08, 0x01,
  557.          0x3C, 0x02, 0x99, 0x07, 0xD4, 0x07, 0xEC, 0x08,
  558.          0x54, 0x0B, 0x9F, 0x13, 0x6B, 0x0D, 0xAB, 0x10,
  559.          0xCC, 0x0D, 0xE8, 0x04, 0x65, 0x02, 0x53, 0x03,
  560.          0x0D, 0x05, 0xC4, 0xFF, 0xDB, 0xF6, 0xBE, 0xEF,
  561.          0x81, 0xEC, 0x4D, 0xE4, 0x81, 0xED, 0x73, 0xF8,
  562.          0xB4, 0xF7, 0x3C, 0xF4, 0x9C, 0xE9, 0x5B, 0xEF,
  563.          0xD3, 0xF2, 0x42, 0xF0, 0xC1, 0xEF, 0x63, 0xEE,
  564.          0x6B, 0xEE, 0xEF, 0xF5, 0x64, 0xFC, 0x52, 0x03,
  565.          0x15, 0x01, 0x89, 0x01, 0x53, 0x08, 0x11, 0x06,
  566.          0x3C, 0x0C, 0xBC, 0x11, 0x42, 0x0D, 0x1D, 0x0B,
  567.          0x77, 0x0A, 0x1D, 0x07, 0x51, 0x08, 0xCA, 0x0B,
  568.          0x01, 0x0C, 0x4C, 0x11, 0xE6, 0x12, 0x2A, 0x18,
  569.          0xA1, 0x11, 0xA4, 0x06, 0x5D, 0x1C, 0x50, 0x19,
  570.          0x9C, 0x0B, 0xF1, 0xF4, 0xF4, 0x01, 0xA2, 0xF8,
  571.          0x98, 0xED, 0x61, 0xEA, 0x69, 0x10, 0x3D, 0x16,
  572.          0x50, 0x0B, 0x90, 0xF7, 0xDE, 0xEB, 0xFD, 0xF2,
  573.          0xCC, 0xEA, 0x04, 0xE7, 0x88, 0x00, 0x19, 0x00,
  574.          0x3F, 0xF1, 0xDB, 0xF4, 0x48, 0xF3, 0x93, 0xF9,
  575.          0x9E, 0xF7, 0x2C, 0xFD, 0x1A, 0x0E, 0x3A, 0x0F,
  576.          0x56, 0x01, 0x2D, 0x0C, 0xEA, 0xFE, 0x77, 0xFF,
  577.          0x35, 0x07, 0xA1, 0x01, 0xC1, 0xFB, 0x0B, 0x05,
  578.          0xF1, 0x09, 0x48, 0x02, 0xC0, 0xF6, 0x47, 0xEF,
  579.          0xB0, 0xE4, 0xF1, 0xEA, 0x85, 0xDE, 0x09, 0xED,
  580.          0xE0, 0xF9, 0x25, 0xFA, 0x33, 0x01, 0x6C, 0x0B,
  581.          0x74, 0x0D, 0xBA, 0x06, 0x79, 0x0F, 0x6C, 0x16,
  582.          0xAC, 0x15, 0x85, 0x06, 0x30, 0x04, 0xD0, 0xFF,
  583.          0x91, 0x12, 0x15, 0x1B, 0x09, 0x25, 0x8A, 0x24,
  584.          0x73, 0x06, 0xB3, 0xE5, 0x1F, 0xD4, 0xDB, 0xB4,
  585.          0x48, 0xC9, 0x1C, 0xD2, 0x23, 0xE6, 0x2A, 0xFC,
  586.          0xA2, 0x17, 0x72, 0x0B, 0xE9, 0x02, 0xED, 0xF5,
  587.          0x23, 0xDB, 0x2E, 0xD1, 0x1E, 0xF4, 0x5B, 0x13,
  588.          0x18, 0x32, 0x9C, 0x05, 0x51, 0xEE, 0x04, 0xF4,
  589.          0x3C, 0xF8, 0x12, 0x58, 0x5B, 0x5A, 0x13, 0x54,
  590.          0x65, 0x3C, 0x84, 0xBA, 0x49, 0x9F, 0x8C, 0x99,
  591.          0x2A, 0xB1, 0x4E, 0xB5, 0x83, 0x0F, 0xF3, 0x47,
  592.          0x51, 0x51, 0x5A, 0x29, 0x12, 0x0C, 0xAB, 0x19,
  593.          0x4F, 0x08, 0xC1, 0x5B, 0x50, 0x44, 0xA8, 0x50,
  594.          0xA9, 0x30, 0x89, 0x24, 0xE5, 0x1A, 0x45, 0xD8,
  595.          0x3F, 0xEC, 0xB8, 0xC9, 0xBB, 0xFF, 0x77, 0x2B,
  596.          0x48, 0x4D, 0xA0, 0x2F, 0xB1, 0xED, 0x77, 0xC6,
  597.          0x78, 0x99, 0xFA, 0xAF, 0x39, 0xB2, 0x72, 0xC6,
  598.          0xE2, 0xC6, 0xEE, 0xBD, 0x72, 0xC4, 0x31, 0xD4,
  599.          0x93, 0xE4, 0x88, 0x09, 0x3B, 0x10, 0x4C, 0x24,
  600.          0xE4, 0x42, 0xCF, 0x42, 0xC5, 0x34, 0x1B, 0x1A,
  601.          0xE6, 0xFF, 0xD7, 0xCB, 0xC2, 0xB4, 0xAA, 0xB4,
  602.          0x22, 0xD2, 0x23, 0xF8, 0x89, 0x03, 0x82, 0x19,
  603.          0x51, 0x2B, 0xAA, 0x25, 0x82, 0x03, 0x5B, 0xF3,
  604.          0x7B, 0x03, 0xD3, 0x19, 0x99, 0x26, 0x6F, 0x2C,
  605.          0x1E, 0x20, 0x91, 0x11, 0xCC, 0xFA, 0xF4, 0xF1,
  606.          0xEE, 0x03, 0xFA, 0x0C, 0x92, 0x08, 0xBA, 0x05,
  607.          0x4B, 0x0A, 0xBC, 0x05, 0xCF, 0xFC, 0xBB, 0xF1,
  608.          0x5D, 0xFC, 0xAF, 0xFB, 0x45, 0xF6, 0x52, 0xFC,
  609.          0x39, 0xFA, 0x13, 0xEE, 0x8C, 0xF4, 0xA2, 0xF5,
  610.          0x6C, 0x07, 0x28, 0x07, 0x29, 0xFF, 0x65, 0xFB,
  611.          0x42, 0x02, 0x9D, 0x09, 0x4D, 0x0E, 0x9F, 0x11,
  612.          0x43, 0x0D, 0xD9, 0x09, 0x77, 0xFF, 0xBF, 0xF9,
  613.          0xAD, 0x02, 0xC7, 0x00, 0x2C, 0x0B, 0xD2, 0x0E,
  614.          0xB0, 0x15, 0xBE, 0x0E, 0x10, 0x02, 0x06, 0x04,
  615.          0x33, 0x01, 0x21, 0x05, 0x14, 0x0F, 0xCE, 0x12,
  616.          0xAA, 0x11, 0x87, 0x06, 0xAA, 0xF8, 0xDF, 0xF3,
  617.          0x52, 0xF1, 0x1D, 0xF4, 0xD8, 0xF9, 0xC3, 0xFB,
  618.          0xC5, 0xF5, 0xA0, 0xFA, 0x35, 0xF9, 0x4A, 0xF6,
  619.          0xD9, 0xEB, 0xDF, 0xEF, 0x0E, 0xF0, 0xC4, 0xED,
  620.          0x74, 0xF1, 0x41, 0x06, 0x9C, 0x1C, 0xDE, 0x1D,
  621.          0x78, 0x11, 0xF4, 0x04, 0xC0, 0x00, 0xD6, 0xF2,
  622.          0x63, 0xE9, 0xCC, 0xED, 0xD0, 0xFA, 0x29, 0xFD,
  623.          0x49, 0xF9, 0x4A, 0xF4, 0x3D, 0xF5, 0xC3, 0xFB,
  624.          0xA3, 0xFD, 0x15, 0xFF, 0x73, 0x06, 0x68, 0x05,
  625.          0xF5, 0x03, 0x2E, 0x00, 0x16, 0x00, 0x52, 0xF7,
  626.          0x3A, 0xF5, 0x25, 0xF3, 0x46, 0xF7, 0xBF, 0xF4,
  627.          0x5D, 0xF6, 0x0D, 0xFD, 0x9C, 0x00, 0x92, 0x09,
  628.          0xFF, 0x05, 0x07, 0x02, 0x2E, 0x0B, 0x58, 0x16,
  629.          0x26, 0x18, 0xE5, 0x12, 0x9C, 0x10, 0x65, 0x04,
  630.          0xF7, 0x04, 0x3D, 0x01, 0x3F, 0x05, 0xB7, 0x03,
  631.          0x8F, 0xFD, 0xD7, 0xF5, 0xB0, 0xF7, 0x15, 0xF5,
  632.          0x9C, 0xEE, 0xB6, 0xF2, 0x4B, 0xF4, 0x54, 0xED,
  633.          0xCB, 0xEC, 0x80, 0xF0, 0xB6, 0xF3, 0xD1, 0xFA,
  634.          0xA5, 0xF9, 0x1E, 0xF4, 0x62, 0xF0, 0x60, 0xEF,
  635.          0x98, 0xF1, 0x96, 0xED, 0xB8, 0xF6, 0x74, 0xFC,
  636.          0x06, 0x09, 0x83, 0x0D, 0xC5, 0x03, 0xCA, 0x07,
  637.          0xD9, 0x0C, 0x36, 0x04, 0xDE, 0x02, 0x0F, 0x09,
  638.          0x73, 0x0C, 0xDB, 0x0D, 0x26, 0x0A, 0x08, 0x0D,
  639.          0x61, 0x09, 0x79, 0x05, 0x98, 0x05, 0x9A, 0xFF,
  640.          0xCE, 0x05, 0x63, 0x0A, 0xB6, 0x09, 0x47, 0x0F,
  641.          0x6A, 0x09, 0x04, 0x07, 0x50, 0x04, 0x34, 0x04,
  642.          0x69, 0x04, 0x72, 0x05, 0x89, 0xFE, 0x45, 0xF8,
  643.          0xFE, 0xF7, 0x73, 0xF3, 0xA8, 0xFC, 0x44, 0x01,
  644.          0x9C, 0xFF, 0x93, 0xF3, 0xAF, 0xF1, 0xEE, 0xF1,
  645.          0x87, 0xFF, 0x72, 0x08, 0x5F, 0x02, 0xB1, 0x00,
  646.          0xF7, 0xFD, 0xE7, 0xF4, 0xCC, 0xEE, 0x11, 0xEF,
  647.          0x93, 0xF8, 0xF6, 0xFE, 0x2E, 0x04, 0x05, 0x04,
  648.          0xAB, 0x04, 0xE4, 0x00, 0xA8, 0xFF, 0x33, 0x01,
  649.          0x95, 0x02, 0x16, 0x04, 0x97, 0xFE, 0xB9, 0x00,
  650.          0x55, 0x00, 0x49, 0xFE, 0x4B, 0xFA, 0xF0, 0x02,
  651.          0x9D, 0x0A, 0x47, 0x0A, 0x7C, 0x0C, 0xA9, 0x0E,
  652.          0x35, 0x0C, 0xAB, 0x08, 0xDB, 0x06, 0x5B, 0x03,
  653.          0xCB, 0x02, 0x86, 0x0A, 0x0E, 0x08, 0xCC, 0x03,
  654.          0x19, 0x08, 0x7E, 0x0D, 0xEC, 0x06, 0xE5, 0x05,
  655.          0x03, 0xFE, 0x7A, 0xFA, 0x90, 0xF2, 0x72, 0xEE,
  656.          0x6F, 0xF0, 0xD6, 0xED, 0xB0, 0xEB, 0x11, 0xE7,
  657.          0x7F, 0xEC, 0x9D, 0xEF, 0x51, 0xEF, 0x89, 0xEB,
  658.          0x90, 0xF6, 0xA7, 0xF4, 0x75, 0xF7, 0x64, 0xF6,
  659.          0x06, 0xF9, 0x04, 0xFE, 0x3B, 0xFE, 0xA2, 0x01,
  660.          0x7D, 0x07, 0xDA, 0x0A, 0x95, 0x0A, 0x46, 0x0E,
  661.          0x5D, 0x0E, 0xAC, 0x0E, 0x02, 0x11, 0xDB, 0x0F,
  662.          0x30, 0x17, 0x57, 0x14, 0x39, 0x10, 0x10, 0x14,
  663.          0xE0, 0x15, 0x30, 0x11, 0xEB, 0x0C, 0xC1, 0x08,
  664.          0x45, 0x08, 0xC3, 0x04, 0x20, 0xFC, 0x0D, 0xFA,
  665.          0x1B, 0xF4, 0x32, 0xF4, 0x60, 0xF1, 0x78, 0xF5,
  666.          0x00, 0xFB, 0x38, 0xF9, 0xBD, 0xF5, 0x82, 0xFD,
  667.          0x7D, 0xFD, 0x4A, 0xF7, 0x20, 0xF6, 0xD0, 0xF4,
  668.          0x8A, 0xF3, 0x4C, 0xF7, 0xD0, 0xFA, 0x7A, 0xFC,
  669.          0x1C, 0x01, 0x34, 0x09, 0xB5, 0x02, 0x1E, 0x00,
  670.          0x60, 0x00, 0x56, 0x00, 0xEA, 0xFC, 0x6A, 0xFD,
  671.          0xB5, 0x01, 0xDE, 0xFF, 0x96, 0x00, 0xEA, 0xFC,
  672.          0x7B, 0x00, 0x43, 0x00, 0x0B, 0x07, 0x7A, 0x0B,
  673.          0x66, 0x12, 0xC6, 0x10, 0x0A, 0x07, 0x68, 0xFE,
  674.          0x81, 0xFC, 0x66, 0xFF, 0x5D, 0xFC, 0x09, 0x03,
  675.          0x47, 0x11, 0x0C, 0x0E, 0xBA, 0x08, 0x6B, 0xFE,
  676.          0x00, 0xFE, 0xFA, 0x03, 0x7A, 0x0A, 0xE4, 0x04,
  677.          0xEF, 0x01, 0x86, 0xFB, 0x90, 0xF4, 0x51, 0xF9,
  678.          0xEA, 0xFA, 0xC8, 0xF8, 0x3F, 0xF5, 0x82, 0xF4,
  679.          0xF5, 0xF1, 0xC7, 0xF8, 0x3E, 0xF9, 0x78, 0xFB,
  680.          0x6D, 0x01, 0x8C, 0xF8, 0xC5, 0xF8, 0xA0, 0xF6,
  681.          0xDE, 0xF2, 0x13, 0xF7, 0x1F, 0xF6, 0x7F, 0xF4,
  682.          0xCA, 0xFC, 0x8A, 0xFE, 0xEF, 0xFD, 0xFF, 0xF7,
  683.          0xDC, 0xFD, 0x20, 0x00, 0x74, 0xFA, 0x65, 0x01,
  684.          0x6C, 0x0D, 0xE7, 0x11, 0x57, 0x19, 0xE1, 0x12,
  685.          0xED, 0x10, 0x7D, 0x10, 0xC3, 0x0C, 0x01, 0x07,
  686.          0x2D, 0x06, 0x7A, 0x0F, 0xF5, 0x10, 0xDC, 0x0E,
  687.          0xC6, 0x11, 0x2F, 0x09, 0xE5, 0x07, 0x37, 0x0C,
  688.          0x90, 0x04, 0xEB, 0xFF, 0xAF, 0x02, 0xE5, 0xF9,
  689.          0x98, 0xF5, 0x49, 0xF5, 0x46, 0xFA, 0xE7, 0xF5,
  690.          0x3E, 0xF5, 0xFC, 0xEA, 0x3D, 0xEC, 0xD4, 0xEB,
  691.          0x51, 0xEF, 0x08, 0xFD, 0xB3, 0x04, 0x86, 0x01,
  692.          0xBE, 0xFD, 0x06, 0x05, 0xC0, 0x0A, 0x93, 0x0D,
  693.          0x54, 0x0D, 0x47, 0x07, 0x6E, 0x0B, 0x55, 0x07,
  694.          0x59, 0x04, 0xC3, 0xFA, 0xFF, 0xFA, 0xFB, 0xFB,
  695.          0xBF, 0xFA, 0x17, 0xFC, 0x6D, 0x02, 0x0D, 0x07,
  696.          0xC4, 0x06, 0x3B, 0x0B, 0x7D, 0x0B, 0xDF, 0x05,
  697.          0x44, 0x02, 0xCB, 0x03, 0x29, 0x0F, 0x3E, 0x12,
  698.          0xA7, 0x04, 0xA2, 0xF4, 0x1F, 0xF1, 0x70, 0xEC,
  699.          0xBF, 0xE2, 0xAE, 0xED, 0x72, 0x05, 0xA0, 0x1A,
  700.          0xBC, 0x18, 0x7E, 0x14, 0x08, 0x0F, 0xE8, 0x11,
  701.          0xE8, 0x06, 0x38, 0x03, 0xCF, 0x01, 0x20, 0x06,
  702.          0xFF, 0x03, 0xFB, 0x02, 0x83, 0x06, 0xF8, 0x07,
  703.          0xF3, 0x03, 0xDE, 0xFB, 0x55, 0xEF, 0x7D, 0xE7,
  704.          0xBB, 0xEA, 0xD1, 0xF1, 0xF7, 0xF9, 0x0A, 0xFE,
  705.          0xF1, 0xF9, 0xA9, 0xF9, 0x40, 0xF1, 0x07, 0xEA,
  706.          0x3E, 0xF5, 0xA7, 0xF7, 0xDD, 0x03, 0xF8, 0xFE,
  707.          0x0F, 0x03, 0xD0, 0xFE, 0xA3, 0xF3, 0xE2, 0xF1,
  708.          0x1A, 0xF1, 0x66, 0xF6, 0x01, 0xFC, 0x69, 0x01,
  709.          0x6D, 0x09, 0x5C, 0x05, 0x24, 0xFD, 0x78, 0xFC,
  710.          0x2C, 0x0F, 0x40, 0x10, 0xB8, 0x0E, 0x9B, 0x06,
  711.          0x09, 0x02, 0xDC, 0x06, 0xD2, 0x02, 0x6B, 0x00,
  712.          0xC7, 0x06, 0x6D, 0xFE, 0x17, 0xF6, 0x6B, 0xF2,
  713.          0x0D, 0xF6, 0xF1, 0xF6, 0x41, 0xF3, 0x76, 0xF9,
  714.          0x5E, 0x02, 0x14, 0xFC, 0x0E, 0xEB, 0x6D, 0xE0,
  715.          0xCF, 0xD9, 0x86, 0xE0, 0x0F, 0xEB, 0x06, 0xFA,
  716.          0xFE, 0x06, 0xF2, 0xFC, 0xF3, 0xE5, 0x57, 0xE6,
  717.          0x03, 0xF2,
  718.      };
  719. __align(2)
  720.      const U8 CopterDown_wav[2444] = 
  721.      {
  722.          0x52, 0x49, 0x46, 0x46, 0x84, 0x09, 0x00, 0x00,
  723.          0x57, 0x41, 0x56, 0x45, 0x66, 0x6D, 0x74, 0x20,
  724.          0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
  725.          0x40, 0x1F, 0x00, 0x00, 0x80, 0x3E, 0x00, 0x00,
  726.          0x02, 0x00, 0x10, 0x00, 0x64, 0x61, 0x74, 0x61,
  727.          0x60, 0x09, 0x00, 0x00, 0x00, 0x00, 0x86, 0xFF,
  728.          0xD5, 0xFF, 0x12, 0xFF, 0x05, 0xFE, 0x70, 0xFB,
  729.          0x41, 0xFB, 0xEA, 0xFB, 0x97, 0xF9, 0x8C, 0xF9,
  730.          0x5C, 0xFD, 0x9C, 0x04, 0x50, 0x05, 0x32, 0x04,
  731.          0x13, 0x09, 0xBF, 0x11, 0x22, 0x19, 0x66, 0x13,
  732.          0xD6, 0x08, 0x28, 0x0D, 0x57, 0x12, 0xB7, 0x10,
  733.          0x80, 0xFD, 0xCA, 0xE7, 0xF5, 0xEC, 0xD1, 0xEA,
  734.          0xA9, 0xF6, 0xF2, 0xF3, 0xAD, 0x01, 0xD5, 0x0C,
  735.          0xEE, 0x09, 0x63, 0x07, 0x91, 0xEE, 0x5E, 0xFC,
  736.          0xC5, 0xFE, 0x44, 0x04, 0xE3, 0x06, 0x9C, 0x04,
  737.          0x50, 0x18, 0x83, 0x0C, 0xF5, 0x09, 0xA5, 0xFC,
  738.          0x20, 0xF5, 0x80, 0x01, 0x5D, 0x07, 0x7A, 0x0F,
  739.          0x63, 0x12, 0x7D, 0x12, 0x1D, 0x16, 0x3B, 0xFA,
  740.          0x1C, 0xF1, 0x05, 0xFC, 0x14, 0xFE, 0x07, 0x12,
  741.          0x15, 0x10, 0xB0, 0x13, 0x78, 0x18, 0x3B, 0x17,
  742.          0xDA, 0x1B, 0xCA, 0x15, 0xD5, 0x19, 0x59, 0x12,
  743.          0x9E, 0x0A, 0x2F, 0x03, 0xE8, 0xF5, 0x1C, 0xF6,
  744.          0xE7, 0xF6, 0xB6, 0x03, 0x95, 0x08, 0x8C, 0xFF,
  745.          0x53, 0x00, 0x39, 0xF7, 0x0E, 0xF5, 0x3C, 0xF3,
  746.          0x91, 0xE6, 0xD5, 0xED, 0x82, 0xF0, 0xA9, 0xFE,
  747.          0x43, 0xFF, 0x0F, 0xF9, 0xA0, 0xF8, 0x1C, 0xF1,
  748.          0x89, 0xF5, 0x2E, 0xF2, 0x82, 0xEE, 0xC6, 0xF4,
  749.          0xB8, 0xF1, 0x78, 0xFE, 0xE6, 0xF8, 0xE1, 0xF6,
  750.          0xD0, 0xF8, 0xF7, 0xF9, 0x08, 0x02, 0x90, 0xFB,
  751.          0xF7, 0xFE, 0x76, 0xFE, 0xF3, 0xFD, 0xE5, 0x04,
  752.          0xCE, 0xFD, 0xB5, 0x01, 0x8B, 0xFA, 0xDC, 0xF9,
  753.          0x5D, 0xFF, 0x1F, 0xFB, 0x1E, 0xFE, 0xC1, 0xF3,
  754.          0x78, 0xFA, 0xDD, 0xF8, 0x64, 0xF6, 0x28, 0xFB,
  755.          0x3E, 0xEC, 0x8B, 0xF7, 0xC9, 0xF4, 0x99, 0xF5,
  756.          0xEF, 0xF9, 0x61, 0xEC, 0xEC, 0xFE, 0xB2, 0xF8,
  757.          0xF4, 0xFA, 0x89, 0xF9, 0x30, 0xF4, 0xD2, 0xFA,
  758.          0xE7, 0xF1, 0xBD, 0xFD, 0xAA, 0x01, 0x19, 0x08,
  759.          0x22, 0x0A, 0x6C, 0x03, 0x6B, 0x10, 0xDB, 0x0B,
  760.          0x00, 0x0D, 0x52, 0x09, 0xC9, 0x0D, 0x48, 0x16,
  761.          0x43, 0x10, 0x2F, 0x17, 0xEE, 0x0F, 0x81, 0x17,
  762.          0x03, 0x14, 0x7B, 0x14, 0x55, 0x14, 0x01, 0x0D,
  763.          0xFB, 0x0F, 0xCA, 0x07, 0xC5, 0x0A, 0xD4, 0x09,
  764.          0xD5, 0x09, 0x2E, 0x0A, 0x2A, 0x03, 0x8C, 0x0B,
  765.          0x34, 0x09, 0xAD, 0x0A, 0xA1, 0x03, 0xB3, 0x00,
  766.          0xCE, 0x04, 0x93, 0x04, 0x30, 0x03, 0xA9, 0xF7,
  767.          0xE7, 0xF5, 0x67, 0xFA, 0x3A, 0xFE, 0x01, 0xFA,
  768.          0xAB, 0xEF, 0x73, 0xEF, 0xED, 0xF5, 0xFD, 0xFB,
  769.          0xE2, 0xF9, 0x80, 0xF5, 0x4F, 0xF3, 0xEB, 0xF9,
  770.          0x50, 0x01, 0x2C, 0x07, 0xC0, 0x02, 0xC0, 0xFE,
  771.          0xE0, 0x00, 0x94, 0x05, 0xEC, 0x0C, 0x01, 0x07,
  772.          0xFD, 0x03, 0x1B, 0x02, 0x77, 0x02, 0x19, 0x08,
  773.          0x1B, 0xFC, 0xEB, 0xF8, 0xA7, 0xF0, 0xA9, 0xF6,
  774.          0xCB, 0xFA, 0x13, 0xF4, 0xA2, 0xF9, 0xC3, 0xED,
  775.          0x31, 0xF5, 0xC7, 0xEF, 0x41, 0xEC, 0x40, 0xF2,
  776.          0xFF, 0xE9, 0x9B, 0xF5, 0x3B, 0xF0, 0xDF, 0xF4,
  777.          0x3C, 0x00, 0xDF, 0xF5, 0xC7, 0xF6, 0xAB, 0xE6,
  778.          0xFA, 0xE6, 0xBC, 0xEC, 0x37, 0xE9, 0x0C, 0xEE,
  779.          0xFD, 0xEA, 0x77, 0xFC, 0x1B, 0x04, 0xC2, 0xFF,
  780.          0xE8, 0xFB, 0x81, 0xF3, 0x33, 0x02, 0x06, 0x02,
  781.          0xC9, 0x07, 0x26, 0x0B, 0x13, 0x0D, 0x4C, 0x22,
  782.          0x56, 0x1C, 0x90, 0x1E, 0xC5, 0x13, 0x7F, 0x09,
  783.          0x01, 0x0E, 0x52, 0x03, 0x13, 0x0B, 0xFD, 0x08,
  784.          0xC0, 0x0C, 0x65, 0x12, 0x01, 0x0B, 0x02, 0x0F,
  785.          0x76, 0xFC, 0x86, 0xFA, 0x30, 0xF6, 0xE1, 0xF8,
  786.          0xC2, 0x01, 0x39, 0xF9, 0x5F, 0x05, 0xC0, 0x05,
  787.          0x25, 0x0E, 0xAC, 0x09, 0x7C, 0xFA, 0xB2, 0xFC,
  788.          0x34, 0xFC, 0x68, 0x04, 0xE2, 0x03, 0xF2, 0x00,
  789.          0x81, 0x07, 0xAB, 0x0D, 0x64, 0x0A, 0x76, 0x00,
  790.          0x90, 0xFB, 0xAD, 0xFB, 0xA5, 0x06, 0x30, 0x01,
  791.          0xF8, 0x03, 0xAB, 0x07, 0x1F, 0x11, 0x55, 0x17,
  792.          0xDB, 0x08, 0xB4, 0x08, 0x74, 0x08, 0xCF, 0x11,
  793.          0xC1, 0x14, 0x9C, 0x09, 0x74, 0x0D, 0xC7, 0x0F,
  794.          0xDA, 0x15, 0xBB, 0x0C, 0x1B, 0xFD, 0x7A, 0xF5,
  795.          0xE3, 0xF7, 0x17, 0xFD, 0x04, 0xFA, 0xDE, 0xF6,
  796.          0xB7, 0xF4, 0x65, 0xFC, 0xA3, 0xFD, 0x45, 0xF8,
  797.          0x82, 0xEE, 0xF5, 0xEC, 0x71, 0xF4, 0xFA, 0xFD,
  798.          0x56, 0x03, 0x75, 0x03, 0xD5, 0x07, 0x3D, 0x07,
  799.          0x70, 0x07, 0x4D, 0xFF, 0xF9, 0xF4, 0x95, 0xF3,
  800.          0xBE, 0xF0, 0x88, 0xFD, 0x17, 0xFC, 0xB7, 0xFF,
  801.          0x13, 0xFE, 0x88, 0xFA, 0x90, 0xFF, 0xC2, 0xF0,
  802.          0xB0, 0xEF, 0x87, 0xEA, 0x4B, 0xF5, 0x06, 0x02,
  803.          0xD8, 0x00, 0x06, 0x0B, 0x1B, 0x08, 0xB7, 0x10,
  804.          0x5A, 0x08, 0x6E, 0xF9, 0x17, 0xF7, 0xC7, 0xEF,
  805.          0x48, 0xFD, 0xF7, 0xF4, 0x95, 0xF7, 0xC2, 0xFA,
  806.          0x6B, 0xFE, 0x2A, 0x02, 0x76, 0xEB, 0x78, 0xE7,
  807.          0xE8, 0xE1, 0x31, 0xEB, 0x93, 0xF2, 0x93, 0xE8,
  808.          0x85, 0xFA, 0x3C, 0xFD, 0x53, 0x0D, 0xE0, 0x08,
  809.          0x04, 0xF7, 0x49, 0xFE, 0x48, 0xF5, 0xAF, 0x02,
  810.          0x28, 0xF8, 0x57, 0xF7, 0xD7, 0x05, 0xBF, 0x00,
  811.          0x6E, 0x0E, 0xE7, 0xFA, 0x06, 0xFC, 0x6B, 0xFC,
  812.          0xDC, 0xF3, 0xDF, 0xFC, 0x48, 0xED, 0x41, 0xFD,
  813.          0x0D, 0xFE, 0xE1, 0x05, 0x41, 0x0A, 0x01, 0xFF,
  814.          0xB9, 0x08, 0xFC, 0xFB, 0x5D, 0x02, 0x65, 0xFD,
  815.          0x0C, 0xFA, 0x62, 0x03, 0x29, 0xF8, 0x18, 0x05,
  816.          0x2A, 0xFD, 0xBB, 0x03, 0x95, 0x01, 0x5B, 0xF7,
  817.          0xE2, 0xFB, 0xE9, 0xF5, 0xB8, 0xFE, 0x7F, 0xFC,
  818.          0x61, 0xFE, 0xF4, 0x02, 0xBE, 0x08, 0x2B, 0x0F,
  819.          0x0C, 0x0E, 0x3D, 0x10, 0x23, 0x0E, 0x89, 0x13,
  820.          0x99, 0x12, 0x3D, 0x12, 0xC8, 0x12, 0xAE, 0x10,
  821.          0x18, 0x15, 0x14, 0x0F, 0xED, 0x13, 0x9D, 0x11,
  822.          0xEA, 0x0B, 0x9A, 0x06, 0x85, 0xFE, 0x60, 0x04,
  823.          0x36, 0x03, 0xCA, 0x07, 0x91, 0x04, 0x19, 0x02,
  824.          0x8A, 0x0B, 0xFA, 0x06, 0xF4, 0x0A, 0x1A, 0x04,
  825.          0xCB, 0xFE, 0x06, 0x04, 0xE0, 0xFB, 0x8E, 0x05,
  826.          0x2B, 0xFC, 0xA5, 0xFE, 0xAA, 0x01, 0x56, 0xFB,
  827.          0x40, 0x02, 0x6E, 0xF6, 0xC2, 0xF9, 0x02, 0xF9,
  828.          0x59, 0xFA, 0x1D, 0x06, 0x6C, 0xFB, 0xA7, 0x04,
  829.          0x5D, 0x01, 0x0A, 0x07, 0xCC, 0x0B, 0xC9, 0x02,
  830.          0x39, 0x08, 0xFE, 0x02, 0xC5, 0x0C, 0xDC, 0x0A,
  831.          0x2C, 0x05, 0x2F, 0x01, 0x84, 0xFF, 0x6A, 0x09,
  832.          0xF8, 0x02, 0xE2, 0x01, 0x33, 0xF8, 0xD9, 0xFB,
  833.          0x6E, 0xFE, 0x11, 0xF7, 0x0F, 0xF8, 0x28, 0xEE,
  834.          0xD0, 0xF3, 0x1C, 0xF1, 0x4B, 0xF1, 0xB1, 0xF7,
  835.          0x83, 0xF6, 0xDA, 0xFC, 0x54, 0xF4, 0x53, 0xF2,
  836.          0xD8, 0xF3, 0xAD, 0xF7, 0x0F, 0xF7, 0xE4, 0xEC,
  837.          0xC3, 0xF0, 0xD8, 0xF7, 0x76, 0x03, 0x77, 0x00,
  838.          0xCC, 0xF2, 0xF4, 0xF1, 0x04, 0xF7, 0x0D, 0x00,
  839.          0xAE, 0xF9, 0xCC, 0xED, 0x34, 0xF8, 0x1F, 0x05,
  840.          0xA1, 0x0E, 0x56, 0x05, 0x29, 0xFA, 0xAC, 0xF8,
  841.          0x0A, 0xFB, 0xC0, 0x04, 0xAB, 0x07, 0x55, 0x04,
  842.          0xD5, 0x07, 0x4A, 0x0A, 0x9A, 0x16, 0x9E, 0x0E,
  843.          0x0B, 0x07, 0x69, 0xFC, 0xE4, 0xFF, 0x8D, 0x0A,
  844.          0xEF, 0xFF, 0x96, 0x03, 0x90, 0xF6, 0x82, 0x00,
  845.          0x41, 0x05, 0x88, 0xFF, 0x09, 0xFE, 0x38, 0xE7,
  846.          0x00, 0xF4, 0x55, 0xF5, 0x45, 0xFB, 0x1D, 0xF7,
  847.          0x39, 0xEC, 0x7A, 0x03, 0x5C, 0xFD, 0x53, 0x0B,
  848.          0xC4, 0xF7, 0xD2, 0xED, 0xEB, 0xFC, 0xB7, 0xF9,
  849.          0x0E, 0x08, 0x5D, 0xF2, 0xC3, 0xF3, 0xA3, 0xFE,
  850.          0xB8, 0x03, 0x64, 0x07, 0x93, 0xEC, 0xF6, 0xF1,
  851.          0xA4, 0xF3, 0x79, 0xFF, 0x50, 0x01, 0xDC, 0xF5,
  852.          0x32, 0xFF, 0x98, 0x04, 0x85, 0x13, 0x2F, 0x09,
  853.          0xF6, 0x02, 0xB2, 0x05, 0xA6, 0x13, 0xB8, 0x1B,
  854.          0xE3, 0x0B, 0xCD, 0x01, 0xB0, 0x00, 0xE7, 0x0C,
  855.          0x5E, 0x0D, 0xCA, 0x01, 0x2E, 0xF8, 0x90, 0xF8,
  856.          0xA5, 0x08, 0x25, 0xFC, 0x0B, 0xF6, 0x8F, 0xEC,
  857.          0xF2, 0xF1, 0xCA, 0xFC, 0xBE, 0x00, 0x4D, 0x08,
  858.          0x44, 0x05, 0x0F, 0x04, 0xFA, 0xFC, 0x13, 0xFE,
  859.          0xCA, 0x03, 0xA8, 0x14, 0x89, 0x20, 0x0E, 0x1A,
  860.          0x49, 0x1B, 0x0A, 0x03, 0xD9, 0xF6, 0x97, 0xF1,
  861.          0xA7, 0xE5, 0x6B, 0xE8, 0x96, 0xF9, 0x30, 0x07,
  862.          0x0D, 0x0C, 0xE3, 0x02, 0x06, 0x04, 0x8D, 0x06,
  863.          0x0B, 0x06, 0xB8, 0x12, 0xCC, 0x0D, 0x95, 0x10,
  864.          0x64, 0x0A, 0xF2, 0x13, 0xF3, 0x16, 0x89, 0x11,
  865.          0xC1, 0x0F, 0x5D, 0x00, 0xE6, 0x0F, 0x6E, 0x13,
  866.          0xA3, 0x18, 0xC8, 0x05, 0xF2, 0xF1, 0x2E, 0xF8,
  867.          0xF5, 0xF1, 0x67, 0xF8, 0x32, 0xEC, 0xE2, 0xEA,
  868.          0x05, 0xF6, 0x2F, 0xF3, 0xFE, 0xF3, 0x45, 0xEE,
  869.          0x65, 0xF5, 0x92, 0x08, 0x3C, 0x0B, 0x69, 0x0D,
  870.          0x3B, 0x0C, 0x62, 0x0D, 0x39, 0x0A, 0xAE, 0x01,
  871.          0xEB, 0xF7, 0x46, 0xED, 0xFF, 0xE9, 0x86, 0xE5,
  872.          0x82, 0xEA, 0xD8, 0xEF, 0x97, 0xF7, 0xD1, 0xF9,
  873.          0xDC, 0xF7, 0x91, 0xF9, 0x1E, 0xF8, 0xA8, 0xFE,
  874.          0xCD, 0xFD, 0x67, 0xFD, 0xD6, 0x00, 0x3E, 0x0A,
  875.          0xF2, 0x0D, 0x32, 0x07, 0xA4, 0xFF, 0x7D, 0xFC,
  876.          0x97, 0x08, 0x48, 0x09, 0x39, 0x03, 0xDC, 0xFB,
  877.          0x47, 0xF8, 0x34, 0x00, 0x73, 0x02, 0x5B, 0x04,
  878.          0xD1, 0x04, 0x9B, 0x03, 0xE3, 0x06, 0xBC, 0x0C,
  879.          0xB7, 0x09, 0x39, 0x00, 0xFB, 0xFC, 0x8E, 0xFF,
  880.          0x4A, 0x10, 0x75, 0x0E, 0x33, 0x09, 0x9D, 0x00,
  881.          0x0C, 0x01, 0x4D, 0x07, 0xA6, 0xFB, 0x02, 0xF4,
  882.          0xA0, 0xE9, 0x56, 0xF5, 0x18, 0xFC, 0x93, 0xFA,
  883.          0x4B, 0xF9, 0x19, 0xF3, 0xB5, 0x05, 0xE9, 0x02,
  884.          0xE6, 0x02, 0xE4, 0xF5, 0xAB, 0xF2, 0xF0, 0x06,
  885.          0xAE, 0x04, 0x18, 0x0A, 0xC8, 0xFB, 0x95, 0xFE,
  886.          0xF8, 0x06, 0xC0, 0xFF, 0x4D, 0xFA, 0x02, 0xE7,
  887.          0x4A, 0xEC, 0xD6, 0xF3, 0xA7, 0xF9, 0xF1, 0xF6,
  888.          0x32, 0xEE, 0xF8, 0xF5, 0x96, 0xFF, 0x98, 0x06,
  889.          0x23, 0xFE, 0x21, 0xFE, 0x4C, 0xFD, 0xD1, 0x06,
  890.          0x3C, 0x06, 0x39, 0xFF, 0xE4, 0x03, 0x11, 0x00,
  891.          0x20, 0x0C, 0x07, 0x05, 0x34, 0xFC, 0x62, 0xF6,
  892.          0x3F, 0xEC, 0x8B, 0xF3, 0x7A, 0xEA, 0x1D, 0xE5,
  893.          0x09, 0xE5, 0x9D, 0xE9, 0x03, 0xFB, 0x54, 0xFF,
  894.          0x0C, 0x02, 0x9A, 0x02, 0x25, 0x01, 0xF8, 0x04,
  895.          0x7F, 0xFF, 0x0A, 0xFD, 0x35, 0x00, 0x53, 0xFF,
  896.          0x3E, 0x0D, 0x95, 0x0E, 0x21, 0x11, 0x8A, 0x0A,
  897.          0x3F, 0xFB, 0x87, 0xFC, 0xD8, 0xF5, 0x6E, 0xFD,
  898.          0xD9, 0xFA, 0xB4, 0xFB, 0xBD, 0x09, 0x8B, 0x13,
  899.          0xB0, 0x1E, 0xB4, 0x12, 0x41, 0x0E, 0x77, 0x06,
  900.          0x43, 0x0D, 0xFE, 0x12, 0xDC, 0x10, 0xFB, 0x18,
  901.          0xD1, 0x15, 0xC0, 0x1F, 0xFA, 0x18, 0xD9, 0x10,
  902.          0x6A, 0x08, 0xC2, 0xFE, 0xE4, 0x02, 0xA1, 0xFA,
  903.          0xC8, 0x03, 0x31, 0x04, 0xC2, 0x08, 0xA7, 0x07,
  904.          0x93, 0x01, 0xA3, 0x05, 0xB9, 0xFD, 0xC5, 0x02,
  905.          0x77, 0xFB, 0x9A, 0x02, 0xE2, 0x0B, 0x3F, 0x0E,
  906.          0x90, 0x13, 0x2B, 0x08, 0xEE, 0x09, 0x34, 0x03,
  907.          0x7A, 0x04, 0x56, 0xFE, 0xE8, 0xFC, 0x50, 0x03,
  908.          0x40, 0xFE, 0x5C, 0x02, 0x21, 0xF8, 0x84, 0xFC,
  909.          0x0B, 0xF5, 0x11, 0xEE, 0xBC, 0xF1, 0x13, 0xF0,
  910.          0x12, 0x00, 0x19, 0xFB, 0xAC, 0xF8, 0x59, 0xF8,
  911.          0xD4, 0xF7, 0x1C, 0xFC, 0x7A, 0xF1, 0x30, 0xEC,
  912.          0xAA, 0xEF, 0x1C, 0xFC, 0x4C, 0x01, 0x0B, 0xFE,
  913.          0xF8, 0xF1, 0x87, 0xF3, 0x93, 0xF7, 0x33, 0xF5,
  914.          0x6A, 0xF2, 0xFA, 0xE1, 0xAE, 0xF1, 0x40, 0xF8,
  915.          0xF8, 0x01, 0x7F, 0x04, 0x1B, 0xF3, 0xBE, 0xFE,
  916.          0x66, 0xF5, 0x7E, 0xF5, 0xCD, 0xEF, 0x4B, 0xE8,
  917.          0xCB, 0xFD, 0xA2, 0xFD, 0x31, 0x08, 0x55, 0x05,
  918.          0x3C, 0x02, 0x95, 0x09, 0x64, 0xFD, 0x36, 0xFA,
  919.          0x0C, 0xF4, 0x16, 0xF8, 0x94, 0x00, 0xBE, 0xFD,
  920.          0xC4, 0xFB, 0x2D, 0xFB, 0x14, 0x00, 0x12, 0x03,
  921.          0xF0, 0xFC, 0x79, 0xF2, 0x7B, 0xF4, 0x6B, 0xFC,
  922.          0xA0, 0x00, 0x12, 0x02, 0x78, 0xFD, 0x2E, 0x07,
  923.          0xDA, 0x0D, 0x2C, 0x13, 0x6B, 0x13, 0xB8, 0x09,
  924.          0x6E, 0x11, 0xBB, 0x0E, 0x21, 0x10, 0xB9, 0x0E,
  925.          0x99, 0x05, 0x48, 0x0D, 0x60, 0x05, 0x4E, 0x0E,
  926.          0x70, 0x0C, 0xD7, 0x05, 0x30, 0x08, 0x66, 0xFB,
  927.          0x07, 0x07, 0xFD, 0x00, 0x66, 0xFF, 0x54, 0x01,
  928.          0xC7, 0x01, 0x22, 0x13, 0xC1, 0x0F, 0xB0, 0x0F,
  929.          0xE7, 0x08, 0xF1, 0x05, 0x26, 0x08, 0x9A, 0xFD,
  930.          0xB2, 0xF9, 0x31, 0xF2, 0x74, 0xF8, 0xEB, 0xF9,
  931.          0xD5, 0xF8, 0xA7, 0xF5, 0xAC, 0xF2, 0xE4, 0xF7,
  932.          0x7D, 0xF1, 0x8F, 0xF2, 0x9B, 0xEE, 0xA9, 0xF7,
  933.          0x09, 0x00, 0xE8, 0xFD, 0xFA, 0x04, 0x99, 0x03,
  934.          0x98, 0x0E, 0xA4, 0x0A, 0x41, 0x05, 0x5B, 0x03,
  935.          0x23, 0xFF, 0xCB, 0x04, 0x7D, 0xFB, 0x63, 0xFD,
  936.          0xB7, 0xF9, 0x43, 0xFC, 0xCC, 0xFD, 0x0E, 0xFD,
  937.          0xEA, 0x04, 0x27, 0xFF, 0x87, 0x04, 0x04, 0xFF,
  938.          0xAB, 0x02, 0x02, 0x09, 0xDE, 0x03, 0xEE, 0x06,
  939.          0x84, 0x00, 0x87, 0x0E, 0x07, 0x11, 0x5B, 0x0A,
  940.          0x63, 0x02, 0x9E, 0xF5, 0x89, 0xFA, 0x58, 0xF5,
  941.          0xAD, 0xED, 0xD7, 0xE3, 0xFA, 0xE4, 0x0F, 0xF1,
  942.          0xED, 0xF7, 0x59, 0xF7, 0x6F, 0xF5, 0xDB, 0xFC,
  943.          0xD7, 0x00, 0x39, 0x02, 0x7F, 0xFA, 0xFA, 0xFC,
  944.          0x07, 0x08, 0xE8, 0x0A, 0xB3, 0x0D, 0x4D, 0x0A,
  945.          0x9C, 0x17, 0x46, 0x18, 0x9A, 0x0D, 0x0E, 0xFE,
  946.          0xC5, 0xF5, 0xD0, 0x04, 0x7F, 0x05, 0xB2, 0x03,
  947.          0xD9, 0xF7, 0x24, 0x01, 0xBE, 0x13, 0x3A, 0x13,
  948.          0x38, 0x11, 0xF5, 0xF8, 0x0F, 0x04, 0x16, 0x09,
  949.          0x7B, 0x05, 0x37, 0x06, 0x5E, 0xF3, 0xFC, 0x0A,
  950.          0x47, 0x0A, 0xB5, 0x09, 0xA8, 0x01, 0x48, 0xE9,
  951.          0x49, 0xF2, 0x6C, 0xE1, 0x6B, 0xE6, 0xCB, 0xE2,
  952.          0x6F, 0xE0, 0x24, 0xF1, 0x6B, 0xED, 0x59, 0xFD,
  953.          0xC0, 0xFB, 0x00, 0xF6, 0x22, 0xEF, 0xF1, 0xE9,
  954.          0x8F, 0xF8, 0x84, 0xFC, 0xED, 0x00, 0xAB, 0xFE,
  955.          0x13, 0x0A, 0xF3, 0x14, 0xFC, 0x14, 0xDD, 0x05,
  956.          0x40, 0xF7, 0x7E, 0xFF, 0x89, 0x02, 0x59, 0x0A,
  957.          0x4A, 0x03, 0xA8, 0x07, 0xB2, 0x16, 0x40, 0x18,
  958.          0xA1, 0x17, 0x5D, 0x01, 0xA3, 0x02, 0x52, 0x02,
  959.          0xF7, 0xFE, 0xEA, 0x02, 0x88, 0xFD, 0x2D, 0x0B,
  960.          0x72, 0x0C, 0x08, 0x05, 0x2E, 0xFE, 0x5A, 0xF5,
  961.          0x8B, 0xF9, 0x79, 0xF8, 0xA2, 0xF7, 0x63, 0xF9,
  962.          0xA2, 0x03, 0xE8, 0x0B, 0x16, 0x0B, 0x5D, 0x01,
  963.          0x31, 0xFA, 0x8C, 0xFC, 0xF5, 0xF8, 0x47, 0xF6,
  964.          0xD5, 0xF0, 0x58, 0xF5, 0xB0, 0x04, 0x2E, 0x07,
  965.          0x0A, 0x05, 0xAF, 0xFB, 0xE3, 0xFB, 0xF5, 0x03,
  966.          0xD3, 0x05, 0x02, 0x08, 0xD4, 0x0A, 0x7A, 0x13,
  967.          0x28, 0x21, 0x77, 0x26, 0x6B, 0x22, 0x91, 0x1A,
  968.          0x1C, 0x0F, 0x2C, 0x0A, 0x57, 0x06, 0x01, 0xFF,
  969.          0x63, 0xFB, 0x82, 0xFC, 0xB1, 0x05, 0x5C, 0x0B,
  970.          0x19, 0x05, 0x09, 0xFC, 0xD4, 0xF3, 0x6E, 0xF3,
  971.          0xB1, 0xF4, 0xD2, 0xF5, 0xC3, 0xF6, 0xE9, 0xFE,
  972.          0xB1, 0x07, 0x8B, 0x0E, 0xE7, 0x0A, 0x71, 0xFF,
  973.          0x16, 0xFA, 0xB6, 0xF5, 0x60, 0xF0, 0x0D, 0xE4,
  974.          0x7B, 0xDB, 0x76, 0xE2, 0x6F, 0xEA, 0x0E, 0xEE,
  975.          0x56, 0xE3, 0x21, 0xDC, 0x25, 0xE2, 0x6F, 0xE4,
  976.          0xA4, 0xEA, 0x70, 0xE6, 0x5C, 0xED, 0x69, 0xFF,
  977.          0xC6, 0x07, 0x7C, 0x0F, 0x12, 0x0A, 0xED, 0x0A,
  978.          0x4A, 0x10, 0xD0, 0x07, 0x97, 0x05, 0x1A, 0xFE,
  979.          0x07, 0xFE, 0x44, 0xFC, 0x28, 0xF3, 0xF5, 0xF4,
  980.          0x49, 0xF8, 0x43, 0xFA, 0xE6, 0xF4, 0x16, 0xF0,
  981.          0x09, 0xF5, 0x7F, 0xFB, 0xB7, 0xFE, 0x7A, 0xFB,
  982.          0x27, 0x02, 0x51, 0x0D, 0x15, 0x13, 0x77, 0x10,
  983.          0xB9, 0x08, 0x2A, 0x06, 0x13, 0x09, 0xC9, 0x06,
  984.          0xB3, 0x00, 0xDB, 0xFB, 0x8D, 0xF9, 0x82, 0xFD,
  985.          0xE6, 0xFC, 0x2B, 0xFC, 0x00, 0xFD, 0xCD, 0xFD,
  986.          0x30, 0x00, 0xB2, 0xFF, 0xA8, 0xFF, 0x0A, 0x00,
  987.          0xFF, 0xFF, 0xBC, 0x0C, 0xC8, 0x0B, 0x52, 0x0F,
  988.          0x3D, 0x10, 0xE2, 0x0E, 0x37, 0x0D, 0x4B, 0x07,
  989.          0xC6, 0x09, 0x18, 0x09, 0xB9, 0x08, 0x73, 0x06,
  990.          0x46, 0x04, 0x0F, 0x09, 0x58, 0x07, 0xE9, 0x04,
  991.          0x20, 0x00, 0xBE, 0xFF, 0x46, 0x05, 0x64, 0x05,
  992.          0x4D, 0x06, 0x8B, 0x07, 0x77, 0x0C, 0xC6, 0x10,
  993.          0x52, 0x0C, 0xA2, 0x06, 0x0B, 0x04, 0x1A, 0x04,
  994.          0xBC, 0x03, 0x74, 0xFE, 0x16, 0xFC, 0xC6, 0x00,
  995.          0x3D, 0x04, 0xF2, 0x04, 0x65, 0xFE, 0xBF, 0xF9,
  996.          0xBF, 0xFA, 0x3C, 0xF9, 0x42, 0xF9, 0xBF, 0xF5,
  997.          0xC2, 0xF7, 0x68, 0xFD, 0xB0, 0xFF, 0xFB, 0x01,
  998.          0x71, 0xFD, 0xE5, 0xFA, 0xE8, 0xF7, 0x27, 0xF5,
  999.          0x28, 0xF5, 0xFA, 0xF2, 0x23, 0xF4, 0x29, 0xF6,
  1000.          0xFE, 0xF9, 0x1E, 0xFC, 0x22, 0xFA, 0x6F, 0xF6,
  1001.          0x83, 0xF5, 0xC0, 0xF6, 0x93, 0xF6, 0xC5, 0xF5,
  1002.          0x20, 0xF4, 0x91, 0xF9, 0xD9, 0xFC, 0x96, 0xFC,
  1003.          0xF3, 0xF8, 0x37, 0xF4, 0x9C, 0xF7, 0xAF, 0xF6,
  1004.          0xDB, 0xF6, 0x75, 0xF4, 0x89, 0xF5, 0x64, 0xFB,
  1005.          0x20, 0xFB, 0x28, 0xFD, 0x3A, 0xFA, 0x23, 0xFD,
  1006.          0x92, 0xFE, 0x9D, 0xFD, 0x9C, 0x00, 0xA9, 0xFF,
  1007.          0x4E, 0x04, 0xBA, 0x00, 0x85, 0xFE, 0xED, 0xFD,
  1008.          0x2B, 0xFD, 0xBB, 0xFF, 0x94, 0xFA, 0xC2, 0xFB,
  1009.          0x0D, 0xFC, 0xBF, 0x00, 0x51, 0x01, 0xF0, 0xFC,
  1010.          0xFC, 0xFD, 0x25, 0xFC, 0xF5, 0x03, 0xE0, 0x02,
  1011.          0xD7, 0x04, 0x9F, 0x08, 0x53, 0x08, 0xD8, 0x0F,
  1012.          0xA9, 0x08, 0xD9, 0x08, 0x0C, 0x06, 0xFF, 0x02,
  1013.          0xD8, 0x06, 0x7C, 0x00, 0x13, 0x06, 0xB0, 0x06,
  1014.          0x13, 0x08, 0x38, 0x08, 0x6E, 0x01, 0xC3, 0x03,
  1015.          0x14, 0x03, 0xFF, 0x04, 0x52, 0x04, 0x0D, 0x05,
  1016.          0x75, 0x0B, 0x8B, 0x11, 0x76, 0x13, 0x94, 0x0F,
  1017.          0x64, 0x0C, 0x19, 0x0A, 0x9F, 0x0B, 0x14, 0x07,
  1018.          0x65, 0x05, 0x87, 0x04, 0x51, 0x06, 0xA0, 0x0A,
  1019.          0x90, 0x05, 0x6F, 0x06, 0xF4, 0xFF, 0x70, 0xFF,
  1020.          0x73, 0xFD, 0xA8, 0xF9, 0x58, 0x00, 0x99, 0xFD,
  1021.          0xBF, 0x04, 0x83, 0x02, 0x59, 0x04, 0x68, 0x08,
  1022.          0x3A, 0x02, 0x73, 0x03, 0xB1, 0xF9, 0x84, 0xFD,
  1023.          0xC4, 0xFD, 0x9D, 0xFD, 0x69, 0xFE, 0x2D, 0xF8,
  1024.          0x32, 0xFF, 0x77, 0xFA, 0xD9, 0xFC, 0xB3, 0xF6,
  1025.          0x34, 0xF3, 0x30, 0xF9, 0xD7, 0xF4, 0xF9, 0xFC,
  1026.          0xB9, 0xF7, 0xA0, 0xFB, 0x75, 0xFF, 0x29, 0xFC,
  1027.          0x6A, 0x01, 0x79, 0xFA,
  1028.      };
  1029. __align(2)
  1030.      const U8 Copter_background_midi[1063] = 
  1031.      {
  1032.          0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06,
  1033.          0x00, 0x00, 0x00, 0x01, 0x03, 0xC0, 0x4D, 0x54,
  1034.          0x72, 0x6B, 0x00, 0x00, 0x04, 0x11, 0x00, 0xFF,
  1035.          0x02, 0x16, 0x43, 0x6F, 0x70, 0x79, 0x72, 0x69,
  1036.          0x67, 0x68, 0x74, 0x20, 0x63, 0x20, 0x32, 0x30,
  1037.          0x30, 0x33, 0x20, 0x62, 0x79, 0x20, 0x43, 0x43,
  1038.          0x00, 0xFF, 0x01, 0x02, 0x43, 0x43, 0x00, 0xFF,
  1039.          0x58, 0x04, 0x04, 0x02, 0x18, 0x08, 0x00, 0xFF,
  1040.          0x59, 0x02, 0x00, 0x00, 0x00, 0xFF, 0x51, 0x03,
  1041.          0x09, 0x27, 0xC0, 0x00, 0xC0, 0x56, 0x00, 0xB0,
  1042.          0x07, 0x66, 0x00, 0x90, 0x4A, 0x6F, 0x00, 0x48,
  1043.          0x67, 0x00, 0x43, 0x7C, 0x81, 0x70, 0x48, 0x00,
  1044.          0x00, 0x4A, 0x00, 0x00, 0x48, 0x52, 0x00, 0x4A,
  1045.          0x53, 0x81, 0x70, 0x4A, 0x00, 0x00, 0x48, 0x00,
  1046.          0x00, 0x43, 0x00, 0x00, 0x4A, 0x52, 0x00, 0x48,
  1047.          0x51, 0x00, 0x43, 0x7D, 0x81, 0x70, 0x48, 0x00,
  1048.          0x00, 0x4A, 0x00, 0x00, 0x4A, 0x6F, 0x00, 0x48,
  1049.          0x5A, 0x81, 0x70, 0x48, 0x00, 0x00, 0x4A, 0x00,
  1050.          0x00, 0x48, 0x52, 0x00, 0x4A, 0x52, 0x81, 0x70,
  1051.          0x4A, 0x00, 0x00, 0x48, 0x00, 0x00, 0x48, 0x53,
  1052.          0x00, 0x4A, 0x53, 0x81, 0x70, 0x4A, 0x00, 0x00,
  1053.          0x48, 0x00, 0x00, 0x43, 0x00, 0x00, 0x48, 0x53,
  1054.          0x00, 0x4A, 0x67, 0x00, 0x43, 0x7C, 0x81, 0x70,
  1055.          0x4A, 0x00, 0x00, 0x48, 0x00, 0x00, 0x4A, 0x67,
  1056.          0x00, 0x48, 0x5A, 0x81, 0x70, 0x48, 0x00, 0x00,
  1057.          0x4A, 0x00, 0x00, 0x43, 0x00, 0x00, 0x4C, 0x6F,
  1058.          0x00, 0x4A, 0x6F, 0x00, 0x45, 0x7D, 0x81, 0x70,
  1059.          0x4A, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x4C, 0x51,
  1060.          0x00, 0x4A, 0x50, 0x81, 0x70, 0x4A, 0x00, 0x00,
  1061.          0x4C, 0x00, 0x00, 0x45, 0x00, 0x00, 0x4C, 0x53,
  1062.          0x00, 0x4A, 0x51, 0x00, 0x45, 0x7D, 0x81, 0x70,
  1063.          0x4A, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x4C, 0x67,
  1064.          0x00, 0x4A, 0x5A, 0x81, 0x70, 0x4A, 0x00, 0x00,
  1065.          0x4C, 0x00, 0x00, 0x4C, 0x53, 0x00, 0x4A, 0x51,
  1066.          0x81, 0x70, 0x4A, 0x00, 0x00, 0x4C, 0x00, 0x00,
  1067.          0x4A, 0x48, 0x00, 0x4C, 0x51, 0x81, 0x70, 0x4C,
  1068.          0x00, 0x00, 0x4A, 0x00, 0x00, 0x45, 0x00, 0x00,
  1069.          0x4C, 0x6F, 0x00, 0x4A, 0x67, 0x00, 0x45, 0x6F,
  1070.          0x81, 0x70, 0x4A, 0x00, 0x00, 0x4C, 0x00, 0x00,
  1071.          0x4C, 0x53, 0x00, 0x4A, 0x53, 0x81, 0x70, 0x4A,
  1072.          0x00, 0x00, 0x4C, 0x00, 0x00, 0x45, 0x00, 0x00,
  1073.          0x4A, 0x67, 0x00, 0x48, 0x67, 0x00, 0x43, 0x7D,
  1074.          0x81, 0x70, 0x48, 0x00, 0x00, 0x4A, 0x00, 0x00,
  1075.          0x4A, 0x53, 0x00, 0x48, 0x51, 0x81, 0x70, 0x48,
  1076.          0x00, 0x00, 0x4A, 0x00, 0x00, 0x43, 0x00, 0x00,
  1077.          0x4A, 0x52, 0x00, 0x48, 0x51, 0x00, 0x43, 0x7C,
  1078.          0x81, 0x70, 0x48, 0x00, 0x00, 0x4A, 0x00, 0x00,
  1079.          0x4A, 0x67, 0x00, 0x48, 0x5A, 0x81, 0x70, 0x48,
  1080.          0x00, 0x00, 0x4A, 0x00, 0x00, 0x48, 0x49, 0x00,
  1081.          0x4A, 0x50, 0x81, 0x70, 0x4A, 0x00, 0x00, 0x48,
  1082.          0x00, 0x00, 0x4A, 0x52, 0x00, 0x48, 0x49, 0x81,
  1083.          0x70, 0x48, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x43,
  1084.          0x00, 0x00, 0x4A, 0x6F, 0x00, 0x48, 0x67, 0x00,
  1085.          0x43, 0x7C, 0x81, 0x70, 0x48, 0x00, 0x00, 0x4A,
  1086.          0x00, 0x00, 0x4A, 0x41, 0x00, 0x48, 0x41, 0x81,
  1087.          0x70, 0x48, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x43,
  1088.          0x00, 0x00, 0x4C, 0x6F, 0x00, 0x4A, 0x67, 0x00,
  1089.          0x45, 0x7D, 0x81, 0x70, 0x4A, 0x00, 0x00, 0x4C,
  1090.          0x00, 0x00, 0x4C, 0x50, 0x00, 0x4A, 0x49, 0x81,
  1091.          0x70, 0x4A, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x45,
  1092.          0x00, 0x00, 0x4C, 0x53, 0x00, 0x4A, 0x52, 0x00,
  1093.          0x45, 0x7D, 0x81, 0x70, 0x4A, 0x00, 0x00, 0x4C,
  1094.          0x00, 0x00, 0x4C, 0x67, 0x00, 0x4A, 0x5A, 0x81,
  1095.          0x70, 0x4A, 0x00, 0x00, 0x4C, 0x00, 0x00, 0x4C,
  1096.          0x5A, 0x00, 0x4A, 0x51, 0x81, 0x70, 0x4A, 0x00,
  1097.          0x00, 0x4C, 0x00, 0x00, 0x4C, 0x53, 0x00, 0x4A,
  1098.          0x52, 0x81, 0x70, 0x4A, 0x00, 0x00, 0x4C, 0x00,
  1099.          0x00, 0x45, 0x00, 0x00, 0x4C, 0x6F, 0x00, 0x4A,
  1100.          0x67, 0x00, 0x45, 0x7D, 0x81, 0x70, 0x4A, 0x00,
  1101.          0x00, 0x4C, 0x00, 0x00, 0x4A, 0x67, 0x00, 0x4C,
  1102.          0x6F, 0x81, 0x70, 0x4C, 0x00, 0x00, 0x4A, 0x00,
  1103.          0x00, 0x45, 0x00, 0x00, 0x4B, 0x7C, 0x00, 0x4D,
  1104.          0x67, 0x00, 0x46, 0x7F, 0x81, 0x70, 0x4D, 0x00,
  1105.          0x00, 0x4B, 0x00, 0x00, 0x4D, 0x50, 0x00, 0x4B,
  1106.          0x67, 0x81, 0x70, 0x4B, 0x00, 0x00, 0x4D, 0x00,
  1107.          0x00, 0x46, 0x00, 0x00, 0x4D, 0x5A, 0x00, 0x4B,
  1108.          0x7C, 0x00, 0x46, 0x7F, 0x81, 0x70, 0x4B, 0x00,
  1109.          0x00, 0x4D, 0x00, 0x00, 0x4D, 0x53, 0x00, 0x4B,
  1110.          0x6F, 0x81, 0x70, 0x4B, 0x00, 0x00, 0x4D, 0x00,
  1111.          0x00, 0x4D, 0x53, 0x00, 0x4B, 0x6F, 0x81, 0x70,
  1112.          0x4B, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x4B, 0x67,
  1113.          0x00, 0x4D, 0x51, 0x81, 0x70, 0x4D, 0x00, 0x00,
  1114.          0x4B, 0x00, 0x00, 0x46, 0x00, 0x00, 0x4D, 0x5A,
  1115.          0x00, 0x4B, 0x7C, 0x00, 0x46, 0x7D, 0x81, 0x70,
  1116.          0x4B, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x4D, 0x5A,
  1117.          0x00, 0x4B, 0x7C, 0x81, 0x70, 0x4B, 0x00, 0x00,
  1118.          0x4D, 0x00, 0x00, 0x46, 0x00, 0x00, 0x4F, 0x6F,
  1119.          0x00, 0x4D, 0x67, 0x00, 0x48, 0x6F, 0x81, 0x70,
  1120.          0x4D, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x4F, 0x51,
  1121.          0x00, 0x4D, 0x53, 0x81, 0x70, 0x4D, 0x00, 0x00,
  1122.          0x4F, 0x00, 0x00, 0x48, 0x00, 0x00, 0x4F, 0x67,
  1123.          0x00, 0x4D, 0x67, 0x00, 0x48, 0x7D, 0x81, 0x70,
  1124.          0x4D, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x4F, 0x5A,
  1125.          0x00, 0x4D, 0x67, 0x81, 0x70, 0x4D, 0x00, 0x00,
  1126.          0x4F, 0x00, 0x00, 0x4F, 0x53, 0x00, 0x4D, 0x52,
  1127.          0x81, 0x70, 0x4D, 0x00, 0x00, 0x4F, 0x00, 0x00,
  1128.          0x4F, 0x53, 0x00, 0x4D, 0x53, 0x81, 0x70, 0x4D,
  1129.          0x00, 0x00, 0x4F, 0x00, 0x00, 0x48, 0x00, 0x00,
  1130.          0x4F, 0x5A, 0x00, 0x4D, 0x5A, 0x00, 0x48, 0x6F,
  1131.          0x81, 0x70, 0x4D, 0x00, 0x00, 0x4F, 0x00, 0x00,
  1132.          0x4F, 0x53, 0x00, 0x4D, 0x5A, 0x81, 0x70, 0x4D,
  1133.          0x00, 0x00, 0x4F, 0x00, 0x00, 0x48, 0x00, 0x00,
  1134.          0x4D, 0x52, 0x00, 0x4B, 0x5A, 0x00, 0x46, 0x7F,
  1135.          0x81, 0x70, 0x4B, 0x00, 0x00, 0x4D, 0x00, 0x00,
  1136.          0x4D, 0x52, 0x00, 0x4B, 0x67, 0x81, 0x70, 0x4B,
  1137.          0x00, 0x00, 0x4D, 0x00, 0x00, 0x46, 0x00, 0x00,
  1138.          0x4D, 0x52, 0x00, 0x4B, 0x67, 0x00, 0x46, 0x7F,
  1139.          0x81, 0x70, 0x4B, 0x00, 0x00, 0x4D, 0x00, 0x00,
  1140.          0x4D, 0x53, 0x00, 0x4B, 0x67, 0x81, 0x70, 0x4B,
  1141.          0x00, 0x00, 0x4D, 0x00, 0x00, 0x4D, 0x51, 0x00,
  1142.          0x4B, 0x6F, 0x81, 0x70, 0x4B, 0x00, 0x00, 0x4D,
  1143.          0x00, 0x00, 0x4D, 0x50, 0x00, 0x4B, 0x67, 0x81,
  1144.          0x70, 0x4B, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x46,
  1145.          0x00, 0x00, 0x4D, 0x53, 0x00, 0x4B, 0x6F, 0x00,
  1146.          0x46, 0x7F, 0x81, 0x70, 0x4B, 0x00, 0x00, 0x4D,
  1147.          0x00, 0x00, 0x4D, 0x51, 0x00, 0x4B, 0x53, 0x81,
  1148.          0x70, 0x4B, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x46,
  1149.          0x00, 0x00, 0x4F, 0x5A, 0x00, 0x4D, 0x5A, 0x00,
  1150.          0x48, 0x7C, 0x81, 0x70, 0x4D, 0x00, 0x00, 0x4F,
  1151.          0x00, 0x00, 0x4F, 0x52, 0x00, 0x4D, 0x52, 0x81,
  1152.          0x70, 0x4D, 0x00, 0x00, 0x4F, 0x00, 0x00, 0x48,
  1153.          0x00, 0x00, 0x4F, 0x51, 0x00, 0x4D, 0x51, 0x00,
  1154.          0x48, 0x7D, 0x81, 0x70, 0x4D, 0x00, 0x00, 0x4F,
  1155.          0x00, 0x00, 0x4D, 0x52, 0x00, 0x4F, 0x50, 0x81,
  1156.          0x70, 0x4F, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x4D,
  1157.          0x52, 0x00, 0x4F, 0x50, 0x81, 0x70, 0x4F, 0x00,
  1158.          0x00, 0x4D, 0x00, 0x00, 0x4F, 0x50, 0x00, 0x4D,
  1159.          0x51, 0x81, 0x70, 0x4D, 0x00, 0x00, 0x4F, 0x00,
  1160.          0x00, 0x48, 0x00, 0x00, 0x4F, 0x51, 0x00, 0x4D,
  1161.          0x51, 0x00, 0x48, 0x7C, 0x81, 0x70, 0x4D, 0x00,
  1162.          0x00, 0x4F, 0x00, 0x00, 0x4F, 0x53, 0x00, 0x4D,
  1163.          0x52, 0x81, 0x70, 0x4D, 0x00, 0x00, 0x4F, 0x00,
  1164.          0x00, 0x48, 0x00, 0x00, 0xFF, 0x2F, 0x00,
  1165.      };
  1166.  #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  1167. /******************************************AUDIO************************************/
  1168. /*****************************************************************************
  1169.  * FUNCTION
  1170.  *  mmi_gx_copter_enter_gfx
  1171.  * DESCRIPTION
  1172.  *  Set Game Framework (GFX) Parameter
  1173.  * PARAMETERS
  1174.  *  void
  1175.  * RETURNS
  1176.  *  void
  1177.  *****************************************************************************/
  1178. /* keep this game old naming style */
  1179. void mmi_gx_copter_enter_gfx(void)
  1180. {
  1181.     /*----------------------------------------------------------------*/
  1182.     /* Local Variables                                                */
  1183.     /*----------------------------------------------------------------*/
  1184.     /*----------------------------------------------------------------*/
  1185.     /* Code Body                                                      */
  1186.     /*----------------------------------------------------------------*/
  1187.     /* Game menu */
  1188.     GFX.game_data.game_img_id = IMG_ID_GX_COPTER_GAME_ICON; /* game icon img ID */
  1189. #if defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__)
  1190.     GFX.game_data.game_str_id = STR_ID_GX_COPTER_GAME_NAME; /* game name string ID */
  1191. #elif defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__)
  1192.     GFX.game_data.game_str_id = STR_ID_GX_COPTER_GAME_NAME_SUBMARINE;   /* game name string ID */
  1193. #elif defined(__MMI_GAME_JET_128x128__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1194.     GFX.game_data.game_str_id = STR_ID_GX_COPTER_GAME_NAME_JET; /* game name string ID */
  1195. #endif 
  1196.     GFX.game_data.menu_resume_str_id = STR_GAME_RESUME;     /* "Resume" string ID */
  1197.     GFX.game_data.menu_new_str_id = STR_GAME_NEW;           /* "New Game" string ID */
  1198.     GFX.game_data.menu_level_str_id = 0;                    /* "Game Level" string ID */
  1199.     GFX.game_data.menu_grade_str_id = STR_GAME_GRADE;       /* "Best Grade" string ID */
  1200.     GFX.game_data.menu_help_str_id = STR_GAME_HELP;         /* "Game Help" string ID */
  1201.     /* level / grade */
  1202.     GFX.game_data.level_count = 1;                          /* how many levels */
  1203.     GFX.game_data.level_str_id_list[0] = STR_GAME_SCORE;    /* level string ID */
  1204.     /* add slot in NVRAMEnum.h */
  1205.     GFX.game_data.grade_nvram_id_list[0] = NVRAM_GX_COPTER_SCORE;       /* grade slot in NVRAM (short) */
  1206.     /* help */
  1207. #if defined(__MMI_TOUCH_SCREEN__)
  1208. #if defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__)
  1209.     GFX.game_data.help_str_id = STR_ID_GX_COPTER_HELP_DESCRIPTION_TP;   /* help desciption string id */
  1210. #elif defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__)
  1211.     GFX.game_data.help_str_id = STR_ID_GX_COPTER_HELP_DESCRIPTION_SUBMARINE_TP; /* help desciption string id */
  1212. #elif defined(__MMI_GAME_JET_128x128__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1213.     GFX.game_data.help_str_id = STR_ID_GX_COPTER_HELP_DESCRIPTION_JET_TP;       /* help desciption string id */
  1214. #endif 
  1215. #else /* defined(__MMI_TOUCH_SCREEN__) */ 
  1216. #if defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__)
  1217.     GFX.game_data.help_str_id = STR_ID_GX_COPTER_HELP_DESCRIPTION;      /* help desciption string id */
  1218. #elif defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__)
  1219.     GFX.game_data.help_str_id = STR_ID_GX_COPTER_HELP_DESCRIPTION_SUBMARINE;    /* help desciption string id */
  1220. #elif defined(__MMI_GAME_JET_128x128__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1221.     GFX.game_data.help_str_id = STR_ID_GX_COPTER_HELP_DESCRIPTION_JET;  /* help desciption string id */
  1222. #endif 
  1223. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  1224.     /* misc */
  1225.     GFX.game_data.grade_value_ptr = (S16*) (&g_gx_copter_context.game_grade);  /* current level's grade (S16*) */
  1226.     GFX.game_data.level_index_ptr = (U8*) (&g_gx_copter_context.game_level);   /* ptr to current level index (U8*) */
  1227.     GFX.game_data.is_new_game = (BOOL*) (&g_gx_copter_context.is_new_game);    /* ptr to new game flag (BOOL*) */
  1228.     /* function ptr */
  1229.     GFX.game_data.best_grade_func_ptr = mmi_gx_copter_calc_best_grade;  /* function to calculate best grade */
  1230.     GFX.game_data.enter_game_func_ptr = mmi_gx_copter_enter_game;       /* function to enter new game */
  1231.     GFX.game_data.exit_game_func_ptr = mmi_gx_copter_exit_game; /* function to exit game */
  1232.     GFX.game_data.draw_gameover_func_ptr = mmi_gx_copter_draw_gameover; /* function to draw gameover screen */
  1233.     /* some flags */
  1234.     GFX.game_data.is_keypad_audio_enable = FALSE;   /* play keypad tone or not */
  1235.     mmi_gfx_entry_menu_screen();
  1236. }
  1237. /*****************************************************************************
  1238.  * FUNCTION
  1239.  *  mmi_gx_copter_calc_best_grade
  1240.  * DESCRIPTION
  1241.  *  Calculate new best grade [Callback required by GFX]
  1242.  * PARAMETERS
  1243.  *  old_grade       [IN]        
  1244.  *  new_grade       [IN]        
  1245.  * RETURNS
  1246.  *  S16
  1247.  *****************************************************************************/
  1248. S16 mmi_gx_copter_calc_best_grade(S16 old_grade, S16 new_grade)
  1249. {
  1250.     /*----------------------------------------------------------------*/
  1251.     /* Local Variables                                                */
  1252.     /*----------------------------------------------------------------*/
  1253.     /*----------------------------------------------------------------*/
  1254.     /* Code Body                                                      */
  1255.     /*----------------------------------------------------------------*/
  1256.     /* compare the best grade and return it */
  1257.     if (new_grade > old_grade)
  1258.     {
  1259.         return new_grade;
  1260.     }
  1261.     else
  1262.     {
  1263.         return old_grade;
  1264.     }
  1265. }
  1266. /*****************************************************************************
  1267.  * FUNCTION
  1268.  *  mmi_gx_copter_set_gameover
  1269.  * DESCRIPTION
  1270.  *  Set the gameover state
  1271.  * PARAMETERS
  1272.  *  void
  1273.  * RETURNS
  1274.  *  void
  1275.  *****************************************************************************/
  1276. void mmi_gx_copter_set_gameover(void)
  1277. {
  1278.     /*----------------------------------------------------------------*/
  1279.     /* Local Variables                                                */
  1280.     /*----------------------------------------------------------------*/
  1281.     /*----------------------------------------------------------------*/
  1282.     /* Code Body                                                      */
  1283.     /*----------------------------------------------------------------*/
  1284.     if (g_gx_copter_context.is_gameover == TRUE)
  1285.     {
  1286.         return;
  1287.     }
  1288.     g_gx_copter_context.is_gameover = TRUE;
  1289.     GFX_PLAY_VIBRATION();
  1290. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  1291.     GFX_STOP_MULTICHANNEL_WAV(g_gx_copter_context.down_wav);
  1292.     GFX_STOP_MULTICHANNEL_WAV(g_gx_copter_context.flying_wav);
  1293.     GFX_PLAY_SOUND_EFFECTS_MIDI(g_gx_copter_context.crash_midi);
  1294. #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ /* /__MMI_GAME_MULTICHANNEL_SOUND__ */
  1295.     GFX_PLAY_AUDIO_MIDI(CopterCrash_midi, COPTERCRASH_MIDI, DEVICE_AUDIO_PLAY_ONCE);
  1296. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ /* /__MMI_GAME_MULTICHANNEL_SOUND__ */
  1297.     g_gx_copter_context.game_grade = g_gx_copter_context.tick / 5;
  1298.     g_gx_copter_context.tick = 0;
  1299. }
  1300. /*****************************************************************************
  1301.  * FUNCTION
  1302.  *  mmi_gx_copter_draw_gameover
  1303.  * DESCRIPTION
  1304.  *  Draw Gameover Screen [Callback required by GFX]
  1305.  * PARAMETERS
  1306.  *  void
  1307.  * RETURNS
  1308.  *  void
  1309.  *****************************************************************************/
  1310. void mmi_gx_copter_draw_gameover(void)
  1311. {
  1312.     /*----------------------------------------------------------------*/
  1313.     /* Local Variables                                                */
  1314.     /*----------------------------------------------------------------*/
  1315.     /*----------------------------------------------------------------*/
  1316.     /* Code Body                                                      */
  1317.     /*----------------------------------------------------------------*/
  1318.     GFX_PLAY_AUDIO_GAMEOVER();
  1319.     /* call this function to draw standard gameover screen */
  1320.     mmi_gfx_draw_gameover_screen(
  1321.         IMG_ID_GX_COPTER_GOTEXT,
  1322.         IMG_ID_GX_COPTER_GRADESMAP,
  1323.         IMG_ID_GX_COPTER_GOPIC,
  1324.         g_gx_copter_context.game_grade);
  1325. }
  1326. /*****************************************************************************
  1327.  * FUNCTION
  1328.  *  mmi_gx_copter_enter_game
  1329.  * DESCRIPTION
  1330.  *  Enter Game [Callback required by GFX]
  1331.  * PARAMETERS
  1332.  *  void
  1333.  * RETURNS
  1334.  *  void
  1335.  *****************************************************************************/
  1336. void mmi_gx_copter_enter_game(void)
  1337. {
  1338.     /*----------------------------------------------------------------*/
  1339.     /* Local Variables                                                */
  1340.     /*----------------------------------------------------------------*/
  1341.     /*----------------------------------------------------------------*/
  1342.     /* Code Body                                                      */
  1343.     /*----------------------------------------------------------------*/
  1344.     if (g_gx_copter_context.is_new_game == TRUE)
  1345.     {
  1346.         mmi_gx_copter_init_game();  /* is new game, otherwise resume game */
  1347.     }
  1348. #if defined(GDI_USING_LAYER)
  1349.     gdi_layer_multi_layer_enable();
  1350.     gdi_layer_get_base_handle(&g_gx_copter_context.background);
  1351.     gdi_layer_create(0, 0, MMI_GX_COPTER_LCD_WIDTH, MMI_GX_COPTER_LCD_HEIGHT, &g_gx_copter_context.foreground);
  1352.     gdi_layer_set_active(g_gx_copter_context.foreground);
  1353.     gdi_layer_set_source_key(TRUE, MMI_GX_COPTER_TRANSPARENT_COLOR);
  1354.     gdi_layer_clear_background(MMI_GX_COPTER_TRANSPARENT_COLOR);
  1355.     gdi_layer_set_active(g_gx_copter_context.background);
  1356. #endif /* defined(GDI_USING_LAYER) */ 
  1357.     /* clear key state */
  1358.     g_gx_copter_context.key_pressed = FALSE;
  1359.     if (g_gx_copter_context.is_gameover != TRUE)
  1360.     {
  1361.         g_gx_copter_context.is_new_game = FALSE;
  1362.         g_gx_copter_context.is_gameover = FALSE;
  1363.         SetKeyHandler(mmi_gx_copter_key_pressed, KEY_5, KEY_EVENT_DOWN);
  1364.         SetKeyHandler(mmi_gx_copter_key_released, KEY_5, KEY_EVENT_UP);
  1365.     }
  1366.     gdi_layer_lock_frame_buffer();
  1367.     mmi_gx_copter_draw_static_background();
  1368.     /* render first frame */
  1369.     mmi_gx_copter_render();
  1370.     gdi_layer_unlock_frame_buffer();
  1371. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  1372.     GFX_OPEN_BACKGROUND_SOUND(Copter_background_midi, COPTERBACKGROUND_MIDI, g_gx_copter_context.background_midi);
  1373.     GFX_PLAY_BACKGROUND_SOUND(g_gx_copter_context.background_midi);
  1374.     GFX_OPEN_DUMMY_BACKGROUND_SOUND();
  1375.     GFX_PLAY_DUMMY_BACKGROUND_SOUND();
  1376.     GFX_OPEN_SOUND_EFFECTS_MIDI(CopterCrash_midi, COPTERCRASH_MIDI, 1, g_gx_copter_context.crash_midi);
  1377.     GFX_OPEN_MULTICHANNEL_WAV(CopterDown_wav, COPTERDOWN_WAV, 0, g_gx_copter_context.down_wav);
  1378.     GFX_OPEN_MULTICHANNEL_WAV(CopterFlying_wav, COPTERFLYING_WAV, 0, g_gx_copter_context.flying_wav);
  1379.     GFX_STOP_MULTICHANNEL_WAV(g_gx_copter_context.down_wav);
  1380.     GFX_STOP_MULTICHANNEL_WAV(g_gx_copter_context.flying_wav);
  1381.     if (g_gx_copter_context.is_gameover != TRUE)
  1382.     {
  1383.         GFX_PLAY_MULTICHANNEL_WAV(g_gx_copter_context.down_wav);
  1384.     }
  1385. #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ /* /__MMI_GAME_MULTICHANNEL_SOUND__ */
  1386.     if (g_gx_copter_context.is_gameover != TRUE)
  1387.     {
  1388.         GFX_PLAY_AUDIO_DVI(CopterDown_dvi, COPTERDOWN_DVI, DEVICE_AUDIO_PLAY_INFINITE);
  1389.     }
  1390. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  1391.     //  /* set bgm resume handle */
  1392.     //      SetProtocolEventHandler(mmi_gx_copter_resume_bgm, PRT_EQ_PLAY_AUDIO_FINISH_IND);
  1393.     /* start game loop */
  1394.     mmi_gx_copter_cyclic_timer();
  1395. #ifdef __MMI_TOUCH_SCREEN__
  1396.     wgui_register_pen_down_handler(mmi_copter_pen_down_hdlr);
  1397.     wgui_register_pen_up_handler(mmi_copter_pen_up_hdlr);
  1398.     wgui_register_pen_repeat_handler(mmi_copter_pen_repeat_hdlr);
  1399. #endif /* __MMI_TOUCH_SCREEN__ */ 
  1400. }
  1401. #if defined(GDI_USING_LAYER)
  1402. /*****************************************************************************
  1403.  * FUNCTION
  1404.  *  mmi_gx_copter_init_background_list
  1405.  * DESCRIPTION
  1406.  *  init the background list
  1407.  * PARAMETERS
  1408.  *  void
  1409.  * RETURNS
  1410.  *  void
  1411.  *****************************************************************************/
  1412. void mmi_gx_copter_init_background_list(void)
  1413. {
  1414.     /*----------------------------------------------------------------*/
  1415.     /* Local Variables                                                */
  1416.     /*----------------------------------------------------------------*/
  1417.     U8 i;
  1418.     /*----------------------------------------------------------------*/
  1419.     /* Code Body                                                      */
  1420.     /*----------------------------------------------------------------*/
  1421.     g_gx_copter_context.bg_image_list[0].image_id = (MMI_ID_TYPE) IMG_ID_GX_COPTER_BACKGROUND;
  1422.     g_gx_copter_context.first_bg_image = &g_gx_copter_context.bg_image_list[0];
  1423.     for (i = 0; i < MMI_GX_COPTER_BG_LIST_NUMBER - 1; i++)
  1424.     {
  1425.         g_gx_copter_context.bg_image_list[i].next = &g_gx_copter_context.bg_image_list[i + 1];
  1426.         g_gx_copter_context.bg_image_list[i + 1].image_id = (MMI_ID_TYPE) IMG_ID_GX_COPTER_BACKGROUND;
  1427.     }
  1428.     g_gx_copter_context.last_bg_image = &g_gx_copter_context.bg_image_list[MMI_GX_COPTER_BG_LIST_NUMBER - 1];
  1429. }
  1430. /*****************************************************************************
  1431.  * FUNCTION
  1432.  *  mmi_gx_copter_draw_background
  1433.  * DESCRIPTION
  1434.  *  draw the moving background
  1435.  * PARAMETERS
  1436.  *  void
  1437.  * RETURNS
  1438.  *  void
  1439.  *****************************************************************************/
  1440. void mmi_gx_copter_draw_background(void)
  1441. {
  1442.     /*----------------------------------------------------------------*/
  1443.     /* Local Variables                                                */
  1444.     /*----------------------------------------------------------------*/
  1445.     U8 i;
  1446.     S16 position_x;
  1447.     S32 image_width;
  1448.     S32 image_height;
  1449.     gx_copter_bg_node_struct *current_node;
  1450.     /*----------------------------------------------------------------*/
  1451.     /* Code Body                                                      */
  1452.     /*----------------------------------------------------------------*/
  1453.     /* get the width of background image */
  1454.     gui_measure_image(get_image(IMG_ID_GX_COPTER_BACKGROUND), &image_width, &image_height);
  1455.     /* if the tile can not be seen at all */
  1456.     if (g_gx_copter_context.first_bg_position_x < -image_width)
  1457.     {
  1458.         g_gx_copter_context.last_bg_image->next = g_gx_copter_context.first_bg_image;
  1459.         g_gx_copter_context.last_bg_image = g_gx_copter_context.first_bg_image;
  1460.         g_gx_copter_context.first_bg_image = g_gx_copter_context.first_bg_image->next;
  1461.         g_gx_copter_context.first_bg_position_x = g_gx_copter_context.first_bg_position_x + image_width;
  1462.     }
  1463.     gdi_layer_set_active(g_gx_copter_context.background);
  1464.     gdi_layer_push_clip();
  1465.     gdi_layer_set_clip(
  1466.         0,
  1467.         MMI_GX_COPTER_GAME_ORIGIN,
  1468.         MMI_GX_COPTER_LCD_WIDTH - 1,
  1469.         MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT);
  1470.     position_x = g_gx_copter_context.first_bg_position_x;
  1471.     current_node = g_gx_copter_context.first_bg_image;
  1472.     for (i = 0; i < MMI_GX_COPTER_BG_LIST_NUMBER; i++)
  1473.     {
  1474.         gdi_image_draw_id(position_x, MMI_GX_COPTER_GAME_ORIGIN, (U16) current_node->image_id);
  1475.         current_node = current_node->next;
  1476.         position_x = position_x + image_width;
  1477.     }
  1478.     gdi_layer_pop_clip();
  1479. }
  1480. #endif /* defined(GDI_USING_LAYER) */ 
  1481. /*****************************************************************************
  1482.  * FUNCTION
  1483.  *  mmi_gx_copter_exit_game
  1484.  * DESCRIPTION
  1485.  *  Exit Game [Callback required by GFX]
  1486.  * PARAMETERS
  1487.  *  void
  1488.  * RETURNS
  1489.  *  void
  1490.  *****************************************************************************/
  1491. void mmi_gx_copter_exit_game(void)
  1492. {
  1493.     /*----------------------------------------------------------------*/
  1494.     /* Local Variables                                                */
  1495.     /*----------------------------------------------------------------*/
  1496.     /*----------------------------------------------------------------*/
  1497.     /* Code Body                                                      */
  1498.     /*----------------------------------------------------------------*/
  1499.     gui_cancel_timer(mmi_gx_copter_cyclic_timer);   /* cancle the looping timer */
  1500. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  1501.     GFX_STOP_MULTICHANNEL_WAV(g_gx_copter_context.flying_wav);
  1502.     GFX_CLOSE_MULTICHANNEL_WAV(g_gx_copter_context.flying_wav);
  1503.     GFX_STOP_MULTICHANNEL_WAV(g_gx_copter_context.down_wav);
  1504.     GFX_CLOSE_MULTICHANNEL_WAV(g_gx_copter_context.down_wav);
  1505.     GFX_STOP_SOUND_EFFECTS_MIDI(g_gx_copter_context.crash_midi);
  1506.     GFX_CLOSE_SOUND_EFFECTS_MIDI(g_gx_copter_context.crash_midi);
  1507.     GFX_STOP_DUMMY_BACKGROUND_SOUND();
  1508.     GFX_CLOSE_DUMMY_BACKGROUND_SOUND();
  1509.     GFX_STOP_BACKGROUND_SOUND(g_gx_copter_context.background_midi);
  1510.     GFX_CLOSE_BACKGROUND_SOUND(g_gx_copter_context.background_midi);
  1511. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ /* /__MMI_GAME_MULTICHANNEL_SOUND__ */
  1512. #if defined(GDI_USING_LAYER)
  1513.     gdi_layer_free(g_gx_copter_context.foreground);
  1514.     gdi_layer_multi_layer_disable();
  1515. #endif /* defined(GDI_USING_LAYER) */ 
  1516. }
  1517. /*****************************************************************************
  1518.  * FUNCTION
  1519.  *  mmi_gx_copter_init_game
  1520.  * DESCRIPTION
  1521.  *  Game initilization
  1522.  * PARAMETERS
  1523.  *  void
  1524.  * RETURNS
  1525.  *  void
  1526.  *****************************************************************************/
  1527. void mmi_gx_copter_init_game(void)
  1528. {
  1529.     /*----------------------------------------------------------------*/
  1530.     /* Local Variables                                                */
  1531.     /*----------------------------------------------------------------*/
  1532.     /*----------------------------------------------------------------*/
  1533.     /* Code Body                                                      */
  1534.     /*----------------------------------------------------------------*/
  1535.     /* init game */
  1536.     mmi_gx_copter_init_obstacle_list();
  1537.     g_gx_copter_context.local_step = 1;
  1538.     g_gx_copter_context.tick = 0;
  1539.     g_gx_copter_context.last_sound_playing_tick = 0;
  1540.     g_gx_copter_context.key_pressed = FALSE;
  1541.     g_gx_copter_context.is_gameover = FALSE;
  1542.     g_gx_copter_context.slope = 0;
  1543.     g_gx_copter_context.obstacle_period = 0;
  1544.     g_gx_copter_context.max_period = 0;
  1545. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_JET_128x160__)
  1546.     g_gx_copter_context.copter_position_y = 70;
  1547.     g_gx_copter_context.space = 120;
  1548. #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  1549.     g_gx_copter_context.copter_position_y = 70;
  1550.     g_gx_copter_context.space = 116;
  1551. #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  1552.     g_gx_copter_context.copter_position_y = 110;
  1553.     g_gx_copter_context.space = 162;
  1554. #endif 
  1555. #if defined(GDI_USING_LAYER)
  1556.     mmi_gx_copter_init_background_list();
  1557.     g_gx_copter_context.first_bg_position_x = 0;
  1558. #endif /* defined(GDI_USING_LAYER) */ 
  1559. }
  1560. /*****************************************************************************
  1561.  * FUNCTION
  1562.  *  mmi_gx_copter_init_obstacle_list
  1563.  * DESCRIPTION
  1564.  *  Initialize the obstacles
  1565.  * PARAMETERS
  1566.  *  void
  1567.  * RETURNS
  1568.  *  void
  1569.  *****************************************************************************/
  1570. void mmi_gx_copter_init_obstacle_list(void)
  1571. {
  1572.     /*----------------------------------------------------------------*/
  1573.     /* Local Variables                                                */
  1574.     /*----------------------------------------------------------------*/
  1575.     U8 i;
  1576.     /*----------------------------------------------------------------*/
  1577.     /* Code Body                                                      */
  1578.     /*----------------------------------------------------------------*/
  1579.     g_gx_copter_context.obstacle[0].position_x = 0;
  1580. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1581.     g_gx_copter_context.obstacle[0].position_y = 0 + MMI_GX_COPTER_GAME_ORIGIN / 2;
  1582. #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  1583.     g_gx_copter_context.obstacle[0].position_y = 1;
  1584. #endif 
  1585.     g_gx_copter_context.obstacle[0].old_position_x = g_gx_copter_context.obstacle[0].position_x;
  1586.     g_gx_copter_context.obstacle[0].old_position_y = g_gx_copter_context.obstacle[0].position_y;
  1587.     /* Use single linking list structure for obstacles */
  1588.     for (i = 1; i < MMI_GX_COPTER_OBSTACLE_COUNT; i++)
  1589.     {
  1590.         g_gx_copter_context.obstacle[i].position_x =
  1591.             g_gx_copter_context.obstacle[i - 1].position_x + MMI_GX_COPTER_OBSTACLE_WIDTH;
  1592.     #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1593.         g_gx_copter_context.obstacle[i].position_y = 0 + MMI_GX_COPTER_GAME_ORIGIN / 2;
  1594.     #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  1595.         g_gx_copter_context.obstacle[i].position_y = g_gx_copter_context.obstacle[0].position_y;
  1596.     #endif 
  1597.         g_gx_copter_context.obstacle[i - 1].next = &(g_gx_copter_context.obstacle[i]);
  1598.         g_gx_copter_context.obstacle[i].old_position_x = g_gx_copter_context.obstacle[i].position_x;
  1599.         g_gx_copter_context.obstacle[i].old_position_y = g_gx_copter_context.obstacle[i].position_y;
  1600.     }
  1601.     g_gx_copter_context.first_obstacle = &(g_gx_copter_context.obstacle[0]);
  1602.     g_gx_copter_context.last_obstacle = &(g_gx_copter_context.obstacle[MMI_GX_COPTER_OBSTACLE_COUNT - 1]);
  1603.     g_gx_copter_context.single_obstacle.position_x = (S16) MMI_GX_COPTER_LCD_WIDTH;
  1604.     g_gx_copter_context.single_obstacle.position_y =
  1605.         (2 * MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT) / 2 - MMI_GX_COPTER_OBSTACLE_HEIGHT / 2;
  1606.     g_gx_copter_context.single_obstacle.old_position_x = g_gx_copter_context.single_obstacle.position_x;
  1607.     g_gx_copter_context.single_obstacle.old_position_y = g_gx_copter_context.single_obstacle.position_y;
  1608. }
  1609. /*****************************************************************************
  1610.  * FUNCTION
  1611.  *  mmi_gx_copter_draw_static_background
  1612.  * DESCRIPTION
  1613.  *  Draw the elements that only need to be drawn once
  1614.  * PARAMETERS
  1615.  *  void
  1616.  * RETURNS
  1617.  *  void
  1618.  *****************************************************************************/
  1619. void mmi_gx_copter_draw_static_background(void)
  1620. {
  1621.     /*----------------------------------------------------------------*/
  1622.     /* Local Variables                                                */
  1623.     /*----------------------------------------------------------------*/
  1624.     gx_copter_obstacle_node_struct *tmp_node;
  1625.     /*----------------------------------------------------------------*/
  1626.     /* Code Body                                                      */
  1627.     /*----------------------------------------------------------------*/
  1628. #if !defined(GDI_USING_LAYER)
  1629.     gui_fill_rectangle(0, 0, MMI_GX_COPTER_LCD_WIDTH - 1, MMI_GX_COPTER_LCD_HEIGHT - 1, MMI_GX_COPTER_BACK_COLOR);
  1630. #endif 
  1631.     gui_fill_rectangle(0, 0, MMI_GX_COPTER_LCD_WIDTH - 1, MMI_GX_COPTER_GAME_ORIGIN, MMI_GX_COPTER_BORDER_COLOR);
  1632. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1633.     gui_fill_rectangle(
  1634.         0,
  1635.         MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT + 1,
  1636.         MMI_GX_COPTER_LCD_WIDTH - 1,
  1637.         MMI_GX_COPTER_LCD_HEIGHT - 1,
  1638.         MMI_GX_COPTER_BORDER_COLOR);
  1639. #endif /* defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__) */ 
  1640. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1641.     /* top four lines here */
  1642.     gui_draw_horizontal_line(2, MMI_GX_COPTER_LCD_WIDTH - 1 - 2, 1, MMI_GX_COPTER_LIGHT_BORDER);
  1643.     gui_draw_horizontal_line(
  1644.         2,
  1645.         MMI_GX_COPTER_LCD_WIDTH - 1 - 2,
  1646.         MMI_GX_COPTER_GAME_ORIGIN - 2,
  1647.         MMI_GX_COPTER_DARK_BORDER);
  1648.     gui_draw_vertical_line(2, MMI_GX_COPTER_GAME_ORIGIN - 3, 1, MMI_GX_COPTER_LIGHT_BORDER);
  1649.     gui_draw_vertical_line(
  1650.         2,
  1651.         MMI_GX_COPTER_GAME_ORIGIN - 3,
  1652.         MMI_GX_COPTER_LCD_WIDTH - 1 - 1,
  1653.         MMI_GX_COPTER_DARK_BORDER);
  1654.     /* bottom four lines here */
  1655.     gui_draw_horizontal_line(
  1656.         2,
  1657.         MMI_GX_COPTER_LCD_WIDTH - 1 - 2,
  1658.         MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT + 1,
  1659.         MMI_GX_COPTER_LIGHT_BORDER);
  1660.     gui_draw_horizontal_line(
  1661.         2,
  1662.         MMI_GX_COPTER_LCD_WIDTH - 1 - 2,
  1663.         MMI_GX_COPTER_LCD_HEIGHT - 1 - 1,
  1664.         MMI_GX_COPTER_DARK_BORDER);
  1665.     gui_draw_vertical_line(
  1666.         MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT + 2,
  1667.         MMI_GX_COPTER_LCD_HEIGHT - 1 - 2,
  1668.         1,
  1669.         MMI_GX_COPTER_LIGHT_BORDER);
  1670.     gui_draw_vertical_line(
  1671.         MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT + 2,
  1672.         MMI_GX_COPTER_LCD_HEIGHT - 1 - 2,
  1673.         MMI_GX_COPTER_LCD_WIDTH - 1 - 1,
  1674.         MMI_GX_COPTER_DARK_BORDER);
  1675. #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  1676.     //      gui_fill_rectangle(     0,
  1677.     //                                                                              MMI_GX_COPTER_LCD_HEIGHT - 1,
  1678.     //                                                                              MMI_GX_COPTER_LCD_WIDTH - 1,
  1679.     //                                                                              MMI_GX_COPTER_LCD_HEIGHT - 1,
  1680.     //                                                                              gui_color(255, 127, 0));
  1681. #endif 
  1682. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1683.     gui_show_image(
  1684.         MMI_GX_COPTER_SCORE_POSITION_X + 2,
  1685.         MMI_GX_COPTER_SCORE_POSITION_Y - 1,
  1686.         (PU8) GetImage(IMG_ID_GX_COPTER_SCORE));
  1687. #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  1688.     gui_show_image(
  1689.         MMI_GX_COPTER_SCORE_POSITION_X + 1,
  1690.         MMI_GX_COPTER_SCORE_POSITION_Y - 2,
  1691.         (PU8) GetImage(IMG_ID_GX_COPTER_SCORE));
  1692. #endif 
  1693. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1694.     gui_show_image(MMI_GX_COPTER_SCORE_POSITION_X,
  1695. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_JET_128x160__)
  1696.                    MMI_GX_COPTER_SCORE_POSITION_Y + 7,
  1697. #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  1698.                    MMI_GX_COPTER_SCORE_POSITION_Y + 10,
  1699. #endif 
  1700.                    (PU8) GetImage(IMG_ID_GX_COPTER_BOX));
  1701.     gui_show_image(MMI_GX_COPTER_TITLE_POSITION_X, 1, (PU8) GetImage(IMG_ID_GX_COPTER_TITLE));
  1702. #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  1703.     gui_show_image(
  1704.         MMI_GX_COPTER_SCORE_POSITION_X + 29,
  1705.         MMI_GX_COPTER_SCORE_POSITION_Y - 4,
  1706.         (PU8) GetImage(IMG_ID_GX_COPTER_BOX));
  1707. #endif 
  1708.     if (g_gx_copter_context.is_gameover != FALSE)
  1709.     {
  1710.         gui_push_clip();
  1711.         /* draw ceiling and floor obstacles */
  1712.         gui_set_clip(
  1713.             0,
  1714.             MMI_GX_COPTER_GAME_ORIGIN,
  1715.             MMI_GX_COPTER_LCD_WIDTH - 1,
  1716.             MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT - 1);
  1717.     #if defined(GDI_USING_LAYER)
  1718.         ERASE_AND_DRAW_OBSTACLES(tmp_node, gdi_draw_solid_rect, MMI_GX_COPTER_TRANSPARENT_COLOR);
  1719.     #else 
  1720.         ERASE_AND_DRAW_OBSTACLES(tmp_node, gui_fill_rectangle, MMI_GX_COPTER_BACK_COLOR);
  1721.     #endif 
  1722.         /* draw single obstacle */
  1723.         gui_fill_rectangle(
  1724.             g_gx_copter_context.single_obstacle.old_position_x,
  1725.             g_gx_copter_context.single_obstacle.old_position_y,
  1726.             g_gx_copter_context.single_obstacle.old_position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1,
  1727.             g_gx_copter_context.single_obstacle.old_position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT - 1,
  1728.             MMI_GX_COPTER_BACK_COLOR);
  1729.         gui_show_image(
  1730.             g_gx_copter_context.single_obstacle.position_x,
  1731.             g_gx_copter_context.single_obstacle.position_y,
  1732.             (PU8) GetImage(IMG_ID_GX_COPTER_OBSTACLE));
  1733.         gui_pop_clip();
  1734.     }
  1735. #if !defined(GDI_USING_LAYER)
  1736.     gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
  1737. #endif 
  1738. #if defined(GDI_USING_LAYER)
  1739.     mmi_gx_copter_draw_background();
  1740. #endif 
  1741. }
  1742. /*****************************************************************************
  1743.  * FUNCTION
  1744.  *  mmi_gx_copter_framemove
  1745.  * DESCRIPTION
  1746.  *  Framemove - process the game logic
  1747.  * PARAMETERS
  1748.  *  void
  1749.  * RETURNS
  1750.  *  void
  1751.  *****************************************************************************/
  1752. void mmi_gx_copter_framemove(void)
  1753. {
  1754.     /*----------------------------------------------------------------*/
  1755.     /* Local Variables                                                */
  1756.     /*----------------------------------------------------------------*/
  1757.     U8 i;
  1758.     gx_copter_obstacle_node_struct *tmp_node;
  1759.     U8 probability;
  1760.     S16 obstacle_shift;
  1761.     /*----------------------------------------------------------------*/
  1762.     /* Code Body                                                      */
  1763.     /*----------------------------------------------------------------*/
  1764. #if defined(GDI_USING_LAYER)
  1765.     /* update the background */
  1766.     g_gx_copter_context.first_bg_position_x = g_gx_copter_context.first_bg_position_x - MMI_GX_COPTER_BACKGROUND_SPEED;
  1767. #endif /* defined(GDI_USING_LAYER) */ 
  1768.     /* update the position of the copter */
  1769.     g_gx_copter_context.copter_position_old_y = g_gx_copter_context.copter_position_y;
  1770.     if (g_gx_copter_context.key_pressed != FALSE)
  1771.     {
  1772.         g_gx_copter_context.copter_position_y = g_gx_copter_context.copter_position_y - g_gx_copter_context.local_step;
  1773.     }
  1774.     else
  1775.     {
  1776.         g_gx_copter_context.copter_position_y = g_gx_copter_context.copter_position_y + g_gx_copter_context.local_step;
  1777.     }
  1778.     /* if the acceleration of falling speed is less than 4 (or 6), then increase the acceleration */
  1779. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_128x128__)
  1780.     if (g_gx_copter_context.local_step < 4)
  1781. #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  1782.     if (g_gx_copter_context.local_step < 6)
  1783. #endif 
  1784.     {
  1785.         g_gx_copter_context.local_step = g_gx_copter_context.local_step + 1;
  1786.     }
  1787.     /* update information of floor and ceiling obstacles */
  1788.     tmp_node = g_gx_copter_context.first_obstacle;
  1789.     while (1)
  1790.     {
  1791.         tmp_node->old_position_x = tmp_node->position_x;
  1792.         tmp_node->old_position_y = tmp_node->position_y;
  1793.         tmp_node->position_x = tmp_node->position_x - MMI_GX_COPTER_OBSTACLE_SPEED;
  1794.         if (tmp_node == g_gx_copter_context.last_obstacle)
  1795.         {
  1796.             break;
  1797.         }
  1798.         tmp_node = tmp_node->next;
  1799.     }
  1800.     /* if the first obstacle is going out of the boundary, move it to the last of the obstacle list */
  1801.     if (g_gx_copter_context.first_obstacle->position_x < -MMI_GX_COPTER_OBSTACLE_WIDTH)
  1802.     {
  1803.         g_gx_copter_context.first_obstacle->position_x =
  1804.             g_gx_copter_context.last_obstacle->position_x + MMI_GX_COPTER_OBSTACLE_WIDTH;
  1805.         /* if the duration of the slope of obstacles expire, determine its new duration time and slope */
  1806.         if (g_gx_copter_context.obstacle_period > g_gx_copter_context.max_period)
  1807.         {
  1808.             g_gx_copter_context.obstacle_period = 0;
  1809.             probability = rand() % 10;
  1810.             g_gx_copter_context.max_period = rand() % 10;
  1811.             if (probability < 5)
  1812.             {
  1813.                 g_gx_copter_context.slope = 1;
  1814.             }
  1815.             else if (probability > 7)
  1816.             {
  1817.                 g_gx_copter_context.slope = 3;
  1818.             }
  1819.             else
  1820.             {
  1821.                 g_gx_copter_context.slope = 2;
  1822.             }
  1823.             if (probability % 2 == 0)
  1824.             {
  1825.                 g_gx_copter_context.slope = -g_gx_copter_context.slope;
  1826.             }
  1827.         }
  1828.         else
  1829.         {
  1830.             g_gx_copter_context.obstacle_period = g_gx_copter_context.obstacle_period + 1;
  1831.         }
  1832.         g_gx_copter_context.first_obstacle->old_position_y = g_gx_copter_context.first_obstacle->position_y;
  1833.         g_gx_copter_context.first_obstacle->position_y =
  1834.             g_gx_copter_context.last_obstacle->position_y + g_gx_copter_context.slope;
  1835.         /* To get the proper space between floor and ceiling obstalcles */
  1836.     #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_JET_128x160__)
  1837.         while (g_gx_copter_context.first_obstacle->position_y > MMI_GX_COPTER_GAME_ORIGIN ||
  1838.                g_gx_copter_context.first_obstacle->position_y < MMI_GX_COPTER_GAME_ORIGIN / 2 - 8)
  1839.     #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  1840.         while (g_gx_copter_context.first_obstacle->position_y > MMI_GX_COPTER_GAME_ORIGIN - 2 ||
  1841.                g_gx_copter_context.first_obstacle->position_y < -7)
  1842.     #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  1843.         while (g_gx_copter_context.first_obstacle->position_y > MMI_GX_COPTER_GAME_ORIGIN ||
  1844.                g_gx_copter_context.first_obstacle->position_y < MMI_GX_COPTER_GAME_ORIGIN / 2 - 11)
  1845.     #endif 
  1846.         {
  1847.             g_gx_copter_context.slope = -g_gx_copter_context.slope;
  1848.             g_gx_copter_context.first_obstacle->position_y =
  1849.                 g_gx_copter_context.last_obstacle->position_y + g_gx_copter_context.slope;
  1850.         }
  1851.         g_gx_copter_context.last_obstacle->next = g_gx_copter_context.first_obstacle;
  1852.         g_gx_copter_context.last_obstacle = g_gx_copter_context.first_obstacle;
  1853.         g_gx_copter_context.first_obstacle = g_gx_copter_context.first_obstacle->next;
  1854.     }
  1855.     /* update information of single obstacle */
  1856.     g_gx_copter_context.single_obstacle.old_position_x = g_gx_copter_context.single_obstacle.position_x;
  1857.     g_gx_copter_context.single_obstacle.position_x =
  1858.         g_gx_copter_context.single_obstacle.position_x - MMI_GX_COPTER_OBSTACLE_SPEED;
  1859.     probability = rand() % 10;
  1860.     if (probability % 2 == 0)
  1861.     {
  1862.         obstacle_shift = rand() % 20;
  1863.     }
  1864.     else
  1865.     {
  1866.         obstacle_shift = -(rand() % 20);
  1867.     }
  1868.     /* if the obstacle is going out of the boundary, set it as a new obstacle */
  1869.     if (g_gx_copter_context.single_obstacle.position_x < -MMI_GX_COPTER_OBSTACLE_WIDTH - 2)
  1870.     {
  1871.         g_gx_copter_context.single_obstacle.position_x = (S16) MMI_GX_COPTER_LCD_WIDTH;
  1872.         g_gx_copter_context.single_obstacle.position_y =
  1873.             g_gx_copter_context.last_obstacle->position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT +
  1874.             MMI_GX_COPTER_COPTER_HEIGHT * 3 + obstacle_shift;
  1875.         g_gx_copter_context.single_obstacle.old_position_y = g_gx_copter_context.single_obstacle.position_y;
  1876.     }
  1877.     /* collision detection */
  1878.     /* case for the single obstacle */
  1879.     if (g_gx_copter_context.single_obstacle.position_x < MMI_GX_COPTER_COPTER_X + MMI_GX_COPTER_COPTER_WIDTH)
  1880.     {
  1881.         if (g_gx_copter_context.copter_position_y + MMI_GX_COPTER_COPTER_HEIGHT - 1 >=
  1882.             g_gx_copter_context.single_obstacle.position_y &&
  1883.             g_gx_copter_context.copter_position_y <=
  1884.             g_gx_copter_context.single_obstacle.position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT - 1 &&
  1885.             g_gx_copter_context.single_obstacle.position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1 >= MMI_GX_COPTER_COPTER_X)
  1886.         {
  1887.             mmi_gx_copter_set_gameover();
  1888.         }
  1889.     }
  1890.     /* case for the upper obstacles */
  1891. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_JET_128x160__)
  1892.     if (g_gx_copter_context.copter_position_y < 87)
  1893. #elif defined(__MMI_GAME_COPTER_128x128) || defined(__MMI_GAME_SUBMARINE_128x128) || defined(__MMI_GAME_JET_128x128)
  1894.     if (g_gx_copter_context.copter_position_y < 73)
  1895. #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  1896.     if (g_gx_copter_context.copter_position_y < 120)
  1897. #endif 
  1898.     {
  1899.         tmp_node = g_gx_copter_context.first_obstacle->next;
  1900.         /* due to the fixed position of copter, only need to check the first 2~6th obstacles */
  1901.         for (i = 0; i < 5; i++)
  1902.         {
  1903.             if ((g_gx_copter_context.copter_position_y <= tmp_node->position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT - 1 ||
  1904.                  g_gx_copter_context.copter_position_y <= MMI_GX_COPTER_GAME_ORIGIN) &&
  1905.                 tmp_node->position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1 >= MMI_GX_COPTER_COPTER_X &&
  1906.                 MMI_GX_COPTER_COPTER_X + MMI_GX_COPTER_COPTER_WIDTH - 1 >= tmp_node->position_x)
  1907.             {
  1908.                 mmi_gx_copter_set_gameover();
  1909.             }
  1910.             tmp_node = tmp_node->next;
  1911.         }
  1912.     }
  1913.     /* case for the lower obstacles */
  1914. #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_JET_128x160__)
  1915.     if (g_gx_copter_context.copter_position_y >= 87)
  1916. #elif defined(__MMI_GAME_COPTER_128x128) || defined(__MMI_GAME_SUBMARINE_128x128) || defined(__MMI_GAME_JET_128x128)
  1917.     if (g_gx_copter_context.copter_position_y >= 73)
  1918. #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  1919.     if (g_gx_copter_context.copter_position_y >= 120)
  1920. #endif 
  1921.     {
  1922.         tmp_node = g_gx_copter_context.first_obstacle->next;
  1923.         /* due to the fixed position of copter, only need to check the first 2~6th obstacles */
  1924.         for (i = 0; i < 5; i++)
  1925.         {
  1926.             if ((g_gx_copter_context.copter_position_y + MMI_GX_COPTER_COPTER_HEIGHT - 1 >=
  1927.                  tmp_node->position_y + g_gx_copter_context.space ||
  1928.         #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_176x220__)
  1929.                  g_gx_copter_context.copter_position_y + MMI_GX_COPTER_COPTER_HEIGHT - 1 >=
  1930.                  MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT) &&
  1931.         #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  1932.                  g_gx_copter_context.copter_position_y + MMI_GX_COPTER_COPTER_HEIGHT - 1 >=
  1933.                  MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT) &&
  1934.         #endif 
  1935.                 tmp_node->position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1 >= MMI_GX_COPTER_COPTER_X &&
  1936.                 MMI_GX_COPTER_COPTER_X + MMI_GX_COPTER_COPTER_WIDTH - 1 >= tmp_node->position_x)
  1937.             {
  1938.                 if (g_gx_copter_context.is_gameover != TRUE)
  1939.                 {
  1940.                     mmi_gx_copter_set_gameover();
  1941.                 }
  1942.             }
  1943.             tmp_node = tmp_node->next;
  1944.         }
  1945.     }
  1946.     /* decrease the space between ceiling and floor one pixel for every 20 secs for the first 10 minutes */
  1947.     if (g_gx_copter_context.is_gameover != TRUE && g_gx_copter_context.tick % 200 == 0 &&
  1948.         g_gx_copter_context.tick < 6001)
  1949.     {
  1950.     #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x160__) || defined(__MMI_GAME_JET_128x128__)
  1951.         g_gx_copter_context.space = g_gx_copter_context.space - 1;
  1952.     #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  1953.         g_gx_copter_context.space = g_gx_copter_context.space - 2;
  1954.     #endif 
  1955.     }
  1956. }
  1957. /*****************************************************************************
  1958.  * FUNCTION
  1959.  *  mmi_gx_copter_render
  1960.  * DESCRIPTION
  1961.  *  Render the game images
  1962.  * PARAMETERS
  1963.  *  void
  1964.  * RETURNS
  1965.  *  void
  1966.  *****************************************************************************/
  1967. void mmi_gx_copter_render(void)
  1968. {
  1969.     /*----------------------------------------------------------------*/
  1970.     /* Local Variables                                                */
  1971.     /*----------------------------------------------------------------*/
  1972.     /* add drawing code here */
  1973.     MMI_ID_TYPE image_id;   /* store the last digit of tick */
  1974.     S16 position_shift;     /* the position offset of digit displayed */
  1975.     S32 tmp_tick;
  1976.     gx_copter_obstacle_node_struct *tmp_node;
  1977.     /*----------------------------------------------------------------*/
  1978.     /* Code Body                                                      */
  1979.     /*----------------------------------------------------------------*/
  1980.     if (g_gx_copter_context.is_gameover == TRUE)
  1981.     {
  1982.         return;
  1983.     }
  1984. #if defined(GDI_USING_LAYER)
  1985.     /* draw the background */
  1986.     mmi_gx_copter_draw_background();
  1987.     gdi_layer_set_active(g_gx_copter_context.foreground);
  1988.     gdi_layer_push_clip();
  1989. #endif /* defined(GDI_USING_LAYER) */ 
  1990.     tmp_tick = g_gx_copter_context.tick / 5;
  1991.     position_shift = MMI_GX_COPTER_SCORE_POSITION_X - 2;
  1992.     /* make grade same as drawing */
  1993.     g_gx_copter_context.game_grade = tmp_tick;
  1994.     do
  1995.     {
  1996.         image_id = IMG_ID_GX_COPTER_NUMBER_0 + (tmp_tick % 10);
  1997.         tmp_tick = tmp_tick / 10;
  1998.     #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_JET_128x160__)
  1999.         gui_show_image(
  2000.             MMI_GX_COPTER_SCORE_POSITION_X + 15 + position_shift,
  2001.             MMI_GX_COPTER_SCORE_POSITION_Y + 9,
  2002.             (PU8) GetImage(image_id));
  2003.     #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  2004.         gui_show_image(
  2005.             MMI_GX_COPTER_SCORE_POSITION_X + 20 + position_shift,
  2006.             MMI_GX_COPTER_SCORE_POSITION_Y - 2,
  2007.             (PU8) GetImage(image_id));
  2008.     #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  2009.         gui_show_image(
  2010.             MMI_GX_COPTER_SCORE_POSITION_X + 18 + position_shift,
  2011.             MMI_GX_COPTER_SCORE_POSITION_Y + 12,
  2012.             (PU8) GetImage(image_id));
  2013.     #endif 
  2014.     #if defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  2015.         position_shift = position_shift - MMI_GX_COPTER_DIGIT_WIDTH - 1;
  2016.     #else 
  2017.         position_shift = position_shift - MMI_GX_COPTER_DIGIT_WIDTH;
  2018.     #endif 
  2019.     } while (tmp_tick != 0);
  2020.     gui_set_clip(
  2021.         0,
  2022.         MMI_GX_COPTER_GAME_ORIGIN,
  2023.         MMI_GX_COPTER_LCD_WIDTH - 1,
  2024.         MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT - 1);
  2025.     /* erase the previous copter */
  2026. #if defined(GDI_USING_LAYER)
  2027.     gdi_draw_solid_rect(
  2028.         MMI_GX_COPTER_COPTER_X,
  2029.         g_gx_copter_context.copter_position_old_y,
  2030.         MMI_GX_COPTER_COPTER_X + MMI_GX_COPTER_COPTER_WIDTH - 1,
  2031.         g_gx_copter_context.copter_position_old_y + MMI_GX_COPTER_COPTER_HEIGHT - 1,
  2032.         MMI_GX_COPTER_TRANSPARENT_COLOR);
  2033. #else /* defined(GDI_USING_LAYER) */ 
  2034.     gui_fill_rectangle(
  2035.         MMI_GX_COPTER_COPTER_X,
  2036.         g_gx_copter_context.copter_position_old_y,
  2037.         MMI_GX_COPTER_COPTER_X + MMI_GX_COPTER_COPTER_WIDTH - 1,
  2038.         g_gx_copter_context.copter_position_old_y + MMI_GX_COPTER_COPTER_HEIGHT - 1,
  2039.         MMI_GX_COPTER_BACK_COLOR);
  2040. #endif /* defined(GDI_USING_LAYER) */ 
  2041.     /* erase the previous single obstacle */
  2042. #if defined(GDI_USING_LAYER)
  2043.     gdi_draw_solid_rect(
  2044.         g_gx_copter_context.single_obstacle.old_position_x,
  2045.         g_gx_copter_context.single_obstacle.old_position_y,
  2046.         g_gx_copter_context.single_obstacle.old_position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1,
  2047.         g_gx_copter_context.single_obstacle.old_position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT - 1,
  2048.         MMI_GX_COPTER_TRANSPARENT_COLOR);
  2049. #else /* defined(GDI_USING_LAYER) */ 
  2050.     gui_fill_rectangle(
  2051.         g_gx_copter_context.single_obstacle.old_position_x,
  2052.         g_gx_copter_context.single_obstacle.old_position_y,
  2053.         g_gx_copter_context.single_obstacle.old_position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1,
  2054.         g_gx_copter_context.single_obstacle.old_position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT - 1,
  2055.         MMI_GX_COPTER_BACK_COLOR);
  2056. #endif /* defined(GDI_USING_LAYER) */ 
  2057.     /* erase ceiling and floor obstacles */
  2058. #if defined(GDI_USING_LAYER)
  2059.     ERASE_AND_DRAW_OBSTACLES(tmp_node, gdi_draw_solid_rect, MMI_GX_COPTER_TRANSPARENT_COLOR);
  2060. #else 
  2061.     ERASE_AND_DRAW_OBSTACLES(tmp_node, gui_fill_rectangle, MMI_GX_COPTER_BACK_COLOR);
  2062. #endif 
  2063.     /* draw single obstacle */
  2064.     gui_show_image(
  2065.         g_gx_copter_context.single_obstacle.position_x,
  2066.         g_gx_copter_context.single_obstacle.position_y,
  2067.         (PU8) GetImage(IMG_ID_GX_COPTER_OBSTACLE));
  2068.     /* draw copter */
  2069.     image_id = (U16) (IMG_ID_GX_COPTER_0 + (g_gx_copter_context.tick % 3));
  2070.     gui_show_transparent_image(
  2071.         MMI_GX_COPTER_COPTER_X,
  2072.         g_gx_copter_context.copter_position_y,
  2073.         (PU8) GetImage(image_id),
  2074.         0);
  2075.     gui_set_clip(0, 0, MMI_GX_COPTER_LCD_WIDTH - 1, MMI_GX_COPTER_LCD_HEIGHT - 1);
  2076. #if defined(GDI_USING_LAYER)
  2077.     gdi_layer_blt(
  2078.         g_gx_copter_context.background,
  2079.         g_gx_copter_context.foreground,
  2080.         0,
  2081.         0,
  2082.         0,
  2083.         0,
  2084.         MMI_GX_COPTER_LCD_WIDTH - 1,
  2085.         MMI_GX_COPTER_LCD_HEIGHT - 1);
  2086.     gdi_layer_pop_clip();
  2087.     gdi_layer_set_active(g_gx_copter_context.background);
  2088. #else /* defined(GDI_USING_LAYER) */ 
  2089.     gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
  2090. #endif /* defined(GDI_USING_LAYER) */ 
  2091. }
  2092. /*****************************************************************************
  2093.  * FUNCTION
  2094.  *  mmi_gx_copter_gameover
  2095.  * DESCRIPTION
  2096.  *  Gameover function
  2097.  * PARAMETERS
  2098.  *  void
  2099.  * RETURNS
  2100.  *  void
  2101.  *****************************************************************************/
  2102. void mmi_gx_copter_gameover(void)
  2103. {
  2104.     /*----------------------------------------------------------------*/
  2105.     /* Local Variables                                                */
  2106.     /*----------------------------------------------------------------*/
  2107.     /*----------------------------------------------------------------*/
  2108.     /* Code Body                                                      */
  2109.     /*----------------------------------------------------------------*/
  2110.     g_gx_copter_context.is_gameover = TRUE;
  2111.     g_gx_copter_context.is_new_game = TRUE;
  2112.     /* call this function to draw gameover screen */
  2113.     mmi_gfx_entry_gameover_screen();
  2114. }
  2115. /*****************************************************************************
  2116.  * FUNCTION
  2117.  *  mmi_gx_copter_draw_crash
  2118.  * DESCRIPTION
  2119.  *  Draw crash images
  2120.  * PARAMETERS
  2121.  *  void
  2122.  * RETURNS
  2123.  *  void
  2124.  *****************************************************************************/
  2125. void mmi_gx_copter_draw_crash(void)
  2126. {
  2127.     /*----------------------------------------------------------------*/
  2128.     /* Local Variables                                                */
  2129.     /*----------------------------------------------------------------*/
  2130.     MMI_ID_TYPE image_id;
  2131.     gx_copter_obstacle_node_struct *tmp_node;
  2132.     S32 tmp_tick;
  2133.     S16 position_shift; /* the position offset of digit displayed */
  2134.     /*----------------------------------------------------------------*/
  2135.     /* Code Body                                                      */
  2136.     /*----------------------------------------------------------------*/
  2137. #if defined(GDI_USING_LAYER)
  2138.     gdi_layer_set_active(g_gx_copter_context.foreground);
  2139.     gdi_layer_push_clip();
  2140. #else /* defined(GDI_USING_LAYER) */ 
  2141.     gui_push_clip();
  2142. #endif /* defined(GDI_USING_LAYER) */ 
  2143.     tmp_tick = g_gx_copter_context.game_grade;
  2144.     position_shift = MMI_GX_COPTER_SCORE_POSITION_X - 2;
  2145.     do
  2146.     {
  2147.         image_id = IMG_ID_GX_COPTER_NUMBER_0 + (tmp_tick % 10);
  2148.         tmp_tick = tmp_tick / 10;
  2149.     #if defined(__MMI_GAME_COPTER_128x160__) || defined(__MMI_GAME_SUBMARINE_128x160__) || defined(__MMI_GAME_JET_128x160__)
  2150.         gui_show_image(
  2151.             MMI_GX_COPTER_SCORE_POSITION_X + 15 + position_shift,
  2152.             MMI_GX_COPTER_SCORE_POSITION_Y + 9,
  2153.             (PU8) GetImage(image_id));
  2154.     #elif defined(__MMI_GAME_COPTER_128x128__) || defined(__MMI_GAME_SUBMARINE_128x128__) || defined(__MMI_GAME_JET_128x128__)
  2155.         gui_show_image(
  2156.             MMI_GX_COPTER_SCORE_POSITION_X + 20 + position_shift,
  2157.             MMI_GX_COPTER_SCORE_POSITION_Y - 2,
  2158.             (PU8) GetImage(image_id));
  2159.     #elif defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  2160.         gui_show_image(
  2161.             MMI_GX_COPTER_SCORE_POSITION_X + 18 + position_shift,
  2162.             MMI_GX_COPTER_SCORE_POSITION_Y + 12,
  2163.             (PU8) GetImage(image_id));
  2164.     #endif 
  2165.     #if defined(__MMI_GAME_COPTER_176x220__) || defined(__MMI_GAME_SUBMARINE_176x220__) || defined(__MMI_GAME_JET_176x220__)
  2166.         position_shift = position_shift - MMI_GX_COPTER_DIGIT_WIDTH - 1;
  2167.     #else 
  2168.         position_shift = position_shift - MMI_GX_COPTER_DIGIT_WIDTH;
  2169.     #endif 
  2170.     } while (tmp_tick != 0);
  2171.     if (g_gx_copter_context.tick <= 8)
  2172.     {
  2173.         image_id = IMG_ID_GX_COPTER_CRASHED_0;
  2174.     }
  2175.     else if (g_gx_copter_context.tick <= 16)
  2176.     {
  2177.         image_id = IMG_ID_GX_COPTER_CRASHED_1;
  2178.     }
  2179.     else
  2180.     {
  2181.         image_id = IMG_ID_GX_COPTER_CRASHED_2;
  2182.     }
  2183.     gui_set_clip(
  2184.         0,
  2185.         MMI_GX_COPTER_GAME_ORIGIN,
  2186.         MMI_GX_COPTER_LCD_WIDTH - 1,
  2187.         MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT - 1);
  2188.     /* erase the previous image of the copter */
  2189. #if defined(GDI_USING_LAYER)
  2190.     gdi_draw_solid_rect(
  2191.         MMI_GX_COPTER_COPTER_X,
  2192.         g_gx_copter_context.copter_position_old_y,
  2193.         MMI_GX_COPTER_COPTER_X + MMI_GX_COPTER_COPTER_WIDTH - 1,
  2194.         g_gx_copter_context.copter_position_old_y + MMI_GX_COPTER_COPTER_HEIGHT - 1,
  2195.         MMI_GX_COPTER_TRANSPARENT_COLOR);
  2196. #else /* defined(GDI_USING_LAYER) */ 
  2197.     gui_fill_rectangle(
  2198.         MMI_GX_COPTER_COPTER_X,
  2199.         g_gx_copter_context.copter_position_old_y,
  2200.         MMI_GX_COPTER_COPTER_X + MMI_GX_COPTER_COPTER_WIDTH - 1,
  2201.         g_gx_copter_context.copter_position_old_y + MMI_GX_COPTER_COPTER_HEIGHT - 1,
  2202.         MMI_GX_COPTER_BACK_COLOR);
  2203. #endif /* defined(GDI_USING_LAYER) */ 
  2204.     /* erase and draw ceiling and floor obstacles */
  2205. #if defined(GDI_USING_LAYER)
  2206.     ERASE_AND_DRAW_OBSTACLES(tmp_node, gdi_draw_solid_rect, MMI_GX_COPTER_TRANSPARENT_COLOR);
  2207. #else 
  2208.     ERASE_AND_DRAW_OBSTACLES(tmp_node, gui_fill_rectangle, MMI_GX_COPTER_BACK_COLOR);
  2209. #endif 
  2210.     /* erase single obstacle */
  2211. #if defined(GDI_USING_LAYER)
  2212.     gdi_draw_solid_rect(
  2213.         g_gx_copter_context.single_obstacle.old_position_x,
  2214.         g_gx_copter_context.single_obstacle.old_position_y,
  2215.         g_gx_copter_context.single_obstacle.old_position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1,
  2216.         g_gx_copter_context.single_obstacle.old_position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT - 1,
  2217.         MMI_GX_COPTER_TRANSPARENT_COLOR);
  2218. #else /* defined(GDI_USING_LAYER) */ 
  2219.     gui_fill_rectangle(
  2220.         g_gx_copter_context.single_obstacle.old_position_x,
  2221.         g_gx_copter_context.single_obstacle.old_position_y,
  2222.         g_gx_copter_context.single_obstacle.old_position_x + MMI_GX_COPTER_OBSTACLE_WIDTH - 1,
  2223.         g_gx_copter_context.single_obstacle.old_position_y + MMI_GX_COPTER_OBSTACLE_HEIGHT - 1,
  2224.         MMI_GX_COPTER_BACK_COLOR);
  2225. #endif /* defined(GDI_USING_LAYER) */ 
  2226.     gui_show_image(
  2227.         g_gx_copter_context.single_obstacle.position_x,
  2228.         g_gx_copter_context.single_obstacle.position_y,
  2229.         (PU8) GetImage(IMG_ID_GX_COPTER_OBSTACLE));
  2230.     /* if the position of the dying copter is lower than the boundary of the game display, set it to the boundary position */
  2231.     if (g_gx_copter_context.copter_position_y + MMI_GX_COPTER_COPTER_HEIGHT >=
  2232.         MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT)
  2233.     {
  2234.         g_gx_copter_context.copter_position_y =
  2235.             MMI_GX_COPTER_GAME_ORIGIN + MMI_GX_COPTER_GAME_HEIGHT - MMI_GX_COPTER_COPTER_HEIGHT + 1;
  2236.     }
  2237.     gui_show_transparent_image(
  2238.         MMI_GX_COPTER_COPTER_X,
  2239.         g_gx_copter_context.copter_position_y,
  2240.         (PU8) GetImage(image_id),
  2241.         0);
  2242. #if defined(GDI_USING_LAYER)
  2243.     gdi_layer_blt(
  2244.         g_gx_copter_context.background,
  2245.         g_gx_copter_context.foreground,
  2246.         0,
  2247.         0,
  2248.         0,
  2249.         0,
  2250.         MMI_GX_COPTER_LCD_WIDTH - 1,
  2251.         MMI_GX_COPTER_LCD_HEIGHT - 1);
  2252.     gdi_layer_pop_clip();
  2253.     gdi_layer_set_active(g_gx_copter_context.background);
  2254. #else /* defined(GDI_USING_LAYER) */ 
  2255.     gui_pop_clip();
  2256.     gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
  2257. #endif /* defined(GDI_USING_LAYER) */ 
  2258.     if (g_gx_copter_context.tick >= 24)
  2259.     {
  2260.         mmi_gx_copter_gameover();
  2261.     }
  2262. }
  2263. /*****************************************************************************
  2264.  * FUNCTION
  2265.  *  mmi_gx_copter_cyclic_timer
  2266.  * DESCRIPTION
  2267.  *  Timer trigger function - looping
  2268.  * PARAMETERS
  2269.  *  void
  2270.  * RETURNS
  2271.  *  void
  2272.  *****************************************************************************/
  2273. void mmi_gx_copter_cyclic_timer(void)
  2274. {
  2275.     /*----------------------------------------------------------------*/
  2276.     /* Local Variables                                                */
  2277.     /*----------------------------------------------------------------*/
  2278.     /*----------------------------------------------------------------*/
  2279.     /* Code Body                                                      */
  2280.     /*----------------------------------------------------------------*/
  2281.     /* accumulation for time */
  2282.     g_gx_copter_context.tick++;
  2283.     gui_start_timer(g_gx_copter_context.timer_elapse, mmi_gx_copter_cyclic_timer);
  2284.     if (g_gx_copter_context.is_gameover == FALSE)
  2285.     {
  2286.         mmi_gx_copter_framemove();
  2287.         mmi_gx_copter_render();
  2288.     }
  2289.     else
  2290.     {
  2291.         /* draw crash images */
  2292.         mmi_gx_copter_draw_crash();
  2293.     }
  2294. }
  2295. /*****************************************************************************
  2296.  * FUNCTION
  2297.  *  mmi_gx_copter_key_pressed
  2298.  * DESCRIPTION
  2299.  *  Key handling
  2300.  * PARAMETERS
  2301.  *  void
  2302.  * RETURNS
  2303.  *  void
  2304.  *****************************************************************************/
  2305. void mmi_gx_copter_key_pressed(void)
  2306. {
  2307.     /*----------------------------------------------------------------*/
  2308.     /* Local Variables                                                */
  2309.     /*----------------------------------------------------------------*/
  2310.     /*----------------------------------------------------------------*/
  2311.     /* Code Body                                                      */
  2312.     /*----------------------------------------------------------------*/
  2313.     g_gx_copter_context.key_pressed = TRUE;
  2314.     if (g_gx_copter_context.is_gameover != FALSE)
  2315.     {
  2316.         return;
  2317.     }
  2318.     /* prevent the queue of sound events from overflowing */
  2319.     /* at least 200ms between two successive playing */
  2320.     if (g_gx_copter_context.tick - g_gx_copter_context.last_sound_playing_tick >= 2)
  2321.     {
  2322.     #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  2323.         GFX_STOP_MULTICHANNEL_WAV(g_gx_copter_context.down_wav);
  2324.         GFX_PLAY_MULTICHANNEL_WAV(g_gx_copter_context.flying_wav);
  2325.     #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  2326.         GFX_PLAY_AUDIO_DVI(CopterFlying_dvi, COPTERFLYING_DVI, DEVICE_AUDIO_PLAY_INFINITE);
  2327.     #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  2328.         g_gx_copter_context.last_sound_playing_tick = g_gx_copter_context.tick;
  2329.     }
  2330. }
  2331. /*****************************************************************************
  2332.  * FUNCTION
  2333.  *  mmi_gx_copter_key_released
  2334.  * DESCRIPTION
  2335.  *  Key handling
  2336.  * PARAMETERS
  2337.  *  void
  2338.  * RETURNS
  2339.  *  void
  2340.  *****************************************************************************/
  2341. void mmi_gx_copter_key_released(void)
  2342. {
  2343.     /*----------------------------------------------------------------*/
  2344.     /* Local Variables                                                */
  2345.     /*----------------------------------------------------------------*/
  2346.     /*----------------------------------------------------------------*/
  2347.     /* Code Body                                                      */
  2348.     /*----------------------------------------------------------------*/
  2349.     g_gx_copter_context.key_pressed = FALSE;
  2350.     g_gx_copter_context.local_step = 0;
  2351.     if (g_gx_copter_context.is_gameover != FALSE)
  2352.     {
  2353.         return;
  2354.     }
  2355. #ifdef __MMI_GAME_MULTICHANNEL_SOUND__
  2356.     GFX_STOP_MULTICHANNEL_WAV(g_gx_copter_context.flying_wav);
  2357.     GFX_PLAY_MULTICHANNEL_WAV(g_gx_copter_context.down_wav);
  2358. #else /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  2359.     GFX_PLAY_AUDIO_DVI(CopterDown_dvi, COPTERDOWN_DVI, DEVICE_AUDIO_PLAY_INFINITE);
  2360. #endif /* __MMI_GAME_MULTICHANNEL_SOUND__ */ 
  2361. }
  2362. /* MTK Leo add */
  2363. #ifdef __MMI_TOUCH_SCREEN__
  2364. /*****************************************************************************
  2365.  * FUNCTION
  2366.  *  mmi_copter_pen_down_hdlr
  2367.  * DESCRIPTION
  2368.  *  
  2369.  * PARAMETERS
  2370.  *  pos     [IN]        
  2371.  * RETURNS
  2372.  *  void
  2373.  *****************************************************************************/
  2374. void mmi_copter_pen_down_hdlr(mmi_pen_point_struct pos)
  2375. {
  2376.     /*----------------------------------------------------------------*/
  2377.     /* Local Variables                                                */
  2378.     /*----------------------------------------------------------------*/
  2379.     /*----------------------------------------------------------------*/
  2380.     /* Code Body                                                      */
  2381.     /*----------------------------------------------------------------*/
  2382.     mmi_gx_copter_key_pressed();
  2383. }
  2384. /*****************************************************************************
  2385.  * FUNCTION
  2386.  *  mmi_copter_pen_repeat_hdlr
  2387.  * DESCRIPTION
  2388.  *  
  2389.  * PARAMETERS
  2390.  *  pos     [IN]        
  2391.  * RETURNS
  2392.  *  void
  2393.  *****************************************************************************/
  2394. void mmi_copter_pen_repeat_hdlr(mmi_pen_point_struct pos)
  2395. {
  2396.     /*----------------------------------------------------------------*/
  2397.     /* Local Variables                                                */
  2398.     /*----------------------------------------------------------------*/
  2399.     /*----------------------------------------------------------------*/
  2400.     /* Code Body                                                      */
  2401.     /*----------------------------------------------------------------*/
  2402.     mmi_gx_copter_key_pressed();
  2403. }
  2404. /*****************************************************************************
  2405.  * FUNCTION
  2406.  *  mmi_copter_pen_up_hdlr
  2407.  * DESCRIPTION
  2408.  *  
  2409.  * PARAMETERS
  2410.  *  pos     [IN]        
  2411.  * RETURNS
  2412.  *  void
  2413.  *****************************************************************************/
  2414. void mmi_copter_pen_up_hdlr(mmi_pen_point_struct pos)
  2415. {
  2416.     /*----------------------------------------------------------------*/
  2417.     /* Local Variables                                                */
  2418.     /*----------------------------------------------------------------*/
  2419.     /*----------------------------------------------------------------*/
  2420.     /* Code Body                                                      */
  2421.     /*----------------------------------------------------------------*/
  2422.     mmi_gx_copter_key_released();
  2423. }
  2424. #endif /* __MMI_TOUCH_SCREEN__ */ 
  2425. /* MTK Leo end */
  2426. #endif /* IS_COPTER_BASE_GAME */