Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
1518 dunkaist 1
;;===Pause_mode================================================================================================================
2
 
3
Pause_mode:
4
 
1677 dunkaist 5
      mcall     66,1,1                          ; set scan codes mode for keyboard
1566 dunkaist 6
      call      Show_cursor
1518 dunkaist 7
    mov  [action],  0
8
    mov  eax, [time_wait_limit]
9
    mov  [time_to_wait],    eax
10
 
1522 dunkaist 11
  .redraw:
1677 dunkaist 12
      call      Set_geometry
1518 dunkaist 13
      mcall     12,1
1522 dunkaist 14
      mcall     0, , ,[window_style], ,window_title
1518 dunkaist 15
 
16
      call      Draw_decorations
17
      call      Draw_pause_picture
18
      call      Draw_pause_strings
19
 
20
      mcall     12,2
21
 
22
 
1522 dunkaist 23
  .still:
1518 dunkaist 24
      mcall     10                              ; wait for event
25
                                                ; ok, what an event?
26
    dec  al                                     ; has the window been moved or resized?
1522 dunkaist 27
     jz  .redraw
1518 dunkaist 28
    dec  al                                     ; was a key pressed?
1522 dunkaist 29
     jz  .key
1518 dunkaist 30
 
31
 
1522 dunkaist 32
  .button:                                      ; a button was pressed
1518 dunkaist 33
      mcall     17                              ; get button number
34
    shr  eax, 8                                 ; we should do it to get the real button code
35
 
36
    cmp  eax, 1
1566 dunkaist 37
     je  Save_do_smth_else_and_exit
1518 dunkaist 38
 
1522 dunkaist 39
     jmp .still
1518 dunkaist 40
 
41
 
1522 dunkaist 42
  .key:                                         ; a key was pressed
1518 dunkaist 43
      mcall     2                               ; get keycode
44
 
1677 dunkaist 45
    cmp  ah,  0x01                              ; Escape - go to menu
1518 dunkaist 46
     je  First_menu
1677 dunkaist 47
    cmp  ah,  0x39                              ; Space - resume game
1518 dunkaist 48
     je  Level_body
1677 dunkaist 49
    cmp  ah, [shortcut_increase]
50
     jne @f
51
      call      Increase_geometry
52
     jmp .redraw
53
  @@:
54
    cmp  ah, [shortcut_decrease]
55
     jne @f
56
      call      Decrease_geometry
57
     jmp .redraw
58
  @@:
1518 dunkaist 59
 
1522 dunkaist 60
     jmp .still
1518 dunkaist 61
 
62
;;---Pause_mode----------------------------------------------------------------------------------------------------------------
63
 
64
 
65
;;===Some_functions============================================================================================================
66
 
67
Draw_pause_picture:
68
    ;;===Draw_pause_picture========================================================================================================
69
 
1566 dunkaist 70
    mov  ax,  2*0x100+24
1522 dunkaist 71
    mov  cx,  4*0x100+6
1518 dunkaist 72
    mov  edx, [pause_picture_color]
1522 dunkaist 73
    mov  esi, picture_pause
1518 dunkaist 74
      call      Draw_picture
75
 
76
    ret
77
 
78
    ;;---Draw_pause_picture--------------------------------------------------------------------------------------------------------
79
 
80
 
81
Draw_pause_strings:
82
    ;;===Draw_pause_strings================================================================================================
83
 
1522 dunkaist 84
    mov  ebx, [window_width]
85
    shr  ebx, 1
1566 dunkaist 86
    sub  ebx, string_resume_space.size*3+6
1522 dunkaist 87
    shl  ebx, 16
88
    add  ebx, dword[bottom_middle_strings]
89
      mcall     4, ,[navigation_strings_color],string_resume_space ; Show 'RESUME - SPACE' string
1518 dunkaist 90
 
91
    call    Draw_menu_esc                       ; Show 'MENU - ESC' string
92
 
93
 
94
    ret
95
 
96
    ;;---Draw_pause_strings------------------------------------------------------------------------------------------------
97
 
98
;;---Some_functions------------------------------------------------------------------------------------------------------------