Subversion Repositories Kolibri OS

Rev

Rev 5159 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5159 Rev 8069
Line 1... Line 1...
1
align 4
1
align 4
2
proc ZB_plot uses eax ebx ecx edx edi, zb:dword, p:dword
2
proc ZB_plot uses eax ebx ecx edx edi, zb:dword, p:dword
3
	mov eax,[zb]
3
	mov eax,[zb]
4
	mov ebx,[p]
4
	mov ebx,[p]
5
	mov ecx,[ebx+offs_zbup_y]
5
	mov ecx,[ebx+ZBufferPoint.y]
6
	imul ecx,[eax+offs_zbuf_xsize]
6
	imul ecx,[eax+ZBuffer.xsize]
7
	add ecx,[ebx+offs_zbup_x]
7
	add ecx,[ebx+ZBufferPoint.x]
8
	shl ecx,1
8
	shl ecx,1
9
	add ecx,[eax+offs_zbuf_zbuf]
9
	add ecx,[eax+ZBuffer.zbuf]
10
	mov edx,[eax+offs_zbuf_linesize]
10
	mov edx,[eax+ZBuffer.linesize]
11
	imul edx,[ebx+offs_zbup_y]
11
	imul edx,[ebx+ZBufferPoint.y]
12
	mov edi,[ebx+offs_zbup_x]
12
	mov edi,[ebx+ZBufferPoint.x]
13
	imul edi,PSZB
13
	imul edi,PSZB
14
	add edx,edi
14
	add edx,edi
15
	add edx,[eax+offs_zbuf_pbuf]
15
	add edx,[eax+ZBuffer.pbuf]
16
	mov edi,[ebx+offs_zbup_z]
16
	mov edi,[ebx+ZBufferPoint.z]
17
	shr edi,ZB_POINT_Z_FRAC_BITS
17
	shr edi,ZB_POINT_Z_FRAC_BITS
18
	cmp di,word[ecx]
18
	cmp di,word[ecx]
19
	jl .end_f
19
	jl .end_f
20
if TGL_FEATURE_RENDER_BITS eq 24
20
if TGL_FEATURE_RENDER_BITS eq 24
21
	mov eax,[ebx+offs_zbup_r]
21
	mov eax,[ebx+ZBufferPoint.r]
22
	mov byte[edx],ah
22
	mov byte[edx],ah
23
	mov eax,[ebx+offs_zbup_g]
23
	mov eax,[ebx+ZBufferPoint.g]
24
	mov byte[edx+1],ah
24
	mov byte[edx+1],ah
25
	mov eax,[ebx+offs_zbup_b]
25
	mov eax,[ebx+ZBufferPoint.b]
26
	mov byte[edx+2],ah
26
	mov byte[edx+2],ah
27
else
27
else
28
;	*pp = RGB_TO_PIXEL(p->r, p->g, p->b);
28
;	*pp = RGB_TO_PIXEL(p->r, p->g, p->b);
29
end if
29
end if
30
	mov word[ecx],di
30
	mov word[ecx],di
Line 58... Line 58...
58
if DEBUG ;ZB_line_z
58
if DEBUG ;ZB_line_z
59
push edi
59
push edi
60
	mov ecx,80
60
	mov ecx,80
61
	mov eax,[p1]
61
	mov eax,[p1]
62
	mov eax,[eax+offs_zbup_x]
62
	mov eax,[eax+ZBufferPoint.x]
63
	lea edi,[buf_param]
63
	lea edi,[buf_param]
64
	stdcall convert_int_to_str,ecx
64
	stdcall convert_int_to_str,ecx
65
	stdcall str_n_cat,edi,txt_zp_sp,2
65
	stdcall str_n_cat,edi,txt_zp_sp,2
66
	stdcall str_len,edi
66
	stdcall str_len,edi
67
	add edi,eax
67
	add edi,eax
68
	sub ecx,eax
68
	sub ecx,eax
69
 
69
 
Line 70... Line 70...
70
	mov eax,[p1]
70
	mov eax,[p1]
71
	mov eax,[eax+offs_zbup_y]
71
	mov eax,[eax+ZBufferPoint.y]
72
	stdcall convert_int_to_str,ecx
72
	stdcall convert_int_to_str,ecx
73
	stdcall str_n_cat,edi,txt_zp_sp,2
73
	stdcall str_n_cat,edi,txt_zp_sp,2
74
	stdcall str_len,edi
74
	stdcall str_len,edi
75
	add edi,eax
75
	add edi,eax
76
	sub ecx,eax
76
	sub ecx,eax
Line 77... Line 77...
77
 
77
 
78
	mov eax,[p2]
78
	mov eax,[p2]
79
	mov eax,[eax+offs_zbup_x]
79
	mov eax,[eax+ZBufferPoint.x]
80
	stdcall convert_int_to_str,ecx
80
	stdcall convert_int_to_str,ecx
81
	stdcall str_n_cat,edi,txt_zp_sp,2
81
	stdcall str_n_cat,edi,txt_zp_sp,2
82
	stdcall str_len,edi
82
	stdcall str_len,edi
83
	add edi,eax
83
	add edi,eax
Line 84... Line 84...
84
	sub ecx,eax
84
	sub ecx,eax
85
 
85
 
86
	mov eax,[p2]
86
	mov eax,[p2]
Line 87... Line 87...
87
	mov eax,[eax+offs_zbup_y]
87
	mov eax,[eax+ZBufferPoint.y]
88
	stdcall convert_int_to_str,ecx
88
	stdcall convert_int_to_str,ecx
89
 
89
 
90
	stdcall str_n_cat,edi,txt_nl,2
90
	stdcall str_n_cat,edi,txt_nl,2
91
	stdcall dbg_print,f_zbz,buf_param
91
	stdcall dbg_print,f_zbz,buf_param
92
pop edi
92
pop edi
93
end if
93
end if
94
	mov ebx,[p1]
94
	mov ebx,[p1]
95
	RGB_TO_PIXEL dword[ebx+offs_zbup_r],dword[ebx+offs_zbup_g],dword[ebx+offs_zbup_b]
95
	RGB_TO_PIXEL dword[ebx+ZBufferPoint.r],dword[ebx+ZBufferPoint.g],dword[ebx+ZBufferPoint.b]
Line 96... Line 96...
96
	mov ecx,eax
96
	mov ecx,eax
97
	mov ebx,[p2]
97
	mov ebx,[p2]
98
	RGB_TO_PIXEL dword[ebx+offs_zbup_r],dword[ebx+offs_zbup_g],dword[ebx+offs_zbup_b]
98
	RGB_TO_PIXEL dword[ebx+ZBufferPoint.r],dword[ebx+ZBufferPoint.g],dword[ebx+ZBufferPoint.b]
99
 
99
 
Line 113... Line 113...
113
if DEBUG ;ZB_line
113
if DEBUG ;ZB_line
114
push edi
114
push edi
115
	mov ecx,80
115
	mov ecx,80
116
	mov eax,[p1]
116
	mov eax,[p1]
117
	mov eax,[eax+offs_zbup_x]
117
	mov eax,[eax+ZBufferPoint.x]
118
	lea edi,[buf_param]
118
	lea edi,[buf_param]
119
	stdcall convert_int_to_str,ecx
119
	stdcall convert_int_to_str,ecx
120
	stdcall str_n_cat,edi,txt_zp_sp,2
120
	stdcall str_n_cat,edi,txt_zp_sp,2
121
	stdcall str_len,edi
121
	stdcall str_len,edi
122
	add edi,eax
122
	add edi,eax
123
	sub ecx,eax
123
	sub ecx,eax
124
 
124
 
Line 125... Line 125...
125
	mov eax,[p1]
125
	mov eax,[p1]
126
	mov eax,[eax+offs_zbup_y]
126
	mov eax,[eax+ZBufferPoint.y]
127
	stdcall convert_int_to_str,ecx
127
	stdcall convert_int_to_str,ecx
128
	stdcall str_n_cat,edi,txt_zp_sp,2
128
	stdcall str_n_cat,edi,txt_zp_sp,2
129
	stdcall str_len,edi
129
	stdcall str_len,edi
130
	add edi,eax
130
	add edi,eax
131
	sub ecx,eax
131
	sub ecx,eax
Line 132... Line 132...
132
 
132
 
133
	mov eax,[p2]
133
	mov eax,[p2]
134
	mov eax,[eax+offs_zbup_x]
134
	mov eax,[eax+ZBufferPoint.x]
135
	stdcall convert_int_to_str,ecx
135
	stdcall convert_int_to_str,ecx
136
	stdcall str_n_cat,edi,txt_zp_sp,2
136
	stdcall str_n_cat,edi,txt_zp_sp,2
137
	stdcall str_len,edi
137
	stdcall str_len,edi
138
	add edi,eax
138
	add edi,eax
Line 139... Line 139...
139
	sub ecx,eax
139
	sub ecx,eax
140
 
140
 
141
	mov eax,[p2]
141
	mov eax,[p2]
Line 142... Line 142...
142
	mov eax,[eax+offs_zbup_y]
142
	mov eax,[eax+ZBufferPoint.y]
143
	stdcall convert_int_to_str,ecx
143
	stdcall convert_int_to_str,ecx
144
 
144
 
145
	stdcall str_n_cat,edi,txt_nl,2
145
	stdcall str_n_cat,edi,txt_nl,2
146
	stdcall dbg_print,f_zb,buf_param
146
	stdcall dbg_print,f_zb,buf_param
147
pop edi
147
pop edi
148
end if
148
end if
149
	mov ebx,[p1]
149
	mov ebx,[p1]
150
	RGB_TO_PIXEL dword[ebx+offs_zbup_r],dword[ebx+offs_zbup_g],dword[ebx+offs_zbup_b]
150
	RGB_TO_PIXEL dword[ebx+ZBufferPoint.r],dword[ebx+ZBufferPoint.g],dword[ebx+ZBufferPoint.b]
Line 151... Line 151...
151
	mov ecx,eax
151
	mov ecx,eax
152
	mov ebx,[p2]
152
	mov ebx,[p2]
153
	RGB_TO_PIXEL dword[ebx+offs_zbup_r],dword[ebx+offs_zbup_g],dword[ebx+offs_zbup_b]
153
	RGB_TO_PIXEL dword[ebx+ZBufferPoint.r],dword[ebx+ZBufferPoint.g],dword[ebx+ZBufferPoint.b]
154
 
154