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 12... Line 12...
12
   dd     0x40000        ; memory for app (256 Kb)
12
   dd     0x40000        ; memory for app (256 Kb)
13
   dd     0x40000        ; esp
13
   dd     0x40000        ; esp
14
   dd     0x0 , 0x0      ; I_Param , I_Icon
14
   dd     0x0 , 0x0      ; I_Param , I_Icon
Line 15... Line 15...
15
 
15
 
16
include   'lang.inc'
16
include   'lang.inc'
Line 17... Line 17...
17
include   'macros.inc'
17
include   '..\..\..\macros.inc'
Line 18... Line 18...
18
 
18
 
19
;include   'debug.inc'
19
;include   'debug.inc'
20
 
20
 
21
START:
21
START:
22
     mov  eax,14
22
     mov  eax,14
Line 23... Line 23...
23
     int  0x40
23
     mcall
24
     and  eax,0xFFFF0000
24
     and  eax,0xFFFF0000
25
     mov  [top_right_corner],eax
25
     mov  [top_right_corner],eax
Line 26... Line 26...
26
 
26
 
27
     mov  eax,40        ; ãáâ ­®¢¨âì ¬ áªã ᮡë⨩
27
     mov  eax,40        ; ãáâ ­®¢¨âì ¬ áªã ᮡë⨩
28
     mov  ebx,110010b   ; ॠ£¨à㥬 ­  ª« ¢¨ âãàã, ¬ëèì, ®âà¨á®¢ªã ä®­ 
28
     mov  ebx,110010b   ; ॠ£¨à㥬 ­  ª« ¢¨ âãàã, ¬ëèì, ®âà¨á®¢ªã ä®­ 
29
     int  0x40
29
     mcall
30
 
30
 
Line 31... Line 31...
31
     mov  eax,14        ; ¯®«ã稬 à §¬¥àë íªà ­ 
31
     mov  eax,14        ; ¯®«ã稬 à §¬¥àë íªà ­ 
32
     int  0x40
32
     mcall
33
     mov  [y_max],ax
33
     mov  [y_max],ax
34
     shr  eax,16
34
     shr  eax,16
35
     mov  [x_max],ax
35
     mov  [x_max],ax
36
 
36
 
37
  event:              ; ®¡à ¡®â稪 ᮡë⨩ (¢á¥å)
37
  event:              ; ®¡à ¡®â稪 ᮡë⨩ (¢á¥å)
38
    mov  eax,26
38
    mov  eax,26
39
    mov  ebx,9
39
    mov  ebx,9
40
    int  0x40         ; ¯®«ãç¨âì ¢à¥¬ï á¨á⥬ë
40
    mcall         ; ¯®«ãç¨âì ¢à¥¬ï á¨á⥬ë
41
;    mov  eax,3
41
;    mov  eax,3
42
;    int  0x40
42
;    mcall
43
    mov  [evtime],eax ; § ¯®¬­¨âì ¥£®
43
    mov  [evtime],eax ; § ¯®¬­¨âì ¥£®
44
    mov  eax,37
44
    mov  eax,37
45
    mov  ebx,2
45
    mov  ebx,2
46
    int  0x40
46
    mcall
47
    cmp  eax,3        ; ¯à®¤®«¦¨¬, ¥á«¨ ­ ¦ â  á।­ïï ª­®¯ª  ¬ëè¨
47
    cmp  eax,3        ; ¯à®¤®«¦¨¬, ¥á«¨ ­ ¦ â  á।­ïï ª­®¯ª  ¬ëè¨
48
    jne  still
48
    jne  still
Line 49... Line 49...
49
    mov  eax,37       ; ¯à®¢¥à¨¬ ª®®à¤¨­ âë
49
    mov  eax,37       ; ¯à®¢¥à¨¬ ª®®à¤¨­ âë
Line 50... Line 50...
50
    mov  ebx,0
50
    mov  ebx,0
51
    int  0x40
51
    mcall
52
    cmp  [top_right_corner],eax
52
    cmp  [top_right_corner],eax
Line 53... Line 53...
53
    je   create_setup ; ᮧ¤ ñ¬ ®ª­® ­ áâனª¨, ¥á«¨ ¬ëèì ¢ ¢¥àå­¥¬ ¯à ¢®¬
53
    je   create_setup ; ᮧ¤ ñ¬ ®ª­® ­ áâனª¨, ¥á«¨ ¬ëèì ¢ ¢¥àå­¥¬ ¯à ¢®¬
54
                      ; 㣫ã íªà ­ 
54
                      ; 㣫ã íªà ­ 
55
 
55
 
56
 
56
 
Line 73... Line 73...
73
    cmp  eax,6
73
    cmp  eax,6
74
    je   event
74
    je   event
Line 75... Line 75...
75
 
75
 
76
    mov  eax,26
76
    mov  eax,26
77
    mov  ebx,9
77
    mov  ebx,9
78
    int  0x40
78
    mcall
79
    sub  eax,[evtime]
79
    sub  eax,[evtime]
80
    xor  edx,edx
80
    xor  edx,edx
81
    mov  ebx,60*100     ; ¯®¤¥«¨¬ ­  60*100, ¯®«ã稬 ¢à¥¬ï ¢ ¬¨­ãâ å
81
    mov  ebx,60*100     ; ¯®¤¥«¨¬ ­  60*100, ¯®«ã稬 ¢à¥¬ï ¢ ¬¨­ãâ å
82
    div  ebx
82
    div  ebx
Line 95... Line 95...
95
    jc   still
95
    jc   still
96
    mov  eax,51
96
    mov  eax,51
97
    mov  ebx,1
97
    mov  ebx,1
98
    mov  ecx,sthread
98
    mov  ecx,sthread
99
    mov  edx,0x3F000
99
    mov  edx,0x3F000
100
    int  0x40
100
    mcall
101
    bts dword [params],1
101
    bts dword [params],1
102
    jmp  still
102
    jmp  still
Line 103... Line 103...
103
 
103
 
104
  create_ss:
104
  create_ss:
105
    mov  eax,51
105
    mov  eax,51
106
    mov  ebx,1
106
    mov  ebx,1
107
    mov  ecx,thread
107
    mov  ecx,thread
108
    mov  edx,0x3E000
108
    mov  edx,0x3E000
109
    int  0x40
109
    mcall
110
    bts dword [params],0
110
    bts dword [params],0
Line 111... Line 111...
111
    ret
111
    ret
112
 
112
 
113
 thread:
113
 thread:
114
    mov  eax,5
114
    mov  eax,5
115
    mov  ebx,eax
115
    mov  ebx,eax
116
    int  0x40
116
    mcall
117
    mov  eax,40
117
    mov  eax,40
118
    mov  ebx,100010b
118
    mov  ebx,100010b
119
    int  0x40
119
    mcall
120
    cmp  dword [type],0
120
    cmp  dword [type],0
121
    je   drawsswin
121
    je   drawsswin
122
    cmp  dword [type],24
122
    cmp  dword [type],24
Line 133... Line 133...
133
    jmp  drawsswin
133
    jmp  drawsswin
134
 asminit:                 ; for "assembler"
134
 asminit:                 ; for "assembler"
135
    mov  dword [delay],25
135
    mov  dword [delay],25
136
    mov  eax,58
136
    mov  eax,58
137
    mov  ebx,fileinfo
137
    mov  ebx,fileinfo
138
    int  0x40
138
    mcall
139
 asminit1:
139
 asminit1:
140
    mov  eax,data_from_file
140
    mov  eax,data_from_file
141
    mov  [stringstart],eax
141
    mov  [stringstart],eax
142
    mov  dword [stringlen],1
142
    mov  dword [stringlen],1
143
 newpage:
143
 newpage:
Line 150... Line 150...
150
    mov  bx,[x_max]
150
    mov  bx,[x_max]
151
    mov  cx,[y_max]
151
    mov  cx,[y_max]
152
    inc  ebx
152
    inc  ebx
153
    inc  ecx
153
    inc  ecx
154
    mov  edx,0x01000000
154
    mov  edx,0x01000000
155
    int  0x40
155
    mcall
156
    mov  eax,13
156
    mov  eax,13
157
    xor  edx,edx
157
    xor  edx,edx
158
    int  0x40
158
    mcall
159
 tstill:
159
 tstill:
160
    mov  eax,23
160
    mov  eax,23
161
    mov  ebx,[delay]
161
    mov  ebx,[delay]
162
    int  0x40
162
    mcall
163
    cmp  eax,2
163
    cmp  eax,2
164
    je   thr_end
164
    je   thr_end
165
    cmp  eax,6
165
    cmp  eax,6
166
    je   thr_end
166
    je   thr_end
167
    cmp  dword [type],0
167
    cmp  dword [type],0
Line 172... Line 172...
172
    jmp  tstill
172
    jmp  tstill
173
 thr_end:
173
 thr_end:
174
    btr  dword [params],0
174
    btr  dword [params],0
175
    mov  eax,26
175
    mov  eax,26
176
    mov  ebx,9
176
    mov  ebx,9
177
    int  0x40
177
    mcall
178
    mov  [evtime],eax
178
    mov  [evtime],eax
179
    or   eax,-1
179
    or   eax,-1
180
    int  0x40
180
    mcall
Line 181... Line 181...
181
 
181
 
182
 drawssasm:
182
 drawssasm:
183
    mov  edi,[stringstart]
183
    mov  edi,[stringstart]
184
    add  edi,[stringlen]
184
    add  edi,[stringlen]
Line 202... Line 202...
202
    mov  ebx,10*65536
202
    mov  ebx,10*65536
203
    mov  bx,[stringpos]
203
    mov  bx,[stringpos]
204
    mov  ecx,0x104ba010
204
    mov  ecx,0x104ba010
205
    mov  edx,[stringstart]
205
    mov  edx,[stringstart]
206
    mov  esi,[stringlen]
206
    mov  esi,[stringlen]
207
    int  0x40
207
    mcall
208
    inc dword [stringlen]
208
    inc dword [stringlen]
209
    cmp byte [edi],byte ' '
209
    cmp byte [edi],byte ' '
210
    je   drawssasm
210
    je   drawssasm
211
    jmp  tstill
211
    jmp  tstill
Line 274... Line 274...
274
    mov  cx,word [ly2]
274
    mov  cx,word [ly2]
Line 275... Line 275...
275
 
275
 
276
    mov  eax,38
276
    mov  eax,38
277
    mov  edx,[lcolor]
277
    mov  edx,[lcolor]
278
    and  edx,0xffffff
278
    and  edx,0xffffff
Line 279... Line 279...
279
    int  0x40
279
    mcall
Line 280... Line 280...
280
 
280
 
Line 290... Line 290...
290
     call sdraw_window
290
     call sdraw_window
Line 291... Line 291...
291
 
291
 
Line 292... Line 292...
292
sstill:
292
sstill:
293
 
293
 
Line 294... Line 294...
294
    mov  eax,10                 ; wait here for event
294
    mov  eax,10                 ; wait here for event
295
    int  0x40
295
    mcall
296
 
296
 
297
    cmp  eax,1                  ; redraw request ?
297
    cmp  eax,1                  ; redraw request ?
Line 303... Line 303...
303
 
303
 
Line 304... Line 304...
304
    jmp  sstill
304
    jmp  sstill
305
 
305
 
306
  sbutton:                       ; button
306
  sbutton:                       ; button
Line 307... Line 307...
307
    mov  eax,17                 ; get id
307
    mov  eax,17                 ; get id
308
    int  0x40
308
    mcall
Line 309... Line 309...
309
 
309
 
310
    cmp  ah,1                   ; button id=1 ?
310
    cmp  ah,1                   ; button id=1 ?
311
    jne  snoclose
311
    jne  snoclose
312
 
312
 
313
    btr dword [params],1
313
    btr dword [params],1
314
    mov  eax,-1                 ; close this program
314
    mov  eax,-1                 ; close this program
315
    int  0x40
315
    mcall
316
  snoclose:
316
  snoclose:
Line 360... Line 360...
360
  notimeup:
360
  notimeup:
361
    cmp  ah,6
361
    cmp  ah,6
362
    jne  noshow
362
    jne  noshow
363
    mov  eax,5
363
    mov  eax,5
364
    mov  ebx,150
364
    mov  ebx,150
365
    int  0x40
365
    mcall
366
    call create_ss
366
    call create_ss
367
    jmp  sstill
367
    jmp  sstill
368
  noshow:
368
  noshow:
369
    jmp  sstill
369
    jmp  sstill
Line 385... Line 385...
385
sdraw_window:
385
sdraw_window:
Line 386... Line 386...
386
 
386
 
387
 
387
 
388
    mov  eax,12                    ; function 12:tell os about windowdraw
388
    mov  eax,12                    ; function 12:tell os about windowdraw
Line 389... Line 389...
389
    mov  ebx,1                     ; 1, start of draw
389
    mov  ebx,1                     ; 1, start of draw
390
    int  0x40
390
    mcall
391
 
391
 
392
                                   ; DRAW WINDOW
392
                                   ; DRAW WINDOW
393
    xor  eax,eax                   ; function 0 : define and draw window
393
    xor  eax,eax                   ; function 0 : define and draw window
394
    mov  ebx,100*65536+215         ; [x start] *65536 + [x size]
394
    mov  ebx,100*65536+215         ; [x start] *65536 + [x size]
-
 
395
    mov  ecx,100*65536+70          ; [y start] *65536 + [y size]
Line 395... Line 396...
395
    mov  ecx,100*65536+70          ; [y start] *65536 + [y size]
396
    mov  edx,0x03400088            ; color of work area RRGGBB,8->color gl
396
    mov  edx,0x03400088            ; color of work area RRGGBB,8->color gl
397
    mov  edi,title
397
    int  0x40
398
    mcall
398
 
399
 
399
    mov  eax,8
400
    mov  eax,8
400
    mov  ebx,47*65536+10
401
    mov  ebx,47*65536+10
401
    mov  ecx,31*65536+10
402
    mov  ecx,31*65536+10
402
    mov  edx,2
403
    mov  edx,2
403
    mov  esi,0x702050
404
    mov  esi,0x702050
404
    int  0x40
405
    mcall
405
    push ebx
406
    push ebx
406
    add  ebx,13*65536
407
    add  ebx,13*65536
407
    mov  edi,ebx
408
    mov  edi,ebx
408
    inc  edx
409
    inc  edx
409
    int  0x40
410
    mcall
410
    pop  ebx
411
    pop  ebx
411
    add  ecx,15*65536
412
    add  ecx,15*65536
412
    inc  edx
413
    inc  edx
413
    int  0x40
414
    mcall
414
    mov  ebx,edi
415
    mov  ebx,edi
415
    inc  edx
416
    inc  edx
416
    int  0x40
417
    mcall
417
    mov  ebx,160*65536+40
-
 
-
 
418
    mov  ebx,160*65536+40
418
    mov  ecx,28*65536+14
419
    mov  ecx,28*65536+14
419
    inc  edx
420
    inc  edx
420
    int  0x40
-
 
421
                                   ; WINDOW LABEL
-
 
422
    mov  eax,4                     ; function 4 : write text to window
-
 
423
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
-
 
424
    mov  ecx,0x10ddeeff            ; font 1 & color ( 0xF0RRGGBB )
-
 
425
    mov  edx,labelt                ; pointer to text beginning
421
    mcall
426
    mov  esi,17                    ; text length
422
 
427
    int  0x40
423
    mov  eax,4                     ; function 4 : write text to window
428
    add  ebx,7*65536+25
424
    mov  ebx,15*65536+33             ; [x start] *65536 + [y start]
429
    mov  ecx,0xffffff
425
    mov  ecx,0xffffff
430
    mov  edx,setuptext
426
    mov  edx,setuptext
431
    mov  esi,9
427
    mov  esi,9
432
    int  0x40
428
    mcall
433
    add  ebx,15
429
    add  ebx,15
434
    add  edx,esi
430
    add  edx,esi
435
    mov  esi,30
431
    mov  esi,30
436
    int  0x40
432
    mcall
Line 437... Line 433...
437
    mov  ebx,169*65536+32
433
    mov  ebx,169*65536+32
438
    mov  edx,buttext
434
    mov  edx,buttext
439
    mov  esi,4
435
    mov  esi,4
Line 440... Line 436...
440
    int  0x40
436
    mcall
441
 
437
 
442
    call drawtype
438
    call drawtype
Line 443... Line 439...
443
    call drawtime
439
    call drawtime
Line 444... Line 440...
444
    call drawflag
440
    call drawflag
445
 
441
 
Line 456... Line 452...
456
    mov  edx,0xffffff
452
    mov  edx,0xffffff
457
    bt   dword [params],0
453
    bt   dword [params],0
458
    jnc  noblue
454
    jnc  noblue
459
    mov  edx,0x4e00e7
455
    mov  edx,0x4e00e7
460
 noblue:
456
 noblue:
461
    int  0x40
457
    mcall
462
    mov  eax,4
458
    mov  eax,4
463
    mov  ebx,82*65536+32
459
    mov  ebx,82*65536+32
464
    xor  ecx,ecx
460
    xor  ecx,ecx
465
    mov  edx,typetext
461
    mov  edx,typetext
466
    add  edx,[type]
462
    add  edx,[type]
467
    mov  esi,12
463
    mov  esi,12
468
    int  0x40
464
    mcall
469
    ret
465
    ret
Line 470... Line 466...
470
 
466
 
471
drawtime:
467
drawtime:
472
    mov  eax,13
468
    mov  eax,13
Line 475... Line 471...
475
    mov  edx,0xffffff
471
    mov  edx,0xffffff
476
    bt   dword [params],0
472
    bt   dword [params],0
477
    jnc  noblue1
473
    jnc  noblue1
478
    mov  edx,0x4e00e7
474
    mov  edx,0x4e00e7
479
 noblue1:
475
 noblue1:
480
    int  0x40
476
    mcall
481
    mov  eax,47
477
    mov  eax,47
482
    mov  edx,82*65536+47
478
    mov  edx,82*65536+47
483
    xor  esi,esi
479
    xor  esi,esi
484
    movzx ecx,byte [time]
480
    movzx ecx,byte [time]
485
    mov  ebx,0x00020000
481
    mov  ebx,0x00020000
486
    int  0x40
482
    mcall
487
    ret
483
    ret
Line 488... Line 484...
488
 
484
 
489
drawflag:
485
drawflag:
490
    mov  eax,8
486
    mov  eax,8
491
    mov  ebx,150*65536+10
487
    mov  ebx,150*65536+10
492
    mov  ecx,45*65536+10
488
    mov  ecx,45*65536+10
493
    mov  edx,7
489
    mov  edx,7
494
    mov  esi,0xe0e0e0
490
    mov  esi,0xe0e0e0
495
    int  0x40
491
    mcall
496
    mov  eax,4
492
    mov  eax,4
497
    mov  ebx,153*65536+47
493
    mov  ebx,153*65536+47
498
    xor  ecx,ecx
494
    xor  ecx,ecx
499
    mov  esi,1
495
    mov  esi,1
500
    mov  edx,flag
496
    mov  edx,flag
501
    bt   dword [params],0
497
    bt   dword [params],0
502
    jc   setf
498
    jc   setf
503
    inc  edx
499
    inc  edx
504
  setf:
500
  setf:
505
    int  0x40
501
    mcall
Line 506... Line 502...
506
    ret
502
    ret
507
 
503
 
508
; DATA AREA
504
; DATA AREA
509
buttext    db 'SHOW'
505
buttext    db 'SHOW'
510
flag       db 'V '
506
flag       db 'V '
511
labelt     db   'SCREENSAVER SETUP'
507
title     db   'SCREENSAVER SETUP',0
512
setuptext  db 'TYPE: < >TIME: < >     MINUTES    NEVER'
508
setuptext  db 'TYPE: < >TIME: < >     MINUTES    NEVER'
513
typetext   db 'BLACK SCREENCOLOR LINES ASSEMBLER   '
509
typetext   db 'BLACK SCREENCOLOR LINES ASSEMBLER   '
514
type       dd 12
510
type       dd 12