Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3905 → Rev 3904

/programs/games/pipes/pipes.asm
1,6 → 1,6
;
; pipes kolibri
; v1.21
; pipes for menuet {and now kolibri}
; v1.2
; 2006 by Mario Birkner
;
; l.mod. 27.08.06/15:11
28,10 → 28,15
dd 0x0 , 0x0 ; I_Param , I_Icon
 
START: ; start of execution
jmp red
 
call draw_window
call draw_board
 
still:
mcall 10 ; wait here for event
 
mov eax,10 ; wait here for event
mcall
 
cmp eax,1 ; redraw request ?
je red
cmp eax,2 ; key in buffer ?
38,6 → 43,7
je key
cmp eax,3 ; button in buffer ?
je button
 
jmp still
 
red: ; redraw
47,7 → 53,8
jmp still
 
key: ; key
mcall 2 ; just read it and ignore
mov eax,2 ; just read it and ignore
mcall
jmp still
button: ; button
call get_input
57,11 → 64,14
 
get_input:
pusha
mcall 17 ; get id
mov eax,17 ; get id
mcall
 
cmp ah,1 ; button id=1 ?
jne .noclose
mcall -1 ; close this program
 
mov eax,-1 ; close this program
mcall
.noclose:
cmp ah,4
jne .moderate
445,6 → 455,8
pusha
cmp [stat],0
je .nomessage
cmp [stat],3
je .nomessage
mov eax,13
mov ebx,146 shl 16 + 200
mov ecx,190 shl 16 + 40
455,18 → 467,6
mov edx,fgcolor
mcall
 
cmp [stat],3
jne .stat1
mov eax,4
mov ebx,174 shl 16 +206
mov edx,lbl_start_a_new_game+1
movzx esi,byte [lbl_start_a_new_game]
mov ecx,btcolor
add ecx,0x10000000
mcall
jmp .nomessage
 
.stat1:
cmp [stat],1
je .winmessage
mov eax,4
521,7 → 521,9
add edx,9 ;button-id = map-pos + 10;gen_image inkrements
add edx,0x80000000 ;first delete previous button
mcall
sub edx,0x30000000 ;first delete previous button
movsx edx, byte [map]
add edx,9 ;button-id = map-pos + 10;gen_image inkrements
add edx,0x50000000 ;no button image - no esi need
mcall
pop edx
push ebx
550,8 → 552,11
draw_window:
pusha
 
mcall 12,1
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+492 ; [x start] *65536 + [x size]
mov ecx,100*65536+420 ; [y start] *65536 + [y size]
583,13 → 588,15
mov edx,lbl_score+1
movsx esi, byte [lbl_score]
mcall
mov ebx,340 shl 16 +405
mov ebx,350 shl 16 +405
mov ecx,fg3color
mov edx,lbl_copy+1
movsx esi,byte [lbl_copy]
mcall
 
mcall 12,2
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
 
popa
ret
598,13 → 605,10
; DATA AREA
 
 
title db 'Pipes',0
title db 'PIPES',0
lbl_gameover:
db 19
db 'G a m e O v e r !'
lbl_start_a_new_game:
db 22
db 'Start a new game first'
lbl_win:
db 32
db ' G r e a t ! '
616,8 → 620,8
db 43
db 'New Game: Easy Moderate Hard'
lbl_copy:
db 24
db 'v1.21 2006,Mario Birkner'
db 23
db 'v1.2 2006,Mario Birkner'
lbl_score:
db 28
db 'Time: Score: Level:'