Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 684 → Rev 685

/programs/games/tetris/trunk/tetris.asm
57,9 → 57,8
dd I_END+1024 ; reguired amount of memory
dd I_END+1024 ; esp
dd 0x0,0x0 ; I_PARAM, I_ICON
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'macros.inc'
 
 
START: ; start of execution
68,7 → 67,7
; -- quickcode - start
 
mov eax,3
mcall
int 0x40
mov cl,16
ror eax,cl ; to make seconds more significant
mov [generator],eax
88,7 → 87,7
attesa:
 
mov eax,11 ; get event
mcall
int 0x40
 
cmp eax,1 ; redraw request ?
jz red
126,7 → 125,7
call draw_block
mov eax,5
movzx ebx,byte [delay]
mcall
int 0x40
jmp still
 
block_crash: dec dword [current_block_y]
141,7 → 140,7
call check_crash
jz adr400
aspetta: mov eax,10
mcall
int 0x40
cmp eax,1
jne adr10000
call draw_window
148,7 → 147,7
adr10000: cmp eax,3
jne aspetta
new_game: mov eax,17
mcall
int 0x40
cmp ah,1
jnz adr401
jmp end_program
165,12 → 164,19
call draw_block
mov eax,5
movzx ebx,byte [delay]
mcall
int 0x40
jmp still
 
key: mov eax,2
mcall
int 0x40
cmp eax,1
jne getkeyi
mov ah,dh
jmp adr32
 
getkeyi: mov dh,ah
jmp key
 
adr32: cmp ah,LEFT_KEY
jne adr_30
dec dword [current_block_x]
211,7 → 217,7
 
button: ; button
mov eax,17
mcall
int 0x40
cmp ah,1 ; button id=1 ?
jz end_program
cmp ah,2
222,7 → 228,7
 
end_program:
or eax,-1 ; close this program
mcall
int 0x40
 
go_new_game:
jmp new_game
246,11 → 252,11
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
mcall
int 0x40
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
int 0x40
 
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
257,9 → 263,9
mov ebx,320*65536+(LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2
mov ecx,25*65536+ (LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION+30
mov edx,[sc.work] ; color of work area RRGGBB
or edx,0x14000000
mov edi,title ; WINDOW LABEL
mcall
or edx,0x13000000
mov edi,header ; WINDOW LABEL
int 0x40
 
mov eax,8
267,7 → 273,7
mov ecx,378*65536+18
mov edx,2
mov esi,[sc.work_button]
mcall
int 0x40
;/////////////////////////////////////////////// Wildwest's 'Pause' button
;mov eax,8
mov ebx,132*65536+102
274,7 → 280,7
mov ecx,378*65536+18
mov edx,3
mov esi,[sc.work_button];
mcall
int 0x40
 
mov eax,4 ; function 4 : write text to window
mov ebx,164*65536+384 ; [x start] *65536 + [y start]
281,12 → 287,12
mov ecx,[sc.work_button_text] ; color of text RRGGBB
or ecx,0x90000000
mov edx,labe ; pointer to text
mcall
int 0x40
;///////////////////////////////////////////////
;mov eax,4
mov ebx,49*65536+384
mov edx,game_finished
mcall
int 0x40
call draw_table
 
movzx edx,byte [current_block_color]
298,13 → 304,13
or ecx,0x90000000
mov edx,text
mov eax,4
mcall
int 0x40
 
call write_score
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
int 0x40
 
ret
 
440,12 → 446,12
; pusha
; mov eax,5
; mov ebx,10
; mcall
; int 0x40
; popa
mov eax,13
movzx edx,byte [esi]
mov edx,[color_table+edx*4]
mcall
int 0x40
call draw_frames
inc esi
add ebx,65536*ADOBE_SIZE
494,7 → 500,7
adr_121: cmp byte [edi],0
je adr_120
 
mcall
int 040h
 
call draw_frames
 
518,7 → 524,7
mov bx,1
add edx,0x282828
mov eax,13
mcall
int 0x40
popa
 
pusha
525,7 → 531,7
mov cx,1
add edx,0x282828
mov eax,13
mcall
int 0x40
popa
 
pusha
537,7 → 543,7
shr edx,1
and edx,0x7f7f7f
mov eax,13
mcall
int 0x40
popa
 
pusha
549,7 → 555,7
shr edx,1
and edx,0x7f7f7f
mov eax,13
mcall
int 0x40
popa
 
ret
619,7 → 625,7
push ebx
mov eax,26
mov ebx,9
mcall
int 0x40
pop ebx
xor eax,0xdeadbeef
add eax,[generator]
650,7 → 656,7
mov esi,[size_of_number_str]
mov edi,[sc.work]
mov eax,4
mcall
int 0x40
ret
 
; DATA AREA
826,7 → 832,7
 
if lang eq ru
 
title db '’…’ˆ‘ 1.61 - ‘’…‹Šˆ ˆ Ž…‹',0
header db '’…’ˆ‘ 1.61 - ‘’…‹Šˆ ˆ Ž…‹',0
labe db '€“‡€',0
text db 'Žçª¨:',0
game_finished: db 'Ž‚€Ÿ',0
833,7 → 839,7
 
else
 
title db 'TETRIS 1.61 - ARROWS & SPACE',0
header db 'TETRIS 1.61 - ARROWS & SPACE',0
labe db 'PAUSE',0
text db 'Score:',0
game_finished: db 'NEW GAME',0