Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6016 → Rev 6017

/programs/develop/libraries/TinyGL/asm_fork/clip.asm
8,15 → 8,6
CLIP_ZMIN equ (1<<4)
CLIP_ZMAX equ (1<<5)
 
offs_X equ 0
offs_Y equ 4
offs_Z equ 8
offs_W equ 12
 
if DEBUG
f_ttv db ' gl_transform_to_viewport',0
end if
 
align 4
proc gl_transform_to_viewport uses eax ebx ecx, context:dword,v:dword
locals
87,31 → 78,6
fistp dword[ebx+offs_vert_zp+offs_zbup_t]
add dword[ebx+offs_vert_zp+offs_zbup_s],ZB_POINT_T_MIN
@@:
if DEBUG ;gl_transform_to_viewport
pushad
mov ecx,80
mov eax,[ebx+offs_vert_zp]
lea edi,[buf_param]
stdcall convert_int_to_str,ecx
stdcall str_n_cat,edi,txt_zp_sp,2
stdcall str_len,edi
add edi,eax
sub ecx,eax
 
mov eax,[ebx+offs_vert_zp+offs_zbup_y]
stdcall convert_int_to_str,ecx
stdcall str_n_cat,edi,txt_zp_sp,2
stdcall str_len,edi
add edi,eax
sub ecx,eax
 
mov eax,[ebx+offs_vert_zp+offs_zbup_z]
stdcall convert_int_to_str,ecx
 
stdcall str_n_cat,edi,txt_nl,2
stdcall dbg_print,f_ttv,buf_param
popad
end if
ret
endp
 
/programs/develop/libraries/TinyGL/asm_fork/zgl.inc
2,6 → 2,10
include 'zbuffer.inc'
include 'zmath.inc'
 
offs_X equ 0
offs_Y equ 4
offs_Z equ 8
offs_W equ 12
 
;enum { OP_ ## a , ... }
sum1 equ 0
/programs/develop/libraries/TinyGL/asm_fork/zmath.asm
207,7 → 207,7
fmul st0,st3 ;st0 *= c.Z
faddp
fld dword[ebx+12] ;st0 += m[_][3]
fmul st0,st2 ;st0 *= c.Z
fmul st0,st2 ;st0 *= c.W
faddp
fstp dword[edx] ;a.X = b.m[_][0]*c.X +b.m[_][1]*c.Y +b.m[_][2]*c.Z +b.m[_][3]*c.W
add ebx,16 ;ñëåäóùàÿ ñòðîêà ìàòðèöû
343,14 → 343,18
shl eax,2
add eax,[m]
fld dword[eax]
fcom dword[max] ;if (fabs(m[i*n+j])>fabs(max))
fld st0
fabs
fld dword[max]
fabs
fcompp ;if (fabs(m[i*n+j])>fabs(max))
fstsw ax
sahf
jbe @f
jae @f
mov edx,edi ;k=i
fst dword[max]
@@:
ffree st0
ffree st0 ;m[i*n+j]
fincstp
inc edi
jmp .cycle_1
600,10 → 604,10
mov ebx,[a]
fld dword[ebx]
fmul st0,st0
fld dword[ebx+4]
fld dword[ebx+offs_Y]
fmul st0,st0
faddp
fld dword[ebx+8]
fld dword[ebx+offs_Z]
fmul st0,st0
faddp
fsqrt ;st0 = sqrt(a.X^2 +a.Y^2 +a.Z^2)
614,12 → 618,12
fld dword[ebx] ;offs_X = 0
fdiv st0,st1
fstp dword[ebx] ;a.X/=sqrt(...)
fld dword[ebx+4]
fld dword[ebx+offs_Y]
fdiv st0,st1
fstp dword[ebx+4] ;a.Y/=sqrt(...)
fld dword[ebx+8]
fstp dword[ebx+offs_Y] ;a.Y/=sqrt(...)
fld dword[ebx+offs_Z]
fdiv st0,st1
fstp dword[ebx+8] ;a.Z/=sqrt(...)
fstp dword[ebx+offs_Z] ;a.Z/=sqrt(...)
xor eax,eax
jmp @f
.r1: