Subversion Repositories Kolibri OS

Rev

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