Rev 7280 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7280 | Rev 8014 | ||
---|---|---|---|
Line 278... | Line 278... | ||
278 | mov .maxxx,0 |
278 | mov .maxxx,0 |
279 | mov ecx,3 |
279 | mov ecx,3 |
280 | xor ebx,ebx ; ebx - x,y,z coord in real_points list |
280 | xor ebx,ebx ; ebx - x,y,z coord in real_points list |
281 | .next_c: ; max/min/center x,y,z |
281 | .next_c: ; max/min/center x,y,z |
282 | mov edi,[points_ptr] ; in real_point list minimum two points |
282 | mov edi,[points_ptr] ; in real_point list minimum two points |
283 | mov dx,[points_count_var] |
283 | mov edx,[points_count_var] |
284 | fld dword[edi+ebx] |
284 | fld dword[edi+ebx] |
285 | fst .max |
285 | fst .max |
286 | fstp .min |
286 | fstp .min |
287 | add edi,12 |
287 | add edi,12 |
288 | dec dx |
288 | dec edx |
289 | .next_coord: ; next coord from real_points list |
289 | .next_coord: ; next coord from real_points list |
290 | fld dword [edi+ebx] ; real_points -> x,y,z |
290 | fld dword [edi+ebx] ; real_points -> x,y,z |
291 | fcom .max ; max_x,y,z |
291 | fcom .max ; max_x,y,z |
292 | fstsw ax |
292 | fstsw ax |
293 | sahf |
293 | sahf |
Line 303... | Line 303... | ||
303 | @@: |
303 | @@: |
304 | ffree st |
304 | ffree st |
305 | .end_coords: |
305 | .end_coords: |
306 | add edi,12 |
306 | add edi,12 |
307 | ; cmp dword[edi],-1 ; cmp with end mark |
307 | ; cmp dword[edi],-1 ; cmp with end mark |
308 | dec dx |
308 | dec edx |
309 | jnz .next_coord |
309 | jnz .next_coord |
310 | ; ok after this we found max_coord and min_coord |
310 | ; ok after this we found max_coord and min_coord |
311 | fld .max ; find center point |
311 | fld .max ; find center point |
312 | fadd .min |
312 | fadd .min |
313 | fld1 |
313 | fld1 |
Line 324... | Line 324... | ||
324 | jbe @f ; jmp lower |
324 | jbe @f ; jmp lower |
325 | fst .maxxx ; new maxx |
325 | fst .maxxx ; new maxx |
326 | @@: |
326 | @@: |
327 | ffree st |
327 | ffree st |
328 | mov edi,[points_ptr] |
328 | mov edi,[points_ptr] |
329 | mov dx,[points_count_var] ; substraction all coords - center point |
329 | mov edx,[points_count_var] ; substraction all coords - center point |
330 | @@: |
330 | @@: |
331 | fld dword[edi+ebx] |
331 | fld dword[edi+ebx] |
332 | fsub .center |
332 | fsub .center |
333 | fstp dword[edi+ebx] |
333 | fstp dword[edi+ebx] |
334 | add edi,12 |
334 | add edi,12 |
335 | ; cmp dword[edi],-1 |
335 | ; cmp dword[edi],-1 |
336 | ; jne @b |
336 | ; jne @b |
337 | dec dx |
337 | dec edx |
338 | jnz @b |
338 | jnz @b |
Line 339... | Line 339... | ||
339 | 339 | ||
340 | add ebx,4 ; ebx - x,y,z cooficientes in list real_points |
340 | add ebx,4 ; ebx - x,y,z cooficientes in list real_points |
341 | dec ecx |
341 | dec ecx |
Line 342... | Line 342... | ||
342 | jnz .next_c |
342 | jnz .next_c |
343 | 343 | ||
344 | fld .maxxx |
344 | fld .maxxx |
345 | mov edi,[points_ptr] ; create all coords in <-1.0,1.0> |
345 | mov edi,[points_ptr] ; create all coords in <-1.0,1.0> |
346 | movzx ecx,[points_count_var] |
346 | mov ecx,[points_count_var] |
347 | @@: |
347 | @@: |
348 | fld dword[edi] |
348 | fld dword[edi] |
349 | fdiv .maxxx |
349 | fdiv .maxxx |
Line 403... | Line 403... | ||
403 | 403 | ||
404 | 404 | ||
Line 405... | Line 405... | ||
405 | ;init triangles list |
405 | ;init triangles list |
406 | mov edi,[triangles_ptr] |
406 | mov edi,[triangles_ptr] |
407 | 407 | ||
408 | xor si,si |
408 | xor esi,esi |
409 | xor ax,ax |
409 | xor eax,eax |
410 | mov bx,.N+1 |
410 | mov ebx,.N+1 |
411 | mov cx,(.N*2)+2 ;-- |
411 | mov ecx,(.N*2)+2 ;-- |
412 | mov dx,(.N*3)+3 ;--- |
412 | mov edx,(.N*3)+3 ;--- |
413 | mov [triangles_count_var],0 |
413 | mov [triangles_count_var],0 |
414 | .again_tri: |
414 | .again_tri: |
415 | stosw ; main wave |
415 | stosd ; main wave |
416 | mov word[edi],bx |
416 | mov dword[edi],ebx |
417 | inc ax |
417 | inc eax |
418 | add edi,2 |
418 | add edi,4 |
419 | stosw |
419 | stosd |
420 | stosw |
420 | stosd |
Line 421... | Line 421... | ||
421 | mov word[edi],bx |
421 | mov dword[edi],ebx |
Line 422... | Line 422... | ||
422 | inc bx |
422 | inc ebx |
423 | mov word[edi+2],bx |
423 | mov dword[edi+4],ebx |
424 | 424 | ||
425 | 425 | ||
426 | add edi,4 |
426 | add edi,8 |
427 | 427 | ||
428 | mov word[edi],cx ;---- ; n2+2 ; xor ax,ax |
428 | mov dword[edi],ecx ;---- ; n2+2 ; xor ax,ax |
429 | inc cx ; n2+3 ; mov bx,.N+1 |
429 | inc ecx ; n2+3 ; mov bx,.N+1 |
430 | mov word[edi+2],dx ; ; mov cx,(.N*2)+2 ;-- |
430 | mov dword[edi+4],edx ; ; mov cx,(.N*2)+2 ;-- |
431 | mov word[edi+4],cx ; n3+3 ; mov dx,(.N*3)+3 ;--- |
- | |
432 | mov word[edi+6],dx ; n3+3 ; |
- | |
433 | inc dx ; ; |
- | |
434 | mov word[edi+8],dx ; n2+3 ; |
- | |
435 | mov word[edi+10],cx ; n3+4 |
- | |
Line 436... | Line 431... | ||
436 | add edi,12 ;---- |
431 | mov dword[edi+8],ecx ; n3+3 ; mov dx,(.N*3)+3 ;--- |
437 | 432 | mov dword[edi+12],edx ; n3+3 ; |
|
438 | dec ax ; border of wave |
- | |
439 | dec bx |
- | |
440 | dec cx |
- | |
441 | dec dx |
- | |
442 | 433 | inc edx ; ; |
|
443 | stosw ; first border |
- | |
444 | inc ax |
- | |
445 | stosw |
434 | mov dword[edi+16],edx ; n2+3 ; |
446 | mov word[edi],dx |
- | |
Line 447... | Line 435... | ||
447 | add edi,2 |
435 | mov dword[edi+20],ecx ; n3+4 |
448 | 436 | add edi,24 ;---- |
|
449 | mov word[edi],dx |
437 | |
450 | add edi,2 |
438 | dec eax ; border of wave |
- | 439 | dec ebx |
|
Line -... | Line 440... | ||
- | 440 | dec ecx |
|
- | 441 | dec edx |
|
- | 442 | ||
- | 443 | stosd ; first border |
|
- | 444 | inc eax |
|
- | 445 | stosd |
|
- | 446 | mov dword[edi],edx |
|
451 | stosw |
447 | add edi,4 |
- | 448 | ||
- | 449 | mov dword[edi],edx |
|
- | 450 | add edi,4 |
|
- | 451 | stosd |
|
452 | inc dx |
452 | inc edx |
453 | mov word[edi],dx |
453 | mov dword[edi],edx |
454 | 454 | ||
455 | mov word[edi+2],bx ; second border |
455 | mov dword[edi+4],ebx ; second border |
Line 456... | Line 456... | ||
456 | mov word[edi+4],cx |
456 | mov dword[edi+8],ecx |
457 | inc bx |
457 | inc ebx |
458 | mov word[edi+6],bx |
458 | mov dword[edi+12],ebx |
459 | 459 | ||
Line 460... | Line 460... | ||
460 | mov word[edi+8],bx |
460 | mov dword[edi+16],ebx |
461 | mov word[edi+10],cx |
461 | mov dword[edi+20],ecx |
462 | inc cx |
462 | inc ecx |
463 | mov word[edi+12],cx |
463 | mov dword[edi+24],ecx |
464 | add edi,14 |
464 | add edi,28 |
465 | 465 | ||
466 | add [triangles_count_var],8 ;10 |
466 | add [triangles_count_var],8 ;10 |
Line 467... | Line 467... | ||
467 | inc si |
467 | inc esi |
Line 468... | Line 468... | ||
468 | cmp si,.N |
468 | cmp esi,.N |
469 | jne .again_tri |
469 | jne .again_tri |
470 | 470 | ||
471 | add ax,((.N+1)*3)+1 |
471 | add eax,((.N+1)*3)+1 |
Line 822... | Line 822... | ||
822 | shr ecx,3 |
822 | shr ecx,3 |
823 | lea ebx,[ebx*3] |
823 | lea ebx,[ebx*3] |
824 | ; mov ecx,(SIZE_X*(SIZE_Y-3))*3/8 |
824 | ; mov ecx,(SIZE_X*(SIZE_Y-3))*3/8 |
825 | .blr: |
825 | .blr: |
826 | @@: |
826 | @@: |
827 | push ecx |
- | |
828 | mov ecx,edi |
- | |
829 | sub ecx,ebx |
- | |
830 | movq mm0,[edi+ebx] |
827 | movq mm0,[edi+ebx] |
831 | movq mm1,[ecx] |
828 | movq mm1,[edi-ebx] |
832 | movq mm2,[edi-3] |
829 | movq mm2,[edi-3] |
833 | movq mm3,[edi+3] |
830 | movq mm3,[edi+3] |
Line 834... | Line 831... | ||
834 | 831 | ||
835 | pavgb mm0,mm1 |
832 | pavgb mm0,mm1 |
Line 839... | Line 836... | ||
839 | psubusb mm0,mm4 ; importand if fire |
836 | psubusb mm0,mm4 ; importand if fire |
Line 840... | Line 837... | ||
840 | 837 | ||
841 | movq [edi],mm0 |
838 | movq [edi],mm0 |
842 | add edi,8 |
839 | add edi,8 |
843 | add esi,8 |
840 | add esi,8 |
844 | pop ecx |
841 | |
Line 845... | Line 842... | ||
845 | loop .blr |
842 | loop .blr |
846 | 843 | ||
847 | xor eax,eax |
844 | xor eax,eax |
Line 993... | Line 990... | ||
993 | mirror: ; mirror effect - loseless operation |
990 | mirror: ; mirror effect - loseless operation |
994 | ; in ah - button id = 11, 12, 13 |
991 | ; in ah - button id = 11, 12, 13 |
995 | mov edi,[points_ptr] ; one real point - triple float |
992 | mov edi,[points_ptr] ; one real point - triple float |
996 | mov esi,[points_normals_ptr] ; one 3dvector - triple float dword x,y,z |
993 | mov esi,[points_normals_ptr] ; one 3dvector - triple float dword x,y,z |
997 | fninit |
994 | fninit |
998 | movzx ecx,[points_count_var] |
995 | mov ecx,[points_count_var] |
Line 999... | Line 996... | ||
999 | 996 | ||
1000 | cmp ah,11 |
997 | cmp ah,11 |
1001 | je @f |
998 | je @f |
1002 | cmp ah,12 |
999 | cmp ah,12 |
Line 1042... | Line 1039... | ||
1042 | 1039 | ||
1043 | exchange: ; exchange some coords - loseless operation |
1040 | exchange: ; exchange some coords - loseless operation |
1044 | mov edi,[points_ptr] ; one real point - triple float |
1041 | mov edi,[points_ptr] ; one real point - triple float |
1045 | mov esi,[points_normals_ptr] ; one 3dvector - triple float dword x,y,z |
1042 | mov esi,[points_normals_ptr] ; one 3dvector - triple float dword x,y,z |
1046 | fninit ; exchange both points and normal vactors coords/coofics |
1043 | fninit ; exchange both points and normal vactors coords/coofics |
Line 1047... | Line 1044... | ||
1047 | movzx ecx,[points_count_var] |
1044 | mov ecx,[points_count_var] |
1048 | 1045 | ||
1049 | cmp [xchg_flag],1 |
1046 | cmp [xchg_flag],1 |
1050 | je @f |
1047 | je @f |