Subversion Repositories Kolibri OS

Rev

Rev 5159 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5153 IgorA 1
 
2
proc ZB_plot uses eax ebx ecx edx edi, zb:dword, p:dword
3
	mov eax,[zb]
4
	mov ebx,[p]
5
	mov ecx,[ebx+offs_zbup_y]
6
	imul ecx,[eax+offs_zbuf_xsize]
7
	add ecx,[ebx+offs_zbup_x]
8
	add ecx,[eax+offs_zbuf_zbuf]
9
	mov edx,[eax+offs_zbuf_linesize]
10
	imul edx,[ebx+offs_zbup_y]
11
	mov edi,[ebx+offs_zbup_x]
12
	imul edi,PSZB
13
	add edx,edi
14
	add edx,[eax+offs_zbuf_pbuf]
15
	mov edi,[ebx+offs_zbup_z]
16
	shr edi,ZB_POINT_Z_FRAC_BITS
17
	cmp edi,[ecx]
18
	jl .end_f
19
if TGL_FEATURE_RENDER_BITS eq 24
20
	mov eax,[ebx+offs_zbup_r]
21
	mov byte[edx],ah
22
	mov eax,[ebx+offs_zbup_g]
23
	mov byte[edx+1],ah
24
	mov eax,[ebx+offs_zbup_b]
25
	mov byte[edx+2],ah
26
else
27
;	*pp = RGB_TO_PIXEL(p->r, p->g, p->b);
28
end if
29
	mov [ecx],edi
30
	.end_f:
31
	ret
32
endp
33
34
 
35
align 4
36
proc ZB_line_flat_z, zb:dword, p1:dword, p2:dword, color:dword
37
include 'zline.inc'
38
39
 
40
INTERP_Z equ 1
41
align 4
42
proc ZB_line_interp_z, zb:dword, p1:dword, p2:dword
43
include 'zline_r.inc'
44
45
 
46
47
 
48
proc ZB_line_flat, zb:dword, p1:dword, p2:dword, color:dword
49
include 'zline.inc'
50
51
 
52
proc ZB_line_interp, zb:dword, p1:dword, p2:dword
53
include 'zline_r.inc'
54
55
 
56
proc ZB_line_z uses eax ebx ecx, zb:dword, p1:dword, p2:dword
57
if DEBUG ;ZB_line_z
58
push edi
59
	mov ecx,80
60
	mov eax,[p1]
61
	mov eax,[eax+offs_zbup_x]
62
	lea edi,[buf_param]
63
	stdcall convert_int_to_str,ecx
64
	stdcall str_n_cat,edi,txt_zp_sp,2
65
	stdcall str_len,edi
66
	add edi,eax
67
	sub ecx,eax
68
69
 
70
	mov eax,[eax+offs_zbup_y]
71
	stdcall convert_int_to_str,ecx
72
	stdcall str_n_cat,edi,txt_zp_sp,2
73
	stdcall str_len,edi
74
	add edi,eax
75
	sub ecx,eax
76
77
 
78
	mov eax,[eax+offs_zbup_x]
79
	stdcall convert_int_to_str,ecx
80
	stdcall str_n_cat,edi,txt_zp_sp,2
81
	stdcall str_len,edi
82
	add edi,eax
83
	sub ecx,eax
84
85
 
86
	mov eax,[eax+offs_zbup_y]
87
	stdcall convert_int_to_str,ecx
88
89
 
90
	stdcall dbg_print,f_zbz,buf_param
91
pop edi
92
end if
93
	mov ebx,[p1]
94
	RGB_TO_PIXEL dword[ebx+offs_zbup_r],dword[ebx+offs_zbup_g],dword[ebx+offs_zbup_b]
95
	mov ecx,eax
96
	mov ebx,[p2]
97
	RGB_TO_PIXEL dword[ebx+offs_zbup_r],dword[ebx+offs_zbup_g],dword[ebx+offs_zbup_b]
98
99
 
100
	cmp ecx,eax
101
	jne .els
102
		stdcall ZB_line_flat_z, dword[zb], dword[p1], ebx, ecx
103
		jmp @f
104
	.els:
105
		stdcall ZB_line_interp_z, dword[zb], dword[p1], ebx
106
	@@:
107
	ret
108
endp
109
110
 
111
proc ZB_line uses eax ebx ecx, zb:dword, p1:dword, p2:dword
112
if DEBUG ;ZB_line
113
push edi
114
	mov ecx,80
115
	mov eax,[p1]
116
	mov eax,[eax+offs_zbup_x]
117
	lea edi,[buf_param]
118
	stdcall convert_int_to_str,ecx
119
	stdcall str_n_cat,edi,txt_zp_sp,2
120
	stdcall str_len,edi
121
	add edi,eax
122
	sub ecx,eax
123
124
 
125
	mov eax,[eax+offs_zbup_y]
126
	stdcall convert_int_to_str,ecx
127
	stdcall str_n_cat,edi,txt_zp_sp,2
128
	stdcall str_len,edi
129
	add edi,eax
130
	sub ecx,eax
131
132
 
133
	mov eax,[eax+offs_zbup_x]
134
	stdcall convert_int_to_str,ecx
135
	stdcall str_n_cat,edi,txt_zp_sp,2
136
	stdcall str_len,edi
137
	add edi,eax
138
	sub ecx,eax
139
140
 
141
	mov eax,[eax+offs_zbup_y]
142
	stdcall convert_int_to_str,ecx
143
144
 
145
	stdcall dbg_print,f_zb,buf_param
146
pop edi
147
end if
148
	mov ebx,[p1]
149
	RGB_TO_PIXEL dword[ebx+offs_zbup_r],dword[ebx+offs_zbup_g],dword[ebx+offs_zbup_b]
150
	mov ecx,eax
151
	mov ebx,[p2]
152
	RGB_TO_PIXEL dword[ebx+offs_zbup_r],dword[ebx+offs_zbup_g],dword[ebx+offs_zbup_b]
153
154
 
155
	cmp ecx,eax
156
	jne .els
157
		stdcall ZB_line_flat, dword[zb], dword[p1], ebx, ecx
158
		jmp @f
159
	.els:
160
		stdcall ZB_line_interp, dword[zb], dword[p1], ebx
161
	@@:
162
	ret
163
endp
164