Rev 1522 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1518 | dunkaist | 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_window: |
||
12 | mcall 12,1 |
||
13 | mcall 0,200*65536+WINDOW_WIDTH,326*65536+WINDOW_HEIGHT,[window_style], ,window_title |
||
14 | |||
15 | call Draw_decorations |
||
16 | call Draw_first_menu_picture |
||
17 | call Draw_menu_strings |
||
18 | |||
19 | mcall 12,2 |
||
20 | |||
21 | Wait_for_event: |
||
22 | mcall 10 ; wait for event |
||
23 | ; ok, what an event? |
||
24 | dec al ; has the window been moved or resized? |
||
25 | jz Redraw_window ; |
||
26 | dec al ; was a key pressed? |
||
27 | jz Is_key ; |
||
28 | |||
29 | |||
30 | Is_button: ; a button was pressed |
||
31 | mcall 17 ; get button number |
||
32 | shr eax, 8 ; we should do it to get the real button code |
||
33 | |||
34 | cmp eax, 1 ; is it close button? |
||
35 | je Exit ; if so, jump to quit... |
||
36 | |||
37 | jmp Wait_for_event ; jump to wait for another event |
||
38 | |||
39 | |||
40 | Is_key: ; a key was pressed |
||
41 | mcall 2 ; get keycode |
||
42 | |||
43 | cmp ah, 0x1B ; Escape |
||
44 | je Exit |
||
45 | cmp ah, 0x0D ; Enter |
||
46 | je Level_begin |
||
47 | cmp ah, 0x20 ; Space |
||
48 | je Level_begin |
||
49 | |||
50 | jmp Wait_for_event ; jump to wait for another event |
||
51 | |||
52 | ;;---First_menu_mode----------------------------------------------------------------------------------------------------------- |
||
53 | |||
54 | |||
55 | ;;===Some_functions============================================================================================================ |
||
56 | |||
57 | Draw_first_menu_picture: |
||
58 | ;;===Draw_first_menu_picture================================================================================================ |
||
59 | |||
60 | mov al, 5 |
||
61 | mov bh, 0 |
||
62 | mov ecx, picture_first_menu_snake |
||
63 | mov edx, [snake_picture_color] |
||
64 | call Draw_picture |
||
65 | |||
66 | mov al, 4 |
||
67 | mov bh, 7 |
||
68 | mov ecx, picture_first_menu_version |
||
69 | mov edx, [version_picture_color] |
||
70 | call Draw_picture |
||
71 | |||
72 | ret |
||
73 | |||
74 | ;;---Draw_first_menu_picture------------------------------------------------------------------------------------------------ |
||
75 | |||
76 | |||
77 | Draw_menu_strings: |
||
78 | ;;===Make_menu_strings========================================================================================= |
||
79 | |||
80 | mcall 4,153*65536+BOTTOM_MIDDLE_STRINGS,[navigation_strings_color],press_to_start |
||
81 | mcall ,213*65536+TOP_STRINGS,[navigation_strings_color],press_esc_to_exit |
||
82 | ; mcall ,406*65536+TOP_STRINGS,[navigation_strings_color],press_F2_to_options |
||
83 | |||
84 | ret |
||
85 | |||
86 | ;;---Make_menu_strings----------------------------------------------------------------------------------------- |
||
87 | |||
88 | ;;---Some_functions------------------------------------------------------------------------------------------------------------ |