Subversion Repositories Kolibri OS

Rev

Rev 1677 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;===Level_mode================================================================================================================
  2.  
  3. Level_begin:
  4.  
  5.       call      Load_level
  6.       call      Get_eat
  7.         mcall     66,1,1                          ; set scan codes mode for keyboard
  8.  
  9. Level_body:
  10.     ;;===Level_body========================================================================================================
  11.  
  12.       call      Hide_cursor
  13. mcall     26, 9
  14.     mov  [time_before_waiting], eax
  15.     mov  eax, [time_wait_limit]
  16.     mov  [time_to_wait],    eax
  17.  
  18.   .redraw:
  19.       call      Set_geometry
  20.       mcall     12,1
  21.       mcall     0, , ,[window_style], ,window_title
  22.     test [proc_info.wnd_state], 0x04            ; is rolled up?
  23.      jnz Pause_mode
  24.    
  25.       call      Draw_decorations
  26.       call      Draw_stones
  27.       call      Draw_snake
  28.       call      Draw_eat
  29.       call      Draw_level_strings
  30.       mcall     12,2
  31.    
  32.   .still:
  33.       mcall     26, 9
  34.     push eax
  35.     sub  eax, [time_before_waiting]
  36.     pop  [time_before_waiting]
  37.     cmp  [time_to_wait],    eax
  38.      jg  @f
  39.     cmp  [action],  0
  40.      jne Game_step
  41.   @@:
  42.     sub  [time_to_wait],    eax
  43.       mcall     23, [time_to_wait]              ;
  44.  
  45.     test al,  al
  46.      jnz  @f
  47.     cmp  [action],  0
  48.      jne Game_step
  49.       mcall     26, 9
  50.     mov  [time_before_waiting], eax
  51.     mov  eax, [time_wait_limit]
  52.     mov  [time_to_wait],    eax
  53.      jmp .still
  54.   @@:
  55.  
  56.       .message:                                 ; ok, what an event?
  57.         dec  al                                 ; has the window been moved or resized?
  58.          jz  .redraw                            ;
  59.         dec  al                                 ; was a key pressed?
  60.          jz  .key                               ;
  61.         dec  al                                 ; was a button pressed?
  62.          jz  .button                            ;
  63.  
  64.  
  65.   .button:                                      ; ¯à®æ¥¤ãà  ®¡à ¡®ª¨ ª­®¯®ª ¢ ¯à®£à ¬¬¥
  66.       mcall     17                              ; äã­ªæ¨ï 17: ¯®«ãç¨âì ­®¬¥à ­ ¦ â®© ª­®¯ª¨
  67.  
  68.     shr  eax, 8                                 ; ᤢ¨£ ¥¬ ॣ¨áâà eax ­  8 ¡¨â ¢¯à ¢®, çâ®¡ë ¯®«ãç¨âì ­®¬¥à ­ ¦ â®© ª­®¯ª¨
  69.     cmp  eax, 1
  70.      je  Save_do_smth_else_and_exit
  71.  
  72.      jmp .still
  73.  
  74.  
  75.   .key:
  76.       mcall     2                               ; get keycode
  77.  
  78. ;pushf
  79. ;pusha
  80. ;movzx eax, ah
  81. ;dph eax
  82. ;newline
  83. ;popa
  84. ;popf
  85.  
  86.     cmp  ah,  0x01                              ; Escape
  87.      je  First_menu
  88.     cmp  ah,  0x39                              ; Space
  89.      je  Pause_mode
  90.     cmp  ah,  0x4B                              ; Left
  91.      je  .key.left
  92.     cmp  ah,  [shortcut_move_left]              ; Left
  93.      je  .key.left
  94.     cmp  ah,  0x50                              ; Down
  95.      je  .key.down
  96.     cmp  ah,  [shortcut_move_down]              ; Down
  97.      je  .key.down
  98.     cmp  ah,  0x48                              ; Up
  99.      je  .key.up
  100.     cmp  ah,  [shortcut_move_up]                ; Up
  101.      je  .key.up
  102.     cmp  ah,  0x4D                              ; Right
  103.      je  .key.right
  104.     cmp  ah,  [shortcut_move_right]             ; Right
  105.      je  .key.right
  106.  
  107.     cmp  ah,  0x4B+0x80                         ; Left released
  108.      je  .key.released.left
  109.     mov  al,  [shortcut_move_left]
  110.     add  al,  0x80
  111.     cmp  ah,  al                                ; Left released
  112.      je  .key.released.left
  113.     cmp  ah,  0x50+0x80                         ; Down released
  114.      je  .key.released.down
  115.     mov  al,  [shortcut_move_down]
  116.     add  al,  0x80
  117.     cmp  ah,  al                                ; Down released
  118.      je  .key.released.down
  119.     cmp  ah,  0x48+0x80                         ; Up released
  120.      je  .key.released.up
  121.     mov  al,  [shortcut_move_up]
  122.     add  al,  0x80
  123.     cmp  ah,  al                                ; Up released
  124.      je  .key.released.up
  125.     cmp  ah,  0x4D+0x80                         ; Right released
  126.      je  .key.released.right
  127.     mov  al,  [shortcut_move_right]
  128.     add  al,  0x80
  129.     cmp  ah,  al                                ; Right released
  130.      je  .key.released.right
  131.  
  132.     cmp  ah, [shortcut_reverse]
  133.      jne @f
  134.       call      Reverse_snake
  135.      jmp .still
  136.   @@:
  137.     cmp  ah, [shortcut_increase]
  138.      jne @f
  139.       call      Increase_geometry
  140.      jmp .redraw
  141.   @@:
  142.     cmp  ah, [shortcut_decrease]
  143.      jne @f
  144.       call      Decrease_geometry
  145.      jmp .redraw
  146.   @@:
  147.    
  148.      jmp .still                                 ; jump to wait for another event
  149.  
  150.  
  151.   .key.left:
  152.     bts  [action],  0
  153.      jc  @f
  154.     mov  [time_to_wait],    0
  155.   @@:
  156.     cmp  [smart_reverse],   1
  157.      jne @f
  158.     cmp  [snake_direction], RIGHT
  159.      je  .still
  160.   @@:
  161.     mov  [snake_direction_next],    LEFT
  162.     bts  [acceleration_mask],   LEFT
  163.      jc  Game_step
  164.      jmp .still
  165.            
  166.   .key.down:
  167.     bts  [action],  0
  168.      jc  @f
  169.     mov  [time_to_wait],    0
  170.   @@:
  171.     cmp  [smart_reverse],   1
  172.      jne @f
  173.     cmp  [snake_direction], UP
  174.      je  .still
  175.   @@:
  176.     mov  [snake_direction_next],    DOWN
  177.     bts  [acceleration_mask],   DOWN
  178.      jc  Game_step
  179.      jmp .still
  180.            
  181.   .key.up:
  182.     bts  [action],  0
  183.      jc  @f
  184.     mov  [time_to_wait],    0
  185.   @@:
  186.     cmp  [smart_reverse],   1
  187.      jne @f
  188.     cmp  [snake_direction], DOWN
  189.      je  .still
  190.   @@:
  191.     mov  [snake_direction_next],    UP
  192.     bts  [acceleration_mask],   UP
  193.      jc  Game_step
  194.      jmp .still
  195.            
  196.   .key.right:
  197.     bts  [action],  0
  198.      jc  @f
  199.     mov  [time_to_wait],    0
  200.   @@:
  201.     cmp  [smart_reverse],   1
  202.      jne @f
  203.     cmp  [snake_direction], LEFT
  204.      je  .still
  205.   @@:
  206.     mov  [snake_direction_next],    RIGHT
  207.     bts  [acceleration_mask],   RIGHT
  208.      jc  Game_step
  209.      jmp .still
  210.  
  211.  
  212.   .key.released.left:
  213.     btr  [acceleration_mask],   LEFT
  214.      jmp .still
  215.  
  216.   .key.released.down:
  217.     btr  [acceleration_mask],   DOWN
  218.      jmp .still
  219.  
  220.   .key.released.up:
  221.     btr  [acceleration_mask],   UP
  222.      jmp .still
  223.  
  224.   .key.released.right:
  225.     btr  [acceleration_mask],   RIGHT
  226.      jmp .still
  227.  
  228.  
  229.   Game_step:
  230.  
  231.     cmp  [snake_direction], LEFT                ; are we moving to left?
  232.      jz  .left
  233.     cmp  [snake_direction], DOWN                ; ... down?
  234.      jz  .down
  235.     cmp  [snake_direction], UP                  ; ... up?
  236.      jz  .up
  237.      jmp .right                                 ; then right
  238.      
  239.   .left:
  240.     cmp  [snake_direction_next],    RIGHT       ; next step is to right?
  241.      jz  .with_reverse
  242.      jmp .without_reverse
  243.  
  244.   .down:
  245.     cmp  [snake_direction_next],    UP          ; next step is to up?
  246.      jz  .with_reverse
  247.      jmp .without_reverse
  248.      
  249.   .up:
  250.     cmp  [snake_direction_next],    DOWN        ; next step is to bottom?
  251.      jz  .with_reverse
  252.      jmp .without_reverse
  253.  
  254.   .right:
  255.     cmp  [snake_direction_next],    LEFT        ; next step is to left?
  256.      jz  .with_reverse
  257.      jmp .without_reverse
  258.  
  259.  
  260.   .with_reverse:
  261.       call      Set_reverse_direction
  262.       call      Reverse
  263.        
  264.   .without_reverse:
  265.     mov  edx, snake_dots-2
  266.     add  edx, [snake_length_x2]
  267.        
  268.     cmp  [snake_direction_next],    LEFT
  269.      je  .to_left
  270.     cmp  [snake_direction_next],    DOWN
  271.      je  .to_down
  272.     cmp  [snake_direction_next],    UP
  273.      je  .to_up
  274.     cmp  [snake_direction_next],    RIGHT
  275.      je  .to_right    
  276.        
  277.       .to_left:
  278.         mov  [snake_direction], LEFT
  279.         mov  ax,  [edx]
  280.         dec  al
  281.         cmp  al,  -1
  282.          jne @f
  283.         mov  al,  GRID_WIDTH
  284.         dec  al
  285.       @@:
  286.          jmp Snake_move
  287.  
  288.       .to_down:
  289.         mov  [snake_direction], DOWN
  290.         mov  ax,  [edx]
  291.         inc  ah
  292.         cmp  ah,  GRID_HEIGHT
  293.          jne @f
  294.         mov  ah,  0
  295.       @@:
  296.          jmp Snake_move
  297.        
  298.       .to_up:
  299.         mov  [snake_direction], UP
  300.         mov  ax,  [edx]
  301.         dec  ah
  302.         cmp  ah,  -1
  303.          jne @f
  304.         mov  ah,  GRID_HEIGHT
  305.         dec  ah
  306.       @@:
  307.          jmp Snake_move
  308.        
  309.       .to_right:
  310.         mov  [snake_direction], RIGHT
  311.         mov  ax,  [edx]
  312.         inc  al
  313.         cmp  al,  GRID_WIDTH
  314.          jne @f
  315.         mov  al,  0
  316.       @@:
  317.          jmp Snake_move
  318.  
  319.     ;;---Level_body--------------------------------------------------------------------------------------------------------
  320.  
  321. ;;---Level_mode----------------------------------------------------------------------------------------------------------------
  322.  
  323.  
  324. ;;===Some_functions============================================================================================================
  325.  
  326. Draw_snake:
  327.     ;;===Draw_snake========================================================================================================
  328.    
  329.       call      Draw_head_prehead
  330.     mov  edx, [snake_color]
  331.     mov  esi, snake_dots-6
  332.     add  esi, [snake_length_x2]
  333.  
  334.   @@:
  335.     mov  bx,  [esi]
  336.     sub  esi, 2
  337.       call      Draw_square
  338.     cmp  esi, snake_dots-2
  339.      jne @b
  340.  
  341.     ret
  342.        
  343.     ;;---Draw_snake--------------------------------------------------------------------------------------------------------
  344.  
  345.  
  346. Draw_head_prehead:
  347.     ;;===Draw_head_prehead=================================================================================================
  348.  
  349.     mov  edx, [snake_head_color]
  350.     mov  esi, snake_dots-2
  351.     add  esi, [snake_length_x2]
  352.     mov  bx,  [esi]
  353.       call      Draw_square
  354.     sub  esi, 2
  355.     mov  bx,  [esi]
  356.     mov  edx, [snake_color]
  357.       call      Draw_square
  358.       call      Draw_lives_in_head
  359.  
  360.     ret
  361.  
  362.     ;;---Draw_head_prehead-------------------------------------------------------------------------------------------------
  363.  
  364.  
  365. Draw_level_strings:
  366.     ;;===Draw_level_strings================================================================================================
  367.  
  368.     mov  ebx, [window_width]
  369.     shr  ebx, 1
  370.     sub  ebx, string_pause_space.size*3+6
  371.     shl  ebx, 16
  372.     add  ebx, [top_strings]
  373.       mcall     4, ,[navigation_strings_color],string_pause_space ; Draw 'PAUSE - SPACE' string
  374.  
  375. ;    call    Draw_menu_esc
  376.     call    Draw_score_string
  377.     call    Draw_score_number                   ; Draw score (number)
  378.     call    Draw_champion_string
  379.     call    Draw_champion_name
  380.     call    Draw_hiscore_string
  381.     call    Draw_hiscore_number
  382.  
  383.     cmp  [play_mode],   LEVELS_MODE
  384.      jne @f
  385.  
  386.     mov  ebx, [window_width]
  387.     shr  ebx, 3
  388.     sub  ebx, 5
  389.     shl  ebx, 16
  390.     add  ebx, [bottom_bottom_strings]
  391.       mcall     4, ,[level_string_color],string_level
  392.  
  393.     mov  edx, [window_width]
  394.     shr  edx, 3
  395.     sub  edx, 5+1
  396.     add  edx, string_level.size*6
  397.     shl  edx, 16
  398.     add  edx, [bottom_bottom_strings]
  399.       mcall     47,0x00020000,[cur_level_number], ,[level_number_color],[background_color]
  400.  
  401.   @@:
  402.  
  403.     ret
  404.  
  405.     ;;---Draw_level_strings------------------------------------------------------------------------------------------------
  406.    
  407.    
  408. Reverse:
  409.     ;;===Reverse===========================================================================================================
  410.  
  411.     mov  ecx, [snake_length_x2]
  412.     shr  ecx, 2
  413.     mov  esi, snake_dots
  414.     mov  edi, snake_dots-2
  415.     add  edi, [snake_length_x2]
  416.  
  417.   @@:
  418.     mov  ax,  [edi]
  419.     xchg ax,  [esi]
  420.     mov  [edi], ax
  421.  
  422.     add  esi, 2
  423.     sub  edi, 2
  424.     dec  cx
  425.      jnz @b
  426.  
  427.     ret
  428.  
  429.     ;;---Reverse-----------------------------------------------------------------------------------------------------------
  430.        
  431.        
  432. Draw_eat:
  433.     ;;===Draw_eat==========================================================================================================
  434.        
  435.     mov  bx,  word[eat]
  436.     mov  edx, [eat_color]
  437.        
  438.     call    Draw_square
  439.        
  440.     ret
  441.        
  442.     ;;---Draw_eat----------------------------------------------------------------------------------------------------------
  443.  
  444.  
  445. Get_eat:
  446.     ;;===Get_eat===========================================================================================================
  447.     ;;  in  :
  448.     ;;
  449.     ;;  out :
  450.     ;;          ax  =   coord's of the eat square (al=x, ah=y)
  451.     ;;
  452.  
  453.       mcall     26,9
  454. ;    xor  eax, esp
  455.     shl  eax, 1
  456.     xor  edx, edx
  457.     div  word[number_of_free_dots]
  458.     mov  ebx, field_map
  459.  
  460.   .loop:
  461.     cmp  byte[ebx], 0
  462.      jne @f
  463.     test dx,  dx
  464.      jz  .place_found
  465.     dec  dx
  466.   @@:
  467.     inc  ebx
  468.      jmp .loop
  469.      
  470.   .place_found:
  471.     sub  ebx, field_map
  472.     mov  eax, ebx
  473.     mov  bl,  GRID_WIDTH
  474.     div  bl
  475.     xchg al,  ah
  476.    
  477.     mov  word[eat], ax
  478.  
  479.     ret
  480.  
  481.     ;;---Get_eat-----------------------------------------------------------------------------------------------------------
  482.  
  483.  
  484. Sdvig:
  485.     ;;===Sdvig=============================================================================================================
  486.  
  487.     mov  esi, snake_dots+2
  488.     mov  edi, snake_dots
  489.     mov  ecx, [snake_length_x2]
  490.     shr  ecx, 1
  491.    
  492.     cld
  493.     rep  movsw
  494.  
  495.     ret
  496.  
  497.     ;;---Sdvig-------------------------------------------------------------------------------------------------------------
  498.  
  499.  
  500. Set_reverse_direction:
  501.     ;;===Set_reverse_direction==================================================================================================
  502.  
  503.     mov  eax, snake_dots
  504.     mov  ebx, snake_dots+2
  505.  
  506.     mov  cl,  [eax]                             ; The last dot x_coord
  507.     mov  ch,  [ebx]                             ; The pre_last dot x_coord
  508.  
  509.     cmp  cl,  ch
  510.      je  .X_ravny
  511.    
  512.     cmp  cl,  0
  513.      jne .skip2
  514.    
  515.     mov  dl,  GRID_WIDTH
  516.     dec  dl
  517.     cmp  ch,  dl
  518.      jne .Normal_y_ravny
  519.     mov  [snake_direction_next],    RIGHT
  520.     ret
  521.        
  522.   .skip2:
  523.     mov  dl,  GRID_WIDTH
  524.     dec  dl
  525.     cmp  cl,  dl
  526.      jne .Normal_y_ravny
  527.     cmp  ch,  0
  528.      jne .Normal_y_ravny
  529.     mov  [snake_direction_next],    LEFT
  530.     ret
  531.    
  532.   .Normal_y_ravny:
  533.  
  534.     cmp  cl,  ch
  535.      jg  .Napravlenie_to_right
  536.     mov  [snake_direction_next],    LEFT
  537.     ret
  538.  
  539.   .Napravlenie_to_right:
  540.     mov  [snake_direction_next],    RIGHT
  541.     ret
  542.  
  543.   .X_ravny:
  544.     inc  eax
  545.     inc  ebx
  546.     mov  cl,  [eax]
  547.     mov  ch,  [ebx]
  548.    
  549.     cmp  cl,  0
  550.      jne .skip3
  551.    
  552.     mov  dl,  GRID_HEIGHT
  553.     dec  dl
  554.     cmp  ch,  dl
  555.      jne .Normal_x_ravny
  556.     mov  [snake_direction_next],    DOWN
  557.     ret
  558.        
  559.   .skip3:
  560.     mov  dl,  GRID_HEIGHT
  561.     dec  dl
  562.     cmp  ch,  dl
  563.      jne .Normal_x_ravny
  564.     cmp  ch,  0
  565.      jne .Normal_x_ravny
  566.     mov  [snake_direction_next],    UP
  567.     ret
  568.    
  569.   .Normal_x_ravny:
  570.  
  571.     cmp  cl,  ch                                ; !!!
  572.      jg  .Napravlenie_to_down                   ; 0 1 2 ...
  573.     mov  [snake_direction_next],    UP          ; 1
  574.     ret                                         ; 2
  575.                                                 ; .
  576.   .Napravlenie_to_down:                         ; .
  577.     mov  [snake_direction_next],    DOWN        ; .
  578.  
  579.     ret
  580.  
  581.     ;;---Set_reverse_direction--------------------------------------------------------------------------------------------------
  582.    
  583.    
  584. Snake_move:
  585.     ;;===Snake_move=============================================================================================================
  586.     ;;  in  :
  587.     ;;           ax =   coord's of new head
  588.     ;;          edx =   snake_dots+[snake_length_x2]-2 (snake head)
  589.     ;;
  590.  
  591.     add  edx, 2
  592.     mov  [edx], ax
  593.     cmp  ax,  word[eat]
  594.      jne .eat_and_new_head_are_different
  595.  
  596.     add  [snake_length_x2], 2
  597.     add  [score],   SCORE_EAT
  598.     dec  [number_of_free_dots]
  599.     cmp  [number_of_free_dots], 0
  600.      je  Game_over
  601.     mov  ax,  word[eat]
  602.     mov  cl,  1
  603.       call      Draw_on_map
  604.       call      Draw_head_prehead
  605.  
  606.     cmp  [play_mode],   CLASSIC_MODE
  607.      jne .is_not_classic_mode
  608.     dec  byte[speed_up_counter]
  609.      jns @f
  610.     mov  al,  byte[speed_up_counter+1]
  611.     mov  byte[speed_up_counter],    al
  612.     cmp  [time_wait_limit], 4
  613.      jl  @f
  614.     dec  [time_wait_limit]
  615.   @@:
  616.  
  617.   .is_not_classic_mode:
  618.     cmp  [play_mode],   LEVELS_MODE
  619.      jne .is_not_levels_mode
  620.     cmp  [snake_length_x2], (EAT_TO_END_LEVEL+3)*2
  621.      je  .skip
  622.  
  623.   .is_not_levels_mode:
  624.       call      Get_eat
  625.       call      Draw_eat
  626.   .skip:
  627.  
  628.      jmp Keys_done
  629.  
  630.  
  631.   .eat_and_new_head_are_different:
  632.  
  633.     push ax
  634.    
  635.     mov  ax,  word[snake_dots]
  636.     mov  cl,  0
  637.       call      Draw_on_map
  638.  
  639.     pop ax
  640.  
  641.       call      Get_from_map
  642.  
  643.     test bl,  bl
  644.      jnz Game_over
  645.  
  646.     mov  cl,  1
  647.       call      Draw_on_map
  648.      
  649.     mov  bx,  word[snake_dots]
  650.     mov  edx, [background_color]
  651.       call      Draw_square
  652.    
  653.       call      Sdvig
  654.      
  655.       call      Draw_head_prehead
  656.  
  657.  
  658.   Keys_done:
  659.  
  660.     cmp  [score],   0
  661.      je  @f
  662.     dec  [score]
  663.       call      Draw_score_number
  664.   @@:
  665.  
  666.     cmp  [play_mode],   LEVELS_MODE
  667.      jne @f
  668.     cmp  [snake_length_x2], (EAT_TO_END_LEVEL+3)*2
  669.      je  Do_smth_between_levels
  670.   @@:
  671.  
  672.       mcall     26, 9
  673.     mov  [time_before_waiting], eax
  674.     mov  eax, [time_wait_limit]
  675.     mov  [time_to_wait],    eax
  676.      jmp Level_body.still
  677.  
  678.     ;;---Snake_move------------------------------------------------------------------------------------------------------------
  679.  
  680.  
  681. Do_smth_between_levels:
  682.     ;;===Do_smth_between_levels================================================================================================
  683.  
  684.     inc  [cur_level_number]
  685.     cmp  [cur_level_number],    LAST_LEVEL_NUMBER+1
  686.      jne @f
  687.     mov  [cur_level_number],    LEVELS_MODE_FIRST_LEVEL
  688.   @@:
  689.  
  690.       call      Draw_splash
  691.  
  692.   @@:
  693.       mcall     2
  694.     cmp  eax, 1
  695.      jne @b
  696.  
  697.      jmp Level_begin
  698.  
  699.     ;;---Do_smth_between_levels------------------------------------------------------------------------------------------------
  700.  
  701.  
  702. Draw_splash:
  703.     ;;===Draw_splash===========================================================================================================
  704.  
  705.     mov  al,  0
  706.     mov  cl,  GRID_WIDTH-1
  707.     mov  edx, [splash_background_color]
  708.  
  709.   .draw:
  710.     mov  bh,  GRID_HEIGHT-1
  711.     mov  bl,  al
  712.   @@:
  713.       call      Draw_square
  714.     sub  bh,  2
  715.     cmp  bh,  0
  716.      jg  @b
  717.    
  718.     inc  al
  719.    
  720.     mov  bh,  GRID_HEIGHT-2
  721.     mov  bl,  cl
  722.   @@:
  723.       call      Draw_square
  724.     sub  bh,  2
  725.     cmp  bh,  0
  726.      jnl @b
  727.  
  728.     dec  cl
  729.     cmp  cl,  0
  730.      jl  .picture
  731.  
  732.     push eax ebx
  733.       mcall     5,PAUSE_WHILE_DRAWING_SPLASH
  734.       mcall     2
  735.     cmp  ah,  0x39                              ; Space
  736.      jne @f
  737.     pop  ebx eax
  738.      jmp .quit
  739.   @@:
  740.     cmp  ah,  0x1C                              ; Enter
  741.      jne @f
  742.     pop  ebx eax
  743.      jmp .quit
  744.   @@:
  745.     pop  ebx eax
  746.      jmp .draw
  747.  
  748.  
  749.   .picture:
  750.     mov  ax,  2*0x100+24
  751.     mov  cx,  1*0x100+5
  752.     mov  edx, [splash_level_string_color]
  753.     mov  esi, picture_level
  754.       call      Draw_picture
  755.  
  756.     mov  eax, [cur_level_number]
  757.     mov  dl,  10
  758.     div  dl
  759.     push ax
  760.    
  761.     mov  esi, digits_font
  762.   @@:
  763.     test al,  al
  764.      jz  @f
  765.     add  esi, 5
  766.     dec  al
  767.      jmp @b
  768.   @@:
  769.    
  770.     mov  ax,  9*0x100+4
  771.     mov  cx,  8*0x100+5
  772.     mov  edx, [splash_level_number_color]
  773.       call      Draw_picture
  774.    
  775.     pop  ax
  776.     mov  esi, digits_font
  777.   @@:
  778.     test ah,  ah
  779.      jz  @f
  780.     add  esi, 5
  781.     dec  ah
  782.      jmp @b
  783.   @@:
  784.  
  785.     mov  ax,  15*0x100+4
  786.     mov  cx,  8*0x100+5
  787.     mov  edx, [splash_level_number_color]
  788.       call      Draw_picture
  789.  
  790.       mcall     26,9
  791.     mov  [time_before_waiting], eax
  792.     mov  [time_to_wait],    PAUSE_BETWEEN_LEVELS
  793.   @@:
  794.       mcall     23,[time_to_wait]
  795.       mcall     2
  796.     cmp  ah,  0x39                              ; Space
  797.      je  .quit
  798.     cmp  ah,  0x1C                              ; Enter
  799.      je  .quit
  800.       mcall     26,9
  801.     push eax
  802.     sub  eax, [time_before_waiting]
  803.     pop  [time_before_waiting]
  804.     sub  [time_to_wait],  eax
  805.      jns @b
  806.   .quit:
  807.     ret
  808.  
  809.     ;;---Draw_splash-----------------------------------------------------------------------------------------------------------
  810.  
  811.  
  812. Draw_lives_in_head:
  813.     ;;===Draw_lives_in_head====================================================================================================
  814.  
  815.     cmp  [play_mode],   LEVELS_MODE
  816.      jne .quit
  817.     test [show_lives_style],    2
  818.      jz  .quit
  819.     mov  eax, snake_dots-2
  820.     add  eax, [snake_length_x2]
  821.     mov  ax,  word[eax]
  822.  
  823.     mov  bl,  ah
  824.     mul  byte[g_s]
  825.     mov  edx, [gbxm1]
  826.     add  dx,  ax
  827.     shl  edx, 16
  828.     mov  al,  bl
  829.     mul  byte[g_s]
  830.     mov  dx,  word[gbym1]
  831.     add  dx,  ax
  832.  
  833.     mov  eax, [g_s]
  834.     shl  eax, 16
  835.     add  eax, [g_s]
  836.     and  eax, 0xfffefffe
  837.     shr  eax, 1
  838.     add  edx, eax
  839.     sub  edx, 0x00020003
  840.       mcall     47,0x80010001,lives,,[lives_in_head_number_color]
  841.  
  842.   .quit:
  843.     ret
  844.  
  845.     ;;---Draw_lives_in_head----------------------------------------------------------------------------------------------------
  846.  
  847.  
  848. ;;---Some_functions------------------------------------------------------------------------------------------------------------
  849.