Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
716 | lvd | 1 | #include "std.h" |
2 | |||
3 | #include "emul.h" |
||
4 | #include "vars.h" |
||
5 | #include "draw.h" |
||
6 | #include "dx.h" |
||
7 | #include "dxrframe.h" |
||
8 | |||
9 | RENDER_FUNC auto_ch = 0; |
||
10 | |||
11 | void __fastcall _render_ch_ax(unsigned char *dst, unsigned pitch, RENDER_FUNC c2, RENDER_FUNC c4) |
||
12 | { |
||
13 | if (conf.ch_size == 2) { c2(dst, pitch); return; } |
||
14 | if (conf.ch_size == 4) { c4(dst, pitch); return; } |
||
15 | static unsigned counter; |
||
16 | unsigned i; //Alone Coder 0.36.7 |
||
17 | if (!auto_ch || needclr || !(++counter & 7)) { |
||
18 | unsigned char n[0x100]; |
||
19 | for (/*unsigned*/ i = 0; i < 0x100; i++) n[i] = 0; |
||
20 | for (i = 0; i < 0x300; i++) n[temp.base[i+0x1800]] = 1; |
||
21 | unsigned max = 0; |
||
22 | for (i = 0; i < 0x100; i++) max += n[i]; |
||
23 | auto_ch = (max > 3) ? c2 : c4; |
||
24 | } |
||
25 | auto_ch(dst, pitch); |
||
26 | } |
||
27 | |||
28 | void get_c2_32() { |
||
29 | unsigned char *base = temp.base; |
||
30 | unsigned char *attr = base + 0x1800; |
||
31 | |||
32 | unsigned char *ptr = (unsigned char*)t.bs2h; |
||
33 | for (unsigned p = 0; p < 3; p++) { |
||
34 | for (unsigned y = 0; y < 8; y++) { |
||
35 | for (unsigned x = 0; x < 32; x++) { |
||
36 | unsigned *tab = t.c32tab[*attr++]; |
||
37 | unsigned r = |
||
38 | t.settab2[base[y*0x20+x]] + |
||
39 | t.settab2[base[y*0x20+x+0x100]]; |
||
40 | *(unsigned*)(ptr+16*x+0) = tab[r>>24]; |
||
41 | *(unsigned*)(ptr+16*x+4) = tab[(r>>16)&0xFF]; |
||
42 | *(unsigned*)(ptr+16*x+8) = tab[(r>>8)&0xFF]; |
||
43 | *(unsigned*)(ptr+16*x+12) = tab[r&0xFF]; |
||
44 | r = t.settab2[base[y*0x20+x+0x200]] + |
||
45 | t.settab2[base[y*0x20+x+0x300]]; |
||
46 | *(unsigned*)(ptr+16*x+129*4+0) = tab[r>>24]; |
||
47 | *(unsigned*)(ptr+16*x+129*4+4) = tab[(r>>16)&0xFF]; |
||
48 | *(unsigned*)(ptr+16*x+129*4+8) = tab[(r>>8)&0xFF]; |
||
49 | *(unsigned*)(ptr+16*x+129*4+12) = tab[r&0xFF]; |
||
50 | r = t.settab2[base[y*0x20+x+0x400]] + |
||
51 | t.settab2[base[y*0x20+x+0x500]]; |
||
52 | *(unsigned*)(ptr+16*x+129*8+0) = tab[r>>24]; |
||
53 | *(unsigned*)(ptr+16*x+129*8+4) = tab[(r>>16)&0xFF]; |
||
54 | *(unsigned*)(ptr+16*x+129*8+8) = tab[(r>>8)&0xFF]; |
||
55 | *(unsigned*)(ptr+16*x+129*8+12) = tab[r&0xFF]; |
||
56 | r = t.settab2[base[y*0x20+x+0x600]] + |
||
57 | t.settab2[base[y*0x20+x+0x700]]; |
||
58 | *(unsigned*)(ptr+16*x+129*12+0) = tab[r>>24]; |
||
59 | *(unsigned*)(ptr+16*x+129*12+4) = tab[(r>>16)&0xFF]; |
||
60 | *(unsigned*)(ptr+16*x+129*12+8) = tab[(r>>8)&0xFF]; |
||
61 | *(unsigned*)(ptr+16*x+129*12+12) = tab[r&0xFF]; |
||
62 | } |
||
63 | *(unsigned*)(ptr+512) = *(unsigned*)(ptr+512-4); |
||
64 | *(unsigned*)(ptr+512+129*4) = *(unsigned*)(ptr+512+129*4-4); |
||
65 | *(unsigned*)(ptr+512+129*8) = *(unsigned*)(ptr+512+129*8-4); |
||
66 | *(unsigned*)(ptr+512+129*12) = *(unsigned*)(ptr+512+129*12-4); |
||
67 | ptr += 129*16; |
||
68 | } |
||
69 | base += 2048; |
||
70 | } |
||
71 | } |
||
72 | void get_c4_32() { |
||
73 | unsigned char *base = temp.base; |
||
74 | unsigned char *attr = base + 0x1800; |
||
75 | |||
76 | unsigned char *ptr = (unsigned char*)t.bs4h; |
||
77 | for (unsigned p = 0; p < 3; p++) { |
||
78 | for (unsigned y = 0; y < 8; y++) { |
||
79 | for (unsigned x = 0; x < 32; x++) { |
||
80 | unsigned *tab = t.c32tab[*attr++]; |
||
81 | unsigned r = |
||
82 | t.settab[base[y*0x20+x]] + |
||
83 | t.settab[base[y*0x20+x+0x100]] + |
||
84 | t.settab[base[y*0x20+x+0x200]] + |
||
85 | t.settab[base[y*0x20+x+0x300]]; |
||
86 | *(unsigned*)(ptr+8*x+0) = tab[r >> 8]; |
||
87 | *(unsigned*)(ptr+8*x+4) = tab[r & 0xFF]; |
||
88 | r = t.settab[base[y*0x20+x+0x400]] + |
||
89 | t.settab[base[y*0x20+x+0x500]] + |
||
90 | t.settab[base[y*0x20+x+0x600]] + |
||
91 | t.settab[base[y*0x20+x+0x700]]; |
||
92 | *(unsigned*)(ptr+8*x+65*4+0) = tab[r >> 8]; |
||
93 | *(unsigned*)(ptr+8*x+65*4+4) = tab[r & 0xFF]; |
||
94 | } |
||
95 | *(unsigned*)(ptr+256) = *(unsigned*)(ptr+256-4); |
||
96 | *(unsigned*)(ptr+256+65*4) = *(unsigned*)(ptr+256+65*4-4); |
||
97 | ptr += 65*8; |
||
98 | } |
||
99 | base += 2048; |
||
100 | } |
||
101 | } |
||
102 | |||
103 | void __fastcall _render_c2x16(unsigned char *dst, unsigned pitch) { |
||
104 | get_c2_32(); |
||
105 | if (!(temp.rflags & RF_128x96)) temp.rflags = (temp.rflags & ~RF_64x48) | RF_128x96, set_vidmode(); |
||
106 | else |
||
107 | for (unsigned y = 0; y < 96; y++) { |
||
108 | for (unsigned x = 0; x < 128*4; x+=4) |
||
109 | *(unsigned*)(dst+x) = (*(unsigned*)((char*)t.bs2h[y]+2*x) & 0x0000FFFF) + |
||
110 | (*(unsigned*)((char*)t.bs2h[y]+2*x+4) & 0xFFFF0000); |
||
111 | dst += pitch; |
||
112 | } |
||
113 | } |
||
114 | void __fastcall _render_c4x16(unsigned char *dst, unsigned pitch) { |
||
115 | get_c4_32(); |
||
116 | if (!(temp.rflags & RF_64x48)) temp.rflags = (temp.rflags & ~RF_128x96) | RF_64x48, set_vidmode(); |
||
117 | else |
||
118 | for (unsigned y = 0; y < 48; y++) { |
||
119 | for (unsigned x = 0; x < 64*4; x+=4) |
||
120 | *(unsigned*)(dst+x) = (*(unsigned*)((char*)t.bs4h[y]+2*x) & 0x0000FFFF) + |
||
121 | (*(unsigned*)((char*)t.bs4h[y]+2*x+4) & 0xFFFF0000); |
||
122 | dst += pitch; |
||
123 | } |
||
124 | } |
||
125 | |||
126 | void __fastcall render_ch_ov(unsigned char *dst, unsigned pitch) |
||
127 | { |
||
128 | _render_ch_ax(dst, pitch, _render_c2x16, _render_c4x16); |
||
129 | } |
||
130 | |||
131 | void _render_blt(unsigned char *dst, unsigned pitch, unsigned char *src, unsigned dp) |
||
132 | { |
||
133 | for (unsigned y = 0; y < temp.oy; y++) { |
||
134 | for (unsigned x = 0; x < temp.ox; x++) |
||
135 | *(unsigned*)(dst+4*x) = *(unsigned*)(src+4*x); |
||
136 | dst += pitch; src += dp; |
||
137 | } |
||
138 | } |
||
139 | |||
140 | void __fastcall _render_c2hw(unsigned char *dst, unsigned pitch) |
||
141 | { |
||
142 | get_c2_32(); |
||
143 | if (!(temp.rflags & RF_128x96)) { temp.rflags = (temp.rflags & ~RF_64x48) | RF_128x96, set_vidmode(); return; } |
||
144 | _render_blt(dst, pitch, (unsigned char*)t.bs2h, sizeof t.bs2h[0]); |
||
145 | } |
||
146 | |||
147 | void __fastcall _render_c4hw(unsigned char *dst, unsigned pitch) |
||
148 | { |
||
149 | get_c4_32(); |
||
150 | if (!(temp.rflags & RF_64x48)) { temp.rflags = (temp.rflags & ~RF_128x96) | RF_64x48, set_vidmode(); return; } |
||
151 | _render_blt(dst, pitch, (unsigned char*)t.bs4h, sizeof t.bs4h[0]); |
||
152 | } |
||
153 | |||
154 | void __fastcall render_ch_hw(unsigned char *dst, unsigned pitch) |
||
155 | { |
||
156 | _render_ch_ax(dst, pitch, _render_c2hw, _render_c4hw); |
||
157 | } |
||
158 | |||
159 | void __fastcall _render_c2x16b(unsigned char *dst, unsigned pitch) |
||
160 | { |
||
161 | if (conf.updateb) |
||
162 | { |
||
163 | if (!conf.fast_sl) rend_frame_16d(dst, pitch); |
||
164 | else rend_frame_16d1(dst, pitch*2); |
||
165 | } |
||
166 | |||
167 | get_c2_32(); |
||
168 | dst += pitch * (temp.b_top*2) + temp.b_left*2*sizeof(WORD); |
||
169 | |||
170 | unsigned ll[512*2]; |
||
171 | unsigned y; //Alone Coder 0.36.7 |
||
172 | unsigned x; //Alone Coder 0.36.7 |
||
173 | for (/*unsigned*/ y = 0; y < 512*4; y += 4) |
||
174 | *(unsigned*)((unsigned char*)ll+y) = 0; |
||
175 | for (y = 0; y < 96; y++) { |
||
176 | unsigned *bp = t.bs2h[y]; |
||
177 | for (/*unsigned*/ x = 0; x < 128; x++) { |
||
178 | unsigned *dst1 = ll + 512 + x*4; |
||
179 | unsigned b0 = bp[x] & 0xFCFCFC, b4 = bp[x+1] & 0xFCFCFC; |
||
180 | dst1[0] = bp[x]; |
||
181 | dst1[1] = (3*b0+b4)/4; |
||
182 | dst1[2] = (b0+b4)/2; |
||
183 | dst1[3] = (b0+3*b4)/4; |
||
184 | } |
||
185 | |||
186 | if (temp.hi15) { |
||
187 | #define ps1(yy) \ |
||
188 | for (x = 0; x < 512/2; x++) { \ |
||
189 | unsigned r1 = ll[2*x] & 0xFCFCFC, r2 = ll[512+2*x] & 0xFCFCFC; \ |
||
190 | unsigned r = (r2*yy + r1*(4-yy))/4; \ |
||
191 | r1 = ll[2*x+1] & 0xFCFCFC, r2 = ll[512+2*x+1] & 0xFCFCFC; \ |
||
192 | r2 = (r2*yy + r1*(4-yy))/4; \ |
||
193 | *(unsigned*)(dst+4*x) = ((r>>3) & 0x1F) + ((r>>6) & 0x03E0) + ((r>>9) & 0x7C00) + \ |
||
194 | ((r2<<13) & 0x1F0000) + ((r2<<10) & 0x03E00000) + ((r2<<7) & 0x7C000000); \ |
||
195 | } \ |
||
196 | dst += pitch; |
||
197 | ps1(0); ps1(1); ps1(2); ps1(3); |
||
198 | #undef ps1 |
||
199 | } else { |
||
200 | #define ps1(yy) \ |
||
201 | for (x = 0; x < 512/2; x++) { \ |
||
202 | unsigned r1 = ll[2*x] & 0xFCFCFC, r2 = ll[512+2*x] & 0xFCFCFC; \ |
||
203 | unsigned r = (r2*yy + r1*(4-yy))/4; \ |
||
204 | r1 = ll[2*x+1] & 0xFCFCFC, r2 = ll[512+2*x+1] & 0xFCFCFC; \ |
||
205 | r2 = (r2*yy + r1*(4-yy))/4; \ |
||
206 | *(unsigned*)(dst+4*x) = ((r>>3) & 0x1F) + ((r>>5) & 0x07E0) + ((r>>8) & 0xF800) + \ |
||
207 | ((r2<<13) & 0x1F0000) + ((r2<<11) & 0x07E00000) + ((r2<<8) & 0xF8000000); \ |
||
208 | } \ |
||
209 | dst += pitch; |
||
210 | ps1(0); ps1(1); ps1(2); ps1(3); |
||
211 | #undef ps1 |
||
212 | } |
||
213 | for (x = 0; x < 512; x++) ll[x] = ll[x+512]; |
||
214 | } |
||
215 | } |
||
216 | void __fastcall _render_c2x16bl(unsigned char *dst, unsigned pitch) |
||
217 | { |
||
218 | rend_frame16(dst, pitch); |
||
219 | get_c2_32(); |
||
220 | dst += pitch * temp.b_top + temp.b_left*sizeof(WORD); |
||
221 | |||
222 | unsigned ll[256*2]; |
||
223 | unsigned y; //Alone Coder 0.36.7 |
||
224 | unsigned x; //Alone Coder 0.36.7 |
||
225 | for (/*unsigned*/ y = 0; y < 256*4; y += 4) |
||
226 | *(unsigned*)((unsigned char*)ll+y) = 0; |
||
227 | for (y = 0; y < 96; y++) { |
||
228 | unsigned *bp = t.bs2h[y]; |
||
229 | for (/*unsigned*/ x = 0; x < 128; x++) { |
||
230 | unsigned *dst1 = ll + 256 + x*2; |
||
231 | unsigned b0 = bp[x] & 0xFEFEFE, b2 = bp[x+1] & 0xFEFEFE; |
||
232 | dst1[0] = bp[x]; |
||
233 | dst1[1] = (b0+b2)/2; |
||
234 | } |
||
235 | |||
236 | if (temp.hi15) { |
||
237 | #define ps1(yy) \ |
||
238 | for (x = 0; x < 256/2; x++) { \ |
||
239 | unsigned r1 = ll[2*x] & 0xFEFEFE, r2 = ll[512+2*x] & 0xFEFEFE; \ |
||
240 | unsigned r = (r2*yy + r1*(2-yy))/2; \ |
||
241 | r1 = ll[2*x+1] & 0xFEFEFE, r2 = ll[256+2*x+1] & 0xFEFEFE; \ |
||
242 | r2 = (r2*yy + r1*(2-yy))/2; \ |
||
243 | *(unsigned*)(dst+4*x) = ((r>>3) & 0x1F) + ((r>>6) & 0x03E0) + ((r>>9) & 0x7C00) + \ |
||
244 | ((r2<<13) & 0x1F0000) + ((r2<<10) & 0x03E00000) + ((r2<<7) & 0x7C000000); \ |
||
245 | } \ |
||
246 | dst += pitch; |
||
247 | ps1(0); ps1(1); |
||
248 | #undef ps1 |
||
249 | } else { |
||
250 | #define ps1(yy) \ |
||
251 | for (x = 0; x < 256/2; x++) { \ |
||
252 | unsigned r1 = ll[2*x] & 0xFEFEFE, r2 = ll[256+2*x] & 0xFEFEFE; \ |
||
253 | unsigned r = (r2*yy + r1*(2-yy))/2; \ |
||
254 | r1 = ll[2*x+1] & 0xFEFEFE, r2 = ll[256+2*x+1] & 0xFEFEFE; \ |
||
255 | r2 = (r2*yy + r1*(2-yy))/2; \ |
||
256 | *(unsigned*)(dst+4*x) = ((r>>3) & 0x1F) + ((r>>5) & 0x07E0) + ((r>>8) & 0xF800) + \ |
||
257 | ((r2<<13) & 0x1F0000) + ((r2<<11) & 0x07E00000) + ((r2<<8) & 0xF8000000); \ |
||
258 | } \ |
||
259 | dst += pitch; |
||
260 | ps1(0); ps1(1); |
||
261 | #undef ps1 |
||
262 | } |
||
263 | for (x = 0; x < 256; x++) ll[x] = ll[x+256]; |
||
264 | } |
||
265 | } |
||
266 | void __fastcall _render_c4x16b(unsigned char *dst, unsigned pitch) |
||
267 | { |
||
268 | if (conf.updateb) |
||
269 | { |
||
270 | if (!conf.fast_sl) rend_frame_16d(dst, pitch); |
||
271 | else rend_frame_16d1(dst, pitch*2); |
||
272 | } |
||
273 | |||
274 | get_c4_32(); |
||
275 | dst += pitch * (temp.b_top*2) + 2*temp.b_left*sizeof(WORD); |
||
276 | |||
277 | unsigned ll[512*2]; |
||
278 | unsigned y; //Alone Coder 0.36.7 |
||
279 | unsigned x; //Alone Coder 0.36.7 |
||
280 | for (/*unsigned*/ y = 0; y < 512*4; y += 4) |
||
281 | *(unsigned*)(((unsigned char*)ll)+y) = 0; |
||
282 | for (y = 0; y < 48; y++) { |
||
283 | unsigned *bp = t.bs4h[y]; |
||
284 | for (/*unsigned*/ x = 0; x < 64; x++) { |
||
285 | unsigned *dst1 = ll + 512 + x*8; |
||
286 | unsigned b0 = bp[x] & 0xF8F8F8, b8 = bp[x+1] & 0xF8F8F8; |
||
287 | dst1[0] = bp[x]; |
||
288 | dst1[1] = (7*b0+b8)/8; |
||
289 | dst1[2] = (3*b0+b8)/4; |
||
290 | dst1[3] = (5*b0+3*b8)/8; |
||
291 | dst1[4] = (b0+b8)/2; |
||
292 | dst1[5] = (3*b0+5*b8)/8; |
||
293 | dst1[6] = (b0+3*b8)/4; |
||
294 | dst1[7] = (b0+7*b8)/8; |
||
295 | } |
||
296 | if (temp.hi15) { |
||
297 | #define ps1(yy) \ |
||
298 | for (x = 0; x < 512/2; x++) { \ |
||
299 | unsigned r1 = ll[2*x] & 0xF8F8F8, r2 = ll[2*x+512] & 0xF8F8F8; \ |
||
300 | unsigned r = (r2*yy + r1*(8-yy))/8; \ |
||
301 | r1 = ll[2*x+1] & 0xF8F8F8, r2 = ll[2*x+1+512] & 0xF8F8F8; \ |
||
302 | r2 = ((r2*yy + r1*(8-yy))/8); \ |
||
303 | *(unsigned*)(dst+4*x) = ((r>>3) & 0x1F) + ((r>>6) & 0x03E0) + ((r>>9) & 0x7C00) +\ |
||
304 | ((r2<<13) & 0x1F0000) + ((r2<<10) & 0x03E00000) + ((r2<<7) & 0x7C000000); \ |
||
305 | } \ |
||
306 | dst += pitch; |
||
307 | ps1(0); ps1(1); ps1(2); ps1(3); ps1(4); ps1(5); ps1(6); ps1(7); |
||
308 | #undef ps1 |
||
309 | } else { |
||
310 | #define ps1(yy) \ |
||
311 | for (x = 0; x < 512/2; x++) { \ |
||
312 | unsigned r1 = ll[2*x] & 0xF8F8F8, r2 = ll[2*x+512] & 0xF8F8F8; \ |
||
313 | unsigned r = (r2*yy + r1*(8-yy))/8; \ |
||
314 | r1 = ll[2*x+1] & 0xF8F8F8, r2 = ll[2*x+1+512] & 0xF8F8F8; \ |
||
315 | r2 = ((r2*yy + r1*(8-yy))/8); \ |
||
316 | *(unsigned*)(dst+4*x) = ((r>>3) & 0x1F) + ((r>>5) & 0x07E0) + ((r>>8) & 0xF800) + \ |
||
317 | ((r2<<13) & 0x1F0000) + ((r2<<11) & 0x07E00000) + ((r2<<8) & 0xF8000000); \ |
||
318 | } \ |
||
319 | dst += pitch; |
||
320 | ps1(0); ps1(1); ps1(2); ps1(3); ps1(4); ps1(5); ps1(6); ps1(7); |
||
321 | #undef ps1 |
||
322 | } |
||
323 | for (x = 0; x < 512; x++) ll[x] = ll[x+512]; |
||
324 | } |
||
325 | } |
||
326 | void __fastcall _render_c4x16bl(unsigned char *dst, unsigned pitch) |
||
327 | { |
||
328 | rend_frame16(dst, pitch); |
||
329 | get_c4_32(); |
||
330 | dst += pitch * temp.b_top + temp.b_left*sizeof(WORD); |
||
331 | |||
332 | unsigned ll[256*2]; |
||
333 | unsigned y; //Alone Coder 0.36.7 |
||
334 | unsigned x; //Alone Coder 0.36.7 |
||
335 | for (/*unsigned*/ y = 0; y < 256*4; y += 4) |
||
336 | *(unsigned*)(((unsigned char*)ll)+y) = 0; |
||
337 | for (y = 0; y < 48; y++) { |
||
338 | unsigned *bp = t.bs4h[y]; |
||
339 | for (/*unsigned*/ x = 0; x < 64; x++) { |
||
340 | unsigned *dst1 = ll + 256 + x*4; |
||
341 | unsigned b0 = bp[x] & 0xFCFCFC, b4 = bp[x+1] & 0xFCFCFC; |
||
342 | dst1[0] = bp[x]; |
||
343 | dst1[1] = (3*b0+b4)/4; |
||
344 | dst1[2] = (b0+b4)/2; |
||
345 | dst1[3] = (b0+3*b4)/4; |
||
346 | } |
||
347 | if (temp.hi15) { |
||
348 | #define ps1(yy) \ |
||
349 | for (x = 0; x < 256/2; x++) { \ |
||
350 | unsigned r1 = ll[2*x] & 0xFCFCFC, r2 = ll[2*x+256] & 0xFCFCFC; \ |
||
351 | unsigned r = (r2*yy + r1*(4-yy))/4; \ |
||
352 | r1 = ll[2*x+1] & 0xFCFCFC, r2 = ll[2*x+1+256] & 0xFCFCFC; \ |
||
353 | r2 = ((r2*yy + r1*(4-yy))/4); \ |
||
354 | *(unsigned*)(dst+4*x) = ((r>>3) & 0x1F) + ((r>>6) & 0x03E0) + ((r>>9) & 0x7C00) +\ |
||
355 | ((r2<<13) & 0x1F0000) + ((r2<<10) & 0x03E00000) + ((r2<<7) & 0x7C000000); \ |
||
356 | } \ |
||
357 | dst += pitch; |
||
358 | ps1(0); ps1(1); ps1(2); ps1(3); |
||
359 | #undef ps1 |
||
360 | } else { |
||
361 | #define ps1(yy) \ |
||
362 | for (x = 0; x < 256/2; x++) { \ |
||
363 | unsigned r1 = ll[2*x] & 0xFCFCFC, r2 = ll[2*x+256] & 0xFCFCFC; \ |
||
364 | unsigned r = (r2*yy + r1*(4-yy))/4; \ |
||
365 | r1 = ll[2*x+1] & 0xFCFCFC, r2 = ll[2*x+1+256] & 0xFCFCFC; \ |
||
366 | r2 = ((r2*yy + r1*(4-yy))/4); \ |
||
367 | *(unsigned*)(dst+4*x) = ((r>>3) & 0x1F) + ((r>>5) & 0x07E0) + ((r>>8) & 0xF800) + \ |
||
368 | ((r2<<13) & 0x1F0000) + ((r2<<11) & 0x07E00000) + ((r2<<8) & 0xF8000000); \ |
||
369 | } \ |
||
370 | dst += pitch; |
||
371 | ps1(0); ps1(1); ps1(2); ps1(3); |
||
372 | #undef ps1 |
||
373 | } |
||
374 | for (x = 0; x < 256; x++) ll[x] = ll[x+256]; |
||
375 | } |
||
376 | } |
||
377 | |||
378 | void __fastcall render_c16bl(unsigned char *dst, unsigned pitch) |
||
379 | { |
||
380 | _render_ch_ax(dst, pitch, _render_c2x16bl, _render_c4x16bl); |
||
381 | } |
||
382 | |||
383 | void __fastcall render_c16b(unsigned char *dst, unsigned pitch) |
||
384 | { |
||
385 | _render_ch_ax(dst, pitch, _render_c2x16b, _render_c4x16b); |
||
386 | } |
||
387 | |||
388 | void __fastcall render_c4x32b(unsigned char *dst, unsigned pitch) |
||
389 | { |
||
390 | if (!conf.fast_sl) rend_frame_32d(dst, pitch); |
||
391 | else rend_frame_32d1(dst, pitch*2); |
||
392 | |||
393 | get_c4_32(); |
||
394 | dst += pitch * (temp.b_top*2) + 2*temp.b_left*sizeof(DWORD); |
||
395 | |||
396 | unsigned ll[512*2]; |
||
397 | unsigned y; //Alone Coder 0.36.7 |
||
398 | unsigned x; //Alone Coder 0.36.7 |
||
399 | for (/*unsigned*/ y = 0; y < 512*4; y += 4) |
||
400 | *(unsigned*)(((unsigned char*)ll)+y) = 0; |
||
401 | #define inter(a,b,c) ((unsigned char)((a*(8-c)+b*c)>>3)) |
||
402 | for (y = 0; y < 48; y++) { |
||
403 | unsigned *bp = t.bs4h[y]; |
||
404 | for (/*unsigned*/ x = 0; x < 64; x++) { |
||
405 | unsigned char *dst1 = (unsigned char*)ll + 512*4 + x*8*4; |
||
406 | unsigned char *src = (unsigned char*)&bp[x]; |
||
407 | #define inter2(n) dst1[n*4]=inter(src[0],src[4],n); dst1[n*4+1]=inter(src[1],src[5],n); dst1[n*4+2]=inter(src[2],src[6],n); |
||
408 | inter2(0);inter2(1);inter2(2);inter2(3); |
||
409 | inter2(4);inter2(5);inter2(6);inter2(7); |
||
410 | #undef inter2 |
||
411 | } |
||
412 | unsigned char *l1 = (unsigned char*)ll, *l2 = (unsigned char*)(ll+512); |
||
413 | #define ps1(yy) \ |
||
414 | for (x = 0; x < 512; x++) { \ |
||
415 | dst[4*x+0] = inter(l1[4*x+0], l2[4*x+0], yy); \ |
||
416 | dst[4*x+1] = inter(l1[4*x+1], l2[4*x+1], yy); \ |
||
417 | dst[4*x+2] = inter(l1[4*x+2], l2[4*x+2], yy); \ |
||
418 | } dst += pitch; |
||
419 | ps1(0);ps1(1);ps1(2);ps1(3);ps1(4);ps1(5);ps1(6);ps1(7); |
||
420 | #undef ps1 |
||
421 | for (x = 0; x < 512; x++) ll[x] = ll[x+512]; |
||
422 | } |
||
423 | #undef inter |
||
424 | } |