Subversion Repositories Kolibri OS

Rev

Rev 4609 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4609 Rev 6166
Line 24... Line 24...
24
;              BTW, you can MOVE and ROTATE block during Pause ;)  - Sergey Kuzmin aka Wildwest
24
;              BTW, you can MOVE and ROTATE block during Pause ;)  - Sergey Kuzmin aka Wildwest
25
; 03.11.2003 - added new blocks & random - Ivan Poddubny
25
; 03.11.2003 - added new blocks & random - Ivan Poddubny
26
; 31.10.2001 - rdtsc replaced            - quickcode 
26
; 31.10.2001 - rdtsc replaced            - quickcode 
27
; 28.06.2001 - fasm port & framed blocks - Ville Turjanmaa
27
; 28.06.2001 - fasm port & framed blocks - Ville Turjanmaa
28
; 
28
; 
29
;
-
 
Line 30... Line 29...
30
 
29
 
31
LEN_X equ 19  ;width of table
30
LEN_X equ 19  ;width of table
32
LEN_Y equ 29  ; height of table
31
LEN_Y equ 29  ; height of table
33
BORDER_LEFT equ 1
32
BORDER_LEFT equ 1
Line 252... Line 251...
252
;   *********************************************
251
;   *********************************************
253
;   *******  WINDOW DEFINITIONS AND DRAW ********
252
;   *******  WINDOW DEFINITIONS AND DRAW ********
254
;   *********************************************
253
;   *********************************************
255
draw_window:
254
draw_window:
Line 256... Line -...
256
 
-
 
257
 
-
 
258
    mov  eax,48
-
 
259
    mov  ebx,3
-
 
260
    mov  ecx,sc
255
 
261
    mov  edx,sizeof.system_colors
-
 
262
    int  0x40
-
 
263
 
-
 
264
    mov  eax,12                    ; function 12:tell os about windowdraw
-
 
265
    mov  ebx,1                     ; 1, start of draw
256
  mcall 48,3,sc,sizeof.system_colors
266
    int  0x40
-
 
267
 
257
  mcall 12,1
268
                                 ; DRAW WINDOW
258
  ; DRAW WINDOW
269
  xor  eax,eax                   ; function 0 : define and draw window
259
  xor  eax,eax                   ; function 0 : define and draw window
270
  mov  ebx,320*65536+(LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2
260
  mov  ebx,320*65536+(LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2
271
  mov  ecx,25*65536+ (LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION+30
261
  mov  ecx,25*65536+ (LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION+36
272
  mov  edx,[sc.work]             ; color of work area RRGGBB
262
  mov  edx,[sc.work]             ; color of work area RRGGBB
273
  or   edx,0x13000000
263
  or   edx,0x13000000
274
  mov  edi,title                 ; WINDOW LABEL
264
  mov  edi,title                 ; WINDOW LABEL
Line 275... Line -...
275
  int  0x40
-
 
276
 
-
 
277
                                    
265
  int  0x40
278
    mov eax,8
-
 
279
    mov ebx,30*65536+100
-
 
280
    mov ecx,378*65536+18
266
 
281
    mov edx,2
-
 
282
    mov esi,[sc.work_button]
267
    mcall 8, 30*65536+100,378*65536+22,2,[sc.work_button] ;new game
283
    int 0x40
-
 
284
;/////////////////////////////////////////////// Wildwest's  'Pause' button
-
 
285
    ;mov eax,8
-
 
286
    mov ebx,132*65536+102
-
 
287
    mov ecx,378*65536+18
-
 
288
    mov edx,3
-
 
Line 289... Line 268...
289
    mov esi,[sc.work_button];
268
	mcall  ,132*65536+102,            ,3 ;Wildwest's  'Pause' button
290
    int 0x40
269
;///////////////////////////////////////////////
291
 
270
 
292
    mov  eax,4                      ; function 4 : write text to window
271
    mov  eax,4                      ; function 4 : write text to window
293
    mov  ebx,164*65536+384          ; [x start] *65536 + [y start]
272
    mov  ebx,164*65536+383          ; [x start] *65536 + [y start]
294
    mov  ecx,[sc.work_button_text]  ; color of text RRGGBB
273
    mov  ecx,[sc.work_button_text]  ; color of text RRGGBB
295
    or   ecx,0x90000000
274
    or   ecx,0x90000000
296
    mov  edx,labe                   ; pointer to text
275
    mov  edx,labe                   ; pointer to text
297
    int  0x40
276
    int  0x40
298
;///////////////////////////////////////////////
277
;///////////////////////////////////////////////
299
    ;mov eax,4
278
    ;mov eax,4
300
    mov ebx,49*65536+384
279
    mov ebx,49*65536+383
Line 301... Line 280...
301
    mov edx,game_finished
280
    mov edx,game_finished
302
    int 0x40
281
    int 0x40
Line 303... Line 282...
303
    call draw_table
282
    call draw_table
304
 
283
 
305
    movzx edx,byte [current_block_color]
284
    movzx edx,byte [current_block_color]
306
    call draw_block
285
    call draw_block
307
 
286
 
308
    cld
287
    cld
309
    mov  ebx,38*65536+35           ; draw info text with function 4
288
    mov  ebx,38*65536+32           ; draw info text with function 4
Line 656... Line 635...
656
;--------------------------------------------------------------
635
;--------------------------------------------------------------
657
write_score:
636
write_score:
658
    mov  eax,[score]
637
    mov  eax,[score]
659
    call number_to_str
638
    call number_to_str
Line 660... Line 639...
660
 
639
 
661
    mov  ebx,90*65536+35          ; draw info text with function 4
640
    mov  ebx,90*65536+32          ; draw info text with function 4
662
    mov  ecx,[sc.work_text]        ; color
641
    mov  ecx,[sc.work_text]        ; color
663
    or   ecx,0x50000000    
642
    or   ecx,0x50000000    
664
    mov  edx,number_str
643
    mov  edx,number_str
665
    mov  esi,[size_of_number_str]
644
    mov  esi,[size_of_number_str]
Line 839... Line 818...
839
    dd k_block_0
818
    dd k_block_0
840
    dd k_block_1
819
    dd k_block_1
Line 841... Line 820...
841
 
820
 
Line 842... Line 821...
842
if lang eq ru
821
if lang eq ru
843
 
822
 
844
  title          db '’…’ˆ‘ 1.61 - ‘’…‹Šˆ ˆ Ž…‹',0
823
  title          db '’¥âà¨á 1.62',0
845
  labe           db '€“‡€',0
824
  labe           db '€“‡€',0
Line 846... Line 825...
846
  text           db 'Žçª¨:',0
825
  text           db 'Žçª¨:',0
Line 847... Line 826...
847
  game_finished: db '  Ž‚€Ÿ',0
826
  game_finished: db '  Ž‚€Ÿ',0
848
 
827
 
849
else if lang eq et
828
else if lang eq et
850
 
829
 
Line 851... Line 830...
851
  title          db 'TETRIS 1.61 - NOOLED & TÜHIK',0
830
  title          db 'Tetris 1.62',0
Line 852... Line 831...
852
  labe           db 'PAUS',0
831
  labe           db 'PAUS',0
853
  text           db 'Tulemus:',0
832
  text           db 'Tulemus:',0
854
  game_finished: db 'UUS MÄNG',0
833
  game_finished: db 'UUS MÄNG',0
855
 
834
 
Line 856... Line 835...
856
else
835
else