Subversion Repositories Kolibri OS

Rev

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

Rev 109 Rev 485
Line 81... Line 81...
81
                  dd      0x62000
81
                  dd      0x62000
82
                  dd      0x1000
82
                  dd      0x1000
83
                  dd      0,0
83
                  dd      0,0
Line 84... Line 84...
84
 
84
 
85
include 'lang.inc'
85
include 'lang.inc'
Line 86... Line 86...
86
include 'macros.inc'
86
include '..\..\..\macros.inc'
87
 
87
 
Line 88... Line 88...
88
STARTX  dd  200
88
STARTX  dd  200
89
STARTY  dd  120
89
STARTY  dd  120
Line 90... Line 90...
90
 
90
 
Line -... Line 91...
-
 
91
scaleaddy dd 120
91
scaleaddy dd 120
92
scaleaddx dd 200
92
scaleaddx dd 200
-
 
93
 
93
 
Line 94... Line 94...
94
START:
94
START:
Line 95... Line 95...
95
 
95
 
-
 
96
red:
-
 
97
        call    draw_window
-
 
98
        call    draw_fractal
-
 
99
 
-
 
100
still:
-
 
101
 
-
 
102
        mov  eax,10
-
 
103
        mcall
-
 
104
 
-
 
105
        dec  eax
-
 
106
        jz   red
96
        call    draw_window
107
        dec  eax
-
 
108
        jz   key
-
 
109
 
-
 
110
      button:
-
 
111
        mov  al,17
Line 97... Line 112...
97
 
112
        mcall
98
        call    draw_fractal
113
 
-
 
114
        cmp  ah,1
-
 
115
        jne  no_close
-
 
116
        or   eax,-1
-
 
117
        mcall
-
 
118
      no_close:
-
 
119
 
-
 
120
        cmp  ah,2
-
 
121
        jne  no_bgr
99
 
122
 
100
still:
123
 
-
 
124
        mov  eax,15   ; bgr 512 x 256
101
 
125
        mov  ebx,1
-
 
126
        mov  ecx,512
-
 
127
        mov  edx,256
-
 
128
        mcall
102
        mov  eax,10
129
 
-
 
130
        mov  eax,15
-
 
131
        mov  ebx,5
Line 103... Line 132...
103
        int  0x40
132
        mov  ecx,0x1000
Line 104... Line 133...
104
 
133
        mov  edx,0
-
 
134
        mov  esi,512*3*256
-
 
135
        mcall
-
 
136
 
-
 
137
        mov  eax,15
-
 
138
        mov  ebx,3
-
 
139
        mcall
-
 
140
 
-
 
141
        jmp  still
-
 
142
 
-
 
143
      no_bgr:
-
 
144
 
-
 
145
        cmp  ah,3
105
        cmp  eax,1
146
        jb   no_color
106
        je   red
147
        cmp  ah,5
-
 
148
        jg   no_color
-
 
149
        shr  eax,8
-
 
150
        sub  eax,3
107
        cmp  eax,2
151
        imul eax,8
Line -... Line 152...
-
 
152
        add  eax,8
108
        je   key
153
        not  eax
109
        cmp  eax,3
154
        and  eax,11000b
110
        je   button
155
        mov  [shlc],al
Line 111... Line 156...
111
 
156
        call draw_fractal
112
        jmp  still
157
        jmp  still
113
 
158
 
114
      red:
159
      no_color:
Line 177... Line 222...
177
      no_right:
222
      no_right:
Line 178... Line 223...
178
 
223
 
179
        call draw_fractal
224
        call draw_fractal
Line 180... Line -...
180
        jmp  still
-
 
181
 
-
 
182
      button:
-
 
183
        mov  eax,17
-
 
184
        int  0x40
-
 
185
 
-
 
186
        cmp  ah,1
-
 
187
        jne  no_close
-
 
188
        mov  eax,-1
-
 
189
        int  0x40
-
 
190
      no_close:
-
 
191
 
-
 
192
        cmp  ah,2
-
 
193
        jne  no_bgr
-
 
194
 
-
 
195
        mov  eax,15   ; bgr 512 x 256
-
 
196
        mov  ebx,1
-
 
197
        mov  ecx,512
-
 
198
        mov  edx,256
-
 
199
        int  0x40
-
 
200
 
-
 
201
        mov  eax,15
-
 
202
        mov  ebx,5
-
 
203
        mov  ecx,0x1000
-
 
204
        mov  edx,0
-
 
205
        mov  esi,512*3*256
-
 
206
        int  0x40
-
 
207
 
-
 
208
        mov  eax,15
-
 
209
        mov  ebx,3
-
 
210
        int  0x40
-
 
211
 
-
 
212
        jmp  still
-
 
213
 
-
 
214
      no_bgr:
-
 
215
 
-
 
216
        cmp  ah,3
-
 
217
        jb   no_color
-
 
218
        cmp  ah,5
-
 
219
        jg   no_color
-
 
220
        shr  eax,8
-
 
221
        sub  eax,3
-
 
222
        imul eax,8
-
 
223
        add  eax,8
-
 
224
        not  eax
-
 
225
        and  eax,11000b
-
 
226
;        sub  eax,8
-
 
227
        mov  [shlc],al
-
 
228
        call draw_fractal
-
 
229
        jmp  still
-
 
230
 
-
 
231
      no_color:
-
 
232
 
-
 
233
 
-
 
234
        jmp  still
-
 
235
 
225
        jmp  still
Line 236... Line 226...
236
 
226
 
237
color_cycle:
227
color_cycle:
238
 
228
 
Line 255... Line 245...
255
     cmp  edi,0x1000+512*256*3
245
     cmp  edi,0x1000+512*256*3
256
     jb   newpix
246
     jb   newpix
257
     call put_image
247
     call put_image
258
     mov  eax,5
248
     mov  eax,5
259
     mov  ebx,1
249
     mov  ebx,1
260
     int  0x40
250
     mcall
261
     dec  esi
251
     dec  esi
262
     jnz  newcycle
252
     jnz  newcycle
Line 263... Line 253...
263
 
253
 
264
     mov  eax,0
254
     mov  eax,0
Line 285... Line 275...
285
 
275
 
Line 286... Line 276...
286
draw_fractal:
276
draw_fractal:
287
 
277
 
288
        pusha
278
        pusha
289
        mov     eax,4
279
        mov     eax,4
290
        mov     ebx,15*65536+35
280
        mov     ebx,10*65536+30
291
        mov     ecx,0xffffff
-
 
292
        mov     edx,calc
281
        mov     ecx,0x80ffffff
293
        mov     esi,calcl-calc
282
        mov     edx,calc
294
        int     0x40
283
        mcall
Line 295... Line 284...
295
        popa
284
        popa
296
        pusha
285
        pusha
Line 307... Line 296...
307
        sub     di,cx           ; adjust our Y offset
296
        sub     di,cx           ; adjust our Y offset
308
@@CalcRow:
297
@@CalcRow:
Line 309... Line 298...
309
 
298
 
Line 310... Line -...
310
        push    cx
-
 
311
 
-
 
312
;        and     cl,0x7
-
 
313
;        cmp     cl,0
-
 
314
;        jne     noim
-
 
315
;        call    put_image
-
 
316
;     noim:
299
        push    cx
Line 317... Line 300...
317
 
300
 
318
        mov     cx, PIXWIDTH -1  ; width of screen in pixels
301
        mov     cx, PIXWIDTH -1  ; width of screen in pixels
319
 
302
 
Line 367... Line 350...
367
 
350
 
Line 368... Line 351...
368
        pusha
351
        pusha
369
 
352
 
370
        mov  eax,7
353
        mov  eax,7
371
        mov  ebx,0x1000
354
        mov  ebx,0x1000
372
        mov  ecx,512*65536+255
355
        mov  ecx,512*65536+256
Line 373... Line 356...
373
        mov  edx,10*65536+30
356
        mov  edx,4*65536+21
Line 374... Line 357...
374
        int  0x40
357
        mcall
Line 444... Line 427...
444
 
427
 
Line 445... Line 428...
445
      pusha
428
      pusha
446
 
429
 
447
      mov  eax,12
430
      mov  eax,12
Line 448... Line 431...
448
      mov  ebx,1
431
      mov  ebx,1
449
      int  0x40
432
      mcall
450
 
433
 
451
      mov  eax,0
434
      xor  eax,eax
452
      mov  ebx,50*65536+531
-
 
453
      mov  ecx,100*65536+256+48
435
      mov  ebx,50*65536+PIXWIDTH+8
454
      mov  edx,0x02334455
436
      mov  ecx,100*65536+PIXHEIGHT+25
Line 455... Line 437...
455
      mov  esi,0x80778899
437
      mov  edx,0x13334455
456
      mov  edi,0x00778899
-
 
457
      int  0x40
-
 
458
 
-
 
459
      mov  eax,8
-
 
460
      mov  ebx,(531-19)*65536+12
-
 
461
      mov  ecx,5*65536+12
-
 
462
      mov  edx,1
-
 
463
      mov  esi,0x808080
438
      mov  edi,title
464
      int  0x40
439
      mcall
465
 
440
 
466
      mov  eax,8
441
      mov  eax,8
467
      mov  ebx,300*65536+112
442
      mov  ebx,290*65536+112
Line 468... Line 443...
468
      mov  ecx,5*65536+12
443
      mov  ecx,5*65536+12
469
      mov  edx,2
444
      mov  edx,2
470
      mov  esi,0x808080
445
      mov  esi,0x808080
471
      int  0x40
446
      mcall
472
 
447
 
-
 
448
      mov  ebx,420*65536+12
473
      mov  ebx,430*65536+12
449
      mov  ecx,5*65536+12
474
      mov  ecx,5*65536+12
450
      mov  edx,3
475
      mov  edx,3
-
 
476
      mov  esi,0xa00000
451
      mov  esi,0xa00000
477
      mov  edi,3
452
      mov  edi,3
478
    newcolor:
453
      ;mov  eax,8
479
      mov  eax,8
454
    newcolor:
480
      int  0x40
455
      mcall
Line 481... Line 456...
481
      add  ebx,13*65536
456
      add  ebx,13*65536
482
      shr  esi,8
457
      shr  esi,8
483
      inc  edx
458
      inc  edx
484
      dec  edi
459
      dec  edi
485
      jnz  newcolor
460
      jnz  newcolor
486
 
-
 
Line 487... Line 461...
487
      mov  eax,4
461
 
488
      mov  ebx,8*65536+8
462
      mov  eax,4
489
      mov  ecx,0xffffff
463
      mov  ebx,300*65536+8
Line 490... Line 464...
490
      mov  edx,l
464
      mov  ecx,0x80ffffff
491
      mov  esi,ll-l
465
      mov  edx,button_txt
Line 503... Line 477...
503
;
477
;
504
;     DATA AREA
478
;     DATA AREA
505
;
479
;
Line 506... Line 480...
506
 
480
 
507
 
481
 
508
l:  db 'TINYFRAC - MOVE: ARROWS, ZOOM Q/W, CYCLE: E/R     '
-
 
Line 509... Line 482...
509
    db 'SET AS WALLPAPER'
482
title      db 'Tinyfrac - MOVE: ARROWS, ZOOM Q/W, CYCLE: E/R',0
510
ll:
-
 
Line 511... Line 483...
511
 
483
button_txt  db 'Set as wallpaper',0
512
calc   db 'CALCULATING'
-
 
513
calcl:
-
 
514
 
-
 
515
I_END:
-