tinygl.obj: add some functions,

load_img.inc: delete old file load_lib

git-svn-id: svn://kolibrios.org@8442 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA
2020-12-18 10:03:16 +00:00
parent fe8377e2c7
commit d72fcc2942
14 changed files with 465 additions and 361 deletions

View File

@@ -142,6 +142,19 @@ glNormal3f: ;x, y, z
pop eax
ret 16 ;=sizeof(dd)*4
align 4
proc glNormal3d, x:qword, y:qword, z:qword
add esp,-12
fld qword[z]
fstp dword[esp+8]
fld qword[y]
fstp dword[esp+4]
fld qword[x]
fstp dword[esp]
call glNormal3f
ret
endp
align 4
proc glNormal3fv uses eax, v:dword
mov eax,[v]
@@ -149,6 +162,20 @@ proc glNormal3fv uses eax, v:dword
ret
endp
align 4
proc glNormal3dv uses eax, v:dword
mov eax,[v]
add esp,-12
fld qword[eax+16]
fstp dword[esp+8]
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glNormal3f
ret
endp
; glColor
align 4
@@ -179,6 +206,21 @@ endl
ret
endp
align 4
proc glColor4d, r:qword, g:qword, b:qword, a:qword
add esp,-16
fld qword[a]
fstp dword[esp+12]
fld qword[b]
fstp dword[esp+8]
fld qword[g]
fstp dword[esp+4]
fld qword[r]
fstp dword[esp]
call glColor4f
ret
endp
align 4
proc glColor4fv uses eax ebx, v:dword
mov eax,[v]
@@ -192,6 +234,20 @@ proc glColor3f, r:dword, g:dword, b:dword
ret
endp
align 4
proc glColor3d, r:qword, g:qword, b:qword
push 1.0
add esp,-12
fld qword[b]
fstp dword[esp+8]
fld qword[g]
fstp dword[esp+4]
fld qword[r]
fstp dword[esp]
call glColor4f
ret
endp
align 4
proc glColor3fv uses eax, v:dword
mov eax,[v]
@@ -199,6 +255,21 @@ proc glColor3fv uses eax, v:dword
ret
endp
align 4
proc glColor3dv uses eax, v:dword
mov eax,[v]
push 1.0
add esp,-12
fld qword[eax+16]
fstp dword[esp+8]
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glColor4f
ret
endp
align 4
fl_255 dd 255.0
@@ -230,6 +301,22 @@ proc glColor3ub uses eax, r:dword, g:dword, b:dword
ret
endp
align 4
proc glColor4dv uses eax, v:dword
mov eax,[v]
add esp,-16
fld qword[eax+24]
fstp dword[esp+12]
fld qword[eax+16]
fstp dword[esp+8]
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glColor4f
ret
endp
; TexCoord
align 4
@@ -242,12 +329,78 @@ glTexCoord4f: ;s, t, r, q
pop eax
ret 20 ;=sizeof(dd)*5
align 4
proc glTexCoord4d, s:qword, t:qword, r:qword, q:qword
add esp,-16
fld qword[q]
fstp dword[esp+12]
fld qword[r]
fstp dword[esp+8]
fld qword[t]
fstp dword[esp+4]
fld qword[s]
fstp dword[esp]
call glTexCoord4f
ret
endp
align 4
proc glTexCoord1f, s:dword
stdcall glTexCoord4f,[s],0.0,0.0,1.0
ret
endp
align 4
proc glTexCoord1d, s:qword
push 1.0
push 0.0
push 0.0
add esp,-4
fld qword[s]
fstp dword[esp]
call glTexCoord4f
ret
endp
align 4
proc glTexCoord1fv uses eax, v:dword
mov eax,[v]
stdcall glTexCoord4f,[eax],0.0,0.0,1.0
ret
endp
align 4
proc glTexCoord1dv uses eax, v:dword
mov eax,[v]
push 1.0
push 0.0
push 0.0
add esp,-4
fld qword[eax]
fstp dword[esp]
call glTexCoord4f
ret
endp
align 4
proc glTexCoord2f, s:dword, t:dword
stdcall glTexCoord4f,[s],[t],0.0,1.0
ret
endp
align 4
proc glTexCoord2d, s:qword, t:qword
push 1.0
push 0.0
add esp,-8
fld qword[t]
fstp dword[esp+4]
fld qword[s]
fstp dword[esp]
call glTexCoord4f
ret
endp
align 4
proc glTexCoord2fv uses eax, v:dword
mov eax,[v]
@@ -255,6 +408,85 @@ proc glTexCoord2fv uses eax, v:dword
ret
endp
align 4
proc glTexCoord2dv uses eax, v:dword
mov eax,[v]
push 1.0
push 0.0
add esp,-8
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glTexCoord4f
ret
endp
align 4
proc glTexCoord3f, s:dword, t:dword, r:dword
stdcall glTexCoord4f,[s],[t],[r],1.0
ret
endp
align 4
proc glTexCoord3d, s:qword, t:qword, r:qword
push 1.0
add esp,-12
fld qword[r]
fstp dword[esp+8]
fld qword[t]
fstp dword[esp+4]
fld qword[s]
fstp dword[esp]
call glTexCoord4f
ret
endp
align 4
proc glTexCoord3fv uses eax, v:dword
mov eax,[v]
stdcall glTexCoord4f,[eax],[eax+4],[eax+8],1.0
ret
endp
align 4
proc glTexCoord3dv uses eax, v:dword
mov eax,[v]
push 1.0
add esp,-12
fld qword[eax+16]
fstp dword[esp+8]
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glTexCoord4f
ret
endp
align 4
proc glTexCoord4fv uses eax, v:dword
mov eax,[v]
stdcall glTexCoord4f,[eax],[eax+4],[eax+8],[eax+12]
ret
endp
align 4
proc glTexCoord4dv uses eax, v:dword
mov eax,[v]
add esp,-16
fld qword[eax+24]
fstp dword[esp+12]
fld qword[eax+16]
fstp dword[esp+8]
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glTexCoord4f
ret
endp
align 4
glEdgeFlag: ;flag
push dword[esp] ;копируем адрес возврата
@@ -883,7 +1115,7 @@ glHint: ;target, mode
align 4
proc glDebug uses eax, mode:dword
stdcall gl_get_context ;после вызова функции в eax указатель на GLContext
call gl_get_context ;после вызова функции в eax указатель на GLContext
push dword[mode]
pop dword[eax+GLContext.print_flag]
ret

View File

@@ -0,0 +1,45 @@
align 4
proc glGetIntegerv uses eax edi, pname:dword, params:dword
mov eax,[pname]
mov edi,[params]
cmp eax,GL_VIEWPORT
jne @f
push esi
call gl_get_context
lea esi,[eax+GLContext.viewport]
movsd ;m2m dword[edi],dword[eax+GLContext.viewport.xmin]
movsd ;copy .ymin
movsd ;copy .xsize
movsd ;copy .ysize
pop esi
jmp .endf
@@:
cmp eax,GL_MAX_MODELVIEW_STACK_DEPTH
jne @f
mov dword[edi],MAX_MODELVIEW_STACK_DEPTH
jmp .endf
@@:
cmp eax,GL_MAX_PROJECTION_STACK_DEPTH
jne @f
mov dword[edi],MAX_PROJECTION_STACK_DEPTH
jmp .endf
@@:
cmp eax,GL_MAX_LIGHTS
jne @f
mov dword[edi],MAX_LIGHTS
jmp .endf
@@:
cmp eax,GL_MAX_TEXTURE_SIZE
jne @f
mov dword[edi],4096
jmp .endf
@@:
cmp eax,GL_MAX_TEXTURE_STACK_DEPTH
jne @f
mov dword[edi],MAX_TEXTURE_STACK_DEPTH
jmp .endf
@@:
stdcall dbg_print,sz_kosglMakeCurrent,err_glGet
.endf:
ret
endp

View File

@@ -21,7 +21,7 @@ include 'misc.asm'
include 'clear.asm'
include 'light.asm'
include 'select.asm'
;include 'get.asm'
include 'get.asm'
;include 'error.asm'
include 'zbuffer.asm'
include 'zline.asm'
@@ -52,14 +52,17 @@ m_6 db '(6)',13,10,0
m_7 db '(7)',13,10,0
m_8 db '(8)',13,10,0
m_9 db '(9)',13,10,0
f_fill_tr_nl db ' lines',0
f_zbz db ' ZB_line_z',0
f_zb db ' ZB_line',0
buf_param rb 80
align 4
proc str_n_cat uses eax ecx edi esi, str1:dword, str2:dword, n_len:dword
mov esi,dword[str2]
mov ecx,dword[n_len]
mov edi,dword[str1]
mov esi,[str2]
mov ecx,[n_len]
mov edi,[str1]
stdcall str_len,edi
add edi,eax
cld
@@ -105,26 +108,6 @@ align 4
end if
; ***
glColor3d: ;(double ,double ,double)
glColor3dv: ;(double *)
glColor4d: ;(double ,double ,double, double )
glColor4dv: ;(double *)
glNormal3d: ;(double ,double ,double)
glNormal3dv: ;(double *)
glTexCoord1f: ;(float)
glTexCoord1d: ;(double)
glTexCoord1fv: ;(float *)
glTexCoord1dv: ;(double *)
glTexCoord2d: ;(double ,double)
glTexCoord2dv: ;(double *)
glTexCoord3f: ;(float ,float ,float)
glTexCoord3d: ;(double ,double ,double)
glTexCoord3fv: ;(float *)
glTexCoord3dv: ;(double *)
glTexCoord4d: ;(double ,double ,double, double )
glTexCoord4fv: ;(float *)
glTexCoord4dv: ;(double *)
glGetIntegerv: ;(int pname,int *params)
glGetFloatv: ;(int pname, float *v)
align 4
@@ -139,13 +122,7 @@ err_6 db 'unsupported option',13,10,0
err_7 db 'assert(target == GL_TEXTURE_2D && texture >= 0)',13,10,0
err_8 db 'combinaison of parameters not handled',13,10,0
err_9 db 'GL_INVALID_ENUM',13,10,0
f_zbz db ' ZB_line_z',0
f_zb db ' ZB_line',0
f_find_l db 'find_list',0
f_alloc_l db 'alloc_list',0
f_fill_tr db 'ZB_fillTriangle...',0
f_fill_tr_nl db ' lines',0
f_fill_tr_nll db ' len',0
err_glGet db 'glGet: option not implemented',0
align 4
proc dbg_print, fun:dword, mes:dword