2014-10-31 22:28:24 +01:00
|
|
|
format MS COFF
|
|
|
|
public EXPORTS
|
|
|
|
section '.flat' code readable align 16
|
|
|
|
|
2020-09-19 21:57:00 +02:00
|
|
|
include '../../../../proc32.inc'
|
|
|
|
include '../../../../macros.inc'
|
|
|
|
include '../../../../KOSfuncs.inc'
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
DEBUG equ 0
|
|
|
|
|
|
|
|
include 'zgl.inc'
|
|
|
|
include 'zmath.asm'
|
|
|
|
include 'clip.asm'
|
|
|
|
include 'vertex.asm'
|
|
|
|
include 'api.asm'
|
2015-01-05 20:13:01 +01:00
|
|
|
include 'list.asm' ;gl_add_op
|
2014-10-31 22:28:24 +01:00
|
|
|
include 'init.asm'
|
2015-01-05 20:13:01 +01:00
|
|
|
include 'matrix.asm' ;gl_print_matrix
|
2014-10-31 22:28:24 +01:00
|
|
|
include 'texture.asm'
|
|
|
|
include 'misc.asm'
|
|
|
|
include 'clear.asm'
|
|
|
|
include 'light.asm'
|
|
|
|
include 'select.asm'
|
|
|
|
;include 'get.asm'
|
|
|
|
;include 'error.asm'
|
|
|
|
include 'zbuffer.asm'
|
|
|
|
include 'zline.asm'
|
|
|
|
;include 'zdither.asm'
|
|
|
|
include 'ztriangle.asm'
|
2016-02-10 19:41:35 +01:00
|
|
|
include 'image_util.asm'
|
2014-10-31 22:28:24 +01:00
|
|
|
;include 'msghandling.asm'
|
|
|
|
include 'arrays.asm'
|
2014-12-22 10:21:22 +01:00
|
|
|
include 'specbuf.asm'
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
include 'kosgl.asm'
|
2014-12-05 22:12:56 +01:00
|
|
|
include 'glu.asm'
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
if DEBUG
|
|
|
|
include 'info_fun_float.inc'
|
|
|
|
|
|
|
|
align 4
|
|
|
|
txt_nl db 13,10,0
|
|
|
|
txt_sp db ' ',0
|
2014-11-05 00:31:24 +01:00
|
|
|
txt_op db 'Op_code',0
|
2014-10-31 22:28:24 +01:00
|
|
|
txt_zp_sp db ', ',0
|
|
|
|
m_1 db '(1)',13,10,0
|
|
|
|
m_2 db '(2)',13,10,0
|
|
|
|
m_3 db '(3)',13,10,0
|
|
|
|
m_4 db '(4)',13,10,0
|
|
|
|
m_5 db '(5)',13,10,0
|
2014-11-22 20:14:55 +01:00
|
|
|
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
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
buf_param rb 80
|
|
|
|
|
|
|
|
align 4
|
2014-11-07 16:23:03 +01:00
|
|
|
proc str_n_cat uses eax ecx edi esi, str1:dword, str2:dword, n_len:dword
|
2014-10-31 22:28:24 +01:00
|
|
|
mov esi,dword[str2]
|
2014-11-07 16:23:03 +01:00
|
|
|
mov ecx,dword[n_len]
|
2014-10-31 22:28:24 +01:00
|
|
|
mov edi,dword[str1]
|
|
|
|
stdcall str_len,edi
|
|
|
|
add edi,eax
|
|
|
|
cld
|
|
|
|
repne movsb
|
|
|
|
mov byte[edi],0
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
;input:
|
|
|
|
; eax - число
|
|
|
|
; edi - буфер для строки
|
|
|
|
; len - длинна буфера
|
|
|
|
;output:
|
|
|
|
align 4
|
|
|
|
proc convert_int_to_str, len:dword
|
|
|
|
pushad
|
|
|
|
mov esi,[len]
|
|
|
|
add esi,edi
|
|
|
|
dec esi
|
|
|
|
call .str
|
|
|
|
popad
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 4
|
|
|
|
.str:
|
2020-09-19 21:57:00 +02:00
|
|
|
mov ecx,10
|
|
|
|
cmp eax,ecx
|
2014-10-31 22:28:24 +01:00
|
|
|
jb @f
|
2020-09-19 21:57:00 +02:00
|
|
|
xor edx,edx
|
|
|
|
div ecx
|
|
|
|
push edx
|
|
|
|
call .str
|
2014-10-31 22:28:24 +01:00
|
|
|
pop eax
|
2020-09-19 21:57:00 +02:00
|
|
|
@@:
|
2014-10-31 22:28:24 +01:00
|
|
|
cmp edi,esi
|
|
|
|
jge @f
|
2020-09-19 21:57:00 +02:00
|
|
|
or al,0x30
|
|
|
|
stosb
|
|
|
|
mov byte[edi],0
|
2014-10-31 22:28:24 +01:00
|
|
|
@@:
|
2020-09-19 21:57:00 +02:00
|
|
|
ret
|
2014-10-31 22:28:24 +01:00
|
|
|
end if
|
|
|
|
|
2015-01-05 20:13:01 +01:00
|
|
|
; ***
|
|
|
|
glVertex2d: ;(double ,double)
|
|
|
|
glVertex2dv: ;(double *)
|
|
|
|
glVertex3d: ;(double ,double ,double)
|
|
|
|
glVertex3dv: ;(double *)
|
|
|
|
glVertex4d: ;(double ,double ,double, double )
|
|
|
|
glVertex4dv: ;(double *)
|
|
|
|
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)
|
|
|
|
|
2014-10-31 22:28:24 +01:00
|
|
|
align 4
|
|
|
|
err_0 db 'Error while initializing Z buffer',13,10,0
|
|
|
|
f_zb_opn db ' ZB_open',0
|
|
|
|
err_1 db 'gl_malloc(sizeof.ZBuffer)==0',13,10,0
|
|
|
|
err_2 db 'gl_malloc(xsize*ysize*4)==0',13,10,0
|
|
|
|
err_3 db 'bit mode not correct',13,10,0
|
|
|
|
err_4 db 'error while resizing display',13,10,0
|
|
|
|
err_5 db 'size too small',13,10,0
|
2016-01-28 20:22:54 +01:00
|
|
|
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
|
2014-10-31 22:28:24 +01:00
|
|
|
f_zbz db ' ZB_line_z',0
|
|
|
|
f_zb db ' ZB_line',0
|
2014-11-05 00:31:24 +01:00
|
|
|
f_find_l db 'find_list',0
|
|
|
|
f_alloc_l db 'alloc_list',0
|
2014-11-22 20:14:55 +01:00
|
|
|
f_fill_tr db 'ZB_fillTriangle...',0
|
|
|
|
f_fill_tr_nl db ' lines',0
|
|
|
|
f_fill_tr_nll db ' len',0
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
align 4
|
|
|
|
proc dbg_print, fun:dword, mes:dword
|
|
|
|
pushad
|
2020-09-19 21:57:00 +02:00
|
|
|
mov eax,SF_BOARD
|
|
|
|
mov ebx,SSF_DEBUG_WRITE
|
2014-10-31 22:28:24 +01:00
|
|
|
|
|
|
|
mov esi,[fun]
|
|
|
|
@@:
|
|
|
|
mov cl,byte[esi]
|
|
|
|
int 0x40
|
|
|
|
inc esi
|
|
|
|
cmp byte[esi],0
|
|
|
|
jne @b
|
|
|
|
mov cl,':'
|
|
|
|
int 0x40
|
|
|
|
mov cl,' '
|
|
|
|
int 0x40
|
|
|
|
mov esi,[mes]
|
|
|
|
@@:
|
|
|
|
mov cl,byte[esi]
|
|
|
|
int 0x40
|
|
|
|
inc esi
|
|
|
|
cmp byte[esi],0
|
|
|
|
jne @b
|
|
|
|
popad
|
|
|
|
ret
|
|
|
|
endp
|
|
|
|
|
|
|
|
align 16
|
|
|
|
EXPORTS:
|
|
|
|
macro E_LIB n
|
|
|
|
{
|
|
|
|
dd sz_#n, n
|
|
|
|
}
|
|
|
|
include 'export.inc'
|
|
|
|
dd 0,0
|
|
|
|
macro E_LIB n
|
|
|
|
{
|
|
|
|
sz_#n db `n,0
|
|
|
|
}
|
|
|
|
include 'export.inc'
|