Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 1819 → Rev 1787

/programs/demos/3DS/History.txt
File deleted
\ No newline at end of file
/programs/demos/3DS/3ds_objects/fighter.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/shield1.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/second-A.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/opacity2.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/torus0.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/teapot.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/hrt.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/face.3DS
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/UV_Cyl.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/sink.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/iron.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/knot.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/cube.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/03.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/House.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/knight.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/surf32.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects/cone.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/demos/3DS/3ds_objects
Property changes:
Deleted: tsvn:logminsize
-5
\ No newline at end of property
/programs/demos/3DS/hrt.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programs/demos/3DS/teapot.3ds
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programs/demos/3DS/data.inc
268,7 → 268,7
if Ext=SSE
db ' (SSE)'
end if
db ' 0.055'
db ' 0.054'
labellen:
STRdata db '-1 '
 
396,7 → 396,7
rand_seed dw ?
align 8
buffer dq ?
errr dd ?
err_ dd ?
drr dd ?
xx dd ?
yy dd ?
/programs/demos/3DS/BUMP_TEX.INC
88,8 → 88,6
.dtx23 equ dword[ebp-(52+4*15)]
.dty23 equ [ebp-(52+4*16)]
 
if Ext < SSE
 
.cx1 equ dword[ebp-(52+4*17)] ; current variables
.cz1 equ [ebp-(52+4*18)]
.cx2 equ dword[ebp-(52+4*19)]
108,27 → 106,6
.ctx2 equ dword[ebp-(52+4*31)]
.cty2 equ [ebp-(52+4*32)]
 
else
 
.cx1 equ dword[ebp-(52+4*17)] ; current variables
.cz1 equ [ebp-(52+4*18)]
.cbx1 equ dword[ebp-(52+4*19)]
.cby1 equ [ebp-(52+4*20)]
.cex1 equ dword[ebp-(52+4*21)]
.cey1 equ [ebp-(52+4*22)]
.ctx1 equ dword[ebp-(52+4*23)]
.cty1 equ [ebp-(52+4*24)]
 
.cx2 equ dword[ebp-(52+4*25)]
.cz2 equ [ebp-(52+4*26)]
.cbx2 equ dword[ebp-(52+4*27)]
.cby2 equ [ebp-(52+4*28)]
.cex2 equ dword[ebp-(52+4*29)]
.cey2 equ [ebp-(52+4*30)]
.ctx2 equ dword[ebp-(52+4*31)]
.cty2 equ [ebp-(52+4*32)]
 
end if
cld
mov ebp,esp
push edx ; store bump map
203,9 → 180,18
.bt_dx12_make:
movsx ebx,bx
 
mov ax,.x2
sub ax,.x1
cwde
shl eax,ROUND
cdq
idiv ebx
; mov .dx12,eax
push eax
 
if Ext>=SSE
sub esp,32
 
sub esp,28
; mov eax,256
cvtsi2ss xmm4,[i255d]
cvtsi2ss xmm3,ebx ;rcps
234,7 → 220,6
 
shufps xmm1,xmm1,10110001b
;xmm1--> | dbx | dby | dex | dey |
;1 movups .dey12,xmm1
cvtps2pi mm0,xmm1 ;mm0,xmm1 ; mm0 -> 2 delta dwords
movhlps xmm1,xmm1
cvtps2pi mm1,xmm1 ;mm1,xmm1
250,11 → 235,6
mov ax,.z2
sub ax,.z1
cwde
 
mov dx,.x2
sub dx,.x1
movsx edx,dx
 
;/ movd mm1,eax
 
;/ punpcklwd mm0,mm4
276,40 → 256,17
;/ cvtpi2ps xmm1,mm1
cvtsi2ss xmm1,eax
movlhps xmm1,xmm1
cvtsi2ss xmm1,edx
; movss xmm1,xmm4
shufps xmm1,xmm1,00101111b
cvtpi2ps xmm1,mm3
 
divps xmm1,xmm3 ; xmm1--> | dx | dz | dty | dtx |
divps xmm1,xmm3 ; xmm1--> | xxx | dz | dty | dtx |
 
shufps xmm1,xmm1,11100001b
; xmm1--> | dx | dz | dtx | dty |
;1 movlps .dty12,xmm1
;1 movhps .dz12,xmm1
; xmm1--> | xxx | dz | dtx | dty |
cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords | dtx | dty |
movhlps xmm1,xmm1
cvtps2pi mm1,xmm1
cvtss2si eax,xmm1 ; eax --> 1 delta dword | dz |
movq .dty12,mm0
movq .dz12,mm1
;temporaly conversion to keep upside down
; fninit
; fld .dx12
; fistp .dx12
; fld dword .dz12
; fistp dword .dz12
; fld .dbx12
; fistp .dbx12
; fld dword .dby12
; fistp dword .dby12
; fld .dex12
; fistp .dex12
; fld dword .dey12
; fistp dword .dey12
; fld .dtx12
; fistp .dtx12
; fld dword .dty12
; fistp dword .dty12
mov .dz12,eax
;----
; mov ax,.z2
; sub ax,.z1
360,15 → 317,6
; movq .dty12,mm0
; movq .dz12,mm1
else
mov ax,.x2
sub ax,.x1
cwde
shl eax,ROUND
cdq
idiv ebx
; mov .dx12,eax
push eax
 
mov ax,.z2
sub ax,.z1
cwde
413,6 → 361,8
; mov .dey12,eax
push eax
 
;end if
 
mov ax,word[.t_x2]
sub ax,word[.t_x1]
cwde
443,12 → 393,20
loop @b
jmp .bt_dx13_done
.bt_dx13_make:
mov ax,.x3
sub ax,.x1
cwde
movsx ebx,bx
shl eax,ROUND
cdq
idiv ebx
; mov .dx13,eax
push eax
 
if Ext>=SSE
 
sub esp,32
; mov eax,256
sub esp,28
; mov eax,255
cvtsi2ss xmm4,[i255d]
cvtsi2ss xmm3,ebx ;rcps
divss xmm3,xmm4
476,22 → 434,16
 
shufps xmm1,xmm1,10110001b
;xmm1--> | dbx | dby | dex | dey |
;1 movups .dey13,xmm1
 
cvtps2pi mm0,xmm1 ;mm0,xmm1 ; mm0 -> 2 delta dwords
cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords
movhlps xmm1,xmm1
cvtps2pi mm1,xmm1 ;mm1,xmm1
cvtps2pi mm1,xmm1
movq .dey13,mm0
movq .dby13,mm1
 
;----------
mov ax,.z3
sub ax,.z1
cwde
 
mov dx,.x3
sub dx,.x1
movsx edx,dx
 
movd mm2,[.t_x1]
movd mm3,[.t_x3]
 
501,53 → 453,18
 
cvtsi2ss xmm1,eax
movlhps xmm1,xmm1
cvtsi2ss xmm1,edx
shufps xmm1,xmm1,00101111b
cvtpi2ps xmm1,mm3
 
divps xmm1,xmm3 ; xmm1--> | dx | dz | dty | dtx |
divps xmm1,xmm3 ; xmm1--> | xxx | dz | dty | dtx |
 
shufps xmm1,xmm1,11100001b
; xmm1--> | dx | dz | dtx | dty |
;1 movlps .dty13,xmm1
;1 movhps .dz13,xmm1
 
; xmm1--> | xxx | dz | dtx | dty |
cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords | dtx | dty |
movhlps xmm1,xmm1
cvtps2pi mm1,xmm1
cvtss2si eax,xmm1 ; eax --> 1 delta dword | dz |
movq .dty13,mm0
movq .dz13,mm1
 
;temporaly conversion to keep upside down
; fninit
; fld .dx13
; fistp .dx13
; fld dword .dz13
; fistp dword .dz13
; fld .dbx13
; fistp .dbx13
; fld dword .dby13
; fistp dword .dby13
; fld .dex13
; fistp .dex13
; fld dword .dey13
; fistp dword .dey13
; fld .dtx13
; fistp .dtx13
; fld dword .dty13
; fistp dword .dty13
 
mov .dz13,eax
else
 
mov ax,.x3
sub ax,.x1
cwde
shl eax,ROUND
cdq
idiv ebx
; mov .dx13,eax
push eax
 
mov ax,.z3
sub ax,.z1
cwde
624,12 → 541,20
loop @b
jmp .bt_dx23_done
.bt_dx23_make:
mov ax,.x3
sub ax,.x2
cwde
movsx ebx,bx
shl eax,ROUND
cdq
idiv ebx
; mov .dx23,eax
push eax
 
if Ext>=SSE
 
sub esp,32
; mov eax,256
sub esp,28
; mov eax,255
cvtsi2ss xmm4,[i255d]
cvtsi2ss xmm3,ebx ;rcps
divss xmm3,xmm4
657,22 → 582,16
 
shufps xmm1,xmm1,10110001b
;xmm1--> | dbx | dby | dex | dey |
;1 movups .dey23,xmm1
 
cvtps2pi mm0,xmm1 ;mm0,xmm1 ; mm0 -> 2 delta dwords
cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords
movhlps xmm1,xmm1
cvtps2pi mm1,xmm1 ;mm1,xmm1
cvtps2pi mm1,xmm1
movq .dey23,mm0
movq .dby23,mm1
 
;----------
mov ax,.z3
sub ax,.z2
cwde
 
mov dx,.x3
sub dx,.x2
movsx edx,dx
 
movd mm2,[.t_x2]
movd mm3,[.t_x3]
 
682,50 → 601,18
 
cvtsi2ss xmm1,eax
movlhps xmm1,xmm1
cvtsi2ss xmm1,edx
shufps xmm1,xmm1,00101111b
cvtpi2ps xmm1,mm3
 
divps xmm1,xmm3 ; xmm1--> | dx | dz | dty | dtx |
divps xmm1,xmm3 ; xmm1--> | xxx | dz | dty | dtx |
 
shufps xmm1,xmm1,11100001b
; xmm1--> | dx | dz | dtx | dty |
; movlps .dty23,xmm1
; movhps .dz23,xmm1
; xmm1--> | xxx | dz | dtx | dty |
cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords | dtx | dty |
movhlps xmm1,xmm1
cvtps2pi mm1,xmm1 ; mm1 --> 2 delta dwords | dx | dz |
cvtss2si eax,xmm1 ; eax --> 1 delta dword | dz |
movq .dty23,mm0
movq .dz23,mm1
 
 
;temporaly conversion to keep upside down
; fninit
; fld .dx23
; fistp .dx23
; fld dword .dz23
; fistp dword .dz23
; fld .dbx23
; fistp .dbx23
; fld dword .dby23
; fistp dword .dby23
; fld .dex23
; fistp .dex23
; fld dword .dey23
; fistp dword .dey23
; fld .dtx23
; fistp .dtx23
; fld dword .dty23
; fistp dword .dty23
mov .dz23,eax
else
mov ax,.x3
sub ax,.x2
cwde
shl eax,ROUND
cdq
idiv ebx
; mov .dx23,eax
push eax
 
mov ax,.z3
sub ax,.z2
794,58 → 681,6
; sub esp,40
.bt_dx23_done:
sub esp,64
;if Ext>=SSE
; movsx eax,.x1
; shl eax,ROUND
; cvtsi2ss xmm0,eax
; movss .cx1,xmm0
; movss .cx2,xmm0
;
; movsx ebx,word[.b_x1]
; shl ebx,ROUND
; cvtsi2ss xmm0,ebx
; movss .cbx1,xmm0
; movss .cbx2,xmm0
;
; movsx ecx,word[.b_y1]
; shl ecx,ROUND
; cvtsi2ss xmm0,ecx
; movss .cby1,xmm0
; movss .cby2,xmm0
 
; movsx edx,word[.e_x1]
; shl edx,ROUND
; cvtsi2ss xmm0,edx
; movss .cex1,xmm0
; movss .cex2,xmm0
;
; movsx eax,word[.e_y1]
; shl eax,ROUND
; cvtsi2ss xmm0,eax
; movss .cey1,xmm0
; movss .cey2,xmm0
;
 
; movsx ebx,.z1
; shl ebx,CATMULL_SHIFT
; cvtsi2ss xmm0,ebx
; movss .cz1,xmm0
; movss .cz2,xmm0
;
; movsx ecx,word[.t_x1]
; shl ecx,ROUND
; cvtsi2ss xmm0,ecx
; movss .ctx1,xmm0
; movss .ctx2,xmm0
 
; movsx edx,word[.t_y1]
; shl edx,ROUND
; cvtsi2ss xmm0,edx
; movss .cty1,xmm0
; movss .cty2,xmm0
 
;else
 
movsx eax,.x1
shl eax,ROUND
mov .cx1,eax
902,36 → 737,13
mov .cty2,edx
; push edx
; push edx
;end if
 
 
movsx ecx,.y1
cmp cx,.y2
jge .loop12_done
.loop12:
call .call_line
;if Ext >= SSE
; movups xmm0,.cby1
; movups xmm1,.cty1
; movups xmm2,.cby2
; movups xmm3,.cty2
; movups xmm4,.dby13
; movups xmm5,.dty13
; movups xmm6,.dby12
; movups xmm7,.dty12
; addps xmm0,xmm4
; addps xmm1,xmm5
; addps xmm2,xmm6
; addps xmm3,xmm7
;
;; addps xmm0,.dby12
;; addps xmm1,.dty12
;; addps xmm2,.dby13
;; addps xmm3,.dty13
; movups .cby1,xmm0
; movups .cty1,xmm1
; movups .cby2,xmm2
; movups .cty2,xmm3
;end if
 
if Ext >= MMX
movq mm0,.cby2
958,8 → 770,7
movq .cty2,mm5
movq .cz1,mm6
movq .cz2,mm7
end if
if Ext = NON
else
mov edx,.dbx13
add .cbx1,edx
mov eax,.dbx12
1005,8 → 816,6
cmp cx,.y3
jge .loop23_done
 
;if Ext < SSE
 
movsx eax,.z2
shl eax,CATMULL_SHIFT
mov .cz2,eax
1038,76 → 847,10
movzx ebx,word[.t_y2]
shl ebx,ROUND
mov .cty2,ebx
;else
; movsx eax,.z2
; shl eax,CATMULL_SHIFT
; cvtsi2ss xmm0,eax
; movss .cz2,xmm0
;
; movsx ebx,.x2
; shl ebx,ROUND
; cvtsi2ss xmm1,ebx
; movss .cx2,xmm1
;
; movzx edx,word[.b_x2]
; shl edx,ROUND
; cvtsi2ss xmm2,edx
; movss .cbx2,xmm2
;
; movzx eax,word[.b_y2]
; shl eax,ROUND
; cvtsi2ss xmm0,eax
; movss .cby2,xmm0
;
; movzx ebx,word[.e_x2]
; shl ebx,ROUND
; cvtsi2ss xmm1,ebx
; movss .cex2,xmm1
;
; movzx edx,word[.e_y2]
; shl edx,ROUND
; cvtsi2ss xmm2,edx
; movss .cey2,xmm2
;
; movzx eax,word[.t_x2]
; shl eax,ROUND
; cvtsi2ss xmm0,eax
; movss .ctx2,xmm0
;
; movzx ebx,word[.t_y2]
; shl ebx,ROUND
; cvtsi2ss xmm1,ebx
; movss .cty2,xmm1
 
;end if
 
.loop23:
call .call_line
 
;if Ext >= SSE
 
; movups xmm0,.cby1
; movups xmm1,.cty1
; movups xmm2,.cby2
; movups xmm3,.cty2
; movups xmm4,.dby13
; movups xmm5,.dty13
; movups xmm6,.dby23
; movups xmm7,.dty23
; addps xmm0,xmm4
; addps xmm1,xmm5
; addps xmm2,xmm6
; addps xmm3,xmm7
; ; addps xmm0,.dby13
; ; addps xmm1,.dty13
; ; addps xmm2,.dby23
; ; addps xmm3,.dty23
; movups .cby1,xmm0
; movups .cty1,xmm1
; movups .cby2,xmm2
; movups .cty2,xmm3
;
;end if
if Ext >= MMX
movq mm0,.cby2
movq mm1,.cby1
1133,8 → 876,7
movq .cty2,mm5
movq .cz1,mm6
movq .cz2,mm7
end if
If Ext = NON
else
mov edx,.dbx13
add .cbx1,edx
mov eax,.dbx23
1170,6 → 912,7
add .cty1,edx
mov eax,.dty23
add .cty2,eax
 
end if
inc ecx
cmp cx,.y3
1180,97 → 923,14
ret 50
 
.call_line:
;if Ext >= SSE
; pushad
; push .tex_ptr
; fninit
; fld dword .cty1
; fistp dword [esp-4]
; sub esp,4
;; push dword .cty1
; fld .ctx1
; fistp dword [esp-4]
; sub esp,4
;; push .ctx1
; fld dword .cz1
; fistp dword [esp-4]
; sub esp,4
; ; push dwod .cz1
; fld dword .cty2
; fistp dword [esp-4]
; sub esp,4
; ; push .cty2
; fld .ctx2
; fistp dword [esp-4]
; sub esp,4
; ; push dword .ctx2
; fld dword .cz2
; fistp dword [esp-4]
; sub esp,4
;; push dword .cz2
;
; push .z_buff
; push .t_emap
; push .t_bmap
;--------------------------------------
; fld dword .cey2
; fistp dword [esp-4]
; sub esp,4
;; push dword .cey2
;
; fld .cex2
; fistp dword [esp-4]
; sub esp,4
;; push .cex2
;
; fld dword .cby2
; fistp dword [esp-4]
; sub esp,4
; ; push dword .cby2
 
; fld .cbx2
; fistp dword [esp-4]
; sub esp,4
; push .cbx2
;------------------------------------
; fld dword .cey1
; fistp dword [esp-4]
; sub esp,4
;; push dword .cey1
; fld .cex1
; fistp dword [esp-4]
; sub esp,4
; ; push .cex1
; fld dword .cby1
; fistp dword [esp-4]
; sub esp,4
;; push dword .cby1
; fld .cbx1
; fistp dword [esp-4]
; sub esp,4
;; push .cbx1
; push ecx
 
; fld .cx1
; fistp dword [esp-4]
; mov eax,[esp-4]
; sar eax,ROUND
; fld .cx2
; fistp dword [esp-4]
; mov ebx,[esp-4]
; sar ebx,ROUND
 
; call bump_tex_line_z
;
; popad
;else
pushad
push .tex_ptr
push dword .cty2
push .ctx2
push dword .cty1
push .ctx1
push dword .cz1
push dword .cty2
push .ctx2
push dword .cz2
push .z_buff
push .t_emap
1277,10 → 937,10
push .t_bmap
push dword .cey2
push .cex2
push dword .cey1
push .cex1
push dword .cby2
push .cbx2
push dword .cey1
push .cex1
push dword .cby1
push .cbx1
push ecx
1293,7 → 953,6
call bump_tex_line_z
 
popad
;end if
ret
bump_tex_line_z:
;--------------in: eax - x1
1301,46 → 960,62
;-------------- edi - pointer to screen buffer
;stack - another parameters :
.y equ dword [ebp+4]
.bx1q equ [ebp+8]
.bx2q equ [ebp+16]
.ex1q equ [ebp+24]
.ex2q equ [ebp+32]
.tx1q equ [ebp+60]
.tx2q equ [ebp+68]
;.bx1q equ [ebp+8]
;.bx2q equ [ebp+16]
;.ex1q equ [ebp+24]
;.exyq equ [ebp+32]
.bx1 equ dword [ebp+8] ; ---
.by1 equ dword [ebp+12] ; |
.bx2 equ dword [ebp+16] ; |
.by2 equ dword [ebp+20] ; |> b. map and e. map coords
.ex1 equ dword [ebp+24] ; |> shifted shl ROUND
.ey1 equ dword [ebp+28] ; |
.ex2 equ dword [ebp+32] ; |
.ey2 equ dword [ebp+36] ; ---
.bmap equ dword [ebp+40] ; bump map offset
.emap equ dword [ebp+44] ; env map offset
.z_buff equ dword [ebp+48]
.z2 equ dword [ebp+52] ; -- |> z coords shifted
.z1 equ dword [ebp+56] ; -- shl CATMULL_SHIFT
 
.bx1 equ [ebp+8] ; ---
.by1 equ [ebp+12] ; |
.ex1 equ [ebp+16] ; |
.ey1 equ [ebp+20] ; |
.bx2 equ [ebp+24] ; |
.by2 equ [ebp+28] ; |> b. map and e. map coords
.ex2 equ [ebp+32] ; |> shifted shl ROUND
.ey2 equ [ebp+36] ; ---
.bmap equ [ebp+40] ; bump map offset
.emap equ [ebp+44] ; env map offset
.z_buff equ [ebp+48]
.z2 equ [ebp+52]
.tx2 equ [ebp+56]
.ty2 equ [ebp+60]
.z1 equ [ebp+64]
.tx1 equ [ebp+68]
.ty1 equ [ebp+72]
.tx1 equ dword [ebp+60] ; -----
.ty1 equ dword [ebp+64] ; |> shifted shl ROUND
.tx2 equ dword [ebp+68] ; |
.ty2 equ dword [ebp+72] ; ---
.tex_map equ dword [ebp+76] ; texture offset ( pointer )
 
 
.x1 equ [ebp-4]
.x2 equ [ebp-8]
.dbx equ [ebp-12]
.dby equ [ebp-16]
.dex equ [ebp-20]
.dey equ [ebp-24]
.dz equ [ebp-28]
.dtx equ [ebp-32]
.dty equ [ebp-36]
.x1 equ dword [ebp-4]
.x2 equ dword [ebp-8]
.dbx equ dword [ebp-12]
.dby equ dword [ebp-16]
.dbyq equ qword [ebp-16] ; - new
.dex equ dword [ebp-20]
.dey equ dword [ebp-24]
.deyq equ qword [ebp-24] ; - new
.dz equ dword [ebp-28]
.dtx equ dword [ebp-32]
.dty equ dword [ebp-36]
.dtyq equ qword [ebp-36]
 
.cbx equ [ebp-40]
.cby equ [ebp-44]
.cex equ [ebp-48]
.cey equ [ebp-52]
.cz equ [ebp-56]
.czbuff equ [ebp-60]
.ctx equ [ebp-64]
.cty equ [ebp-68]
.c_scr equ [ebp-72]
.cbx equ dword [ebp-40]
.cby equ dword [ebp-44]
.cbyq equ qword [ebp-44] ; - new
.cex equ dword [ebp-48]
.cey equ dword [ebp-52]
.ceyq equ qword [ebp-52] ; - new
.cz equ dword [ebp-56]
.czbuff equ dword [ebp-60]
.ctx equ dword [ebp-64]
.cty equ dword [ebp-68]
.ctyq equ qword [ebp-68]
.c_scr equ dword [ebp-72]
 
.temp1 equ ebp-80
.temp2 equ ebp-88
1350,6 → 1025,8
 
mov ebp,esp
 
 
 
mov ecx,.y
or ecx,ecx
jl .bl_end
1382,31 → 1059,20
mov edx,.ty1
xchg edx,.ty2
mov .ty1,edx
else
movq mm0,.bx1q
movq mm1,.bx2q
movq mm2,.ex1q
movq mm3,.ex2q
movq mm4,.tx1q
movq mm5,.tx2q
movq .bx2q,mm0
movq .bx1q,mm1
movq .ex1q,mm3
movq .ex2q,mm2
movq .tx1q,mm5
movq .tx2q,mm4
end if
if Ext = MMX
movq mm0,.bx1
movq mm1,.bx2
movq mm2,.ex1
movq mm3,.ex2
movq mm4,.tx1
movq mm5,.tx2
movq .bx2,mm0
movq .bx1,mm1
movq .ex1,mm3
movq .ex2,mm2
movq .tx1,mm5
movq .tx2,mm4
end if
if Ext>=SSE
movups xmm0,.bx1
movups xmm1,.bx2
movups .bx1,xmm1
movups .bx2,xmm0
movq mm0,.tx1
movq mm1,.tx2
movq .tx1,mm1
movq .tx2,mm0
end if
 
mov edx,.z1
xchg edx,.z2
1414,9 → 1080,9
.bl_ok:
push eax
push ebx ;store x1, x2
cmp dword .x1,SIZE_X
cmp .x1,SIZE_X
jge .bl_end
cmp dword .x2,0
cmp .x2,0
jle .bl_end
 
mov ebx,.x2
1427,51 → 1093,43
sub esp,28
cvtsi2ss xmm3,ebx ;rcps
shufps xmm3,xmm3,0
; float using SSE variant ::-->
; movups xmm0,.bx1 ; new
; movups xmm1,.bx2 ; new
 
cvtpi2ps xmm0,.bx1 ;mm0 ; variant fixed point
cvtpi2ps xmm0,.bx1q ;mm0
movlhps xmm0,xmm0
cvtpi2ps xmm0,.ex1 ;mm2
cvtpi2ps xmm1,.bx2 ;mm1
cvtpi2ps xmm0,.ex1q ;mm2
cvtpi2ps xmm1,.bx2q ;mm1
movlhps xmm1,xmm1
cvtpi2ps xmm1,.ex2 ;mm3
cvtpi2ps xmm1,.ex2q ;mm3
subps xmm1,xmm0
 
divps xmm1,xmm3
 
shufps xmm1,xmm1,10110001b
; movups .dey,xmm1 ; new
cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords
movhlps xmm1,xmm1
cvtps2pi mm1,xmm1
movq .dey,mm0
movq .dby,mm1
movq .deyq,mm0
movq .dbyq,mm1
 
movd mm2,.z1
movd mm3,.z2
 
cvtpi2ps xmm0,.tx1 ;mm0
cvtpi2ps xmm0,.tx1q ;mm0
movlhps xmm0,xmm0
cvtpi2ps xmm0,mm2
cvtpi2ps xmm1,.tx2 ;mm1
cvtpi2ps xmm1,.tx2q ;mm1
movlhps xmm1,xmm1
cvtpi2ps xmm1,mm3
; movups xmm0,,z1 ; new
; movups xmm1,.z2 ; new
subps xmm1,xmm0
 
divps xmm1,xmm3
 
; movups .dz,xmm1 ;new
 
shufps xmm1,xmm1,10110100b
cvtps2pi mm0,xmm1 ; mm0 -> 2 delta dwords
movhlps xmm1,xmm1
cvtps2pi mm1,xmm1
movd .dz,mm0
movq .dty,mm1
movq .dtyq,mm1
 
else
 
1519,27 → 1177,14
push eax
 
end if
cmp dword .x1,0 ; set correctly begin variable
cmp .x1,0 ; set correctly begin variable
jge @f ; CLIPPING ON FUNCTION
; cutting triangle exceedes screen
mov ebx,.x1
neg ebx
 
;if Ext >= SSE
 
; cvtsi2ss xmm0,ebx
; shufps xmm0,xmm0,0
; movups xmm1,.dey
; mulps xmm1,xmm0
; shufps xmm1,xmm1,00011011b
; movups xmm2,.bx1
; addps xmm2,xmm1
; movups .bx1,xmm2
 
mov eax,.dz
imul ebx ; eax = .dz * abs(.x1)
add .z1,eax
mov dword .x1,0
mov .x1,0
 
mov eax,.dbx
imul ebx
1566,9 → 1211,9
add .ty1,eax
 
@@:
cmp dword .x2,SIZE_X
cmp .x2,SIZE_X
jl @f
mov dword .x2,SIZE_X
mov .x2,SIZE_X
@@:
mov eax,SIZE_X ;calc memory begin in buffers
mul .y
1582,21 → 1227,21
mov ecx,.x2
sub ecx,.x1
; init current variables
push dword .bx1 ; current b, e and t shifted shl ROUND .cbx
push dword .by1 ; .cby
push dword .ex1 ; .cex
push dword .ey1 ; .cey
push .bx1 ; current b, e and t shifted shl ROUND .cbx
push .by1 ; .cby
push .ex1 ; .cex
push .ey1 ; .cey
 
push dword .z1 ; current z shl CATMULL_SHIFT ; .cz
push .z1 ; current z shl CATMULL_SHIFT ; .cz
push esi ; .czbuff
 
push dword .tx1 ; .ctx
push dword .ty1 ; .cty
push .tx1 ; .ctx
push .ty1 ; .cty
push edi ; .c_scr
if Ext>=MMX
movq mm7,.cty
movq mm6,.cby
movq mm5,.cey
movq mm7,.ctyq
movq mm6,.cbyq
movq mm5,.ceyq
; movq mm4,.dtyq
; movq mm3,.dbyq
end if
1621,6 → 1266,7
end if
 
 
 
shl eax,TEX_SHIFT
add esi,eax ;- ; esi - current bump map index
 
1650,7 → 1296,6
movzx ebx,byte [ebx]
sub edx,ebx
 
 
; eax - horizontal sub modificated x coord
; edx - vertical sub modificated y coord
if Ext=NON
1755,8 → 1400,8
stosd
 
.skip:
add dword .czbuff,4
add dword .c_scr,3
add .czbuff,4
add .c_scr,3
 
if Ext=NON
mov eax,.dbx
1775,9 → 1420,9
add .cty,edx
 
else
paddd mm7,.dty
paddd mm6,.dby
paddd mm5,.dey
paddd mm7,.dtyq
paddd mm6,.dbyq
paddd mm5,.deyq
end if
mov eax,.dz
add .cz,eax
/programs/demos/3DS/VIEW3DS.ASM
1,10 → 1,10
 
; application : View3ds ver. 0.055 - tiny .3ds files viewer.
; compiler : FASM
; system : KolibriOS
; application : View3ds ver. 0.054 - tiny .3ds files viewer.
; compiler : FASM 1.67.11
; system : KolibriOS/MenuetOS
; author : Macgub aka Maciej Guba
; email : macgub3@wp.pl
; web : www.macgub.hekko.pl
; web : www.menuet.xt.pl
; Fell free to use this intro in your own distribution of KolibriOS/MenuetOS.
; Special greetings to all MenuetOS maniax in the world.
; I hope because my intros Christian Belive will be near to each of You.
/programs/demos/3DS/readme.txt
1,8 → 1,11
View3ds 0.055 - tiny viewer to .3ds files.
View3ds 0.054 - tiny viewer to .3ds files.
 
What's new?
1. SSE optimizations (file BUMP_TEX.INC).
3. Compiles correctly in newest FASM.
1. Skinned window by Leency.
2. Optimizations.
3. Re map texture, bumps option - allow spherical mapping around each axle (X,Y,Z).
4. Problem with too small memory to generate object fixed. (Problem ocurred with
house.3ds object and others objects contains less than 1000 faces and points).
 
Buttons description:
1. rotary: choosing rotary axle: x, y, x+y.
30,4 → 33,5
18. re-map tex -> re-map texture and bump map coordinates, to change spherical mapping
around axle use 'xchg' and 'mirror' buttons, then press 're-map tex' button.
 
Macgub Jan 2011
Macgub december 2009
Last edited Jan 2010