Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1521 → Rev 1522

/programs/games/snake/trunk/first_menu.asm
8,9 → 8,15
mov [snake_napravlenie], 3
mov [snake_napravlenie_next], 3
 
Redraw_window:
.redraw:
mcall 12,1
mcall 0,200*65536+WINDOW_WIDTH,326*65536+WINDOW_HEIGHT,[window_style], ,window_title
mov ebx, [wp_x]
shl ebx, 16
add ebx, dword[window_width]
mov ecx, [wp_y]
shl ecx, 16
add ecx, dword[window_height]
mcall 0, , ,[window_style], ,window_title
 
call Draw_decorations
call Draw_first_menu_picture
18,16 → 24,16
 
mcall 12,2
 
Wait_for_event:
.still:
mcall 10 ; wait for event
; ok, what an event?
dec al ; has the window been moved or resized?
jz Redraw_window ;
jz .redraw ;
dec al ; was a key pressed?
jz Is_key ;
jz .key ;
 
 
Is_button: ; a button was pressed
.button: ; a button was pressed
mcall 17 ; get button number
shr eax, 8 ; we should do it to get the real button code
 
34,10 → 40,10
cmp eax, 1 ; is it close button?
je Exit ; if so, jump to quit...
 
jmp Wait_for_event ; jump to wait for another event
jmp .still ; jump to wait for another event
 
 
Is_key: ; a key was pressed
.key: ; a key was pressed
mcall 2 ; get keycode
 
cmp ah, 0x1B ; Escape
47,7 → 53,7
cmp ah, 0x20 ; Space
je Level_begin
 
jmp Wait_for_event ; jump to wait for another event
jmp .still ; jump to wait for another event
 
;;---First_menu_mode-----------------------------------------------------------------------------------------------------------
 
57,16 → 63,16
Draw_first_menu_picture:
;;===Draw_first_menu_picture================================================================================================
 
mov al, 5
mov bh, 0
mov ecx, picture_first_menu_snake
mov ax, 0*0x100+29
mov cx, 1*0x100+6
mov edx, [snake_picture_color]
mov esi, picture_first_menu_snake
call Draw_picture
 
mov al, 4
mov bh, 7
mov ecx, picture_first_menu_version
mov ax, 9*0x100+11
mov cx, 9*0x100+5
mov edx, [version_picture_color]
mov esi, picture_first_menu_version
call Draw_picture
 
ret
77,8 → 83,18
Draw_menu_strings:
;;===Make_menu_strings=========================================================================================
 
mcall 4,153*65536+BOTTOM_MIDDLE_STRINGS,[navigation_strings_color],press_to_start
mcall ,213*65536+TOP_STRINGS,[navigation_strings_color],press_esc_to_exit
mov ebx, [window_width]
shr ebx, 1
sub ebx, (press_esc_to_exit-press_to_start-1)*3+6
shl ebx, 16
add ebx, dword[bottom_middle_strings]
mcall 4, ,[navigation_strings_color],press_to_start
mov ebx, [window_width]
shr ebx, 1
sub ebx, (string_congratulations-press_esc_to_exit-1)*3+6
shl ebx, 16
add ebx, [top_strings]
mcall , ,[navigation_strings_color],press_esc_to_exit
; mcall ,406*65536+TOP_STRINGS,[navigation_strings_color],press_F2_to_options
 
ret