Subversion Repositories Kolibri OS

Rev

Rev 131 | Rev 205 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 131 Rev 180
Line 40... Line 40...
40
 
40
 
41
UP_KEY equ 130+48
41
UP_KEY equ 130+48
42
DOWN_KEY equ 129+48
42
DOWN_KEY equ 129+48
43
LEFT_KEY equ 128+48
43
LEFT_KEY equ 128+48
44
RIGHT_KEY equ 131+48
44
RIGHT_KEY equ 131+48
Line 45... Line 45...
45
BACKGROUND equ 03000080h
45
;BACKGROUND equ 03000080h
Line 46... Line 46...
46
 
46
 
Line 218... Line 218...
218
    cmp  ah,3                   ; button id=3 ? ///Wildwest's  'Pause' button
218
    cmp  ah,3                   ; button id=3 ? ///Wildwest's  'Pause' button
219
    jz  pause_program
219
    jz  pause_program
220
    jmp still
220
    jmp still
Line 221... Line 221...
221
 
221
 
222
end_program:
222
end_program:
223
    mov  eax,0xffffffff         ; close this program
223
    mov  eax,-1                ; close this program
Line 224... Line 224...
224
    int  0x40
224
    int  0x40
225
 
225
 
226
go_new_game:
226
go_new_game:
Line 239... Line 239...
239
;   *******  WINDOW DEFINITIONS AND DRAW ********
239
;   *******  WINDOW DEFINITIONS AND DRAW ********
240
;   *********************************************
240
;   *********************************************
241
draw_window:
241
draw_window:
Line -... Line 242...
-
 
242
 
-
 
243
 
-
 
244
    mov  eax,48
-
 
245
    mov  ebx,3
-
 
246
    mov  ecx,sc
-
 
247
    mov  edx,sizeof.system_colors
242
 
248
    int  0x40
243
 
249
 
244
    mov  eax,12                    ; function 12:tell os about windowdraw
250
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 245... Line 251...
245
    mov  ebx,1                     ; 1, start of draw
251
    mov  ebx,1                     ; 1, start of draw
246
    int  0x40
252
    int  0x40
247
 
253
 
248
                                 ; DRAW WINDOW
254
                                 ; DRAW WINDOW
249
  mov  eax,0                     ; function 0 : define and draw window
255
  xor  eax,eax                   ; function 0 : define and draw window
250
  mov  ebx,320*65536+(LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2
256
  mov  ebx,320*65536+(LEN_X-BORDER_LEFT-BORDER_RIGHT)*ADOBE_SIZE+X_LOCATION*2
251
  mov  ecx,25*65536+ (LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION+30
257
  mov  ecx,25*65536+ (LEN_Y-BORDER_TOP-BORDER_BOTTOM)*ADOBE_SIZE+Y_LOCATION+30
252
  mov  edx,BACKGROUND            ; color of work area RRGGBB
258
  mov  edx,[sc.work]             ; color of work area RRGGBB
Line 253... Line -...
253
  mov  esi,0x006688ee;99bbff            ; color of grab bar  RRGGBB,8->col
-
 
254
  mov  edi,0x007799ff;99bbee            ; color of frames    RRGGBB
-
 
255
  int  0x40
-
 
256
 
-
 
257
                                    ; WINDOW LABEL
-
 
258
    mov  eax,4                      ; function 4 : write text to window
-
 
259
    mov  ebx,8*65536+8              ; [x start] *65536 + [y start]
-
 
260
    mov  ecx,0x10ffffff             ; color of text RRGGBB
-
 
261
    mov  edx,labelt                 ; pointer to text beginning
-
 
262
    mov  esi,labellen-labelt        ; text length
-
 
263
    int  0x40
-
 
264
 
-
 
265
                                   ; CLOSE BUTTON
-
 
266
;    mov  eax,8                     ; function 8 : define and draw button
-
 
267
;    mov  ebx,243*65536+12          ; [x start] *65536 + [x size]
-
 
Line 268... Line 259...
268
;    mov  ecx,5*65536+12            ; [y start] *65536 + [y size]
259
  or   edx,0x13000000
269
;    mov  edx,1                     ; button id
260
  mov  edi,header                ; WINDOW LABEL
270
;    mov  esi,0x5580cc;22aacc              ; button color RRGGBB
261
  int  0x40
271
;    int  0x40
262
 
272
 
263
                                    
273
    mov eax,8
264
    mov eax,8
274
    mov ebx,30*65536+102
265
    mov ebx,30*65536+100
275
    mov ecx,378*65536+18
266
    mov ecx,378*65536+18
276
    mov edx,2
267
    mov edx,2
277
    mov esi,0xA24466;5580cc;22aacc
268
    mov esi,[sc.work_button]
278
    int 0x40
269
    int 0x40
279
;/////////////////////////////////////////////// Wildwest's  'Pause' button
270
;/////////////////////////////////////////////// Wildwest's  'Pause' button
280
    mov eax,8
271
    ;mov eax,8
Line 281... Line 272...
281
    mov ebx,132*65536+102
272
    mov ebx,132*65536+102
282
    mov ecx,378*65536+18
273
    mov ecx,378*65536+18
283
    mov edx,3
274
    mov edx,3
284
    mov esi,0x0FA0F0;
275
    mov esi,[sc.work_button];
285
    int 0x40
276
    int 0x40
286
 
277
 
287
    mov  eax,4                      ; function 4 : write text to window
278
    mov  eax,4                      ; function 4 : write text to window
288
    mov  ebx,164*65536+384             ; [x start] *65536 + [y start]
279
    mov  ebx,164*65536+384          ; [x start] *65536 + [y start]
289
    mov  ecx,0x10ffffff             ; color of text RRGGBB
280
    mov  ecx,[sc.work_button_text]  ; color of text RRGGBB
290
    mov  edx,labe                ; pointer to text beginning
-
 
291
    mov  esi,labelen-labe       ; text length
-
 
292
    int  0x40
281
    or   ecx,0x90000000
293
;///////////////////////////////////////////////
-
 
294
    mov eax,4
282
    mov  edx,labe                   ; pointer to text
295
    mov ebx,49*65536+384
-
 
296
    xor ecx,ecx
283
    int  0x40
Line 297... Line 284...
297
    mov ecx,0x10ffffff
284
;///////////////////////////////////////////////
298
    mov edx,game_finished
285
    ;mov eax,4
Line 299... Line 286...
299
    mov esi,size_of_game_finished-game_finished
286
    mov ebx,49*65536+384
300
    int 0x40
287
    mov edx,game_finished
301
 
288
    int 0x40
-
 
289
    call draw_table
302
    call draw_table
290
 
303
 
-
 
304
    movzx edx,byte [current_block_color]
291
    movzx edx,byte [current_block_color]
305
    call draw_block
292
    call draw_block
Line 306... Line 293...
306
 
293
 
Line 452... Line 439...
452
              ;  pusha
439
              ;  pusha
453
              ;  mov eax,5
440
              ;  mov eax,5
454
              ;  mov ebx,10
441
              ;  mov ebx,10
455
              ;  int 0x40
442
              ;  int 0x40
456
              ;  popa
443
              ;  popa
457
                mov ax,13
444
                mov eax,13
458
                movzx edx,byte [esi]
445
                movzx edx,byte [esi]
459
                mov edx,[color_table+edx*4]
446
                mov edx,[color_table+edx*4]
460
                int 0x40
447
                int 0x40
461
                call draw_frames
448
                call draw_frames
462
                inc esi
449
                inc esi
Line 653... Line 640...
653
;--------------------------------------------------------------
640
;--------------------------------------------------------------
654
write_score:
641
write_score:
655
    mov  eax,[score]
642
    mov  eax,[score]
656
    call number_to_str
643
    call number_to_str
Line 657... Line 644...
657
 
644
 
658
    mov  ebx,100*65536+100         ;clear box to write new score
645
    mov  ebx,90*65536+35          ; draw info text with function 4
659
    mov  ecx,35*65536+15
646
    mov  ecx,[sc.work_text]        ; color
660
    mov  edx,BACKGROUND
-
 
661
    mov  eax,13
-
 
662
    int  40h
-
 
663
 
-
 
664
    mov  ebx,100*65536+35          ; draw info text with function 4
-
 
665
    mov  ecx,0xffff00              ; color
647
    or   ecx,0x50000000    
666
    mov  edx,number_str
648
    mov  edx,number_str
-
 
649
    mov  esi,[size_of_number_str]
667
    mov  esi,[size_of_number_str]
650
    mov  edi,[sc.work]
668
    mov  eax,4
651
    mov  eax,4
669
    int  0x40
652
    int  0x40
Line 670... Line 653...
670
    ret
653
    ret
Line 840... Line 823...
840
    dd k_block_0
823
    dd k_block_0
841
    dd k_block_1
824
    dd k_block_1
Line 842... Line 825...
842
 
825
 
Line 843... Line -...
843
if lang eq ru
-
 
844
 
826
if lang eq ru
845
  labelt:
-
 
846
         db '’…’ˆ‘ 1.6 - ‘’…‹Šˆ ˆ Ž…‹'
-
 
847
  labellen:
827
 
848
  labe:
-
 
849
         db '€“‡€'
828
  header         db '’…’ˆ‘ 1.61 - ‘’…‹Šˆ ˆ Ž…‹',0
850
  labelen:
829
  labe           db '€“‡€',0
851
  text:                 db 'Žçª¨:  '
-
 
Line 852... Line 830...
852
  game_finished:        db ' €—€’œ'
830
  text           db 'Žçª¨:',0
Line 853... Line -...
853
  size_of_game_finished:
-
 
854
 
831
  game_finished: db 'Ž‚€Ÿ',0
855
else
-
 
856
 
-
 
857
  labelt:
832
 
858
         db 'TETRIS 1.6 - ARROWS & SPACE'
-
 
859
  labellen:
833
else
860
  labe:
834
 
861
         db 'PAUSE'
-
 
Line 862... Line 835...
862
  labelen:
835
  header         db 'TETRIS 1.61 - ARROWS & SPACE',0
Line 863... Line 836...
863
  text:                 db 'Score: '
836
  labe           db 'PAUSE',0
864
  game_finished:        db 'NEW GAME'
837
  text           db 'Score:',0
Line 878... Line 851...
878
current_block_color:    db 0
851
current_block_color:    db 0
879
number_str:             db 0,0,0,0,0,0,0,0,0
852
number_str:             db 0,0,0,0,0,0,0,0,0
880
end_number_str:
853
end_number_str:
881
size_of_number_str      dd 9
854
size_of_number_str      dd 9
882
delay:                  db 40
855
delay:                  db 40
-
 
856
sc     system_colors
883
table_tetris:
857
table_tetris:
Line 884... Line 858...
884
 
858
 
-
 
859
I_END: