Rev 1518 | Rev 1566 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1518 | Rev 1522 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | mov word[snake_dots], 0x0303 |
6 | mov word[snake_dots], 0x0303 |
7 | mov dword[snake_dots+2], 0x03050304 |
7 | mov dword[snake_dots+2], 0x03050304 |
8 | mov [snake_napravlenie], 3 |
8 | mov [snake_napravlenie], 3 |
9 | mov [snake_napravlenie_next], 3 |
9 | mov [snake_napravlenie_next], 3 |
Line 10... | Line 10... | ||
10 | 10 | ||
11 | Redraw_window: |
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 |
|
12 | mcall 12,1 |
18 | add ecx, dword[window_height] |
Line 13... | Line 19... | ||
13 | mcall 0,200*65536+WINDOW_WIDTH,326*65536+WINDOW_HEIGHT,[window_style], ,window_title |
19 | mcall 0, , ,[window_style], ,window_title |
14 | 20 | ||
15 | call Draw_decorations |
21 | call Draw_decorations |
Line 16... | Line 22... | ||
16 | call Draw_first_menu_picture |
22 | call Draw_first_menu_picture |
Line 17... | Line 23... | ||
17 | call Draw_menu_strings |
23 | call Draw_menu_strings |
18 | 24 | ||
19 | mcall 12,2 |
25 | mcall 12,2 |
20 | 26 | ||
21 | Wait_for_event: |
27 | .still: |
22 | mcall 10 ; wait for event |
28 | mcall 10 ; wait for event |
23 | ; ok, what an event? |
29 | ; ok, what an event? |
Line 24... | Line 30... | ||
24 | dec al ; has the window been moved or resized? |
30 | dec al ; has the window been moved or resized? |
25 | jz Redraw_window ; |
31 | jz .redraw ; |
26 | dec al ; was a key pressed? |
32 | dec al ; was a key pressed? |
Line 27... | Line 33... | ||
27 | jz Is_key ; |
33 | jz .key ; |
28 | 34 | ||
Line 29... | Line 35... | ||
29 | 35 | ||
Line 30... | Line 36... | ||
30 | Is_button: ; a button was pressed |
36 | .button: ; a button was pressed |
31 | mcall 17 ; get button number |
37 | mcall 17 ; get button number |
Line 32... | Line 38... | ||
32 | shr eax, 8 ; we should do it to get the real button code |
38 | shr eax, 8 ; we should do it to get the real button code |
33 | 39 | ||
34 | cmp eax, 1 ; is it close button? |
40 | cmp eax, 1 ; is it close button? |
35 | je Exit ; if so, jump to quit... |
41 | je Exit ; if so, jump to quit... |
36 | 42 | ||
37 | jmp Wait_for_event ; jump to wait for another event |
43 | jmp .still ; jump to wait for another event |
Line 38... | Line 44... | ||
38 | 44 | ||
Line 39... | Line 45... | ||
39 | 45 | ||
Line 40... | Line 46... | ||
40 | Is_key: ; a key was pressed |
46 | .key: ; a key was pressed |
Line 41... | Line 47... | ||
41 | mcall 2 ; get keycode |
47 | mcall 2 ; get keycode |
42 | 48 | ||
Line 43... | Line 49... | ||
43 | cmp ah, 0x1B ; Escape |
49 | cmp ah, 0x1B ; Escape |
44 | je Exit |
50 | je Exit |
45 | cmp ah, 0x0D ; Enter |
- | |
46 | je Level_begin |
51 | cmp ah, 0x0D ; Enter |
- | 52 | je Level_begin |
|
47 | cmp ah, 0x20 ; Space |
53 | cmp ah, 0x20 ; Space |
Line 48... | Line 54... | ||
48 | je Level_begin |
54 | je Level_begin |
49 | 55 | ||
50 | jmp Wait_for_event ; jump to wait for another event |
- | |
51 | 56 | jmp .still ; jump to wait for another event |
|
- | 57 | ||
52 | ;;---First_menu_mode----------------------------------------------------------------------------------------------------------- |
58 | ;;---First_menu_mode----------------------------------------------------------------------------------------------------------- |
Line 53... | Line 59... | ||
53 | 59 | ||
Line 54... | Line 60... | ||
54 | 60 | ||
Line 55... | Line 61... | ||
55 | ;;===Some_functions============================================================================================================ |
61 | ;;===Some_functions============================================================================================================ |
56 | 62 | ||
Line -... | Line 63... | ||
- | 63 | Draw_first_menu_picture: |
|
- | 64 | ;;===Draw_first_menu_picture================================================================================================ |
|
- | 65 | ||
- | 66 | mov ax, 0*0x100+29 |
|
- | 67 | mov cx, 1*0x100+6 |
|
57 | Draw_first_menu_picture: |
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 |
|
58 | ;;===Draw_first_menu_picture================================================================================================ |
74 | mov edx, [version_picture_color] |
59 | 75 | mov esi, picture_first_menu_version |
|
Line 60... | Line 76... | ||
60 | mov al, 5 |
76 | call Draw_picture |
Line 61... | Line 77... | ||
61 | mov bh, 0 |
77 |