Rev 1245 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1245 | Rev 1931 | ||
---|---|---|---|
Line 714... | Line 714... | ||
714 | 714 | ||
Line 715... | Line 715... | ||
715 | push .cz1 |
715 | push .cz1 |
716 | push .cz2 |
716 | push .cz2 |
717 | push .z_buff |
717 | push .z_buff |
718 | push .t_emap |
- | |
719 | push .t_bmap |
718 | push .t_bmap |
- | 719 | push .t_emap |
|
720 | push dword .cey2 |
720 | push dword .cey2 |
721 | push .cex2 |
721 | push .cex2 |
722 | push dword .cey1 |
722 | push dword .cey1 |
723 | push .cex1 |
723 | push .cex1 |
724 | push dword .cby2 |
724 | push dword .cby2 |
Line 741... | Line 741... | ||
741 | ;-------------- ebx - x2 |
741 | ;-------------- ebx - x2 |
742 | ;-------------- edi - pointer to screen buffer |
742 | ;-------------- edi - pointer to screen buffer |
743 | ;stack - another parameters : |
743 | ;stack - another parameters : |
744 | .y equ dword [ebp+4] |
744 | .y equ dword [ebp+4] |
745 | .bx1q equ [ebp+8] |
745 | .bx1 equ [ebp+8] ; --- |
746 | .bx1 equ dword [ebp+8] ; --- |
- | |
747 | .by1 equ dword [ebp+12] ; | |
746 | .by1 equ [ebp+12] ; | |
748 | .bx2q equ [ebp+16] |
747 | .bx2 equ [ebp+16] ; | |
749 | .bx2 equ dword [ebp+16] ; | |
- | |
750 | .by2 equ dword [ebp+20] ; |> b. texture and e. texture coords |
748 | .by2 equ [ebp+20] ; |> b. texture and e. texture coords |
751 | .ex1q equ [ebp+24] |
749 | .ex1 equ [ebp+24] ; |> shifted shl ROUND |
752 | .ex1 equ dword [ebp+24] ; |> shifted shl ROUND |
- | |
753 | .ey1 equ dword [ebp+28] ; | |
750 | .ey1 equ [ebp+28] ; | |
754 | .ex2q equ [ebp+32] |
751 | .ex2 equ [ebp+32] ; | |
755 | .ex2 equ dword [ebp+32] ; | |
- | |
756 | .ey2 equ dword [ebp+36] ; --- |
752 | .ey2 equ [ebp+36] ; --- |
757 | .bmap equ dword [ebp+40] ; b texture offset |
753 | .emap equ [ebp+40] ; b texture offset |
758 | .emap equ dword [ebp+44] ; e texture offset |
754 | .bmap equ [ebp+44] ; e texture offset |
759 | .z_buff equ dword [ebp+48] |
755 | .z_buff equ dword [ebp+48] |
760 | .z2 equ dword [ebp+52] ; -- |> z coords shifted |
756 | .z2 equ dword [ebp+52] ; -- |> z coords shifted |
761 | .z1 equ dword [ebp+56] ; -- shl CATMULL_SHIFT |
757 | .z1 equ dword [ebp+56] ; -- shl CATMULL_SHIFT |
762 | 758 | ||
Line 763... | Line 759... | ||
763 | .x1 equ dword [ebp-4] |
759 | .x1 equ dword [ebp-4] |
764 | .x2 equ dword [ebp-8] |
760 | .x2 equ dword [ebp-8] |
765 | .dbx equ dword [ebp-12] |
761 | .dbx equ [ebp-12] |
766 | .dby equ dword [ebp-16] |
762 | .dex equ [ebp-16] |
767 | .dbyq equ qword [ebp-16] ; - new |
- | |
768 | .dex equ dword [ebp-20] |
763 | .dby equ [ebp-20] |
769 | .dey equ dword [ebp-24] |
764 | .dey equ [ebp-24] |
770 | .deyq equ qword [ebp-24] ; - new |
- | |
771 | .dz equ dword [ebp-28] |
765 | .dz equ dword [ebp-28] |
772 | .cbx equ dword [ebp-32] |
766 | .cbx equ [ebp-32] |
773 | .cby equ dword [ebp-36] |
767 | .cex equ [ebp-36] |
774 | .cbyq equ qword [ebp-36] ; - new |
- | |
775 | .cex equ dword [ebp-40] |
768 | .cby equ [ebp-40] |
776 | .cey equ dword [ebp-44] |
769 | .cey equ [ebp-44] |
777 | .ceyq equ qword [ebp-44] ; - new |
- | |
778 | .cz equ dword [ebp-48] |
770 | .cz equ dword [ebp-48] |
779 | .czbuff equ dword [ebp-52] |
771 | .czbuff equ dword [ebp-52] |
Line 780... | Line 772... | ||
780 | 772 | ||
Line 805... | Line 797... | ||
805 | mov edx,.ey1 |
797 | mov edx,.ey1 |
806 | xchg edx,.ey2 |
798 | xchg edx,.ey2 |
807 | mov .ey1,edx |
799 | mov .ey1,edx |
808 | else |
800 | else |
809 | movq mm0,.bx1q |
801 | movq mm0,.bx1 |
810 | movq mm1,.ex1q |
802 | movq mm1,.ex1 |
811 | movq mm2,.bx2q |
803 | movq mm2,.bx2 |
812 | movq mm3,.ex2q |
804 | movq mm3,.ex2 |
813 | movq .bx2q,mm0 |
805 | movq .bx2,mm0 |
814 | movq .ex2q,mm1 |
806 | movq .ex2,mm1 |
815 | movq .bx1q,mm2 |
807 | movq .bx1,mm2 |
816 | movq .ex1q,mm3 |
808 | movq .ex1,mm3 |
817 | end if |
809 | end if |
818 | mov edx,.z1 |
810 | mov edx,.z1 |
819 | xchg edx,.z2 |
811 | xchg edx,.z2 |
820 | mov .z1,edx |
812 | mov .z1,edx |
821 | @@: |
813 | @@: |
822 | push eax ebx |
814 | push eax ebx |
Line 829... | Line 821... | ||
829 | 821 | ||
Line 830... | Line 822... | ||
830 | mov ebx,.x2 |
822 | mov ebx,.x2 |
831 | sub ebx,.x1 |
823 | sub ebx,.x1 |
Line 832... | Line 824... | ||
832 | 824 | ||
Line 833... | Line 825... | ||
833 | if Ext=SSE |
825 | if Ext>=SSE |
834 | 826 | ||
835 | sub esp,16 |
827 | sub esp,16 |
Line 845... | Line 837... | ||
845 | ; cvtpi2ps xmm1,mm1 |
837 | ; cvtpi2ps xmm1,mm1 |
846 | ; movlhps xmm1,xmm1 |
838 | ; movlhps xmm1,xmm1 |
847 | ; cvtpi2ps xmm1,mm3 |
839 | ; cvtpi2ps xmm1,mm3 |
848 | 840 | ||
Line 849... | Line 841... | ||
849 | cvtpi2ps xmm0,.bx1q ;mm0 |
841 | cvtpi2ps xmm0,.bx1 ;mm0 ; bx1; by1 |
850 | movlhps xmm0,xmm0 |
842 | movlhps xmm0,xmm0 |
851 | cvtpi2ps xmm0,.ex1q ;mm2 |
843 | cvtpi2ps xmm0,.ex1 ;mm2 ; ex1; ey1 |
852 | cvtpi2ps xmm1,.bx2q ;mm1 |
844 | cvtpi2ps xmm1,.bx2 ;mm1 ; bx2; by2 |
853 | movlhps xmm1,xmm1 |
845 | movlhps xmm1,xmm1 |
854 | cvtpi2ps xmm1,.ex2q ;mm3 |
846 | cvtpi2ps xmm1,.ex2 ;mm3 ; ex2; ey2 |
855 | subps xmm1,xmm0 |
847 | subps xmm1,xmm0 |
- | 848 | ; hi lo |
|
- | 849 | divps xmm1,xmm3 ; xmm1 -> dby; dbx; dey; dex |
|
Line 856... | Line -... | ||
856 | - | ||
857 | divps xmm1,xmm3 |
- | |
858 | 850 | ||
859 | shufps xmm1,xmm1,10110001b |
851 | shufps xmm1,xmm1,11011000b |
860 | cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords |
852 | cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords |
861 | movhlps xmm1,xmm1 |
853 | movhlps xmm1,xmm1 |
862 | cvtps2pi mm1,xmm1 |
854 | cvtps2pi mm1,xmm1 |
863 | movq .deyq,mm0 |
855 | movq .dex,mm0 ; hi - lo -> dbx, dex |
Line 864... | Line 856... | ||
864 | movq .dbyq,mm1 |
856 | movq .dey,mm1 ; hi - lo -> dby, dey |
Line 865... | Line 857... | ||
865 | 857 | ||
866 | else |
858 | else |
867 | 859 | ||
868 | mov eax,.bx2 ; calc .dbx |
860 | mov eax,.bx2 ; calc .dbx |
869 | sub eax,.bx1 |
861 | sub eax,.bx1 |
Line 870... | Line 862... | ||
870 | cdq |
862 | cdq |
871 | idiv ebx |
863 | idiv ebx |
872 | push eax |
864 | push eax |
873 | 865 | ||
874 | mov eax,.by2 ; calc .dby |
866 | mov eax,.ex2 ; calc .dby |
Line 875... | Line 867... | ||
875 | sub eax,.by1 |
867 | sub eax,.ex1 |
876 | cdq |
868 | cdq |
877 | idiv ebx |
869 | idiv ebx |
878 | push eax |
870 | push eax |
879 | 871 | ||
Line 880... | Line 872... | ||
880 | mov eax,.ex2 ; calc .dex |
872 | mov eax,.by2 ; calc .dex |
Line 940... | Line 932... | ||
940 | 932 | ||
Line 941... | Line 933... | ||
941 | mov ecx,.x2 |
933 | mov ecx,.x2 |
942 | sub ecx,.x1 |
934 | sub ecx,.x1 |
943 | ; init current variables |
935 | ; init current variables |
944 | push .bx1 .by1 .ex1 .ey1 .z1 esi |
936 | push dword .bx1 ;.by1 .ex1 .ey1 .z1 esi |
945 | ; push .by1 |
937 | push dword .ex1 |
946 | ; push .ex1 |
938 | push dword .by1 |
947 | ; push .ey1 |
939 | push dword .ey1 |
Line 948... | Line 940... | ||
948 | 940 | ||
949 | ; push .z1 ; current z shl CATMULL_SHIFT |
941 | push .z1 ; current z shl CATMULL_SHIFT |
Line 950... | Line 942... | ||
950 | ; push esi |
942 | push esi |
951 | 943 | ||
952 | if Ext >= MMX |
944 | if Ext >= MMX |
953 | pxor mm0,mm0 |
945 | pxor mm0,mm0 |
954 | movq mm3,.ceyq |
946 | movq mm3,.cex ; hi - lo -> cbx; cex |
955 | movq mm4,.cbyq |
947 | movq mm4,.cey ; hi - lo -> cby; cey |
956 | ; movq mm5,mm3 |
948 | ; movq mm5,mm3 |
957 | ; movq mm6,mm4 |
949 | ; movq mm6,mm4 |
958 | ; psrad mm5,ROUND |
950 | ; psrad mm5,ROUND |
Line 974... | Line 966... | ||
974 | cmp ebx,dword[edx] |
966 | cmp ebx,dword[edx] |
975 | end if |
967 | end if |
976 | jge .skip |
968 | jge .skip |
977 | 969 | ||
Line 978... | Line 970... | ||
978 | ;if Ext=NON |
970 | if Ext=NON |
979 | mov eax,.cby |
971 | mov eax,.cby |
980 | mov esi,.cbx |
972 | mov esi,.cbx |
981 | sar eax,ROUND |
973 | sar eax,ROUND |
982 | sar esi,ROUND |
974 | sar esi,ROUND |
983 | ;else |
- | |
984 | ; movd eax,mm6 |
- | |
985 | ; psrlq mm6,32 |
- | |
986 | ; movd esi,mm6 |
- | |
987 | ;end if |
- | |
988 | shl eax,TEX_SHIFT ;- |
975 | shl eax,TEX_SHIFT ;- |
989 | add esi,eax |
976 | add esi,eax |
990 | lea esi,[esi*3] ;- ; esi - current b. texture addres |
977 | lea esi,[esi*3] ;- ; esi - current b. texture addres |
991 | add esi,.bmap |
978 | add esi,.bmap |
Line 992... | Line -... | ||
992 | - | ||
993 | ;if Ext=NON |
979 | |
994 | mov ebx,.cex ;.cex - current env map X |
980 | mov ebx,.cex ;.cex - current env map X |
995 | mov eax,.cey ;.cey - current env map y |
981 | mov eax,.cey ;.cey - current env map y |
996 | sar ebx,ROUND |
982 | sar ebx,ROUND |
997 | sar eax,ROUND |
983 | sar eax,ROUND |
998 | ;else |
- | |
999 | ; movd eax,mm5 |
- | |
1000 | ; psrlq mm5,32 |
- | |
1001 | ; movd ebx,mm5 |
- | |
1002 | ;end if |
984 | |
1003 | shl eax,TEX_SHIFT |
985 | shl eax,TEX_SHIFT |
1004 | add ebx,eax |
986 | add ebx,eax |
1005 | lea ebx,[ebx*3] |
987 | lea ebx,[ebx*3] |
- | 988 | add ebx,.emap |
|
- | 989 | ||
- | 990 | ||
- | 991 | else |
|
- | 992 | movq mm5,.cey |
|
- | 993 | psrad mm5,ROUND |
|
- | 994 | pslld mm5,TEX_SHIFT |
|
- | 995 | movq mm6,.cex |
|
- | 996 | psrad mm6,ROUND |
|
- | 997 | paddd mm5,mm6 |
|
- | 998 | movq mm6,mm5 |
|
- | 999 | paddd mm5,mm5 |
|
- | 1000 | paddd mm5,mm6 |
|
- | 1001 | paddd mm5,.emap |
|
- | 1002 | movd esi,mm5 |
|
- | 1003 | psrlq mm5,32 |
|
- | 1004 | movd ebx,mm5 |
|
1006 | add ebx,.emap |
1005 | end if |
1007 | if Ext>=MMX |
1006 | if Ext>=MMX |
1008 | movd mm1,[esi] |
1007 | movd mm1,[esi] |
1009 | movd mm2,[ebx] |
1008 | movd mm2,[ebx] |
1010 | punpcklbw mm1,mm0 |
1009 | punpcklbw mm1,mm0 |
Line 1054... | Line 1053... | ||
1054 | mov eax,.dey |
1053 | mov eax,.dey |
1055 | add .cey,eax |
1054 | add .cey,eax |
1056 | else |
1055 | else |
1057 | add edx,4 |
1056 | add edx,4 |
1058 | paddd mm3,.deyq |
1057 | paddd mm3,.dex |
1059 | paddd mm4,.dbyq |
1058 | paddd mm4,.dey |
1060 | ; movq mm5,mm3 |
1059 | ; movq mm5,mm3 |
1061 | ; movq mm6,mm4 |
1060 | ; movq mm6,mm4 |
1062 | ; psrad mm5,ROUND |
1061 | ; psrad mm5,ROUND |
1063 | ; psrad mm6,ROUND |
1062 | ; psrad mm6,ROUND |
1064 | movq .ceyq,mm3 |
1063 | movq .cex,mm3 |
1065 | movq .cbyq,mm4 |
1064 | movq .cey,mm4 |
1066 | end if |
1065 | end if |
1067 | mov eax,.dz |
1066 | mov eax,.dz |
1068 | add .cz,eax |
1067 | add .cz,eax |
1069 | if Ext = NON |
1068 | if Ext = NON |
1070 | dec ecx |
1069 | dec ecx |
1071 | jnz .draw |
1070 | jnz .draw |