Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 3... Line 3...
3
;
3
;
4
;    Compile with FASM
4
;    Compile with FASM
5
;
5
;
6
 
6
 
Line -... Line 7...
-
 
7
include 'lang.inc'
-
 
8
include '..\..\..\macros.inc'
7
use32
9
 
Line -... Line 10...
-
 
10
 
8
 
11
use32
9
                org   0x0
12
 org	0x0
10
                db    'MENUET00'              ; 8 byte id
13
 db	'MENUET01'    ; header
11
                dd    38                      ; required os
14
 dd	0x01	      ; header version
12
                dd    START                   ; program start
15
 dd	START	      ; entry point
13
                dd    I_END                   ; program image size
16
 dd	I_END	      ; image size
14
                dd    0x1000                  ; reguired amount of memory
17
 dd	0x1000        ; required memory
15
                dd    0x1000
18
 dd	0x1000        ; esp
Line 16... Line -...
16
                dd    0x00000000              ; reserved=no extended header
-
 
17
 
-
 
Line 18... Line -...
18
include 'lang.inc'
-
 
Line -... Line 19...
-
 
19
 dd	0x0 , 0x0     ; I_Param , I_Path
Line -... Line 20...
-
 
20
 
19
include 'macros.inc'
21
 
Line 20... Line 22...
20
 
22
 
Line 21... Line 23...
21
START:                          ; start of execution
23
START:                          ; start of execution
22
 
24
 
Line 23... Line 25...
23
 
25
  red:                          ; redraw
24
    call draw_window            ; at first, draw the window
26
    call draw_window            ; at first, draw the window
25
 
27
 
26
 
28
 
27
still:
29
still:
28
 
30
 
Line 29... Line 31...
29
    mov  eax,10                 ; wait here for event
31
    mov  eax,10                 ; wait here for event
Line 30... Line -...
30
    int  0x40
-
 
31
 
-
 
32
    cmp  eax,1                  ; redraw request ?
-
 
33
    jz   red
-
 
34
    cmp  eax,2                  ; key in buffer ?
-
 
35
    jz   key
32
    mcall
36
    cmp  eax,3                  ; button in buffer ?
33
 
37
    jz   button
34
    cmp  eax,1                  ; redraw request ?
Line 38... Line 35...
38
 
35
    jz   red
Line 39... Line 36...
39
    jmp  still
36
    cmp  eax,2                  ; key in buffer ?
40
 
37
    jz   key
41
  red:                          ; redraw
38
    cmp  eax,3                  ; button in buffer ?
Line 42... Line 39...
42
    call draw_window
39
    jz   button
43
 
40
 
44
    jmp  still
41
    jmp  still
45
 
42
 
46
  key:                          ; key
43
  key:                          ; key
Line 47... Line 44...
47
    mov  eax,2                  ; just read it and ignore
44
    mov  eax,2                  ; just read it and ignore
48
    int  0x40
45
    mcall
49
 
46
 
Line 121... Line 118...
121
  nomain15:
118
  nomain15:
122
 
119
 
Line 123... Line 120...
123
    mov  eax,25
120
    mov  eax,25
124
    mov  ebx,1
121
    mov  ebx,1
125
    int  0x40
122
    mcall
Line 126... Line 123...
126
 
123
 
Line 127... Line 124...
127
    jmp  still
124
    jmp  still
Line 152... Line 149...
152
  nocd15:
149
  nocd15:
153
 
150
 
Line 154... Line 151...
154
    mov  eax,25
151
    mov  eax,25
155
    mov  ebx,2
152
    mov  ebx,2
156
    int  0x40
153
    mcall
Line 157... Line 154...
157
 
154
 
Line 158... Line 155...
158
    jmp  still
155
    jmp  still
Line 194... Line 191...
194
  IIwnomain15:
191
  IIwnomain15:
195
 
192
 
Line 196... Line 193...
196
    mov  eax,28
193
    mov  eax,28
197
    mov  ebx,1
194
    mov  ebx,1
198
    int  0x40
195
    mcall
Line 199... Line 196...
199
 
196
 
Line 200... Line 197...
200
    jmp  still
197
    jmp  still
Line 225... Line 222...
225
  IIwnocd15:
222
  IIwnocd15:
226
 
223
 
Line 227... Line 224...
227
    mov  eax,28
224
    mov  eax,28
228
    mov  ebx,2
225
    mov  ebx,2
229
    int  0x40
226
    mcall
Line 230... Line 227...
230
 
227
 
Line 231... Line 228...
231
    jmp  still
228
    jmp  still
Line 272... Line 269...
272
  wnomain15:
269
  wnomain15:
273
 
270
 
Line 274... Line 271...
274
    mov  eax,27
271
    mov  eax,27
275
    mov  ebx,1
272
    mov  ebx,1
276
    int  0x40
273
    mcall
Line 277... Line 274...
277
 
274
 
Line 278... Line 275...
278
    jmp  still
275
    jmp  still
Line 303... Line 300...
303
  wnocd15:
300
  wnocd15:
304
 
301
 
Line 305... Line 302...
305
    mov  eax,27
302
    mov  eax,27
306
    mov  ebx,2
303
    mov  ebx,2
307
    int  0x40
304
    mcall
Line 308... Line 305...
308
 
305
 
Line 309... Line 306...
309
    jmp  still
306
    jmp  still
Line 324... Line 321...
324
draw_window:
321
draw_window:
Line 325... Line 322...
325
 
322
 
326
    mov  eax,12                    ; function 12:tell os about windowdraw
323
    mov  eax,12                    ; function 12:tell os about windowdraw
327
    mov  ebx,1                     ; 1, start of draw
324
    mov  ebx,1                     ; 1, start of draw
Line 328... Line 325...
328
    int  0x40
325
    mcall
329
 
326
 
330
                                   ; DRAW WINDOW
327
                                   ; DRAW WINDOW
331
    mov  eax,0                     ; function 0 : define and draw window
328
    mov  eax,0                     ; function 0 : define and draw window
332
    mov  ebx,100*65536+195         ; [x start] *65536 + [x size]
329
    mov  ebx,100*65536+195         ; [x start] *65536 + [x size]
333
    mov  ecx,100*65536+140         ; [y start] *65536 + [y size]
-
 
334
    mov  edx,[wcolor]              ; color of work area RRGGBB
-
 
335
    mov  esi,0x8099bbff            ; color of grab bar  RRGGBB,8->color glide
-
 
336
    mov  edi,0x0099bbee            ; color of frames    RRGGBB
-
 
337
    int  0x40
330
    mov  ecx,100*65536+140         ; [y start] *65536 + [y size]
338
 
-
 
339
                                   ; WINDOW LABEL
-
 
340
    mov  eax,4                     ; function 4 : write text to window
-
 
341
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
-
 
342
    mov  ecx,0x00ffffff            ; color of text RRGGBB
-
 
343
    mov  edx,labelt                ; pointer to text beginning
331
    mov  edx,[wcolor]              ; color of work area RRGGBB
Line 344... Line -...
344
    mov  esi,labellen-labelt       ; text length
-
 
345
    int  0x40
-
 
346
 
-
 
347
                                   ; CLOSE BUTTON
-
 
348
    mov  eax,8                     ; function 8 : define and draw button
-
 
349
    mov  ebx,(195-19)*65536+12     ; [x start] *65536 + [x size]
-
 
350
    mov  ecx,5*65536+12            ; [y start] *65536 + [y size]
-
 
Line 351... Line 332...
351
    mov  edx,1                     ; button id
332
    mov  edi,title                 ; WINDOW LABEL
352
    mov  esi,0x22aacc              ; button color RRGGBB
333
    mcall
Line 353... Line 334...
353
;    int  0x40
334
 
Line 365... Line 346...
365
    mov  eax,8                     ; function 8 : define and draw button
346
    mov  eax,8                     ; function 8 : define and draw button
366
    mov  bx,22                     ; [x start] *65536 + [x size]
347
    mov  bx,22                     ; [x start] *65536 + [x size]
367
    mov  ecx,35*65536+8            ; [y start] *65536 + [y size]
348
    mov  ecx,35*65536+8            ; [y start] *65536 + [y size]
368
    dec  edx
349
    dec  edx
369
    int  0x40
350
    mcall
370
    mov  eax,8                     ; function 8 : define and draw button
-
 
371
    mov  bx,22                     ; [x start] *65536 + [x size]
351
    mov  bx,22                     ; [x start] *65536 + [x size]
372
    mov  ecx,45*65536+8            ; [y start] *65536 + [y size]
352
    mov  ecx,45*65536+8            ; [y start] *65536 + [y size]
373
    dec  edx
353
    dec  edx
374
    int  0x40
354
    mcall
375
    mov  eax,8                     ; function 8 : define and draw button
-
 
376
    mov  bx,22                     ; [x start] *65536 + [x size]
355
    mov  bx,22                     ; [x start] *65536 + [x size]
377
    mov  ecx,55*65536+8            ; [y start] *65536 + [y size]
356
    mov  ecx,55*65536+8            ; [y start] *65536 + [y size]
378
    dec  edx
357
    dec  edx
379
    int  0x40
358
    mcall
380
    mov  eax,8                     ; function 8 : define and draw button
-
 
381
    mov  bx,22                     ; [x start] *65536 + [x size]
359
    mov  bx,22                     ; [x start] *65536 + [x size]
382
    mov  ecx,65*65536+8            ; [y start] *65536 + [y size]
360
    mov  ecx,65*65536+8            ; [y start] *65536 + [y size]
383
    dec  edx
361
    dec  edx
384
    int  0x40
362
    mcall
385
    mov  eax,8                     ; function 8 : define and draw button
-
 
386
    mov  bx,22                     ; [x start] *65536 + [x size]
363
    mov  bx,22                     ; [x start] *65536 + [x size]
387
    mov  ecx,75*65536+8            ; [y start] *65536 + [y size]
364
    mov  ecx,75*65536+8            ; [y start] *65536 + [y size]
388
    dec  edx
365
    dec  edx
389
    int  0x40
366
    mcall
Line 390... Line 367...
390
 
367
 
391
    pop  ebx
368
    pop  ebx
Line 392... Line 369...
392
    pop  edx
369
    pop  edx
Line 406... Line 383...
406
    mov  ebx,10*65536+104          ; [x start] *65536 + [y start]
383
    mov  ebx,10*65536+104          ; [x start] *65536 + [y start]
407
    mov  ecx,0x00ffffff            ; color of text RRGGBB
384
    mov  ecx,0x00ffffff            ; color of text RRGGBB
408
    mov  edx,text                  ; pointer to text beginning
385
    mov  edx,text                  ; pointer to text beginning
409
    mov  esi,29
386
    mov  esi,29
410
    int  0x40
387
    mcall
411
 
388
 
Line 412... Line 389...
412
    mov  eax,8                     ; function 8 : define and draw button
389
    mov  eax,8                     ; function 8 : define and draw button
413
    mov  ebx,(5)*65536+185         ; [x start] *65536 + [x size]
390
    mov  ebx,(5)*65536+185         ; [x start] *65536 + [x size]
414
    mov  ecx,120*65536+14          ; [y start] *65536 + [y size]
391
    mov  ecx,120*65536+14          ; [y start] *65536 + [y size]
415
    mov  edx,101                   ; button id
392
    mov  edx,101                   ; button id
416
    mov  esi,[bcolor]              ; button color RRGGBB
393
    mov  esi,[bcolor]              ; button color RRGGBB
417
    int  0x40
394
    mcall
Line 418... Line 395...
418
 
395
 
Line 419... Line 396...
419
    call drawusedcard
396
    call drawusedcard
420
 
397
 
421
    mov  eax,12                    ; function 12:tell os about windowdraw
398
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 422... Line 399...
422
    mov  ebx,2                     ; 2, end of draw
399
    mov  ebx,2                     ; 2, end of draw
Line 423... Line 400...
423
    int  0x40
400
    mcall
Line 432... Line 409...
432
    mov  eax,13
409
    mov  eax,13
433
    mov  ebx,14*65536+160
410
    mov  ebx,14*65536+160
434
    mov  ecx,123*65536+10
411
    mov  ecx,123*65536+10
435
    mov  edx,[bcolor]
412
    mov  edx,[bcolor]
436
    int  0x40
413
    mcall
Line 437... Line 414...
437
 
414
 
438
    mov  eax,[usecard]
415
    mov  eax,[usecard]
Line 439... Line 416...
439
    mov  edx,c3
416
    mov  edx,c3
Line 454... Line 431...
454
    mov  eax,4
431
    mov  eax,4
455
    mov  ebx,14*65536+123
432
    mov  ebx,14*65536+123
456
    mov  ecx,0x00ffffff
433
    mov  ecx,0x00ffffff
457
    mov  esi,30
434
    mov  esi,30
458
    int  0x40
435
    mcall
Line 459... Line 436...
459
 
436
 
Line 460... Line 437...
460
    popa
437
    popa
Line 466... Line 443...
466
; DATA AREA
443
; DATA AREA
Line 467... Line 444...
467
 
444
 
Line 468... Line 445...
468
bcolor  dd  0x5577c8
445
bcolor  dd  0x5577c8
Line 469... Line 446...
469
 
446
 
470
wcolor  dd  0x03000000
447
wcolor  dd  0x13000000
Line 479... Line 456...
479
 
456
 
Line 480... Line 457...
480
 
457
 
Line 481... Line -...
481
usecard dd 0x1
-
 
482
 
458
usecard dd 0x1
483
labelt:
-
 
Line 484... Line 459...
484
    db   'MIXER'
459