Rev 6619 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2984 | leency | 1 | do_sinus: |
2 | .x equ [ebp-8] |
||
3 | .y equ [ebp-12] |
||
4 | .new_y equ [ebp-16] |
||
5 | .temp equ [ebp-20] |
||
6 | push ebp |
||
7 | mov ebp,esp |
||
8 | sub esp,64 |
||
9 | mov dword .x,0 |
||
10 | mov dword .y,0 |
||
11 | mov esi,[screen_ptr] |
||
12 | mov edi,[Zbuffer_ptr] |
||
13 | push edi |
||
14 | ; clear Zbuffer temporally used as image buffer |
||
6619 | leency | 15 | movzx ecx,word[size_x_var] |
16 | movzx eax,word[size_y_var] |
||
17 | imul ecx,eax ;SIZE_X*SIZE_Y |
||
2984 | leency | 18 | xor eax,eax |
19 | cld |
||
20 | rep stosd |
||
21 | pop edi |
||
22 | ; movzx eax,[sinus_flag] |
||
23 | ; mov edx,10 |
||
24 | ; mul edx |
||
25 | ; mov [sin_amplitude],eax |
||
26 | ; mov [sin_frq],eax |
||
27 | fninit |
||
28 | ;if Ext = SSE2 |
||
29 | ; movups xmm1,[const0123] ; xmm1 - init values |
||
30 | ; mov eax,0x000000ff |
||
31 | ; movd xmm2,eax |
||
32 | ; shufps xmm2,xmm2,0 ; xmm2 - mask value |
||
33 | ; mov eax,4 |
||
34 | ; movd xmm3,eax |
||
35 | ; shufps xmm3,xmm3,0 |
||
36 | .again: |
||
37 | if 0 |
||
38 | fild dword .x |
||
39 | fidiv [sin_frq] |
||
40 | fsin |
||
41 | fimul [sin_amplitude] |
||
42 | fiadd dword .y |
||
43 | fistp dword .new_y |
||
44 | else |
||
45 | fild dword .x |
||
46 | fmul [sin_frq] |
||
47 | fistp dword .temp |
||
48 | mov eax, .temp |
||
49 | ; mov bx, [angle_x] |
||
50 | ; add bx, [angle_y] |
||
51 | ; movzx ebx,bx |
||
52 | ; shr ebx,1 ; change phase |
||
53 | ; add eax,ebx |
||
54 | |||
55 | |||
56 | and eax, 0x000000ff |
||
57 | |||
58 | ; cdq |
||
59 | ; mul [sin_frq] |
||
60 | ; and eax,0x000000ff |
||
61 | ; and ax,0x00ff |
||
62 | ; cwde |
||
63 | |||
64 | fld dword [sin_tab+eax*4] |
||
65 | fimul dword [sin_amplitude] |
||
66 | fiadd dword .y |
||
67 | fistp dword .new_y |
||
68 | end if |
||
69 | mov eax,.new_y |
||
70 | or eax,eax |
||
71 | jl .skip |
||
6619 | leency | 72 | movzx ebx,word[size_y_var] |
73 | cmp eax,ebx ;SIZE_Y |
||
2984 | leency | 74 | jg .skip |
6619 | leency | 75 | movzx edx,word[size_x_var] |
76 | mul edx |
||
77 | ; shl eax,9 |
||
2984 | leency | 78 | add eax,dword .x |
79 | lea ebx,[eax*3] |
||
80 | mov eax,[esi] |
||
81 | mov [edi+ebx],eax |
||
82 | .skip: |
||
83 | add esi,3 |
||
84 | inc dword .x |
||
6619 | leency | 85 | movzx edx,word[size_x_var] |
86 | cmp dword .x,edx ;SIZE_X |
||
2984 | leency | 87 | jl .again |
88 | mov dword .x,0 |
||
89 | inc dword .y |
||
6619 | leency | 90 | movzx edx,word[size_y_var] |
91 | cmp dword .y,edx ;SIZE_Y |
||
2984 | leency | 92 | jl .again |
93 | |||
94 | ; copy from temporary buffer -> Zbuffer to screen |
||
95 | mov esi,[Zbuffer_ptr] |
||
96 | mov edi,[screen_ptr] |
||
6619 | leency | 97 | movzx ecx,word[size_x_var] |
98 | movzx eax,word[size_y_var] |
||
99 | imul ecx,eax |
||
100 | lea ecx,[ecx*3] |
||
101 | shr ecx,2 |
||
102 | ; mov ecx,SIZE_X*SIZE_Y*3/4 |
||
2984 | leency | 103 | cld |
104 | rep movsd |
||
105 | |||
106 | |||
107 | mov esp,ebp |
||
108 | pop ebp |
||
109 | ret |
||
110 | |||
111 | |||
1245 | hidnplayr | 112 | draw_dots: |
113 | mov esi,[points_translated_ptr] |
||
114 | movzx ecx,[points_count_var] |
||
115 | .drw: |
||
116 | @@: |
||
117 | lodsd |
||
118 | add esi,2 ; skip z |
||
119 | movzx ebx,ax |
||
120 | shr eax,16 ; bx = x , ax = y |
||
121 | or ax,ax |
||
122 | jl @f |
||
123 | or bx,bx |
||
124 | jl @f |
||
6619 | leency | 125 | cmp ax,[size_y_var] ;SIZE_Y |
1245 | hidnplayr | 126 | jge @f |
6619 | leency | 127 | cmp bx,[size_x_var] ;SIZE_X |
1245 | hidnplayr | 128 | jge @f |
6619 | leency | 129 | movzx edx,word[size_x_var] ;SIZE_X ; SIZE_X not only power of 2 -> 256,512,... |
1245 | hidnplayr | 130 | mul edx |
131 | add eax,ebx |
||
132 | mov edi,[screen_ptr] |
||
133 | lea eax,[eax*3] |
||
134 | add edi,eax |
||
135 | xor eax,eax |
||
136 | not eax |
||
137 | stosd |
||
138 | @@: |
||
139 | loop .drw |
||
140 | |||
141 | ret |
||
142 | |||
6619 | leency | 143 | do_emboss: ; sse2 version only |
144 | if Ext >= SSE2 |
||
145 | movzx ecx,[bumps_deep_flag] |
||
146 | inc ecx |
||
147 | call blur_screen ;blur n times |
||
148 | |||
149 | mov eax,[size_y_var] ;load both x, y |
||
150 | mov ebx,eax |
||
151 | shr ebx,16 |
||
152 | cwde |
||
153 | mul ebx |
||
154 | mov ecx,eax |
||
155 | sub ecx,ebx |
||
156 | sub ecx,ebx |
||
157 | mov esi,[screen_ptr] |
||
158 | mov edi,[Zbuffer_ptr] |
||
159 | lea ebx,[ebx*3] |
||
160 | mov edx,esi |
||
161 | add esi,ebx |
||
162 | lea ebx,[ebx+esi] |
||
163 | pxor xmm0,xmm0 |
||
164 | push eax |
||
165 | @@: |
||
166 | movlps xmm1,[esi+3] |
||
167 | movhps xmm1,[esi+6] |
||
168 | punpcklbw xmm1,xmm0 |
||
169 | movlps xmm2,[esi-3] |
||
170 | movhps xmm2,[esi] |
||
171 | punpcklbw xmm2,xmm0 |
||
172 | movlps xmm3,[ebx] |
||
173 | movhps xmm3,[ebx+3] |
||
174 | movlps xmm4,[edx] |
||
175 | movhps xmm4,[edx+3] |
||
176 | punpcklbw xmm3,xmm0 |
||
177 | punpcklbw xmm4,xmm0 |
||
178 | psubsw xmm1,xmm2 |
||
6769 | IgorA | 179 | paddw xmm1,[emboss_bias] |
6619 | leency | 180 | psubsw xmm3,xmm4 |
6769 | IgorA | 181 | paddw xmm3,[emboss_bias] |
6619 | leency | 182 | pmulhw xmm1,xmm3 |
183 | movaps xmm7,xmm1 |
||
184 | movaps xmm6,xmm1 |
||
185 | psrlq xmm7,2*8 |
||
186 | psrlq xmm6,4*8 |
||
187 | pmaxsw xmm1,xmm7 |
||
188 | pmaxsw xmm1,xmm6 |
||
189 | |||
190 | if 0 |
||
191 | movaps xmm7,xmm3 |
||
192 | movaps xmm6,xmm3 |
||
193 | psrlq xmm7,2*8 |
||
194 | psrlq xmm6,4*8 |
||
195 | pmaxsw xmm3,xmm7 |
||
196 | pmaxsw xmm3,xmm6 |
||
197 | end if |
||
198 | pmaxsw xmm1,xmm3 |
||
199 | |||
200 | movd eax,xmm1 |
||
201 | movzx eax,al |
||
202 | lea eax,[eax*3+envmap_cub] |
||
203 | mov eax,[eax] |
||
204 | mov [edi],eax ;xmm1 |
||
205 | psrldq xmm1,8 |
||
206 | movd eax,xmm1 |
||
207 | movzx eax,al |
||
208 | lea eax,[eax*3+envmap_cub] |
||
209 | mov eax,[eax] |
||
210 | mov [edi+4],eax |
||
211 | |||
212 | |||
213 | add edi,8 |
||
214 | add esi,6 |
||
215 | add ebx,6 |
||
216 | add edx,6 |
||
217 | sub ecx,2 |
||
218 | jnc @b |
||
219 | |||
220 | |||
221 | pop ecx ;,eax |
||
222 | mov edi,[screen_ptr] |
||
223 | mov esi,[Zbuffer_ptr] |
||
224 | @@: |
||
225 | movsd |
||
226 | dec edi |
||
227 | loop @b |
||
228 | end if |
||
229 | ret |
||
230 | |||
6769 | IgorA | 231 | ;align 16 |
232 | ; emboss_bias: |
||
233 | ; dw 128, 128, 128, 128, 128, 128, 128, 128 |
||
6619 | leency | 234 | |
235 | if 0 ; old emb proc |
||
236 | |||
1245 | hidnplayr | 237 | ; emboss - after drawing all, |
238 | ; transfer screen buffer into bump map |
||
239 | ; and draw two bump triangles |
||
240 | ; ************************************* |
||
241 | mov esi,screen |
||
242 | mov edi,bumpmap2 |
||
243 | mov ecx,TEXTURE_SIZE/3 |
||
244 | cld |
||
245 | if Ext=NON |
||
246 | xor eax,eax |
||
247 | xor bh,bh |
||
248 | xor dh,dh |
||
249 | @@: |
||
250 | lodsb |
||
251 | movzx bx,al |
||
252 | lodsb |
||
253 | movzx dx,al |
||
254 | lodsb |
||
255 | add ax,bx |
||
256 | add ax,dx |
||
257 | ; cwd |
||
258 | ; div [i3] |
||
259 | ;; push ax |
||
260 | ;; pop bx |
||
261 | ;; shr bx,3 |
||
262 | ;; shr ax,2 |
||
263 | ;; add ax,bx |
||
264 | |||
265 | lea eax,[eax*5] |
||
266 | shr ax,4 |
||
267 | |||
268 | stosb |
||
269 | loop @b |
||
270 | else |
||
271 | emms |
||
272 | pxor mm1,mm1 |
||
273 | mov ebx,0x0000ffff |
||
274 | @@: |
||
275 | movd mm0,[esi] |
||
276 | punpcklbw mm0,mm1 |
||
277 | movq mm2,mm0 |
||
278 | psrlq mm2,16 |
||
279 | movq mm3,mm0 |
||
280 | psrlq mm3,32 |
||
281 | paddw mm0,mm2 |
||
282 | paddw mm0,mm3 |
||
283 | |||
284 | |||
285 | movd eax,mm0 |
||
286 | and eax,ebx |
||
287 | lea eax,[eax*5] |
||
288 | shr ax,4 |
||
289 | stosb |
||
290 | add esi,3 |
||
291 | loop @b |
||
292 | |||
293 | end if |
||
294 | push ebp |
||
295 | |||
296 | push dword 0 ; env coords |
||
297 | push word 0 |
||
298 | push word SIZE_X |
||
299 | push word SIZE_Y |
||
300 | push dword 0 |
||
301 | push dword 0 ; bump coords |
||
302 | push word SIZE_X |
||
303 | push word SIZE_Y |
||
304 | push word 0 |
||
305 | mov eax,SIZE_Y |
||
306 | mov ebx,SIZE_X*65536+0 |
||
307 | xor ecx,ecx |
||
308 | mov edx,bumpmap2 |
||
309 | mov esi,envmap |
||
310 | mov edi,screen |
||
311 | call bump_triangle |
||
312 | |||
313 | push dword SIZE_X shl 16 + SIZE_Y ; env coords |
||
314 | push word 0 |
||
315 | push word SIZE_X |
||
316 | push word SIZE_Y |
||
317 | push word 0 |
||
318 | push dword SIZE_X shl 16 + SIZE_Y ; bump coords |
||
319 | push word 0 |
||
320 | push word SIZE_X |
||
321 | push word SIZE_Y |
||
322 | push word 0 |
||
323 | mov eax,SIZE_Y |
||
324 | mov ebx,SIZE_X * 65536+0 |
||
325 | mov ecx,SIZE_X shl 16 + SIZE_Y |
||
326 | mov edx,bumpmap2 |
||
327 | mov esi,envmap |
||
328 | mov edi,screen |
||
329 | call bump_triangle |
||
330 | |||
331 | pop ebp |
||
332 | ret |
||
6619 | leency | 333 | end if |
1245 | hidnplayr | 334 | ;********************************EMBOSS DONE******************************* |
335 | |||
336 | |||
337 | generate_object2: ; torus |
||
338 | ;in ax - figure number 2=torus, 3=loop, 4=loop |
||
339 | ;locals |
||
340 | ; counter dw ? |
||
341 | ; sin dd ? |
||
342 | ; cos dd ? |
||
343 | ;endl |
||
344 | .counter equ word[ebp-2] |
||
345 | .sin equ dword[ebp-6] |
||
346 | .cos equ dword[ebp-10] |
||
347 | .sin2 equ dword[ebp-14] |
||
348 | .cos2 equ dword[ebp-18] |
||
349 | .piD180m3 equ dword[ebp-22] |
||
350 | .cD2 equ word[ebp-24] |
||
351 | push ebp |
||
352 | mov ebp,esp |
||
353 | sub esp,24 |
||
354 | |||
355 | push ax |
||
356 | |||
357 | fninit |
||
358 | mov edi,[points_ptr] |
||
359 | xor eax,eax |
||
360 | ; init seed -> 4 3d points |
||
361 | mov dword[edi],-1.0 ; x |
||
362 | add edi,4 |
||
363 | stosd ; y |
||
364 | stosd ; z |
||
365 | mov dword[edi],-0.9 ; x1 |
||
366 | mov dword[edi+4],0.1 ; y1 |
||
367 | add edi,8 |
||
368 | stosd ; z1 |
||
369 | mov dword[edi],-0.8 |
||
370 | add edi,4 |
||
371 | stosd |
||
372 | stosd |
||
373 | mov dword[edi],-0.9 ; x3 |
||
374 | mov dword[edi+4],-0.1 ; y3 |
||
375 | add edi,8 |
||
376 | stosd ; z3 |
||
377 | mov [points_count_var],4 |
||
378 | |||
379 | fld [piD180] |
||
380 | fidiv [i3] |
||
381 | fstp .piD180m3 |
||
382 | mov .cD2,5 |
||
383 | |||
384 | pop ax |
||
385 | mov ecx,1 |
||
386 | mov edx,9 |
||
387 | .next: ; calc angle and rotate seed 4 points |
||
388 | mov .counter,cx |
||
389 | mov ebx,[points_ptr] |
||
390 | fld .piD180m3 |
||
391 | fimul .counter |
||
392 | fld st |
||
393 | fsincos |
||
394 | fstp .sin |
||
395 | fstp .cos |
||
396 | fadd st,st0 |
||
397 | fsincos |
||
398 | fstp .sin2 |
||
399 | fstp .cos2 |
||
400 | |||
401 | .rotor: ; next 4 |
||
402 | ; rotary y |
||
403 | fld dword[ebx] ; x |
||
404 | fld .sin |
||
405 | fmul dword[ebx+8] ; z * sinbeta |
||
406 | fchs |
||
407 | fld .cos |
||
408 | fmul dword[ebx] ; x * cosbeta |
||
409 | faddp |
||
410 | fstp dword[edi] ; new x |
||
411 | fmul .sin ; old x * sinbeta |
||
412 | fld .cos |
||
413 | fmul dword[ebx+8] ; z * cosbeta |
||
414 | faddp |
||
415 | dec dx |
||
416 | or dx,dx |
||
417 | jnz @f |
||
418 | ; mov .counter,dx |
||
419 | fld st |
||
420 | fidiv [i3] |
||
421 | faddp |
||
422 | @@: |
||
423 | fstp dword[edi+8] ; new z |
||
424 | fld dword[ebx+4] |
||
425 | or dx,dx |
||
426 | jnz @f |
||
427 | ; fld1 |
||
428 | ; faddp |
||
429 | ; fld st |
||
430 | fadd st,st0 |
||
431 | fadd st,st0 |
||
432 | ; fxch |
||
433 | ; fimul [i3] |
||
434 | ; fsin |
||
435 | ; faddp |
||
436 | mov dx,9 |
||
437 | @@: |
||
438 | fstp dword[edi+4] |
||
439 | ; rotary x |
||
440 | cmp al,3 |
||
441 | jl .end_rot |
||
442 | fld dword[edi+4] ;y |
||
443 | fld .sin2 |
||
444 | fmul dword[edi+8] ;z |
||
445 | fld .cos2 |
||
446 | fmul dword[edi+4] ;y |
||
447 | faddp |
||
448 | fstp dword[edi+4] ; new y |
||
449 | fmul .sin2 ; sinbeta * old y |
||
450 | fchs |
||
451 | fld .cos2 |
||
452 | fmul dword[edi+8] |
||
453 | faddp |
||
454 | fstp dword[edi+8] |
||
455 | ; rotary z |
||
456 | cmp al,4 |
||
457 | jl .end_rot |
||
458 | fld dword[edi] ;x |
||
459 | fld .sin |
||
460 | fmul dword[edi+4] ;y |
||
461 | fld .cos |
||
462 | fmul dword[edi] ;x |
||
463 | faddp |
||
464 | fstp dword[edi] ;new x |
||
465 | fmul .sin ; sinbeta * old x |
||
466 | fchs |
||
467 | fld .cos |
||
468 | fmul dword[edi+4] ; cosbeta * y |
||
469 | faddp |
||
470 | fstp dword[edi+4] ; new y |
||
471 | |||
472 | |||
473 | |||
474 | .end_rot: |
||
475 | |||
476 | add edi,12 |
||
477 | add ebx,12 |
||
478 | mov esi,[points_ptr] |
||
479 | add esi,12*4 |
||
480 | cmp ebx,esi |
||
481 | jl .rotor |
||
482 | |||
483 | add [points_count_var],4 |
||
484 | add cx,18 |
||
485 | cmp cx,(18*21*3)+1 |
||
486 | jle .next |
||
487 | |||
488 | mov edi,[triangles_ptr] |
||
489 | mov ax,4 |
||
490 | mov bx,4+4 |
||
491 | mov [triangles_count_var],164*3 ;140 |
||
492 | |||
493 | mov cx,80*3 ;68 |
||
494 | @@: |
||
495 | stosw ;---- |
||
496 | mov [edi],bx ; | |
||
497 | add edi,2 ; | |
||
498 | inc ax ; | |
||
499 | stosw ; |repeat 4 times |
||
500 | |||
501 | mov [edi],bx ; | |
||
502 | inc bx |
||
503 | add edi,2 |
||
504 | stosw ; | |
||
505 | mov [edi],bx ; | |
||
506 | add edi,2 ;---- |
||
507 | loop @b |
||
508 | |||
509 | |||
510 | mov dword[edi],-1 ; < - end mark |
||
511 | mov [culling_flag],0 |
||
512 | |||
513 | mov esp,ebp |
||
514 | pop ebp |
||
515 | |||
516 | ret |
||
517 | |||
518 | |||
519 | generate_object3: ; heart |
||
520 | ;locals |
||
521 | ; counter dw ? |
||
522 | ; sin dd ? |
||
523 | ; cos dd ? |
||
524 | ;endl |
||
525 | .counter equ word[ebp-2] |
||
526 | .sin equ dword[ebp-6] |
||
527 | .cos equ dword[ebp-10] |
||
528 | .sin2 equ dword[ebp-14] |
||
529 | .cos2 equ dword[ebp-18] |
||
530 | .piD180m3 equ dword[ebp-22] |
||
531 | .cD2 equ word[ebp-24] |
||
532 | push ebp |
||
533 | mov ebp,esp |
||
534 | sub esp,24 |
||
535 | |||
536 | fninit |
||
537 | mov edi,[points_ptr] |
||
538 | xor eax,eax |
||
539 | ; init seed -> eight 3d points |
||
540 | mov dword[edi],2.0 |
||
541 | add edi,4 |
||
542 | stosd |
||
543 | stosd |
||
544 | |||
545 | mov dword[edi],2.0 |
||
546 | mov dword[edi+4],-0.5 |
||
547 | add edi,8 |
||
548 | stosd |
||
549 | |||
550 | mov dword[edi],1.5 |
||
551 | mov dword[edi+4],-1.5 |
||
552 | add edi,8 |
||
553 | stosd |
||
554 | mov dword[edi],1.0 |
||
555 | mov dword[edi+4],-2.0 |
||
556 | add edi,8 |
||
557 | stosd |
||
558 | |||
559 | stosd |
||
560 | mov dword[edi],-2.5 |
||
561 | add edi,4 |
||
562 | stosd |
||
563 | |||
564 | mov [points_count_var],5 |
||
565 | |||
566 | mov ecx,1 |
||
567 | .next: ; calc angle and rotate seed 4 points |
||
568 | mov .counter,cx |
||
569 | mov ebx,[points_ptr] |
||
570 | fld [piD180] |
||
571 | fimul .counter |
||
572 | fsincos |
||
573 | fstp .sin |
||
574 | fstp .cos |
||
575 | |||
576 | .rotor: ; next 4 |
||
577 | ; rotary y |
||
578 | fld dword[ebx] ; x |
||
579 | fld .sin |
||
580 | fmul dword[ebx+8] ; z * sinbeta |
||
581 | fchs |
||
582 | fld .cos |
||
583 | fmul dword[ebx] ; x * cosbeta |
||
584 | faddp |
||
585 | fidiv [i3] |
||
586 | fstp dword[edi] ; new x |
||
587 | fmul .sin ; old x * sinbeta |
||
588 | fld .cos |
||
589 | fmul dword[ebx+8] ; z * cosbeta |
||
590 | faddp |
||
591 | fstp dword[edi+8] ; new z |
||
592 | |||
593 | fld dword[ebx+4] ;y |
||
594 | fstp dword[edi+4] |
||
595 | |||
596 | |||
597 | .end_rot: |
||
598 | |||
599 | add edi,12 |
||
600 | add ebx,12 |
||
601 | mov esi,[points_ptr] |
||
602 | add esi,12*5 |
||
603 | cmp ebx,esi ;real_points + (12*5) |
||
604 | jl .rotor |
||
605 | |||
606 | add [points_count_var],5 |
||
607 | add cx,18 |
||
608 | cmp cx,(18*21)+1 |
||
609 | jle .next |
||
610 | ;last points |
||
611 | |||
612 | xor eax,eax |
||
613 | |||
614 | mov dword[edi],0.22 |
||
615 | mov dword[edi+4],0.77 |
||
616 | mov dword[edi+8],1.25 |
||
617 | add edi,12 |
||
618 | |||
619 | mov dword[edi],0.22 |
||
620 | mov dword[edi+4],0.77 |
||
621 | mov dword[edi+8],-1.25 |
||
622 | add edi,12 |
||
623 | stosd |
||
624 | |||
625 | add [points_count_var],2 |
||
626 | |||
627 | ; init triangles list |
||
628 | |||
629 | mov edi,[triangles_ptr] |
||
630 | mov ax,5 |
||
631 | mov bx,5+5 |
||
632 | mov [triangles_count_var],204 |
||
633 | |||
634 | mov cx,100 |
||
635 | @@: |
||
636 | stosw ;---- |
||
637 | mov [edi],bx ; | |
||
638 | add edi,2 ; | |
||
639 | inc ax ; | |
||
640 | stosw ; |repeat |
||
641 | |||
642 | mov [edi],bx ; | |
||
643 | inc bx |
||
644 | add edi,2 |
||
645 | stosw ; | |
||
646 | mov [edi],bx ; | |
||
647 | add edi,2 ;---- |
||
648 | loop @b |
||
649 | |||
650 | mov ax,5 |
||
651 | mov bx,[points_count_var] |
||
652 | sub bx,2 |
||
653 | mov dl,2 |
||
654 | .nx: |
||
655 | mov cx,5 |
||
656 | add [triangles_count_var],cx |
||
657 | @@: |
||
658 | stosw |
||
659 | add ax,5 |
||
660 | stosw |
||
661 | mov word[edi],bx |
||
662 | add edi,2 |
||
663 | loop @b |
||
664 | |||
665 | cmp dl,1 |
||
666 | je @f |
||
667 | |||
668 | inc bx |
||
669 | jmp .lab |
||
670 | @@: |
||
671 | dec bx |
||
672 | .lab: |
||
673 | mov cx,5 |
||
674 | add [triangles_count_var],cx |
||
675 | @@: |
||
676 | stosw |
||
677 | add ax,5 |
||
678 | stosw |
||
679 | mov word[edi],bx |
||
680 | add edi,2 |
||
681 | loop @b |
||
682 | |||
683 | dec dl |
||
684 | or dl,dl |
||
685 | jnz .nx |
||
686 | |||
687 | sub ax,25 |
||
688 | stosw |
||
689 | sub ax,50 |
||
690 | stosw |
||
691 | mov word[edi],bx |
||
692 | add edi,2 |
||
693 | |||
694 | stosw |
||
695 | add ax,50 |
||
696 | stosw |
||
697 | inc bx |
||
698 | mov word[edi],bx |
||
699 | add edi,2 |
||
700 | add [triangles_count_var],2 |
||
701 | |||
702 | mov dword[edi],-1 ; < - end mark |
||
703 | mov [culling_flag],0 |
||
704 | |||
705 | mov esp,ebp |
||
706 | pop ebp |
||
707 | |||
708 | ret>> |