Subversion Repositories Kolibri OS

Rev

Rev 1518 | Rev 1566 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;===First_menu_mode===========================================================================================================
  2.  
  3. First_menu:
  4.  
  5.     mov [snake_length_x2],  6
  6.     mov word[snake_dots],   0x0303
  7.     mov dword[snake_dots+2],    0x03050304
  8.     mov [snake_napravlenie],    3
  9.     mov [snake_napravlenie_next],   3
  10.  
  11.   .redraw:
  12.       mcall     12,1
  13.     mov  ebx, [wp_x]
  14.     shl  ebx, 16
  15.     add  ebx, dword[window_width]
  16.     mov  ecx, [wp_y]
  17.     shl  ecx, 16
  18.     add  ecx, dword[window_height]
  19.       mcall     0, , ,[window_style], ,window_title
  20.  
  21.     call    Draw_decorations
  22.     call    Draw_first_menu_picture
  23.     call    Draw_menu_strings
  24.  
  25.       mcall     12,2
  26.  
  27.   .still:
  28.       mcall     10                              ; wait for event
  29.                                                 ; ok, what an event?
  30.     dec  al                                     ; has the window been moved or resized?
  31.      jz  .redraw                                ;
  32.     dec  al                                     ; was a key pressed?
  33.      jz  .key                                   ;
  34.  
  35.  
  36.   .button:                                      ; a button was pressed
  37.       mcall     17                              ; get button number
  38.     shr  eax, 8                                 ; we should do it to get the real button code
  39.  
  40.     cmp  eax, 1                                 ; is it close button?
  41.      je  Exit                                   ; if so, jump to quit...
  42.  
  43.      jmp .still                                 ; jump to wait for another event
  44.  
  45.  
  46.   .key:                                         ; a key was pressed
  47.       mcall     2                               ; get keycode
  48.  
  49.     cmp  ah, 0x1B                               ; Escape
  50.      je  Exit
  51.     cmp  ah, 0x0D                               ; Enter
  52.      je  Level_begin
  53.     cmp  ah, 0x20                               ; Space
  54.      je  Level_begin
  55.  
  56.      jmp .still                                 ; jump to wait for another event
  57.  
  58. ;;---First_menu_mode-----------------------------------------------------------------------------------------------------------
  59.  
  60.  
  61. ;;===Some_functions============================================================================================================
  62.  
  63. Draw_first_menu_picture:
  64.     ;;===Draw_first_menu_picture================================================================================================
  65.  
  66.     mov  ax,  0*0x100+29
  67.     mov  cx,  1*0x100+6
  68.     mov  edx, [snake_picture_color]
  69.     mov  esi, picture_first_menu_snake
  70.       call      Draw_picture
  71.  
  72.     mov  ax,  9*0x100+11
  73.     mov  cx,  9*0x100+5
  74.     mov  edx, [version_picture_color]
  75.     mov  esi, picture_first_menu_version
  76.       call      Draw_picture
  77.  
  78.     ret
  79.            
  80.     ;;---Draw_first_menu_picture------------------------------------------------------------------------------------------------
  81.  
  82.  
  83. Draw_menu_strings:
  84.     ;;===Make_menu_strings=========================================================================================
  85.  
  86.     mov  ebx, [window_width]
  87.     shr  ebx, 1
  88.     sub  ebx, (press_esc_to_exit-press_to_start-1)*3+6
  89.     shl  ebx, 16
  90.     add  ebx, dword[bottom_middle_strings]
  91.       mcall     4, ,[navigation_strings_color],press_to_start
  92.     mov  ebx, [window_width]
  93.     shr  ebx, 1
  94.     sub  ebx, (string_congratulations-press_esc_to_exit-1)*3+6
  95.     shl  ebx, 16
  96.     add  ebx, [top_strings]
  97.       mcall     , ,[navigation_strings_color],press_esc_to_exit
  98. ;      mcall     ,406*65536+TOP_STRINGS,[navigation_strings_color],press_F2_to_options
  99.  
  100.     ret
  101.  
  102.     ;;---Make_menu_strings-----------------------------------------------------------------------------------------
  103.    
  104. ;;---Some_functions------------------------------------------------------------------------------------------------------------