Subversion Repositories Kolibri OS

Rev

Rev 502 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 502 Rev 532
1
;   SCREENSAVER APPLICATION by lisovin@26.ru
1
;   SCREENSAVER APPLICATION by lisovin@26.ru
2
;
2
;
3
;   Compile with FASM for Menuet
3
;   Compile with FASM for Menuet
4
;
4
;
5
   use32
5
   use32
6
   org    0x0
6
   org    0x0
-
 
7
 
-
 
8
used_memory = 0x10000
7
 
9
 
8
   db     'MENUET01'     ; 8 byte id
10
   db     'MENUET01'     ; 8 byte id
9
   dd     0x01           ; header version
11
   dd     0x01           ; header version
10
   dd     START          ; start of code
12
   dd     START          ; start of code
11
   dd     I_END          ; size of image
13
   dd     I_END          ; size of image
12
   dd     0x40000        ; memory for app (256 Kb)
14
   dd     used_memory    ; memory for app
13
   dd     0x40000        ; esp
15
   dd     used_memory    ; esp
14
   dd     0x0 , 0x0      ; I_Param , I_Icon
16
   dd     0x0 , 0x0      ; I_Param , I_Icon
15
 
17
 
16
include   'lang.inc'
18
include   'lang.inc'
17
include   '..\..\..\macros.inc'
19
include   '..\..\..\macros.inc'
-
 
20
purge mov       ; decrease kpack'ed size
18
 
21
 
19
;include   'debug.inc'
22
;include   'debug.inc'
20
 
23
 
21
START:
24
START:
22
     mov  eax,14
-
 
23
     mcall
-
 
24
     and  eax,0xFFFF0000
-
 
25
     mov  [top_right_corner],eax
-
 
26
 
-
 
27
     mov  eax,40        ; ãáâ ­®¢¨âì ¬ áªã ᮡë⨩
25
     mov  eax,40        ; ãáâ ­®¢¨âì ¬ áªã ᮡë⨩
28
     mov  ebx,110010b   ; ॠ£¨à㥬 ­  ª« ¢¨ âãàã, ¬ëèì, ®âà¨á®¢ªã ä®­ 
26
     mov  ebx,110010b   ; ॠ£¨à㥬 ­  ª« ¢¨ âãàã, ¬ëèì, ®âà¨á®¢ªã ä®­ 
29
     mcall
27
     mcall
-
 
28
 
-
 
29
bgr_changed:
30
 
30
 
31
     mov  eax,14        ; ¯®«ã稬 à §¬¥àë íªà ­ 
31
        mov     eax,14
32
     mcall
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
        shl     eax, 16
-
 
37
        mov     [top_right_corner], eax
36
 
-
 
-
 
38
 
37
  event:              ; ®¡à ¡®â稪 ᮡë⨩ (¢á¥å)
39
still:
38
    mov  eax,26
40
        movzx   ebx, [time]
39
    mov  ebx,9
41
        imul    ebx, 60*100
40
    mcall         ; ¯®«ãç¨âì ¢à¥¬ï á¨á⥬ë
42
        mcall   23              ; ¦¤ñ¬ ᮡëâ¨ï ¢ â¥ç¥­¨¥ [time] ¬¨­ãâ
-
 
43
        test    eax, eax
-
 
44
        jz      create_ss_thread
41
;    mov  eax,3
45
        cmp     al, 2           ; key in buffer?
42
;    mcall
46
        jz      key
43
    mov  [evtime],eax ; § ¯®¬­¨âì ¥£®
47
        cmp     al, 5           ; background redraw?
44
    mov  eax,37
48
        jz      bgr_changed
-
 
49
; mouse event
45
    mov  ebx,2
50
        mcall   37,2            ; ¯à®¢¥à¨¬ ª­®¯ª¨
46
    mcall
51
        and     al, 3
47
    cmp  eax,3        ; ¯à®¤®«¦¨¬, ¥á«¨ ­ ¦ â  á।­ïï ª­®¯ª  ¬ëè¨
52
        cmp     al, 3           ; ­ ¦ âë ®¡¥ ª­®¯ª¨ ¬ëè¨?
48
    jne  still
53
        jnz     still
49
    mov  eax,37       ; ¯à®¢¥à¨¬ ª®®à¤¨­ âë
-
 
50
    mov  ebx,0
-
 
51
    mcall
54
        mcall   37,0            ; ¯à®¢¥à¨¬ ª®®à¤¨­ âë
52
    cmp  [top_right_corner],eax
-
 
53
    je   create_setup ; ᮧ¤ ñ¬ ®ª­® ­ áâனª¨, ¥á«¨ ¬ëèì ¢ ¢¥àå­¥¬ ¯à ¢®¬
-
 
54
                      ; 㣫ã íªà ­ 
-
 
55
 
-
 
56
 
-
 
57
 
-
 
58
still:                  ; ®á­®¢­®© 横« ¯à®£à ¬¬ë
-
 
59
 
-
 
60
    mov  eax,23         ; ¦¤ñ¬ ᮡëâ¨ï ¢ â¥ç¥­¨¥ 1 ᥪ㭤ë
-
 
61
    mov  ebx,100
-
 
62
    mcall
-
 
63
 
-
 
64
    bt   dword [params],0  ; ssaver works?
-
 
65
    jc   event
-
 
66
    bt   dword [params],1  ; setup works?
-
 
67
    jc   event
-
 
68
 
-
 
69
    cmp  eax,2          ; key in buffer ?
55
        cmp     [top_right_corner], eax
70
    je   event
-
 
71
    cmp  eax,5
-
 
72
    je   event
-
 
73
    cmp  eax,6
56
        jnz     still
74
    je   event
-
 
75
 
-
 
76
    mov  eax,26
-
 
77
    mov  ebx,9
-
 
78
    mcall
57
create_setup:
79
    sub  eax,[evtime]
-
 
80
    xor  edx,edx
58
        test    [params], 2
81
    mov  ebx,60*100     ; ¯®¤¥«¨¬ ­  60*100, ¯®«ã稬 ¢à¥¬ï ¢ ¬¨­ãâ å
59
        jnz     still           ; ®ª­® ­ áâ஥ª 㦥 ᮧ¤ ­®
82
    div  ebx
60
        mcall   51,1,sthread,used_memory-0x1000
83
    cmp  al,[time]
61
        or      [params], 2
84
    jb   still
-
 
85
 
-
 
86
; current_time-evtime/100/60 = ¢à¥¬ï ¢ ¬¨­ãâ å á ¯à®è«®£® ᮡëâ¨ï
62
        jmp     still
87
 
63
key:
88
    call create_ss
64
        mcall                   ; eax = 2
89
    jmp  still
-
 
90
 
-
 
91
 
65
        jmp     still
92
 
66
 
93
  create_setup:
67
create_ss_thread:
94
    bt dword [params],1
-
 
95
    jc   still
-
 
96
    mov  eax,51
-
 
97
    mov  ebx,1
-
 
98
    mov  ecx,sthread
-
 
99
    mov  edx,0x3F000
68
        test    [params], 3
100
    mcall
69
        jnz     still
101
    bts dword [params],1
70
        call    create_ss
102
    jmp  still
71
        jmp     still
103
 
72
 
104
  create_ss:
73
create_ss:
105
    mov  eax,51
-
 
106
    mov  ebx,1
-
 
107
    mov  ecx,thread
74
        mcall   51,1,thread,used_memory-0x2000
108
    mov  edx,0x3E000
-
 
109
    mcall
-
 
110
    bts dword [params],0
75
        or      [params], 1
111
    ret
76
        ret
112
 
77
 
113
 thread:
78
 thread:
114
    mov  eax,5
79
;    mov  eax,5
115
    mov  ebx,eax
80
;    mov  ebx,eax
116
    mcall
81
;    mcall
117
    mov  eax,40
82
    mov  eax,40
118
    mov  ebx,100010b
83
    mov  ebx,100010b
119
    mcall
84
    mcall
120
    cmp  dword [type],0
85
    cmp  dword [type],0
121
    je   drawsswin
86
    je   drawsswin
122
    cmp  dword [type],24
87
    cmp  dword [type],24
123
    je   asminit
88
    je   asminit
124
    mov  dword [delay],1
89
    mov  dword [delay],1
125
    mov  [lx1],10         ; for "draw line"
90
    mov  [lx1],10         ; for "draw line"
126
    mov  [lx2],40
91
    mov  [lx2],40
127
    mov  [ly1],50
92
    mov  [ly1],50
128
    mov  [ly2],100
93
    mov  [ly2],100
129
    mov  [addx1],1
94
    mov  [addx1],1
130
    mov  [addx2],1
95
    mov  [addx2],1
131
    mov  [addy1],1
96
    mov  [addy1],1
132
    mov  [addy2],1
97
    mov  [addy2],1
133
    jmp  drawsswin
98
    jmp  drawsswin
134
 asminit:                 ; for "assembler"
99
 asminit:                 ; for "assembler"
135
    mov  dword [delay],25
100
    mov  dword [delay],25
136
    mov  eax,58
101
    mov  eax,70
137
    mov  ebx,fileinfo
102
    mov  ebx,fileinfo
138
    mcall
103
    mcall
-
 
104
    mov  [filesize], ebx
139
 asminit1:
105
 asminit1:
140
    mov  eax,data_from_file
106
    mov  [stringstart],data_from_file
141
    mov  [stringstart],eax
-
 
142
    mov  dword [stringlen],1
107
    mov  dword [stringlen],1
143
 newpage:
108
 newpage:
144
    mov  word [stringpos],10
109
    mov  word [stringpos],10
145
 
110
 
146
 drawsswin:
111
 drawsswin:
147
    xor  eax,eax
112
    xor  eax,eax
148
    mov  ebx,eax
-
 
149
    mov  ecx,eax
-
 
150
    mov  bx,[x_max]
113
    movzx ebx,[x_max]
151
    mov  cx,[y_max]
114
    movzx ecx,[y_max]
152
    inc  ebx
115
    inc  ebx
153
    inc  ecx
116
    inc  ecx
154
    mov  edx,0x01000000
117
    mov  edx,0x01000000
155
    mcall
118
    mcall
156
    mov  eax,13
119
    mov  eax,13
157
    xor  edx,edx
120
    xor  edx,edx
158
    mcall
121
    mcall
159
 tstill:
122
 tstill:
160
    mov  eax,23
123
    mov  eax,23
161
    mov  ebx,[delay]
124
    mov  ebx,[delay]
162
    mcall
125
    mcall
163
    cmp  eax,2
126
    test eax,eax
164
    je   thr_end
127
    jnz  thr_end
165
    cmp  eax,6
-
 
166
    je   thr_end
-
 
167
    cmp  dword [type],0
128
    cmp  dword [type],0
168
    je   tstill
129
    je   tstill
169
    cmp  dword [type],24
130
    cmp  dword [type],24
170
    je   drawssasm
131
    je   drawssasm
171
    call draw_line
132
    call draw_line
172
    jmp  tstill
133
    jmp  tstill
173
 thr_end:
134
 thr_end:
174
    btr  dword [params],0
135
    and  [params], not 1
175
    mov  eax,26
-
 
176
    mov  ebx,9
-
 
177
    mcall
-
 
178
    mov  [evtime],eax
-
 
179
    or   eax,-1
136
    or   eax,-1
180
    mcall
137
    mcall
181
 
138
 
182
 drawssasm:
139
 drawssasm:
183
    mov  edi,[stringstart]
140
    mov  edi,[stringstart]
184
    add  edi,[stringlen]
141
    add  edi,[stringlen]
185
    dec  edi
142
    dec  edi
186
    mov  eax,edi
-
 
187
    sub  eax,data_from_file
143
    lea  eax,[edi-data_from_file]
188
    cmp  eax,10450
144
    cmp  eax,[filesize]
189
    ja   asminit1
145
    ja   asminit1
190
    cmp word [edi],0x0a0d
146
    cmp  word [edi],0x0a0d
-
 
147
    je   addstring
-
 
148
    cmp  byte [edi],0x0a
191
    jne  noaddstring
149
    jne  noaddstring
-
 
150
    dec  edi
-
 
151
addstring:
192
    add  word [stringpos],10
152
    add  word [stringpos],10
193
    add  edi,2
153
    add  edi,2
194
    mov  [stringstart],edi
154
    mov  [stringstart],edi
195
    mov dword [stringlen],1
155
    mov dword [stringlen],1
196
    mov  ax,[stringpos]
156
    mov  ax,[stringpos]
197
    cmp  ax,[y_max]
157
    cmp  ax,[y_max]
198
    jb   tstill
158
    jb   tstill
199
    jmp  newpage
159
    jmp  newpage
200
 noaddstring:
160
 noaddstring:
201
    mov  eax,4
161
    mov  eax,4
202
    mov  ebx,10*65536
162
    mov  ebx,10*65536
203
    mov  bx,[stringpos]
163
    mov  bx,[stringpos]
204
    mov  ecx,0x104ba010
164
    mov  ecx,0x104ba010
205
    mov  edx,[stringstart]
165
    mov  edx,[stringstart]
206
    mov  esi,[stringlen]
166
    mov  esi,[stringlen]
207
    mcall
167
    mcall
208
    inc dword [stringlen]
168
    inc dword [stringlen]
209
    cmp byte [edi],byte ' '
169
    cmp byte [edi],byte ' '
210
    je   drawssasm
170
    je   drawssasm
211
    jmp  tstill
171
    jmp  tstill
212
 
172
 
213
draw_line:
173
draw_line:
214
 
-
 
215
    xor  esi,esi
-
 
216
    xor  edi,edi
-
 
217
    mov  si,[x_max]
174
    movzx esi,[x_max]
218
    mov  di,[y_max]
175
    movzx edi,[y_max]
219
 
176
 
220
    mov  eax,[addx1]
177
    mov  eax,[addx1]
221
    add  [lx1],eax
178
    add  [lx1],eax
222
    mov  eax,[addy1]
179
    mov  eax,[addy1]
223
    add  [ly1],eax
180
    add  [ly1],eax
224
 
181
 
225
    mov  eax,[addx2]
182
    mov  eax,[addx2]
226
    add  [lx2],eax
183
    add  [lx2],eax
227
    mov  eax,[addy2]
184
    mov  eax,[addy2]
228
    add  [ly2],eax
185
    add  [ly2],eax
229
 
186
 
230
    cmp  [lx1],1
187
    cmp  [lx1],1
231
    jge  dl1
188
    jge  dl1
232
    mov  [addx1],1
189
    mov  [addx1],1
233
  dl1:
190
  dl1:
234
    cmp  [lx2],1
191
    cmp  [lx2],1
235
    jge  dl2
192
    jge  dl2
236
    mov  [addx2],1
193
    mov  [addx2],1
237
  dl2:
194
  dl2:
238
    cmp  [lx1],esi
195
    cmp  [lx1],esi
239
    jbe  dl3
196
    jbe  dl3
240
    mov  [addx1],0xffffffff
197
    mov  [addx1],0xffffffff
241
  dl3:
198
  dl3:
242
    cmp  [lx2],esi
199
    cmp  [lx2],esi
243
    jbe  dl4
200
    jbe  dl4
244
    mov  [addx2],0xffffffff
201
    mov  [addx2],0xffffffff
245
  dl4:
202
  dl4:
246
 
203
 
247
    cmp  [ly1],1
204
    cmp  [ly1],1
248
    jge  dl5
205
    jge  dl5
249
    mov  [addy1],1
206
    mov  [addy1],1
250
  dl5:
207
  dl5:
251
    cmp  [ly2],2
208
    cmp  [ly2],2
252
    jge  dl6
209
    jge  dl6
253
    mov  [addy2],1
210
    mov  [addy2],1
254
  dl6:
211
  dl6:
255
    cmp  [ly1],edi
212
    cmp  [ly1],edi
256
    jbe  dl7
213
    jbe  dl7
257
    mov  [addy1],-1
214
    mov  [addy1],-1
258
  dl7:
215
  dl7:
259
    cmp  [ly2],edi
216
    cmp  [ly2],edi
260
    jbe  dl8
217
    jbe  dl8
261
    mov  [addy2],-1
218
    mov  [addy2],-1
262
  dl8:
219
  dl8:
263
 
220
 
264
    mov  eax,[lx2]
221
    mov  eax,[lx2]
265
    cmp  [lx1],eax
222
    cmp  [lx1],eax
266
    jz   dnol
223
    jz   dnol
267
 
224
 
268
    mov  bx,word [lx1]
225
    mov  bx,word [lx1]
269
    shl  ebx,16
226
    shl  ebx,16
270
    mov  bx,word [lx2]
227
    mov  bx,word [lx2]
271
 
228
 
272
    mov  cx,word [ly1]
229
    mov  cx,word [ly1]
273
    shl  ecx,16
230
    shl  ecx,16
274
    mov  cx,word [ly2]
231
    mov  cx,word [ly2]
275
 
232
 
276
    mov  eax,38
233
    mov  eax,38
277
    mov  edx,[lcolor]
234
    mov  edx,[lcolor]
278
    and  edx,0xffffff
235
    and  edx,0xffffff
279
    mcall
236
    mcall
280
 
237
 
281
   dnol:
238
   dnol:
282
 
239
 
283
    add  [lcolor],0x010201
240
    add  [lcolor],0x010201
284
 
241
 
285
    ret
242
    ret
286
 
243
 
287
 
244
 
288
sthread:                        ; start of execution
245
sthread:                        ; start of execution
289
 
246
 
290
     call sdraw_window
247
     call sdraw_window
291
 
248
 
292
sstill:
249
sstill:
293
 
250
 
294
    mov  eax,10                 ; wait here for event
251
    mov  eax,10                 ; wait here for event
295
    mcall
252
    mcall
296
 
253
 
297
    cmp  eax,1                  ; redraw request ?
254
    dec  eax                    ; redraw request ?
298
    je   sthread
255
    je   sthread
299
    cmp  eax,2                  ; key in buffer ?
256
    dec  eax                    ; key in buffer ?
300
    je   sstill
-
 
301
    cmp  eax,3                  ; button in buffer ?
257
    jne  sbutton
302
    je   sbutton
258
    mov  al,2
303
 
259
    mcall
304
    jmp  sstill
260
    jmp  sstill
305
 
261
 
306
  sbutton:                       ; button
262
  sbutton:                       ; button
307
    mov  eax,17                 ; get id
263
    mov  eax,17                 ; get id
308
    mcall
264
    mcall
309
 
265
 
310
    cmp  ah,1                   ; button id=1 ?
266
    cmp  ah,1                   ; button id=1 ?
311
    jne  snoclose
267
    jne  snoclose
312
 
268
 
313
    btr dword [params],1
269
    and  [params], not 2
314
    mov  eax,-1                 ; close this program
270
    mov  eax,-1                 ; close this program
315
    mcall
271
    mcall
316
  snoclose:
272
  snoclose:
317
    cmp  ah,7
273
    cmp  ah,7
318
    jne  nosetfl
274
    jne  nosetfl
319
    btc dword [params],0
275
    xor  [params], 1
320
    call drawflag
276
    call drawflag
321
    call drawtype
277
    call drawtype
322
    call drawtime
278
    call drawtime
323
    jmp  sstill
279
    jmp  sstill
324
  nosetfl:
280
  nosetfl:
325
    bt dword [params],0
281
    test [params], 1
326
    jc   sstill
282
    jnz  sstill
327
    cmp  ah,2
283
    cmp  ah,2
328
    jne  notypedown
284
    jne  notypedown
329
    mov  eax,[type]
285
    mov  eax,[type]
330
    test  eax,eax
286
    test  eax,eax
331
    je   sstill
287
    je   sstill
332
    sub  eax,12
288
    sub  eax,12
333
    jmp  typeupdn
289
    jmp  typeupdn
334
  notypedown:
290
  notypedown:
335
    cmp  ah,3
291
    cmp  ah,3
336
    jne  notypeup
292
    jne  notypeup
337
    mov  eax,[type]
293
    mov  eax,[type]
338
    cmp  eax,24
294
    cmp  eax,24
339
    jae  sstill
295
    jae  sstill
340
    add  eax,12
296
    add  eax,12
341
    jmp  typeupdn
297
    jmp  typeupdn
342
  notypeup:
298
  notypeup:
343
    cmp  ah,4
299
    cmp  ah,4
344
    jne  notimedown
300
    jne  notimedown
345
    mov  al,[time]
301
    mov  al,[time]
346
    cmp  al,1
302
    cmp  al,1
347
    jbe  sstill
303
    jbe  sstill
348
    dec  al
304
    dec  eax
349
;    das
305
;    das
350
    jmp  timeupdn
306
    jmp  timeupdn
351
  notimedown:
307
  notimedown:
352
    cmp  ah,5
308
    cmp  ah,5
353
    jne  notimeup
309
    jne  notimeup
354
    mov  al,[time]
310
    mov  al,[time]
355
    cmp  al,59 ; 0x59
311
    cmp  al,59 ; 0x59
356
    jae  sstill
312
    jae  sstill
357
    inc  al
313
    inc  eax
358
;    daa
314
;    daa
359
    jmp  timeupdn
315
    jmp  timeupdn
360
  notimeup:
316
  notimeup:
361
    cmp  ah,6
317
    cmp  ah,6
362
    jne  noshow
318
    jne  noshow
363
    mov  eax,5
319
    mov  eax,5
364
    mov  ebx,150
320
    mov  ebx,10;150
365
    mcall
321
    mcall
366
    call create_ss
322
    call create_ss
367
    jmp  sstill
-
 
368
  noshow:
323
  noshow:
369
    jmp  sstill
324
    jmp  sstill
370
 
325
 
371
  timeupdn:
326
  timeupdn:
372
    mov  [time],al
327
    mov  [time],al
373
    call drawtime
328
    call drawtime
374
    jmp  sstill
329
    jmp  sstill
375
  typeupdn:
330
  typeupdn:
376
    mov  [type],eax
331
    mov  [type],eax
377
    call drawtype
332
    call drawtype
378
    jmp  sstill
333
    jmp  sstill
379
 
334
 
380
;   *********************************************
335
;   *********************************************
381
;   *******  WINDOW DEFINITIONS AND DRAW ********
336
;   *******  WINDOW DEFINITIONS AND DRAW ********
382
;   *********************************************
337
;   *********************************************
383
 
338
 
384
 
339
 
385
sdraw_window:
340
sdraw_window:
386
 
341
 
387
 
342
 
388
    mov  eax,12                    ; function 12:tell os about windowdraw
343
    mov  eax,12                    ; function 12:tell os about windowdraw
389
    mov  ebx,1                     ; 1, start of draw
344
    mov  ebx,1                     ; 1, start of draw
390
    mcall
345
    mcall
391
 
346
 
392
                                   ; DRAW WINDOW
347
                                   ; DRAW WINDOW
393
    xor  eax,eax                   ; function 0 : define and draw window
348
    xor  eax,eax                   ; function 0 : define and draw window
394
    mov  ebx,100*65536+215         ; [x start] *65536 + [x size]
349
    mov  ebx,100*65536+215         ; [x start] *65536 + [x size]
395
    mov  ecx,100*65536+70          ; [y start] *65536 + [y size]
350
    mov  ecx,100*65536+70          ; [y start] *65536 + [y size]
396
    mov  edx,0x13400088            ; color of work area RRGGBB,8->color gl
351
    mov  edx,0x13400088            ; color of work area RRGGBB,8->color gl
397
    mov  edi,title
352
    mov  edi,title
398
    mcall
353
    mcall
399
 
354
 
400
    mov  eax,8
355
    mov  al,8
401
    mov  ebx,47*65536+10
356
    mov  ebx,47*65536+10
402
    mov  ecx,31*65536+10
357
    mov  ecx,31*65536+10
403
    mov  edx,2
358
    mov  edx,2
404
    mov  esi,0x702050
359
    mov  esi,0x702050
405
    mcall
360
    mcall
406
    push ebx
361
    push ebx
407
    add  ebx,13*65536
362
    add  ebx,13*65536
408
    mov  edi,ebx
363
    mov  edi,ebx
409
    inc  edx
364
    inc  edx
410
    mcall
365
    mcall
411
    pop  ebx
366
    pop  ebx
412
    add  ecx,15*65536
367
    add  ecx,15*65536
413
    inc  edx
368
    inc  edx
414
    mcall
369
    mcall
415
    mov  ebx,edi
370
    mov  ebx,edi
416
    inc  edx
371
    inc  edx
417
    mcall
372
    mcall
418
    mov  ebx,160*65536+40
373
    mov  ebx,160*65536+40
419
    mov  ecx,28*65536+14
374
    mov  ecx,28*65536+14
420
    inc  edx
375
    inc  edx
421
    mcall
376
    mcall
422
 
377
 
423
    mov  eax,4                     ; function 4 : write text to window
378
    mov  al,4                        ; function 4 : write text to window
424
    mov  ebx,15*65536+33             ; [x start] *65536 + [y start]
379
    mov  ebx,15*65536+33             ; [x start] *65536 + [y start]
425
    mov  ecx,0xffffff
380
    mov  ecx,0x80ffffff
426
    mov  edx,setuptext
-
 
427
    mov  esi,9
381
    mov  edx,setuptext
428
    mcall
382
    mcall
429
    add  ebx,15
383
    add  ebx,15
430
    add  edx,esi
-
 
431
    mov  esi,30
384
    add  edx,10
432
    mcall
385
    mcall
433
    mov  ebx,169*65536+32
386
    mov  ebx,169*65536+32
434
    mov  edx,buttext
387
    mov  edx,buttext
435
    mov  esi,4
-
 
436
    mcall
388
    mcall
437
 
389
 
438
    call drawtype
390
    call drawtype
439
    call drawtime
391
    call drawtime
440
    call drawflag
392
    call drawflag
441
 
393
 
442
    mov  eax,12                    ; function 12:tell os about windowdraw
394
    mov  eax,12                    ; function 12:tell os about windowdraw
443
    mov  ebx,2                     ; 2, end of draw
395
    mov  ebx,2                     ; 2, end of draw
444
    mcall
396
    mcall
445
 
397
 
446
    ret
398
    ret
447
 
399
 
448
drawtype:
400
drawtype:
449
    mov  eax,13
401
    mov  eax,13
450
    mov  ebx,80*65536+75
402
    mov  ebx,80*65536+75
451
    mov  ecx,30*65536+12
403
    mov  ecx,30*65536+12
452
    mov  edx,0xffffff
404
    mov  edx,0xffffff
453
    bt   dword [params],0
405
    test [params], 1
454
    jnc  noblue
406
    jz   noblue
455
    mov  edx,0x4e00e7
407
    mov  edx,0x4e00e7
456
 noblue:
408
 noblue:
457
    mcall
409
    mcall
458
    mov  eax,4
410
    mov  al,4
459
    mov  ebx,82*65536+32
411
    mov  ebx,82*65536+32
460
    xor  ecx,ecx
412
    xor  ecx,ecx
461
    mov  edx,typetext
413
    mov  edx,typetext
462
    add  edx,[type]
414
    add  edx,[type]
463
    mov  esi,12
415
    mov  esi,12
464
    mcall
416
    mcall
465
    ret
417
    ret
466
 
418
 
467
drawtime:
419
drawtime:
468
    mov  eax,13
420
    mov  eax,13
469
    mov  ebx,80*65536+15
421
    mov  ebx,80*65536+15
470
    mov  ecx,45*65536+12
422
    mov  ecx,45*65536+12
471
    mov  edx,0xffffff
423
    mov  edx,0xffffff
472
    bt   dword [params],0
424
    test [params], 1
473
    jnc  noblue1
425
    jz   noblue1
474
    mov  edx,0x4e00e7
426
    mov  edx,0x4e00e7
475
 noblue1:
427
 noblue1:
476
    mcall
428
    mcall
477
    mov  eax,47
429
    mov  al,47
478
    mov  edx,82*65536+47
430
    mov  edx,82*65536+47
479
    xor  esi,esi
431
    xor  esi,esi
480
    movzx ecx,byte [time]
432
    movzx ecx,byte [time]
481
    mov  ebx,0x00020000
433
    mov  ebx,0x00020000
482
    mcall
434
    mcall
483
    ret
435
    ret
484
 
436
 
485
drawflag:
437
drawflag:
486
    mov  eax,8
438
    mov  eax,8
487
    mov  ebx,150*65536+10
439
    mov  ebx,150*65536+10
488
    mov  ecx,45*65536+10
440
    mov  ecx,45*65536+10
489
    mov  edx,7
441
    mov  edx,7
490
    mov  esi,0xe0e0e0
442
    mov  esi,0xe0e0e0
491
    mcall
443
    mcall
492
    mov  eax,4
444
    mov  al,4
493
    mov  ebx,153*65536+47
445
    mov  ebx,153*65536+47
494
    xor  ecx,ecx
446
    xor  ecx,ecx
495
    mov  esi,1
447
    mov  esi,1
496
    mov  edx,flag
448
    mov  edx,flag
497
    bt   dword [params],0
449
    bt   dword [params],0
498
    jc   setf
450
    jc   setf
499
    inc  edx
451
    inc  edx
500
  setf:
452
  setf:
501
    mcall
453
    mcall
502
    ret
454
    ret
503
 
455
 
504
; DATA AREA
456
; DATA AREA
505
buttext    db 'SHOW'
457
buttext    db 'SHOW',0
506
flag       db 'V '
458
flag       db 'V '
507
title      db 'SCREENSAVER SETUP',0
459
title      db 'SCREENSAVER SETUP',0
-
 
460
setuptext  db 'TYPE: < >',0
508
setuptext  db 'TYPE: < >TIME: < >     MINUTES    NEVER'
461
           db 'TIME: < >     MINUTES    NEVER',0
509
typetext   db 'BLACK SCREENCOLOR LINES ASSEMBLER   '
462
typetext   db 'BLACK SCREENCOLOR LINES ASSEMBLER   '
510
type       dd 12
463
type       dd 12
511
time       db 15     ; ¢à¥¬ï ¤® § ¯ã᪠ § áâ ¢ª¨ ¢ ¬¨­ãâ å
464
time       db 15     ; ¢à¥¬ï ¤® § ¯ã᪠ § áâ ¢ª¨ ¢ ¬¨­ãâ å
512
delay      dd 100
465
delay      dd 100
513
 
466
 
514
lx1   dd  10
467
lx1   dd  10
515
lx2   dd  40
468
lx2   dd  40
516
 
469
 
517
ly1   dd  50
470
ly1   dd  50
518
ly2   dd  100
471
ly2   dd  100
519
 
472
 
520
addx1 dd  1
473
addx1 dd  1
521
addx2 dd  1
474
addx2 dd  1
522
 
475
 
523
addy1 dd  1
476
addy1 dd  1
524
addy2 dd  1
477
addy2 dd  1
525
 
478
 
526
stringlen   dd 1
479
stringlen   dd 1
527
stringstart dd 0
480
stringstart dd 0
528
stringpos   dw 10
481
stringpos   dw 10
529
 
482
 
530
params  dd 0     ;if bit 0 set-ssaver works if bit 1 set-setup works
483
params  db 0     ;if bit 0 set-ssaver works if bit 1 set-setup works
-
 
484
 
531
 
485
fileinfo:
532
fileinfo:
486
; used_memory-0x3000-data_from_file = ~50 Kb with current settings
533
  dd 0,0,21,data_from_file,work_area
487
  dd 0,0,0,used_memory-0x3000-data_from_file,data_from_file
534
  db '/RD/1/SS.ASM',0
488
  db '/RD/1/NETWORK/PPP.ASM',0
535
 
489
 
536
I_END:
490
I_END:
537
 
491
 
538
 
492
 
539
; UNINITIALIZED DATA:
493
; UNINITIALIZED DATA:
540
 
494
 
541
lcolor           dd ?
495
lcolor           dd ?
542
evtime           dd ?     ; ¢à¥¬ï ¯à¥¤ë¤ã饣® ᮡëâ¨ï
-
 
543
x_max            dw ?     ; à §¬¥àë íªà ­ 
496
x_max            dw ?     ; à §¬¥àë íªà ­ 
544
y_max            dw ?
497
y_max            dw ?
545
 
498
 
546
top_right_corner dd ?
499
top_right_corner dd ?
547
work_area:
-
 
548
rb 0x10000
500
filesize        dd ?
549
data_from_file:
501
data_from_file:
550
502