Subversion Repositories Kolibri OS

Rev

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

Rev 460 Rev 485
Line 10... Line 10...
10
  dd      0x80000       ; reguired amount of memory
10
  dd      0x80000       ; reguired amount of memory
11
  dd      0x80000       ; stack pointer
11
  dd      0x80000       ; stack pointer
12
  dd      I_Param,0
12
  dd      I_Param,0
Line 13... Line 13...
13
 
13
 
14
  include 'lang.inc'
14
  include 'lang.inc'
Line 15... Line 15...
15
  include 'macros.inc'
15
  include '..\..\..\macros.inc'
16
 
16
 
17
START:
17
START:
18
    mov  eax,48
18
    mov  eax,48
Line 29... Line 29...
29
 
29
 
Line 30... Line 30...
30
 
30
 
31
still:
31
still:
-
 
32
 
32
 
33
    mov  eax,10                 ; wait here for event
33
    mov  eax,10                 ; wait here for event
34
    mcall
34
    int  0x40
-
 
35
    cmp  eax,1
-
 
36
    jz   red
35
 
37
    cmp  eax,2
36
    dec  eax
38
    jz   key
-
 
Line 39... Line 37...
39
    cmp  eax,3
37
    jz   red
40
    jz   button
38
    dec  eax
41
    jmp  still
39
    jnz  button
42
 
40
 
Line 43... Line 41...
43
  key:
41
  key:
44
    mov  eax,2
42
    mov  al,2
45
    int  0x40
43
    mcall
Line 46... Line 44...
46
    jmp  still
44
    jmp  still
47
 
45
 
48
  red:
46
  red:
Line 49... Line 47...
49
    call draw_window
47
    call draw_window
50
    jmp  still
-
 
Line 51... Line 48...
51
 
48
    jmp  still
52
  button:
49
 
53
    mov  eax,17
50
  button:
54
    int  0x40
51
    mov  al,17
55
 
52
    mcall
56
    shr  eax,8
53
 
57
    and  eax,255
54
    shr  eax,8
58
 
55
 
59
    cmp  eax,101                ; tiled
56
    cmp  eax,101                ; tiled
60
    jne  no101
57
    jne  no101
61
    mov  eax,15
58
    mov  eax,15
Line 62... Line 59...
62
    mov  ebx,4
59
    mov  ebx,4
63
    mov  ecx,1
60
    mov  ecx,1
64
    int  0x40
61
    mcall
65
    mov  eax,15
62
    mov  eax,15
66
    mov  ebx,3
63
    mov  ebx,3
67
    int  0x40
64
    mcall
68
    jmp  still
65
    jmp  still
69
  no101:
66
  no101:
70
 
67
 
71
    cmp  eax,102               ; stretch
68
    cmp  eax,102               ; stretch
72
    jne  no102
69
    jne  no102
Line 73... Line 70...
73
    mov  eax,15
70
    mov  eax,15
74
    mov  ebx,4
71
    mov  ebx,4
75
    mov  ecx,2
72
    mov  ecx,2
76
    int  0x40
73
    mcall
77
    mov  eax,15
74
    mov  eax,15
Line 78... Line 75...
78
    mov  ebx,3
75
    mov  ebx,3
79
    int  0x40
76
    mcall
80
    jmp  still
77
    jmp  still
81
  no102:
78
  no102:
Line 124... Line 121...
124
 
121
 
125
    mov  eax,15
122
    mov  eax,15
126
    mov  ebx,1
123
    mov  ebx,1
127
    mov  ecx,256
124
    mov  ecx,256
128
    mov  edx,256
125
    mov  edx,256
Line 129... Line 126...
129
    int  0x40
126
    mcall
130
 
127
 
131
    mov  eax,15
128
    mov  eax,15
132
    mov  ebx,5
129
    mov  ebx,5
133
    mov  ecx,0x40000 ; <<< 0x40000 for blue, 0x40000+1 for red,
130
    mov  ecx,0x40000 ; <<< 0x40000 for blue, 0x40000+1 for red,
134
                       ; <<< 0x40000+2 for green background at boot
131
                       ; <<< 0x40000+2 for green background at boot
135
    mov  edx,0
132
    mov  edx,0
Line 136... Line 133...
136
    mov  esi,256*3*256
133
    mov  esi,256*3*256
137
    int  0x40
134
    mcall
138
 
135
 
139
    mov  eax,15
136
    mov  eax,15
Line 140... Line 137...
140
    mov  ebx,4
137
    mov  ebx,4
141
    mov  ecx,2
138
    mov  ecx,2
142
    int  0x40
139
    mcall
Line 143... Line 140...
143
 
140
 
144
    mov  eax,15
141
    mov  eax,15
Line 145... Line 142...
145
    mov  ebx,3
142
    mov  ebx,3
Line 192... Line 189...
192
 
189
 
193
    mov  eax,15
190
    mov  eax,15
194
    mov  ebx,1
191
    mov  ebx,1
195
    mov  ecx,256
192
    mov  ecx,256
196
    mov  edx,256
193
    mov  edx,256
Line 197... Line 194...
197
    int  0x40
194
    mcall
198
 
195
 
199
    mov  eax,15
196
    mov  eax,15
200
    mov  ebx,5
197
    mov  ebx,5
201
    mov  ecx,edi
198
    mov  ecx,edi
202
    mov  edx,0
199
    mov  edx,0
Line 203... Line 200...
203
    mov  esi,256*256*3
200
    mov  esi,256*256*3
204
    int  0x40
201
    mcall
205
 
202
 
Line 206... Line 203...
206
    mov  eax,15
203
    mov  eax,15
Line 207... Line 204...
207
    mov  ebx,3
204
    mov  ebx,3
Line 208... Line 205...
208
    int  0x40
205
    mcall
Line 209... Line 206...
209
 
206
 
Line -... Line 207...
-
 
207
    jmp  still
-
 
208
 
210
    jmp  still
209
 
211
 
210
; colored background
212
 
211
 
213
; colored background
212
bg2:
214
 
213
 
215
bg2:
-
 
216
 
-
 
Line -... Line 214...
-
 
214
    push eax
217
    push eax
215
 
218
 
216
    mcall 15,4,1
Line 219... Line 217...
219
    mov  eax,15
217
 
-
 
218
    mov  eax,15
Line 220... Line -...
220
    mov  ebx,1
-
 
221
    mov  ecx,8
-
 
222
    mov  edx,8
-
 
223
    int  0x40
-
 
224
 
219
    mov  ebx,1
225
    mov  eax,[esp]
220
    mov  ecx,1
226
 
-
 
227
    sub  eax,14
221
    mov  edx,1
228
    shl  eax,2
-
 
229
 
222
    mcall
230
    mov  edx,[colors+eax]
223
 
231
 
-
 
Line 232... Line 224...
232
    mov  esi,32*32*4
224
    pop  eax
233
    mov  edi,0
225
    sub  eax,14
234
    mov  ecx,0
226
    imul eax,3
Line 235... Line 227...
235
  dbl2:
227
 
Line 236... Line 228...
236
    mov  eax,15
228
    mov  ecx,fill
Line 259... Line 251...
259
    mov  ecx,[eax+0]
251
    mov  ecx,[eax+0]
260
    mov  edx,[eax+4]
252
    mov  edx,[eax+4]
Line 261... Line 253...
261
 
253
 
262
    mov  eax,15
254
    mov  eax,15
263
    mov  ebx,1
255
    mov  ebx,1
Line 264... Line 256...
264
    int  0x40
256
    mcall
265
 
257
 
266
    mov  eax,15
258
    mov  eax,15
Line 267... Line 259...
267
    mov  ebx,3
259
    mov  ebx,3
Line 268... Line 260...
268
    int  0x40
260
    mcall
Line 360... Line 352...
360
 
352
 
361
    mov  eax,7
353
    mov  eax,7
362
    mov  ebx,0x40000
354
    mov  ebx,0x40000
363
    mov  ecx,256*65536+255
355
    mov  ecx,256*65536+255
364
    mov  edx,14*65536+40;55
356
    mov  edx,14*65536+40;55
Line 365... Line 357...
365
    int  0x40
357
    mcall
Line 366... Line 358...
366
 
358
 
Line 375... Line 367...
375
 
367
 
Line 376... Line 368...
376
draw_window:
368
draw_window:
377
 
369
 
378
    mov eax, 12                   ; tell os about draw
370
    mov eax, 12                   ; tell os about draw
Line 379... Line 371...
379
    mov ebx, 1
371
    mov ebx, 1
380
    int 0x40
372
    mcall
381
 
373
 
382
    xor eax, eax                    ; define and draw window
374
    xor eax, eax                    ; define and draw window
383
    mov ebx, 220*65536+293
375
    mov ebx, 220*65536+293
384
    mov ecx, 50*65536+408
376
    mov ecx, 50*65536+408
385
    mov edx, [sc.work]
377
    mov edx, [sc.work]
Line 386... Line 378...
386
    or  edx, 0x33000000
378
    or  edx, 0x33000000
Line 387... Line 379...
387
    mov edi, header
379
    mov edi, title
388
    int 0x40
380
    mcall
389
 
381
 
390
    call draw_image
382
    call draw_image
391
 
383
 
392
    mov  eax,8                     ; Blue button
384
    mov  eax,8                     ; Blue button
393
    mov  ebx,(set+190+27)*65536+17
385
    mov  ebx,(set+190+27)*65536+17
394
    mov  ecx,y_add*65536+y_s
386
    mov  ecx,y_add*65536+y_s
395
    mov  edx,11
387
    mov  edx,11
396
    mov  esi,0x005555bb
388
    mov  esi,0x005555bb
397
    int  0x40
389
    mcall
398
    ;mov  eax,8                     ; Red button
390
    ;mov  eax,8                     ; Red button
399
    mov  ebx,(set+208+27)*65536+17
391
    mov  ebx,(set+208+27)*65536+17
400
    mov  edx,12
392
    mov  edx,12
401
    mov  esi,0x00bb5555
393
    mov  esi,0x00bb5555
402
    int  0x40
394
    mcall
Line 403... Line 395...
403
    ;mov  eax,8                     ; Green button
395
    ;mov  eax,8                     ; Green button
404
    mov  ebx,(set+253)*65536+17
396
    mov  ebx,(set+253)*65536+17
405
    mov  edx,13
397
    mov  edx,13
406
    mov  esi,0x0055bb55
398
    mov  esi,0x0055bb55
407
    int  0x40
399
    mcall
408
 
400
 
Line 409... Line 401...
409
    ;mov  eax, 8                     ; tiled
401
    ;mov  eax, 8                     ; tiled
410
    mov  ebx, 90*65536+63
402
    mov  ebx, 90*65536+63
411
    mov  ecx, y_add*65536+y_s
403
    mov  ecx, y_add*65536+y_s
412
    mov  edx, 101
404
    mov  edx, 101
Line 413... Line 405...
413
    mov  esi, [sc.work_button]
405
    mov  esi, [sc.work_button]
414
    int  0x40
406
    mcall
415
 
407
 
416
    ;mov  eax, 8                     ; stretch
408
    ;mov  eax, 8                     ; stretch
417
    mov  ebx, 154*65536+61
409
    mov  ebx, 154*65536+61
418
    mov  edx, 102
410
    mov  edx, 102
Line 419... Line 411...
419
    int  0x40
411
    mcall
420
 
412
 
421
    mov  eax, 4
413
    mov  eax, 4
422
    mov  ebx, 215*65536+5
414
    mov  ebx, 215*65536+5
Line 423... Line 415...
423
    mov  ecx, [sc.work_text]
415
    mov  ecx, [sc.work_text]
424
    mov  edx, apply_text
416
    mov  edx, apply_text
425
    mov  esi, apply_text.size
417
    mov  esi, apply_text.size
426
    int  0x40
418
    mcall
Line 427... Line 419...
427
 
419
 
428
    mov  ebx, 14*65536+301
420
    mov  ebx, 14*65536+301
429
    mov  edx, image_buttons_text
421
    mov  edx, image_buttons_text
430
    mov  esi, image_buttons_text.size
422
    mov  esi, image_buttons_text.size
431
    int  0x40
423
    mcall
432
 
424
 
433
    mov  ebx, 14*65536+(y_add2+27)
425
    mov  ebx, 14*65536+(y_add2+27)
434
    mov  edx, simple_text
426
    mov  edx, simple_text
435
    mov  esi, simple_text.size
427
    mov  esi, simple_text.size
436
    int  0x40
428
    mcall
437
 
429
 
438
    mov  ecx, (y_add2)*65536+20
430
    mov  ecx, (y_add2)*65536+20
Line 439... Line 431...
439
    mov  ebx, (13)*65536+25
431
    mov  ebx, (13)*65536+25
440
    mov  edx, 121
432
    mov  edx, 121
441
    mov  esi, [sc.work_button]
433
    mov  esi, [sc.work_button]
442
    mov  edi, 9
434
    mov  edi, 9
443
    mov  eax, 8
435
    mov  eax, 8
444
  @@:
436
  @@:
445
    int  0x40
437
    mcall
446
    add  ebx, 29*65536
438
    add  ebx, 29*65536
447
    inc  edx
439
    inc  edx
448
    dec  edi
440
    dec  edi
449
    jnz  @b
441
    jnz  @b
Line 450... Line 442...
450
 
442
 
-
 
443
 
451
 
444
    mov  edx, 34+4
452
    mov  edx, 34+4
445
    mov  edi, 4
453
    mov  edi, 4
446
    ;mov  eax, 8
Line 454... Line 447...
454
    mov  eax, 8
447
    mov  ebx, 13*65536+18
455
    mov  ebx, 13*65536+18
448
    mov  ecx, y_add*65536+y_s
Line 456... Line 449...
456
    mov  ecx, y_add*65536+y_s
449
  @@:
457
  @@:
-
 
Line 458... Line 450...
458
    int  0x40
450
    mcall
459
    inc  edx
451
    inc  edx
460
    add  ebx, 19*65536
-
 
Line 461... Line 452...
461
    dec  edi
452
    add  ebx, 19*65536
462
    jnz  @b
453
    dec  edi
463
 
454
    jnz  @b
Line 464... Line 455...
464
 
455
 
465
    ;-----------------------
456
 
466
    mov  edx,14                            ; button number
457
    ;-----------------------
467
    mov  ebx,(13)*65536+17                 ; button start x & size
458
    mov  eax,8
468
    mov  ecx,(y_add2+40)*65536+14          ; button start y & size
459
    mov  edx,14                            ; button number
469
 
460
    mov  ebx,(13)*65536+17                 ; button start x & size
Line 470... Line 461...
470
  newcb:
461
    mov  ecx,(y_add2+40)*65536+14          ; button start y & size
471
    mov  esi,[(edx-14)*4+colors]
462
 
472
 
463
  newcb:
Line 473... Line 464...
473
    mov  eax,8
464
    mov  esi,[(edx-14)*4+colors]
Line 474... Line 465...
474
    int  0x40
465
 
Line 475... Line 466...
475
 
466
    mcall
476
    inc  edx
467
 
477
    add  ebx,20*65536
468
    inc  edx
478
    add  esi,5*256*256
469
    add  ebx,20*65536
479
 
470
 
Line 480... Line 471...
480
    cmp  edx,27
471
    cmp  edx,27
481
    jnz  newcb
472
    jnz  newcb
482
    ;-----------------------
473
    ;-----------------------
Line 533... Line 524...
533
    dd  0x777777
524
    dd  0x777777
534
    dd  0x335577
525
    dd  0x335577
535
    dd  0x775533
526
    dd  0x775533
536
    dd  0x773355
527
    dd  0x773355
537
    dd  0x553377
528
    dd  0x553377
538
    dd  0x000000
529
    dd  0x111111
539
    dd  0xcccccc
530
    dd  0xcccccc
Line -... Line 531...
-
 
531
 
-
 
532
fill:
-
 
533
    db  0x00,0x00,0x77
-
 
534
    db  0x00,0x77,0x00
-
 
535
    db  0x77,0x00,0x00
-
 
536
    db  0x00,0x77,0x77
-
 
537
    db  0x77,0x00,0x77
-
 
538
    db  0x77,0x77,0x00
-
 
539
    db  0x77,0x77,0x77
-
 
540
    db  0x77,0x55,0x33
-
 
541
    db  0x33,0x55,0x77
-
 
542
    db  0x55,0x33,0x77
-
 
543
    db  0x77,0x33,0x55
-
 
544
    db  0x11,0x11,0x11
Line 540... Line 545...
540
 
545
    db  0xcc,0xcc,0xcc
Line 541... Line 546...
541
 
546
 
542
shape:
547
shape: