Subversion Repositories Kolibri OS

Rev

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