Rev 122 | Rev 9450 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 122 | Rev 485 | ||
---|---|---|---|
1 | ; |
1 | ; |
2 | ; Crown_s Soft Screensaver v1.13m |
2 | ; Crown_s Soft Screensaver v1.13m |
3 | ; WWW: http://www.crown-s-soft.com |
3 | ; WWW: http://www.crown-s-soft.com |
4 | ; |
4 | ; |
5 | ; You may add you own figures. See file FIGURES.INC |
5 | ; You may add you own figures. See file FIGURES.INC |
6 | ; |
6 | ; |
7 | ; Compile with FASM v1.48 for Menuet or hier (FASM v1.40 contains bug) |
7 | ; Compile with FASM v1.48 for Menuet or hier (FASM v1.40 contains bug) |
8 | ; |
8 | ; |
9 | ; Copyright(c) 2002-2004 Crown_s Soft. All rights reserved. |
9 | ; Copyright(c) 2002-2004 Crown_s Soft. All rights reserved. |
10 | ; |
10 | ; |
11 | 11 | ||
12 | fullscreen = 1 |
12 | fullscreen = 1 |
13 | n_points = 0x1800 |
13 | n_points = 0x1800 |
14 | delay = 2 |
14 | delay = 2 |
15 | speed equ 0.004 |
15 | speed equ 0.004 |
16 | 16 | ||
17 | 17 | ||
18 | macro align value { rb (value-1) - ($ + value-1) mod value } |
18 | macro align value { rb (value-1) - ($ + value-1) mod value } |
19 | 19 | ||
20 | use32 |
20 | use32 |
21 | org 0x0 |
21 | org 0x0 |
22 | db 'MENUET01' ; 8 byte id |
22 | db 'MENUET01' ; 8 byte id |
23 | dd 0x01 ; header version |
23 | dd 0x01 ; header version |
24 | dd start ; start of code |
24 | dd start ; start of code |
25 | dd i_end ; size of image |
25 | dd i_end ; size of image |
26 | dd i_end+0x1000 ; memory for app |
26 | dd i_end+0x1000 ; memory for app |
27 | dd i_end+0x1000 ; esp |
27 | dd i_end+0x1000 ; esp |
28 | dd 0x0 ; I_Param |
28 | dd 0x0 ; I_Param |
29 | dd 0x0 ; I_Icon |
29 | dd 0x0 ; I_Icon |
30 | 30 | ||
31 | copyright db 'Crown_s Soft(c) Screensaver v1.13m www.crown-s-soft.com',0 |
31 | copyright db 'Crown_s Soft(c) Screensaver v1.13m www.crown-s-soft.com',0 |
32 | copyrightlen: |
32 | copyrightlen: |
33 | 33 | ||
34 | include "lang.inc" |
34 | include "lang.inc" |
35 | include "figuresi.inc" |
35 | include "figuresi.inc" |
36 | include "macros.inc" |
36 | include "..\..\..\macros.inc" |
37 | start: |
37 | start: |
38 | cld |
38 | cld |
39 | finit |
39 | finit |
40 | call filling_alfbet ; fill table alfbet by casual numbers |
40 | call filling_alfbet ; fill table alfbet by casual numbers |
41 | 41 | ||
42 | mov eax,[tabl_calls] |
42 | mov eax,[tabl_calls] |
43 | mov [pp1adr],eax |
43 | mov [pp1adr],eax |
44 | 44 | ||
45 | 45 | ||
46 | cmp [flscr],0 |
46 | cmp [flscr],0 |
47 | jz nofullscreen |
47 | jz nofullscreen |
48 | mov eax,14 |
48 | mov eax,14 |
49 | int 0x40 |
49 | mcall |
50 | 50 | ||
51 | mov [maxy],ax |
51 | mov [maxy],ax |
52 | sub ax,480 |
52 | sub ax,480 |
53 | jnc m5 |
53 | jnc m5 |
54 | xor ax,ax |
54 | xor ax,ax |
55 | m5: |
55 | m5: |
56 | shr ax,1 |
56 | shr ax,1 |
57 | mov [posy],ax |
57 | mov [posy],ax |
58 | 58 | ||
59 | shr eax,16 |
59 | shr eax,16 |
60 | mov [maxx],ax |
60 | mov [maxx],ax |
61 | sub ax,480 |
61 | sub ax,480 |
62 | jnc m6 |
62 | jnc m6 |
63 | xor ax,ax |
63 | xor ax,ax |
64 | m6: |
64 | m6: |
65 | shr ax,1 |
65 | shr ax,1 |
66 | mov [posx],ax |
66 | mov [posx],ax |
67 | 67 | ||
68 | mov [outsize],480+65536*480 |
68 | mov [outsize],480+65536*480 |
69 | jmp m4 |
69 | jmp m4 |
70 | nofullscreen: |
70 | nofullscreen: |
71 | mov [posx],75 |
71 | mov [posx],75 |
72 | mov [posy],20 |
72 | mov [posy],20 |
73 | 73 | ||
74 | mov [outsize],450+65536*480 |
74 | mov [outsize],450+65536*480 |
75 | m4: |
75 | m4: |
76 | 76 | ||
77 | red: |
77 | red: |
78 | call draw_window |
78 | call draw_window |
79 | 79 | ||
80 | still: |
80 | still: |
81 | mov eax,23 |
81 | mov eax,23 |
82 | mov ebx,delay |
82 | mov ebx,delay |
83 | int 0x40 ; wait here for event |
83 | mcall ; wait here for event |
84 | 84 | ||
85 | cmp eax,1 ; redraw request ? |
85 | cmp eax,1 ; redraw request ? |
86 | je red |
86 | je red |
87 | cmp eax,2 ; key in buffer ? |
87 | cmp eax,2 ; key in buffer ? |
88 | je key |
88 | je key |
89 | cmp eax,3 ; button in buffer ? |
89 | cmp eax,3 ; button in buffer ? |
90 | je button |
90 | je button |
91 | 91 | ||
92 | 92 | ||
93 | call calcframe |
93 | call calcframe |
94 | mov edx,dword [posy] ; edx=image position in window [x]*65536+[y] |
94 | mov edx,dword [posy] ; edx=image position in window [x]*65536+[y] |
95 | mov ecx,[outsize] ; ecx=image position in window [x]*65536+[y] |
95 | mov ecx,[outsize] ; ecx=image position in window [x]*65536+[y] |
96 | mov ebx,scr ; ebx pointer to image in memory |
96 | mov ebx,scr ; ebx pointer to image in memory |
97 | mov eax,07 ; putimage |
97 | mov eax,07 ; putimage |
98 | int 0x40 |
98 | mcall |
99 | jmp still |
99 | jmp still |
100 | 100 | ||
101 | key: |
101 | key: |
102 | mov eax,2 |
102 | mov eax,2 |
103 | int 0x40 |
103 | mcall |
104 | 104 | ||
105 | cmp al,1 ; is key in buffer ? |
105 | cmp al,1 ; is key in buffer ? |
106 | jz still |
106 | jz still |
107 | cmp ah,0x1B ; is key ESC ? |
107 | cmp ah,0x1B ; is key ESC ? |
108 | jz close |
108 | jz close |
109 | jmp still |
109 | jmp still |
110 | 110 | ||
111 | button: ; button |
111 | button: ; button |
112 | mov eax,17 ; get id |
112 | mov eax,17 ; get id |
113 | int 0x40 |
113 | mcall |
114 | 114 | ||
115 | ; cmp ah,1 ; button id=1 ? |
115 | ; cmp ah,1 ; button id=1 ? |
116 | ; jne still |
116 | ; jne still |
117 | 117 | ||
118 | close: |
118 | close: |
119 | mov eax,-1 ; close this program |
119 | mov eax,-1 ; close this program |
120 | int 0x40 |
120 | mcall |
121 | 121 | ||
122 | 122 | ||
123 | ; ********************************************* |
123 | ; ********************************************* |
124 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
124 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
125 | ; ********************************************* |
125 | ; ********************************************* |
126 | 126 | ||
127 | 127 | ||
128 | draw_window: |
128 | draw_window: |
129 | mov eax,12 ; function 12:tell os about windowdraw |
129 | mov eax,12 ; function 12:tell os about windowdraw |
130 | mov ebx,1 ; 1, start of draw |
130 | mov ebx,1 ; 1, start of draw |
131 | int 0x40 |
131 | mcall |
132 | 132 | ||
133 | cmp [flscr],0 |
133 | cmp [flscr],0 |
134 | jnz m2 |
134 | jnz m2 |
135 | mov ebx,1*65536+638 ; [x start] *65536 + [x size] |
135 | mov ebx,1*65536+638 ; [x start] *65536 + [x size] |
136 | mov ecx,1*65536+478 ; [y start] *65536 + [y size] |
136 | mov ecx,1*65536+478 ; [y start] *65536 + [y size] |
137 | mov edx,0x02000000 ; color of work area RRGGBB,8->color gl |
137 | mov edx,0x02000000 ; color of work area RRGGBB,8->color gl |
138 | mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl |
138 | mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl |
139 | mov edi,0x005080d0 ; color of frames RRGGBB |
139 | mov edi,0x005080d0 ; color of frames RRGGBB |
140 | xor eax,eax ; function 0 : define and draw window |
140 | xor eax,eax ; function 0 : define and draw window |
141 | int 0x40 |
141 | mcall |
142 | 142 | ||
143 | ; WINDOW LABEL |
143 | ; WINDOW LABEL |
144 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
144 | mov ebx,8*65536+8 ; [x start] *65536 + [y start] |
145 | mov ecx,0x10ddeeff ; color of text RRGGBB |
145 | mov ecx,0x10ddeeff ; color of text RRGGBB |
146 | mov edx,copyright ; pointer to text beginning |
146 | mov edx,copyright ; pointer to text beginning |
147 | mov esi,copyrightlen-copyright; text length |
147 | mov esi,copyrightlen-copyright; text length |
148 | mov eax,4 ; function 4 : write text to window |
148 | mov eax,4 ; function 4 : write text to window |
149 | int 0x40 |
149 | mcall |
150 | 150 | ||
151 | ; CLOSE BUTTON |
151 | ; CLOSE BUTTON |
152 | mov ebx,(640-19)*65536+12 ; [x start] *65536 + [x size] |
152 | mov ebx,(640-19)*65536+12 ; [x start] *65536 + [x size] |
153 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] |
153 | mov ecx,5*65536+12 ; [y start] *65536 + [y size] |
154 | mov edx,1 ; button id |
154 | mov edx,1 ; button id |
155 | mov esi,0x6688dd ; button color RRGGBB |
155 | mov esi,0x6688dd ; button color RRGGBB |
156 | mov eax,8 ; function 8 : define and draw button |
156 | mov eax,8 ; function 8 : define and draw button |
157 | int 0x40 |
157 | mcall |
158 | jmp m3 |
158 | jmp m3 |
159 | m2: |
159 | m2: |
160 | movzx ebx,[maxx] ; [x start] *65536 + [x size] |
160 | movzx ebx,[maxx] ; [x start] *65536 + [x size] |
161 | movzx ecx,[maxy] ; [y start] *65536 + [y size] |
161 | movzx ecx,[maxy] ; [y start] *65536 + [y size] |
162 | 162 | ||
163 | mov edx,0x01000000 ; color of work area RRGGBB,8->color gl |
163 | mov edx,0x01000000 ; color of work area RRGGBB,8->color gl |
164 | mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl |
164 | mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl |
165 | mov edi,0x005080d0 ; color of frames RRGGBB |
165 | mov edi,0x005080d0 ; color of frames RRGGBB |
166 | xor eax,eax ; function 0 : define and draw window |
166 | xor eax,eax ; function 0 : define and draw window |
167 | int 0x40 |
167 | mcall |
168 | 168 | ||
169 | inc bx |
169 | inc bx |
170 | inc cx |
170 | inc cx |
171 | mov eax,13 ; functiom 13 : draw bar |
171 | mov eax,13 ; functiom 13 : draw bar |
172 | int 0x40 |
172 | mcall |
173 | m3: |
173 | m3: |
174 | 174 | ||
175 | mov eax,12 ; function 12:tell os about windowdraw |
175 | mov eax,12 ; function 12:tell os about windowdraw |
176 | mov ebx,2 ; 2, end of draw |
176 | mov ebx,2 ; 2, end of draw |
177 | int 0x40 |
177 | mcall |
178 | ret |
178 | ret |
179 | 179 | ||
180 | 180 | ||
181 | calcframe: |
181 | calcframe: |
182 | cld |
182 | cld |
183 | mov edi,scr |
183 | mov edi,scr |
184 | mov ecx,480*480*3/4 |
184 | mov ecx,480*480*3/4 |
185 | xor eax,eax |
185 | xor eax,eax |
186 | rep stosd ; CLS |
186 | rep stosd ; CLS |
187 | 187 | ||
188 | 188 | ||
189 | mov ebx,[frame] |
189 | mov ebx,[frame] |
190 | not bh |
190 | not bh |
191 | test bh,03h |
191 | test bh,03h |
192 | not bh |
192 | not bh |
193 | jnz lb1 |
193 | jnz lb1 |
194 | ; ebx=xxxx xxxx xxxx xxxx xxxx xx11 xxxx xxxxb |
194 | ; ebx=xxxx xxxx xxxx xxxx xxxx xx11 xxxx xxxxb |
195 | mov byte [p],bl |
195 | mov byte [p],bl |
196 | lb1: |
196 | lb1: |
197 | 197 | ||
198 | test bx,03ffh |
198 | test bx,03ffh |
199 | jnz lb2 |
199 | jnz lb2 |
200 | ; ebx=xxxx xxxx xxxx xxxx xxxx xx00 0000 0000b |
200 | ; ebx=xxxx xxxx xxxx xxxx xxxx xx00 0000 0000b |
201 | mov [p],0 |
201 | mov [p],0 |
202 | 202 | ||
203 | mov eax,[pp1adr] |
203 | mov eax,[pp1adr] |
204 | mov [pp0adr],eax |
204 | mov [pp0adr],eax |
205 | 205 | ||
206 | inc [pp1] |
206 | inc [pp1] |
207 | cmp [pp1],num_tabl_calls |
207 | cmp [pp1],num_tabl_calls |
208 | jnz lb3 |
208 | jnz lb3 |
209 | mov [pp1],0 |
209 | mov [pp1],0 |
210 | lb3: |
210 | lb3: |
211 | 211 | ||
212 | movzx eax,[pp1] |
212 | movzx eax,[pp1] |
213 | mov eax,[tabl_calls+eax*4] |
213 | mov eax,[tabl_calls+eax*4] |
214 | mov [pp1adr],eax |
214 | mov [pp1adr],eax |
215 | lb2: |
215 | lb2: |
216 | 216 | ||
217 | 217 | ||
218 | fild [frame] ; st0=STime |
218 | fild [frame] ; st0=STime |
219 | fmul [speed1] ; st0=STime*Speed |
219 | fmul [speed1] ; st0=STime*Speed |
220 | fst [bt_r] ; al_rSTime*Speed |
220 | fst [bt_r] ; al_rSTime*Speed |
221 | fadd st0,st0 |
221 | fadd st0,st0 |
222 | fstp [al_r] ; al_rSTime*Speed*2 |
222 | fstp [al_r] ; al_rSTime*Speed*2 |
223 | 223 | ||
224 | 224 | ||
225 | mov [Fl],0 |
225 | mov [Fl],0 |
226 | mov ecx,[mFl] |
226 | mov ecx,[mFl] |
227 | mov esi,alfbet |
227 | mov esi,alfbet |
228 | ckl1: |
228 | ckl1: |
229 | call [pp0adr] |
229 | call [pp0adr] |
230 | cmp [p],0 |
230 | cmp [p],0 |
231 | jz lb4 |
231 | jz lb4 |
232 | fstp [x1] |
232 | fstp [x1] |
233 | fstp [y1] |
233 | fstp [y1] |
234 | fstp [z1] |
234 | fstp [z1] |
235 | call [pp1adr] |
235 | call [pp1adr] |
236 | call mix |
236 | call mix |
237 | lb4: |
237 | lb4: |
238 | 238 | ||
239 | call turn |
239 | call turn |
240 | 240 | ||
241 | add esi,4 |
241 | add esi,4 |
242 | inc [Fl] |
242 | inc [Fl] |
243 | loop ckl1 |
243 | loop ckl1 |
244 | 244 | ||
245 | inc ebx |
245 | inc ebx |
246 | mov [frame],ebx |
246 | mov [frame],ebx |
247 | ret |
247 | ret |
248 | 248 | ||
249 | 249 | ||
250 | ; turn coordinate system |
250 | ; turn coordinate system |
251 | turn: |
251 | turn: |
252 | ; around Y |
252 | ; around Y |
253 | ; x= x*cos(a)-z*sin(a) |
253 | ; x= x*cos(a)-z*sin(a) |
254 | ; y= y |
254 | ; y= y |
255 | ; z= x*sin(a)+z*cos(a) |
255 | ; z= x*sin(a)+z*cos(a) |
256 | fld st2 ; st0=z st1=x st2=y st3=z |
256 | fld st2 ; st0=z st1=x st2=y st3=z |
257 | fld st1 ; st0=x st1=z st2=x st3=y st4=z |
257 | fld st1 ; st0=x st1=z st2=x st3=y st4=z |
258 | fld [al_r] ; st0=a st1=x st2=z st3=x st4=y st5=z |
258 | fld [al_r] ; st0=a st1=x st2=z st3=x st4=y st5=z |
259 | fsincos ; st0=cos(a) st1=sin(a) st2=x st3=z st4=x st5=y st6=z |
259 | fsincos ; st0=cos(a) st1=sin(a) st2=x st3=z st4=x st5=y st6=z |
260 | fmul st4,st0 |
260 | fmul st4,st0 |
261 | fmulp st6,st0 ; st0=sin(a) st1=x st2=z st3=x*cos(a) st4=y st5=z*cos(a) |
261 | fmulp st6,st0 ; st0=sin(a) st1=x st2=z st3=x*cos(a) st4=y st5=z*cos(a) |
262 | fmul st2,st0 |
262 | fmul st2,st0 |
263 | fmulp st1,st0 ; st0=x*sin(a) st1=z*sin(a) st2=x*cos(a) st3=y st4=z*c |
263 | fmulp st1,st0 ; st0=x*sin(a) st1=z*sin(a) st2=x*cos(a) st3=y st4=z*c |
264 | faddp st4,st0 |
264 | faddp st4,st0 |
265 | fsubp st1,st0 |
265 | fsubp st1,st0 |
266 | 266 | ||
267 | 267 | ||
268 | ; around X |
268 | ; around X |
269 | ; x=x |
269 | ; x=x |
270 | ; y= y*cos(b)+z*sin(b) |
270 | ; y= y*cos(b)+z*sin(b) |
271 | ; z=-y*sin(b)+z*cos(b) |
271 | ; z=-y*sin(b)+z*cos(b) |
272 | fld st2 ; st0=z st1=x st2=y st3=z |
272 | fld st2 ; st0=z st1=x st2=y st3=z |
273 | fld st2 ; st0=y st1=z st2=x st3=y st4=z |
273 | fld st2 ; st0=y st1=z st2=x st3=y st4=z |
274 | fld [bt_r] ; st0=b st1=y st2=z st3=x st4=y st5=z |
274 | fld [bt_r] ; st0=b st1=y st2=z st3=x st4=y st5=z |
275 | fsincos ; st0=cos(b) st1=sin(b) st2=y st3=z st4=x st5=y st6=z |
275 | fsincos ; st0=cos(b) st1=sin(b) st2=y st3=z st4=x st5=y st6=z |
276 | fmul st5,st0 |
276 | fmul st5,st0 |
277 | fmulp st6,st0 ; st0=sin(b) st1=y st2=z st3=x st4=y*cos(b) st5=z*cos(b) |
277 | fmulp st6,st0 ; st0=sin(b) st1=y st2=z st3=x st4=y*cos(b) st5=z*cos(b) |
278 | fmul st2,st0 |
278 | fmul st2,st0 |
279 | fmulp st1,st0 ; st0=y*sin(b) st1=z*sin(b) st2=x st3=y*cos(b) st4=z*cos(b) |
279 | fmulp st1,st0 ; st0=y*sin(b) st1=z*sin(b) st2=x st3=y*cos(b) st4=z*cos(b) |
280 | fsubp st4,st0 ; st0=z*sin(b) st1=x st2=y*cos(b) st3=z*cos(b)-y*sin(b) |
280 | fsubp st4,st0 ; st0=z*sin(b) st1=x st2=y*cos(b) st3=z*cos(b)-y*sin(b) |
281 | faddp st2,st0 |
281 | faddp st2,st0 |
282 | 282 | ||
283 | ; st0=x st1=y st2=z |
283 | ; st0=x st1=y st2=z |
284 | fistp [x1] |
284 | fistp [x1] |
285 | fistp [y1] |
285 | fistp [y1] |
286 | fmul [Zdepth] ; st0=z*Zdepth |
286 | fmul [Zdepth] ; st0=z*Zdepth |
287 | fiadd [Zcolor] ; st0=z*Zdepth+Zcolor |
287 | fiadd [Zcolor] ; st0=z*Zdepth+Zcolor |
288 | fistp [z_w] ; st0z*Zdepth+Zcolor |
288 | fistp [z_w] ; st0z*Zdepth+Zcolor |
289 | 289 | ||
290 | 290 | ||
291 | push edx |
291 | push edx |
292 | 292 | ||
293 | mov eax,[x1] |
293 | mov eax,[x1] |
294 | add eax,[mid] |
294 | add eax,[mid] |
295 | mul [const480] |
295 | mul [const480] |
296 | add eax,[y1] |
296 | add eax,[y1] |
297 | add eax,[mid] |
297 | add eax,[mid] |
298 | mul [const3] |
298 | mul [const3] |
299 | 299 | ||
300 | mov dl,byte [z_w] ; al=ZZ |
300 | mov dl,byte [z_w] ; al=ZZ |
301 | mov [scr+0+eax],dl |
301 | mov [scr+0+eax],dl |
302 | mov [scr+1+eax],dl |
302 | mov [scr+1+eax],dl |
303 | mov [scr+2+eax],dl |
303 | mov [scr+2+eax],dl |
304 | 304 | ||
305 | pop edx |
305 | pop edx |
306 | ret |
306 | ret |
307 | 307 | ||
308 | 308 | ||
309 | 309 | ||
310 | mix: |
310 | mix: |
311 | fild [p] ; st0=p |
311 | fild [p] ; st0=p |
312 | fmul [mp] ; st0=p=p*mp |
312 | fmul [mp] ; st0=p=p*mp |
313 | fld st0 ; st0=p st1=p |
313 | fld st0 ; st0=p st1=p |
314 | fmul st4,st0 |
314 | fmul st4,st0 |
315 | fmul st3,st0 |
315 | fmul st3,st0 |
316 | fmulp st2,st0 ; st0=p st1=x*p st2=y*p st3=z*p |
316 | fmulp st2,st0 ; st0=p st1=x*p st2=y*p st3=z*p |
317 | 317 | ||
318 | fld1 |
318 | fld1 |
319 | fsubrp st1,st0 ; st0=1-p st1=x*p st2=y*p st3=z*p |
319 | fsubrp st1,st0 ; st0=1-p st1=x*p st2=y*p st3=z*p |
320 | fld [z1] ; st0=z1 st1=1-p st2=x*p st3=y*p st4=z*p |
320 | fld [z1] ; st0=z1 st1=1-p st2=x*p st3=y*p st4=z*p |
321 | fmul st0,st1 |
321 | fmul st0,st1 |
322 | faddp st4,st0 |
322 | faddp st4,st0 |
323 | fld [y1] ; st0=y1 st1=1-p st2=x*p st3=y*p st4= |
323 | fld [y1] ; st0=y1 st1=1-p st2=x*p st3=y*p st4= |
324 | fmul st0,st1 |
324 | fmul st0,st1 |
325 | faddp st3,st0 |
325 | faddp st3,st0 |
326 | fld [x1] ; st0=x1 st1=1-p st2=x*p st3=y*p+y1*(1-p) st4= |
326 | fld [x1] ; st0=x1 st1=1-p st2=x*p st3=y*p+y1*(1-p) st4= |
327 | fmulp st1,st0 ; st0=x1*(1-p) st1=x*p st2=y*p+y1*(1-p) st3= |
327 | fmulp st1,st0 ; st0=x1*(1-p) st1=x*p st2=y*p+y1*(1-p) st3= |
328 | faddp st1,st0 ; st0=x=x*p+x1*(1-p) st1=y=y*p+y1*(1-p) st2=z |
328 | faddp st1,st0 ; st0=x=x*p+x1*(1-p) st1=y=y*p+y1*(1-p) st2=z |
329 | ret |
329 | ret |
330 | 330 | ||
331 | 331 | ||
332 | filling_alfbet: |
332 | filling_alfbet: |
333 | ; Initialize RND |
333 | ; Initialize RND |
334 | mov eax,3 |
334 | mov eax,3 |
335 | int 40h |
335 | mcall |
336 | ; eax - fist random number |
336 | ; eax - fist random number |
337 | 337 | ||
338 | mov ecx,n_points |
338 | mov ecx,n_points |
339 | mov edi,alfbet |
339 | mov edi,alfbet |
340 | mov ebx,8088405h |
340 | mov ebx,8088405h |
341 | ck2: |
341 | ck2: |
342 | stosd |
342 | stosd |
343 | ; Compute next random number |
343 | ; Compute next random number |
344 | ; New := 8088405H * Old + 1 |
344 | ; New := 8088405H * Old + 1 |
345 | mul ebx |
345 | mul ebx |
346 | inc eax |
346 | inc eax |
347 | loop ck2 |
347 | loop ck2 |
348 | ret |
348 | ret |
349 | 349 | ||
350 | 350 | ||
351 | ; DATA AREA |
351 | ; DATA AREA |
352 | align 2 |
352 | align 2 |
353 | 353 | ||
354 | frame dd 0 |
354 | frame dd 0 |
355 | 355 | ||
356 | mp dd 0.00390625 |
356 | mp dd 0.00390625 |
357 | n_r dd 0.00390625 |
357 | n_r dd 0.00390625 |
358 | 358 | ||
359 | mal_r dd 6.28318530717958648 |
359 | mal_r dd 6.28318530717958648 |
360 | mbt_r dd 6.28318530717958648 |
360 | mbt_r dd 6.28318530717958648 |
361 | 361 | ||
362 | const3 dd 3 |
362 | const3 dd 3 |
363 | const6 dw 6 |
363 | const6 dw 6 |
364 | const480 dd 480 |
364 | const480 dd 480 |
365 | 365 | ||
366 | mFl dd n_points |
366 | mFl dd n_points |
367 | pp1 dw 0 |
367 | pp1 dw 0 |
368 | 368 | ||
369 | Zdepth dd 0.3 |
369 | Zdepth dd 0.3 |
370 | Zcolor dw 140 |
370 | Zcolor dw 140 |
371 | 371 | ||
372 | mid dd 240 ; centre of screen |
372 | mid dd 240 ; centre of screen |
373 | 373 | ||
374 | speed1 dd speed |
374 | speed1 dd speed |
375 | flscr db fullscreen |
375 | flscr db fullscreen |
376 | 376 | ||
377 | align 4 |
377 | align 4 |
378 | 378 | ||
379 | outsize dd ? |
379 | outsize dd ? |
380 | posy dw ? |
380 | posy dw ? |
381 | posx dw ? |
381 | posx dw ? |
382 | maxy dw ? |
382 | maxy dw ? |
383 | maxx dw ? |
383 | maxx dw ? |
384 | 384 | ||
385 | Fl dd ? |
385 | Fl dd ? |
386 | 386 | ||
387 | p dd ? |
387 | p dd ? |
388 | al_r dd ? |
388 | al_r dd ? |
389 | bt_r dd ? |
389 | bt_r dd ? |
390 | 390 | ||
391 | 391 | ||
392 | pp0adr dd ? |
392 | pp0adr dd ? |
393 | pp1adr dd ? |
393 | pp1adr dd ? |
394 | 394 | ||
395 | z_w dw ? |
395 | z_w dw ? |
396 | 396 | ||
397 | x1 dd ? |
397 | x1 dd ? |
398 | y1 dd ? |
398 | y1 dd ? |
399 | z1 dd ? |
399 | z1 dd ? |
400 | 400 | ||
401 | align 16 |
401 | align 16 |
402 | alfbet: ; alfbet db n_points*4 dup (?) |
402 | alfbet: ; alfbet db n_points*4 dup (?) |
403 | scr = alfbet+n_points*4 ; scr db 480*480*3+1 dup (?) |
403 | scr = alfbet+n_points*4 ; scr db 480*480*3+1 dup (?) |
404 | i_end = scr+480*480*3+1 ; i_param db 256 dup (?) |
404 | i_end = scr+480*480*3+1 ; i_param db 256 dup (?) |