Previous 15994 Revisions Next

r6820 Wednesday 30th December, 2009 at 03:55:41 UTC by Harmony
[N64] More RDP refactoring; major performance increase in 2D games. [Harmony]
[src/mame/video]rdpblend.c rdpblend.h rdpcc.c rdpclamp.c rdpfrect.c rdpspn16.c rdptpipe.c rdptpipe.h rdptrect.c rdpupd16.c

src/mame/video/rdpfrect.c
r6819r6820
6868      for (i = x1; i <= x2; i++)
6969      {
7070         curpixel_cvg = (i & 1) ? fill_cvg1 : fill_cvg2;
71         c.c = COLOR_COMBINER1();
71         COLOR_COMBINER1(c);
7272         dith = magic_matrix[(((j) & 3) << 2) + ((i ^ WORD_ADDR_XOR) & 3)];
7373         BLENDER1_16_DITH(&fb[(index + i) ^ WORD_ADDR_XOR], &hb[(index + i) ^ BYTE_ADDR_XOR], c, dith);
7474      }
r6819r6820
8282      for (i = x1; i <= x2; i++)
8383      {
8484         curpixel_cvg = (i & 1) ? fill_cvg1 : fill_cvg2;
85         c.c = COLOR_COMBINER1();
85         COLOR_COMBINER1(c);
8686         dith = bayer_matrix[(((j) & 3) << 2) + ((i ^ WORD_ADDR_XOR) & 3)];
8787         BLENDER1_16_DITH(&fb[(index + i) ^ WORD_ADDR_XOR], &hb[(index + i) ^ BYTE_ADDR_XOR], c, dith);
8888      }
r6819r6820
9595      for (i = x1; i <= x2; i++)
9696      {
9797         curpixel_cvg = (i & 1) ? fill_cvg1 : fill_cvg2;
98         c.c = COLOR_COMBINER1();
98         COLOR_COMBINER1(c);
9999         BLENDER1_16_NDITH(&fb[(index + i) ^ WORD_ADDR_XOR], &hb[(index + i) ^ BYTE_ADDR_XOR], c);
100100      }
101101   }
r6819r6820
172172      for (i=x1; i <= x2; i++)
173173      {
174174         curpixel_cvg = (i & 1) ? fill_cvg1 : fill_cvg2;
175         c1.c = COLOR_COMBINER2_C0();
176         c2.c = COLOR_COMBINER2_C1();
175         COLOR_COMBINER2_C0(c1);
176         COLOR_COMBINER2_C1(c2);
177177         dith = magic_matrix[(((j) & 3) << 2) + ((i ^ WORD_ADDR_XOR) & 3)];
178178         BLENDER2_16_DITH(&fb[(index + i) ^ WORD_ADDR_XOR],  &hb[(index + i) ^ BYTE_ADDR_XOR], c1, c2, dith);
179179      }
r6819r6820
187187      for (i=x1; i <= x2; i++)
188188      {
189189         curpixel_cvg = (i & 1) ? fill_cvg1 : fill_cvg2;
190         c1.c = COLOR_COMBINER2_C0();
191         c2.c = COLOR_COMBINER2_C1();
190         COLOR_COMBINER2_C0(c1);
191         COLOR_COMBINER2_C1(c2);
192192         dith = bayer_matrix[(((j) & 3) << 2) + ((i ^ WORD_ADDR_XOR) & 3)];
193193         BLENDER2_16_DITH(&fb[(index + i) ^ WORD_ADDR_XOR],  &hb[(index + i) ^ BYTE_ADDR_XOR], c1, c2, dith);
194194      }
r6819r6820
201201      for (i=x1; i <= x2; i++)
202202      {
203203         curpixel_cvg = (i & 1) ? fill_cvg1 : fill_cvg2;
204         c1.c = COLOR_COMBINER2_C0();
205         c2.c = COLOR_COMBINER2_C1();
204         COLOR_COMBINER2_C0(c1);
205         COLOR_COMBINER2_C1(c2);
206206         BLENDER2_16_NDITH(&fb[(index + i) ^ WORD_ADDR_XOR],  &hb[(index + i) ^ BYTE_ADDR_XOR], c1, c2);
207207      }
208208   }
src/mame/video/rdptpipe.c
r6819r6820
11#define RELATIVE(x, y)    (((((x) >> 3) - (y)) << 3) | (x & 7))
22
3INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID(INT32 SSS, INT32 SST, TILE* tex_tile)
3   #if defined(COPY)
4      #define CLAMP(SSS, SST, maxs, maxt) \
5         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
6         SST = (SIGN17(SST) >> 5) & 0x1fff;
7   #else
8
9   #if defined(DOS) && defined(DOT)
10      #define CLAMP(SSS, SST, maxs, maxt) \
11         if (SSS & 0x10000) \
12         { \
13            SSS = 0; \
14            SFRAC = 0; \
15         } \
16         else if (maxs) \
17         { \
18            SSS = clamp_s_diff[tex_tile->num]; \
19            SFRAC = 0; \
20         } \
21         else \
22         { \
23            SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
24         } \
25 \
26         if (SST & 0x10000) \
27         { \
28            SST = 0; \
29            TFRAC = 0; \
30         } \
31         else if (maxt) \
32         { \
33            SST = clamp_t_diff[tex_tile->num]; \
34            TFRAC = 0; \
35         } \
36         else \
37         { \
38            SST = (SIGN17(SST) >> 5) & 0x1fff; \
39         }
40   #elif defined(DOS) && !defined(DOT)
41      #define CLAMP(SSS, SST, maxs, maxt) \
42         if (SSS & 0x10000) \
43         { \
44            SSS = 0; \
45            SFRAC = 0; \
46         } \
47         else if (maxs) \
48         { \
49            SSS = clamp_s_diff[tex_tile->num]; \
50            SFRAC = 0; \
51         } \
52         else \
53         { \
54            SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
55         } \
56 \
57         SST = (SIGN17(SST) >> 5) & 0x1fff;
58   #elif !defined(DOS) && defined(DOT)
59      #define CLAMP(SSS, SST, maxs, maxt) \
60         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
61 \
62         if (SST & 0x10000) \
63         { \
64            SST = 0; \
65            TFRAC = 0; \
66         } \
67         else if (maxt) \
68         { \
69            SST = clamp_t_diff[tex_tile->num]; \
70            TFRAC = 0; \
71         } \
72         else \
73         { \
74            SST = (SIGN17(SST) >> 5) & 0x1fff; \
75         }
76   #else
77      #define CLAMP(SSS, SST, maxs, maxt) \
78         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
79         SST = (SIGN17(SST) >> 5) & 0x1fff;
80   #endif
81   #endif
82
83   #if defined(COPY)
84      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
85         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
86         SST = (SIGN17(SST) >> 5) & 0x1fff;
87   #else
88   #if defined(DOS) && defined(DOT)
89      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
90         if (SSS & 0x10000) \
91         { \
92            SSS = 0; \
93         } \
94         else if (maxs) \
95         { \
96            SSS = clamp_s_diff[tex_tile->num]; \
97         } \
98         else \
99         { \
100            SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
101         } \
102 \
103         if (SST & 0x10000) \
104         { \
105            SST = 0; \
106         } \
107         else if (maxt) \
108         { \
109            SST = clamp_t_diff[tex_tile->num]; \
110         } \
111         else \
112         { \
113            SST = (SIGN17(SST) >> 5) & 0x1fff; \
114         }
115   #elif defined(DOS) && !defined(DOT)
116      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
117         if (SSS & 0x10000) \
118         { \
119            SSS = 0; \
120         } \
121         else if (maxs) \
122         { \
123            SSS = clamp_s_diff[tex_tile->num]; \
124         } \
125         else \
126         { \
127            SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
128         } \
129 \
130         SST = (SIGN17(SST) >> 5) & 0x1fff;
131   #elif !defined(DOS) && defined(DOT)
132      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
133         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
134 \
135         if (SST & 0x10000) \
136         { \
137            SST = 0; \
138         } \
139         else if (maxt) \
140         { \
141            SST = clamp_t_diff[tex_tile->num]; \
142         } \
143         else \
144         { \
145            SST = (SIGN17(SST) >> 5) & 0x1fff; \
146         }
147   #else
148      #define CLAMP_LIGHT(SSS, SST, maxs, maxt) \
149         SSS = (SIGN17(SSS) >> 5) & 0x1fff; \
150         SST = (SIGN17(SST) >> 5) & 0x1fff;
151   #endif
152   #endif
153
154   #if defined(SHIFT_S) && defined(SHIFT_T)
155      #define TEXSHIFT(SSS, SST, maxs, maxt) \
156         SSS = SIGN16(SSS); \
157         if (tex_tile->shift_s < 11) \
158         { \
159            SSS >>= tex_tile->shift_s; \
160         } \
161         else \
162         { \
163            SSS <<= (16 - tex_tile->shift_s); \
164         } \
165         SSS = SIGN16(SSS); \
166         SST = SIGN16(SST); \
167         if (tex_tile->shift_t < 11) \
168         { \
169            SST >>= tex_tile->shift_t; \
170         } \
171         else \
172         { \
173            SST <<= (16 - tex_tile->shift_t); \
174         } \
175         SST = SIGN16(SST); \
176         maxs = ((SSS >> 3) >= tex_tile->sh); \
177         maxt = ((SST >> 3) >= tex_tile->th);
178   #elif defined(SHIFT_S) && !defined(SHIFT_T)
179      #define TEXSHIFT(SSS, SST, maxs, maxt) \
180         SSS = SIGN16(SSS); \
181         if (tex_tile->shift_s < 11) \
182         { \
183            SSS >>= tex_tile->shift_s; \
184         } \
185         else \
186         { \
187            SSS <<= (16 - tex_tile->shift_s); \
188         } \
189         SSS = SIGN16(SSS); \
190         maxs = ((SSS >> 3) >= tex_tile->sh); \
191         maxt = ((SST >> 3) >= tex_tile->th);
192   #elif !defined(SHIFT_S) && defined(SHIFT_T)
193      #define TEXSHIFT(SSS, SST, maxs, maxt) \
194         SST = SIGN16(SST); \
195         if (tex_tile->shift_t < 11) \
196         { \
197            SST >>= tex_tile->shift_t; \
198         } \
199         else \
200         { \
201            SST <<= (16 - tex_tile->shift_t); \
202         } \
203         SST = SIGN16(SST); \
204         maxs = ((SSS >> 3) >= tex_tile->sh); \
205         maxt = ((SST >> 3) >= tex_tile->th);
206   #else
207      #define TEXSHIFT(SSS, SST, maxs, maxt) \
208         maxs = ((SSS >> 3) >= tex_tile->sh); \
209         maxt = ((SST >> 3) >= tex_tile->th);
210   #endif
211
212#if defined(SHIFT_T)
213   #if defined(SHIFT_S)
214      #if defined(DOT)
215         #if defined(DOS)
216            #if defined(COPY)
217               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
218            #else
219               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
220            #endif
221         #else
222            #if defined(COPY)
223               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
224            #else
225               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
226            #endif
227         #endif
228      #else
229         #if defined(DOS)
230            #if defined(COPY)
231               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
232            #else
233               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
234            #endif
235         #else
236            #if defined(COPY)
237               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
238            #else
239               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
240            #endif
241         #endif
242      #endif
243   #else
244      #if defined(DOT)
245         #if defined(DOS)
246            #if defined(COPY)
247               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
248            #else
249               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
250            #endif
251         #else
252            #if defined(COPY)
253               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
254            #else
255               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
256            #endif
257         #endif
258      #else
259         #if defined(DOS)
260            #if defined(COPY)
261               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
262            #else
263               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
264            #endif
265         #else
266            #if defined(COPY)
267               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
268            #else
269               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
270            #endif
271         #endif
272      #endif
273   #endif
274#else
275   #if defined(SHIFT_S)
276      #if defined(DOT)
277         #if defined(DOS)
278            #if defined(COPY)
279               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
280            #else
281               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
282            #endif
283         #else
284            #if defined(COPY)
285               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
286            #else
287               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
288            #endif
289         #endif
290      #else
291         #if defined(DOS)
292            #if defined(COPY)
293               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
294            #else
295               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
296            #endif
297         #else
298            #if defined(COPY)
299               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
300            #else
301               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
302            #endif
303         #endif
304      #endif
305   #else
306      #if defined(DOT)
307         #if defined(DOS)
308            #if defined(COPY)
309               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
310            #else
311               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
312            #endif
313         #else
314            #if defined(COPY)
315               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
316            #else
317               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
318            #endif
319         #endif
320      #else
321         #if defined(DOS)
322            #if defined(COPY)
323               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
324            #else
325               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
326            #endif
327         #else
328            #if defined(COPY)
329               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
330            #else
331               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
332            #endif
333         #endif
334      #endif
335   #endif
336#endif
4337{
5338   INT32 maxs, maxt;
6339   COLOR t0, t1, t2, t3, TEX;
r6819r6820
10343   INT32 R32, G32, B32, A32;
11344   INT32 maxs2, maxt2;
12345
13   texshift(&SSS, &SST, &maxs, &maxt, tex_tile);
346   TEXSHIFT(SSS, SST, maxs, maxt)
14347
15348   sss2 = SSS + 32; sst2 = SST + 32;
16349   maxs2 = ((sss2 >> 3) >= tex_tile->sh);
r6819r6820
24357   SFRAC = SSS & 0x1f;
25358   TFRAC = SST & 0x1f;
26359
27   CLAMP(&SSS, &SST, &SFRAC, &TFRAC, maxs, maxt, tex_tile);
28   CLAMP_LIGHT(&sss2, &sst2, maxs2, maxt2, tex_tile);
360   CLAMP(SSS, SST, maxs, maxt)
361   CLAMP_LIGHT(sss2, sst2, maxs2, maxt2)
29362
30363   MASK(&SSS, &SST, tex_tile);
31364   MASK(&sss2, &sst2, tex_tile);
r6819r6820
63396   return TEX.c;
64397}
65398
66INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID(INT32 SSS, INT32 SST, TILE* tex_tile)
399#if defined(SHIFT_T)
400   #if defined(SHIFT_S)
401      #if defined(DOT)
402         #if defined(DOS)
403            #if defined(COPY)
404               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
405            #else
406               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
407            #endif
408         #else
409            #if defined(COPY)
410               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
411            #else
412               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
413            #endif
414         #endif
415      #else
416         #if defined(DOS)
417            #if defined(COPY)
418               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
419            #else
420               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
421            #endif
422         #else
423            #if defined(COPY)
424               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
425            #else
426               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
427            #endif
428         #endif
429      #endif
430   #else
431      #if defined(DOT)
432         #if defined(DOS)
433            #if defined(COPY)
434               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
435            #else
436               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
437            #endif
438         #else
439            #if defined(COPY)
440               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
441            #else
442               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
443            #endif
444         #endif
445      #else
446         #if defined(DOS)
447            #if defined(COPY)
448               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
449            #else
450               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
451            #endif
452         #else
453            #if defined(COPY)
454               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
455            #else
456               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
457            #endif
458         #endif
459      #endif
460   #endif
461#else
462   #if defined(SHIFT_S)
463      #if defined(DOT)
464         #if defined(DOS)
465            #if defined(COPY)
466               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
467            #else
468               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
469            #endif
470         #else
471            #if defined(COPY)
472               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
473            #else
474               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
475            #endif
476         #endif
477      #else
478         #if defined(DOS)
479            #if defined(COPY)
480               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
481            #else
482               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
483            #endif
484         #else
485            #if defined(COPY)
486               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
487            #else
488               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
489            #endif
490         #endif
491      #endif
492   #else
493      #if defined(DOT)
494         #if defined(DOS)
495            #if defined(COPY)
496               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
497            #else
498               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
499            #endif
500         #else
501            #if defined(COPY)
502               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
503            #else
504               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
505            #endif
506         #endif
507      #else
508         #if defined(DOS)
509            #if defined(COPY)
510               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
511            #else
512               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
513            #endif
514         #else
515            #if defined(COPY)
516               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
517            #else
518               INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
519            #endif
520         #endif
521      #endif
522   #endif
523#endif
67524{
68525   INT32 maxs, maxt;
69526   COLOR t0, t1, t2, t3, TEX;
r6819r6820
73530   INT32 R32, G32, B32, A32;
74531   INT32 maxs2, maxt2;
75532
76   texshift(&SSS, &SST, &maxs, &maxt, tex_tile);
533   TEXSHIFT(SSS, SST, maxs, maxt)
77534
78535   sss2 = SSS + 32; sst2 = SST + 32;
79536   maxs2 = ((sss2 >> 3) >= tex_tile->sh);
r6819r6820
87544   SFRAC = SSS & 0x1f;
88545   TFRAC = SST & 0x1f;
89546
90   CLAMP(&SSS, &SST, &SFRAC, &TFRAC, maxs, maxt, tex_tile);
91   CLAMP_LIGHT(&sss2, &sst2, maxs2, maxt2, tex_tile);
547   CLAMP(SSS, SST, maxs, maxt)
548   CLAMP_LIGHT(sss2, sst2, maxs2, maxt2)
92549
93550   MASK(&SSS, &SST, tex_tile);
94551   MASK(&sss2, &sst2, tex_tile);
r6819r6820
137594   return TEX.c;
138595}
139596
140INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID(INT32 SSS, INT32 SST, TILE* tex_tile)
597#if defined(SHIFT_T)
598   #if defined(SHIFT_S)
599      #if defined(DOT)
600         #if defined(DOS)
601            #if defined(COPY)
602               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
603            #else
604               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
605            #endif
606         #else
607            #if defined(COPY)
608               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
609            #else
610               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
611            #endif
612         #endif
613      #else
614         #if defined(DOS)
615            #if defined(COPY)
616               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
617            #else
618               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
619            #endif
620         #else
621            #if defined(COPY)
622               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
623            #else
624               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
625            #endif
626         #endif
627      #endif
628   #else
629      #if defined(DOT)
630         #if defined(DOS)
631            #if defined(COPY)
632               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
633            #else
634               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
635            #endif
636         #else
637            #if defined(COPY)
638               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
639            #else
640               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
641            #endif
642         #endif
643      #else
644         #if defined(DOS)
645            #if defined(COPY)
646               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
647            #else
648               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
649            #endif
650         #else
651            #if defined(COPY)
652               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
653            #else
654               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile)
655            #endif
656         #endif
657      #endif
658   #endif
659#else
660   #if defined(SHIFT_S)
661      #if defined(DOT)
662         #if defined(DOS)
663            #if defined(COPY)
664               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
665            #else
666               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
667            #endif
668         #else
669            #if defined(COPY)
670               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
671            #else
672               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
673            #endif
674         #endif
675      #else
676         #if defined(DOS)
677            #if defined(COPY)
678               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
679            #else
680               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
681            #endif
682         #else
683            #if defined(COPY)
684               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
685            #else
686               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
687            #endif
688         #endif
689      #endif
690   #else
691      #if defined(DOT)
692         #if defined(DOS)
693            #if defined(COPY)
694               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
695            #else
696               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
697            #endif
698         #else
699            #if defined(COPY)
700               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
701            #else
702               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
703            #endif
704         #endif
705      #else
706         #if defined(DOS)
707            #if defined(COPY)
708               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
709            #else
710               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
711            #endif
712         #else
713            #if defined(COPY)
714               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
715            #else
716               INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile)
717            #endif
718         #endif
719      #endif
720   #endif
721#endif
141722{
142723   INT32 maxs, maxt;
143724   INT32 SFRAC, TFRAC;
144725
145   texshift(&SSS, &SST, &maxs, &maxt, tex_tile);
726   TEXSHIFT(SSS, SST, maxs, maxt)
146727   SSS = RELATIVE(SSS, tex_tile->sl);
147728   SST = RELATIVE(SST, tex_tile->tl);
148729
r6819r6820
152733   SFRAC = SSS & 0x1f;
153734   TFRAC = SST & 0x1f;
154735
155   CLAMP(&SSS, &SST, &SFRAC, &TFRAC, maxs, maxt, tex_tile);
736   CLAMP(SSS, SST, maxs, maxt)
156737
157738   MASK(&SSS, &SST, tex_tile);
158739
r6819r6820
160741   return FETCH_TEXEL(SSS, SST);
161742}
162743
163#if 0
164#define RELATIVE(x, y)    (((((x) >> 3) - (y)) << 3) | (x & 7))
165
166INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID(INT32 SSS, INT32 SST, TILE* tex_tile)
167{
168   INT32 maxs, maxt;
169   COLOR t0, t1, t2, t3, TEX;
170   int sss2, sst2;
171
172   INT32 SFRAC = 0;
173   INT32 TFRAC = 0;
174   INT32 INVSF = 0;
175   INT32 INVTF = 0;
176   INT32 R32 = 0;
177   INT32 G32 = 0;
178   INT32 B32 = 0;
179   INT32 A32 = 0;
180
181   texshift(&SSS, &SST, &maxs, &maxt, tex_tile);
182
183   SSS = RELATIVE(SSS, tex_tile->sl);
184   SST = RELATIVE(SST, tex_tile->tl);
185   sss2 = RELATIVE((SSS + 32), tex_tile->sl);
186   sst2 = RELATIVE((SST + 32), tex_tile->tl);
187
188   SFRAC = SSS & 0x1f;
189   TFRAC = SST & 0x1f;
190
191   CLAMP(&SSS, &SST, &SFRAC, &TFRAC, maxs, maxt, tex_tile);
192   CLAMP_LIGHT(&sss2, &sst2, ((sss2 >> 3) >= tex_tile->sh), ((sst2 >> 3) >= tex_tile->th), tex_tile);
193
194   MASK(&SSS, &SST, tex_tile);
195   MASK(&sss2, &sst2, tex_tile);
196
197   t1.c = FETCH_TEXEL(sss2, SST);
198   t2.c = FETCH_TEXEL(SSS, sst2);
199
200   if ((SFRAC + TFRAC) >= 0x20)
201   {
202      INVSF = 0x20 - SFRAC;
203      INVTF = 0x20 - TFRAC;
204      t3.c = FETCH_TEXEL(sss2, sst2);
205      R32 = t3.i.r + ((INVSF*(t2.i.r - t3.i.r))>>5) + ((INVTF*(t1.i.r - t3.i.r))>>5);
206      TEX.i.r = (R32 < 0) ? 0 : R32;
207      G32 = t3.i.g + ((INVSF*(t2.i.g - t3.i.g))>>5) + ((INVTF*(t1.i.g - t3.i.g))>>5);
208      TEX.i.g = (G32 < 0) ? 0 : G32;
209      B32 = t3.i.b + ((INVSF*(t2.i.b - t3.i.b))>>5) + ((INVTF*(t1.i.b - t3.i.b))>>5);
210      TEX.i.b = (B32 < 0) ? 0 : B32;
211      A32 = t3.i.a + ((INVSF*(t2.i.a - t3.i.a))>>5) + ((INVTF*(t1.i.a - t3.i.a))>>5);
212      TEX.i.a = (A32 < 0) ? 0 : A32;
213   }
214   else
215   {
216      t0.c = FETCH_TEXEL(SSS, SST);
217      R32 = t0.i.r + ((SFRAC*(t1.i.r - t0.i.r))>>5) + ((TFRAC*(t2.i.r - t0.i.r))>>5);
218      TEX.i.r = (R32 < 0) ? 0 : R32;
219      G32 = t0.i.g + ((SFRAC*(t1.i.g - t0.i.g))>>5) + ((TFRAC*(t2.i.g - t0.i.g))>>5);
220      TEX.i.g = (G32 < 0) ? 0 : G32;
221      B32 = t0.i.b + ((SFRAC*(t1.i.b - t0.i.b))>>5) + ((TFRAC*(t2.i.b - t0.i.b))>>5);
222      TEX.i.b = (B32 < 0) ? 0 : B32;
223      A32 = t0.i.a + ((SFRAC*(t1.i.a - t0.i.a))>>5) + ((TFRAC*(t2.i.a - t0.i.a))>>5);
224      TEX.i.a = (A32 < 0) ? 0 : A32;
225   }
226
227   return TEX.c;
228}
229
230INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID(INT32 SSS, INT32 SST, TILE* tex_tile)
231{
232   INT32 maxs, maxt;
233   COLOR t0, t1, t2, t3, TEX;
234   int sss2, sst2;
235
236   INT32 SFRAC = 0, TFRAC = 0, INVSF = 0, INVTF = 0;
237   INT32 R32, G32, B32, A32;
238   INT32 maxs2, maxt2;
239
240   texshift(&SSS, &SST, &maxs, &maxt, tex_tile);
241
242   sss2 = SSS + 32; sst2 = SST + 32;
243   maxs2 = ((sss2 >> 3) >= tex_tile->sh);
244   maxt2 = ((sst2 >> 3) >= tex_tile->th);
245
246   SSS = RELATIVE(SSS, tex_tile->sl);
247   SST = RELATIVE(SST, tex_tile->tl);
248   sss2 = RELATIVE(sss2, tex_tile->sl);
249   sst2 = RELATIVE(sst2, tex_tile->tl);
250
251   SFRAC = SSS & 0x1f;
252   TFRAC = SST & 0x1f;
253
254   CLAMP(&SSS, &SST, &SFRAC, &TFRAC, maxs, maxt, tex_tile);
255   CLAMP_LIGHT(&sss2, &sst2, maxs2, maxt2, tex_tile);
256
257   MASK(&SSS, &SST, tex_tile);
258   MASK(&sss2, &sst2, tex_tile);
259
260   t0.c = FETCH_TEXEL(SSS, SST);
261   t1.c = FETCH_TEXEL(sss2, SST);
262   t2.c = FETCH_TEXEL(SSS, sst2);
263   t3.c = FETCH_TEXEL(sss2, sst2);
264
265   if(SFRAC != 0x10 || TFRAC != 0x10)
266   {
267      if (((SFRAC + TFRAC) >= 0x20))
268      {
269         INVSF = 0x20 - SFRAC;
270         INVTF = 0x20 - TFRAC;
271         R32 = t3.i.r + ((INVSF*(t2.i.r - t3.i.r))>>5) + ((INVTF*(t1.i.r - t3.i.r))>>5);
272         TEX.i.r = (R32 < 0) ? 0 : R32;
273         G32 = t3.i.g + ((INVSF*(t2.i.g - t3.i.g))>>5) + ((INVTF*(t1.i.g - t3.i.g))>>5);
274         TEX.i.g = (G32 < 0) ? 0 : G32;
275         B32 = t3.i.b + ((INVSF*(t2.i.b - t3.i.b))>>5) + ((INVTF*(t1.i.b - t3.i.b))>>5);
276         TEX.i.b = (B32 < 0) ? 0 : B32;
277         A32 = t3.i.a + ((INVSF*(t2.i.a - t3.i.a))>>5) + ((INVTF*(t1.i.a - t3.i.a))>>5);
278         TEX.i.a = (A32 < 0) ? 0 : A32;
279      }
280      else
281      {
282         R32 = t0.i.r + ((SFRAC*(t1.i.r - t0.i.r))>>5) + ((TFRAC*(t2.i.r - t0.i.r))>>5);
283         TEX.i.r = (R32 < 0) ? 0 : R32;
284         G32 = t0.i.g + ((SFRAC*(t1.i.g - t0.i.g))>>5) + ((TFRAC*(t2.i.g - t0.i.g))>>5);
285         TEX.i.g = (G32 < 0) ? 0 : G32;
286         B32 = t0.i.b + ((SFRAC*(t1.i.b - t0.i.b))>>5) + ((TFRAC*(t2.i.b - t0.i.b))>>5);
287         TEX.i.b = (B32 < 0) ? 0 : B32;
288         A32 = t0.i.a + ((SFRAC*(t1.i.a - t0.i.a))>>5) + ((TFRAC*(t2.i.a - t0.i.a))>>5);
289         TEX.i.a = (A32 < 0) ? 0 : A32;
290      }
291   }
292   else // Is this accurate?
293   {
294      TEX.i.r = (t0.i.r + t1.i.r + t2.i.r + t3.i.r) >> 2;
295      TEX.i.g = (t0.i.g + t1.i.g + t2.i.g + t3.i.g) >> 2;
296      TEX.i.b = (t0.i.b + t1.i.b + t2.i.b + t3.i.b) >> 2;
297      TEX.i.a = (t0.i.a + t1.i.a + t2.i.a + t3.i.a) >> 2;
298   }
299
300   return TEX.c;
301}
302
303INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID(INT32 SSS, INT32 SST, TILE* tex_tile)
304{
305   INT32 maxs, maxt;
306
307   texshift(&SSS, &SST, &maxs, &maxt, tex_tile);
308   SSS = RELATIVE(SSS, tex_tile->sl) + 0x10;
309   SST = RELATIVE(SST, tex_tile->tl) + 0x10;
310
311   CLAMP_QUICK(&SSS, &SST, maxs, maxt, tex_tile->num);
312
313   MASK(&SSS, &SST, tex_tile);
314
315   /* point sample */
316   return FETCH_TEXEL(SSS, SST);
317}
318#endif
744#undef CLAMP
745#undef CLAMP_LIGHT
746#undef TEXSHIFT
src/mame/video/rdptpipe.h
r6819r6820
1INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID(INT32 SSS, INT32 SST, TILE* tex_tile);
2INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID(INT32 SSS, INT32 SST, TILE* tex_tile);
3INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID(INT32 SSS, INT32 SST, TILE* tex_tile);
1INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
2INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
3INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
4INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
5INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
6INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
7INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
8INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
9INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
10INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
11INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
12INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
413
5static UINT32 (*rdp_texture_pipeline_func[4])(INT32, INT32, TILE*) =
14INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
15INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
16INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
17INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
18INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
19INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
20INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
21INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
22INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
23INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
24INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
25INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_SS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
26
27INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
28INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
29INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
30INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
31INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
32INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
33INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
34INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
35INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
36INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
37INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
38INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
39
40INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
41INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
42INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
43INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
44INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
45INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
46INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
47INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
48INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
49INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
50INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
51INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_SS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
52
53INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
54INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
55INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
56INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
57INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
58INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
59INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
60INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
61INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
62INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
63INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
64INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
65
66INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
67INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
68INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
69INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
70INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
71INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
72INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
73INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
74INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
75INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
76INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
77INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_NSS_ST(INT32 SSS, INT32 SST, TILE* tex_tile);
78
79INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
80INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
81INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
82INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
83INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
84INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
85INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
86INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
87INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
88INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
89INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
90INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
91
92INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
93INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
94INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
95INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
96INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
97INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
98INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
99INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
100INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
101INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
102INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
103INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_NSS_NST(INT32 SSS, INT32 SST, TILE* tex_tile);
104
105static UINT32 (*rdp_texture_pipeline_func[128])(INT32, INT32, TILE*) =
6106{
7   TEXTURE_PIPELINE_NEAREST_NMID, TEXTURE_PIPELINE_BILINEAR_NMID, TEXTURE_PIPELINE_NEAREST_NMID, TEXTURE_PIPELINE_BILINEAR_MID,
8};
9#if 0
10INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_NMID(INT32 SSS, INT32 SST, TILE* tex_tile);
11INLINE UINT32 TEXTURE_PIPELINE_BILINEAR_MID(INT32 SSS, INT32 SST, TILE* tex_tile);
12INLINE UINT32 TEXTURE_PIPELINE_NEAREST_NMID(INT32 SSS, INT32 SST, TILE* tex_tile);
107   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_NSS_NST, TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_NSS_NST,
108   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_NSS_NST, TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_NSS_NST,
109   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_NSS_NST,  TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_NSS_NST,
110   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_NSS_NST,  TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_NSS_NST,
111   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_NSS_NST,  TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_NSS_NST,
112   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_NSS_NST,  TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_NSS_NST,
113   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_NSS_NST,   TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_NSS_NST,
114   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_NSS_NST,   TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_NSS_NST,
115   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_NSS_NST,  TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_NSS_NST,
116   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_NSS_NST,  TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_NSS_NST,
117   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_NSS_NST,   TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_NSS_NST,
118   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_NSS_NST,   TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_NSS_NST,
119   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_NSS_NST,   TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_NSS_NST,
120   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_NSS_NST,   TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_NSS_NST,
121   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_NSS_NST,    TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_NSS_NST,
122   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_NSS_NST,    TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_NSS_NST,
13123
14static UINT32 (*rdp_texture_pipeline_func[4])(INT32, INT32, TILE*) =
15{
16   TEXTURE_PIPELINE_NEAREST_NMID, TEXTURE_PIPELINE_BILINEAR_NMID, TEXTURE_PIPELINE_NEAREST_NMID, TEXTURE_PIPELINE_BILINEAR_MID,
124   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_SS_NST,  TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_SS_NST,
125   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_SS_NST,  TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_SS_NST,
126   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_SS_NST,   TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_SS_NST,
127   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_SS_NST,   TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_SS_NST,
128   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_SS_NST,   TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_SS_NST,
129   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_SS_NST,   TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_SS_NST,
130   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_SS_NST,    TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_SS_NST,
131   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_SS_NST,    TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_SS_NST,
132   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_SS_NST,   TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_SS_NST,
133   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_SS_NST,   TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_SS_NST,
134   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_SS_NST,    TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_SS_NST,
135   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_SS_NST,    TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_SS_NST,
136   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_SS_NST,    TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_SS_NST,
137   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_SS_NST,    TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_SS_NST,
138   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_SS_NST,     TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_SS_NST,
139   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_SS_NST,     TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_SS_NST,
140
141   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_NSS_ST,  TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_NSS_ST,
142   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_NSS_ST,  TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_NSS_ST,
143   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_NSS_ST,   TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_NSS_ST,
144   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_NSS_ST,   TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_NSS_ST,
145   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_NSS_ST,   TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_NSS_ST,
146   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_NSS_ST,   TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_NSS_ST,
147   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_NSS_ST,    TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_NSS_ST,
148   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_NSS_ST,    TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_NSS_ST,
149   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_NSS_ST,   TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_NSS_ST,
150   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_NSS_ST,   TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_NSS_ST,
151   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_NSS_ST,    TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_NSS_ST,
152   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_NSS_ST,    TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_NSS_ST,
153   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_NSS_ST,    TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_NSS_ST,
154   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_NSS_ST,    TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_NSS_ST,
155   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_NSS_ST,     TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_NSS_ST,
156   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_NSS_ST,     TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_NSS_ST,
157
158   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_SS_ST,   TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_NDOT_SS_ST,
159   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_NDOT_SS_ST,   TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_NDOT_SS_ST,
160   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_SS_ST,    TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_NDOT_SS_ST,
161   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_NDOT_SS_ST,    TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_NDOT_SS_ST,
162   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_SS_ST,    TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_NDOT_SS_ST,
163   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_NDOT_SS_ST,    TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_NDOT_SS_ST,
164   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_SS_ST,     TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_NDOT_SS_ST,
165   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_NDOT_SS_ST,     TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_NDOT_SS_ST,
166   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_SS_ST,    TEXTURE_PIPELINE_BILINEAR_NMID_NC_NDOS_DOT_SS_ST,
167   TEXTURE_PIPELINE_NEAREST_NMID_NC_NDOS_DOT_SS_ST,    TEXTURE_PIPELINE_BILINEAR_MID_NC_NDOS_DOT_SS_ST,
168   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_SS_ST,     TEXTURE_PIPELINE_BILINEAR_NMID_C_NDOS_DOT_SS_ST,
169   TEXTURE_PIPELINE_NEAREST_NMID_C_NDOS_DOT_SS_ST,     TEXTURE_PIPELINE_BILINEAR_MID_C_NDOS_DOT_SS_ST,
170   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_SS_ST,     TEXTURE_PIPELINE_BILINEAR_NMID_NC_DOS_DOT_SS_ST,
171   TEXTURE_PIPELINE_NEAREST_NMID_NC_DOS_DOT_SS_ST,     TEXTURE_PIPELINE_BILINEAR_MID_NC_DOS_DOT_SS_ST,
172   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_SS_ST,      TEXTURE_PIPELINE_BILINEAR_NMID_C_DOS_DOT_SS_ST,
173   TEXTURE_PIPELINE_NEAREST_NMID_C_DOS_DOT_SS_ST,      TEXTURE_PIPELINE_BILINEAR_MID_C_DOS_DOT_SS_ST,
17174};
18#endif
src/mame/video/rdpblend.c
r6819r6820
1#if defined(ALPHACOMPARE)
2   #if defined(RGBDITHER1)
3      #if defined(ZCOMPARE)
4         #if defined(IMGREAD)
5            INLINE int BLENDER1_16_IMR_ZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
1#if defined(FORCEBLEND)
2   #if defined(ALPHACOMPARE)
3      #if defined(RGBDITHER1)
4         #if defined(ZCOMPARE)
5            #if defined(IMGREAD)
6               INLINE int BLENDER1_16_IMR_ZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
7            #else
8               INLINE int BLENDER1_16_NIMR_ZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
9            #endif
610         #else
7            INLINE int BLENDER1_16_NIMR_ZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
11            #if defined(IMGREAD)
12               INLINE int BLENDER1_16_IMR_NZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
13            #else
14               INLINE int BLENDER1_16_NIMR_NZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
15            #endif
816         #endif
917      #else
10         #if defined(IMGREAD)
11            INLINE int BLENDER1_16_IMR_NZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
18         #if defined(ZCOMPARE)
19            #if defined(IMGREAD)
20               INLINE int BLENDER1_16_IMR_ZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
21            #else
22               INLINE int BLENDER1_16_NIMR_ZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
23            #endif
1224         #else
13            INLINE int BLENDER1_16_NIMR_NZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
25            #if defined(IMGREAD)
26               INLINE int BLENDER1_16_IMR_NZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
27            #else
28               INLINE int BLENDER1_16_NIMR_NZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
29            #endif
1430         #endif
1531      #endif
1632   #else
17      #if defined(ZCOMPARE)
18         #if defined(IMGREAD)
19            INLINE int BLENDER1_16_IMR_ZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
33      #if defined(RGBDITHER1)
34         #if defined(ZCOMPARE)
35            #if defined(IMGREAD)
36               INLINE int BLENDER1_16_IMR_ZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
37            #else
38               INLINE int BLENDER1_16_NIMR_ZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
39            #endif
2040         #else
21            INLINE int BLENDER1_16_NIMR_ZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
41            #if defined(IMGREAD)
42               INLINE int BLENDER1_16_IMR_NZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
43            #else
44               INLINE int BLENDER1_16_NIMR_NZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
45            #endif
2246         #endif
2347      #else
24         #if defined(IMGREAD)
25            INLINE int BLENDER1_16_IMR_NZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
48         #if defined(ZCOMPARE)
49            #if defined(IMGREAD)
50               INLINE int BLENDER1_16_IMR_ZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
51            #else
52               INLINE int BLENDER1_16_NIMR_ZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
53            #endif
2654         #else
27            INLINE int BLENDER1_16_NIMR_NZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
55            #if defined(IMGREAD)
56               INLINE int BLENDER1_16_IMR_NZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
57            #else
58               INLINE int BLENDER1_16_NIMR_NZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
59            #endif
2860         #endif
2961      #endif
3062   #endif
3163#else
32   #if defined(RGBDITHER1)
33      #if defined(ZCOMPARE)
34         #if defined(IMGREAD)
35            INLINE int BLENDER1_16_IMR_ZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
64   #if defined(ALPHACOMPARE)
65      #if defined(RGBDITHER1)
66         #if defined(ZCOMPARE)
67            #if defined(IMGREAD)
68               INLINE int BLENDER1_16_IMR_ZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
69            #else
70               INLINE int BLENDER1_16_NIMR_ZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
71            #endif
3672         #else
37            INLINE int BLENDER1_16_NIMR_ZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
73            #if defined(IMGREAD)
74               INLINE int BLENDER1_16_IMR_NZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
75            #else
76               INLINE int BLENDER1_16_NIMR_NZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
77            #endif
3878         #endif
3979      #else
40         #if defined(IMGREAD)
41            INLINE int BLENDER1_16_IMR_NZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
80         #if defined(ZCOMPARE)
81            #if defined(IMGREAD)
82               INLINE int BLENDER1_16_IMR_ZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
83            #else
84               INLINE int BLENDER1_16_NIMR_ZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
85            #endif
4286         #else
43            INLINE int BLENDER1_16_NIMR_NZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
87            #if defined(IMGREAD)
88               INLINE int BLENDER1_16_IMR_NZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
89            #else
90               INLINE int BLENDER1_16_NIMR_NZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
91            #endif
4492         #endif
4593      #endif
4694   #else
47      #if defined(ZCOMPARE)
48         #if defined(IMGREAD)
49            INLINE int BLENDER1_16_IMR_ZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
95      #if defined(RGBDITHER1)
96         #if defined(ZCOMPARE)
97            #if defined(IMGREAD)
98               INLINE int BLENDER1_16_IMR_ZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
99            #else
100               INLINE int BLENDER1_16_NIMR_ZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
101            #endif
50102         #else
51            INLINE int BLENDER1_16_NIMR_ZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
103            #if defined(IMGREAD)
104               INLINE int BLENDER1_16_IMR_NZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
105            #else
106               INLINE int BLENDER1_16_NIMR_NZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
107            #endif
52108         #endif
53109      #else
54         #if defined(IMGREAD)
55            INLINE int BLENDER1_16_IMR_NZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
110         #if defined(ZCOMPARE)
111            #if defined(IMGREAD)
112               INLINE int BLENDER1_16_IMR_ZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
113            #else
114               INLINE int BLENDER1_16_NIMR_ZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
115            #endif
56116         #else
57            INLINE int BLENDER1_16_NIMR_NZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith)
117            #if defined(IMGREAD)
118               INLINE int BLENDER1_16_IMR_NZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
119            #else
120               INLINE int BLENDER1_16_NIMR_NZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith)
121            #endif
58122         #endif
59123      #endif
60124   #endif
r6819r6820
100164#endif
101165
102166#if defined(ZCOMPARE)
103   if (!curpixel_overlap && !other_modes.force_blend)
104   {
105      r = *blender1a_r[0];
106      g = *blender1a_g[0];
107      b = *blender1a_b[0];
108   }
109   else
110   {
111      inv_pixel_color.i.a = 0xff - *blender1b_a[0];
167#if defined(FORCEBLEND)
168   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
112169
113      BLENDER_EQUATION0(&r, &g, &b, special_bsel);
114   }
170   BLENDER_EQUATION0_FORCE(&r, &g, &b, special_bsel);
115171#else
116   if (!other_modes.force_blend)
172   if (!curpixel_overlap)
117173   {
118174      r = *blender1a_r[0];
119175      g = *blender1a_g[0];
r6819r6820
123179   {
124180      inv_pixel_color.i.a = 0xff - *blender1b_a[0];
125181
126      BLENDER_EQUATION0(&r, &g, &b, special_bsel);
182      BLENDER_EQUATION0_NFORCE(&r, &g, &b, special_bsel);
127183   }
128184#endif
185#else
186#if defined(FORCEBLEND)
187   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
129188
189   BLENDER_EQUATION0_FORCE(&r, &g, &b, special_bsel);
190#else
191   r = *blender1a_r[0];
192   g = *blender1a_g[0];
193   b = *blender1a_b[0];
194#endif
195#endif
196
130197#if !defined(RGBDITHER1)
131198   // Hack to prevent "double-dithering" artifacts
132199   if (!(((r & 0xf8)==(memory_color.i.r&0xf8) && (g & 0xf8) == (memory_color.i.g & 0xf8) &&(b&0xf8)==(memory_color.i.b&0xf8))))
r6819r6820
138205    return (FBWRITE_16(fb, hb, r, g, b));
139206}
140207
141#if defined(ALPHACOMPARE)
142   #if defined(RGBDITHER1)
143      #if defined(ZCOMPARE)
144         #if defined(IMGREAD)
145            INLINE int BLENDER2_16_IMR_ZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
208#if defined(FORCEBLEND)
209   #if defined(ALPHACOMPARE)
210      #if defined(RGBDITHER1)
211         #if defined(ZCOMPARE)
212            #if defined(IMGREAD)
213               INLINE int BLENDER2_16_IMR_ZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
214            #else
215               INLINE int BLENDER2_16_NIMR_ZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
216            #endif
146217         #else
147            INLINE int BLENDER2_16_NIMR_ZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
218            #if defined(IMGREAD)
219               INLINE int BLENDER2_16_IMR_NZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
220            #else
221               INLINE int BLENDER2_16_NIMR_NZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
222            #endif
148223         #endif
149224      #else
150         #if defined(IMGREAD)
151            INLINE int BLENDER2_16_IMR_NZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
225         #if defined(ZCOMPARE)
226            #if defined(IMGREAD)
227               INLINE int BLENDER2_16_IMR_ZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
228            #else
229               INLINE int BLENDER2_16_NIMR_ZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
230            #endif
152231         #else
153            INLINE int BLENDER2_16_NIMR_NZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
232            #if defined(IMGREAD)
233               INLINE int BLENDER2_16_IMR_NZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
234            #else
235               INLINE int BLENDER2_16_NIMR_NZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
236            #endif
154237         #endif
155238      #endif
156239   #else
157      #if defined(ZCOMPARE)
158         #if defined(IMGREAD)
159            INLINE int BLENDER2_16_IMR_ZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
240      #if defined(RGBDITHER1)
241         #if defined(ZCOMPARE)
242            #if defined(IMGREAD)
243               INLINE int BLENDER2_16_IMR_ZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
244            #else
245               INLINE int BLENDER2_16_NIMR_ZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
246            #endif
160247         #else
161            INLINE int BLENDER2_16_NIMR_ZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
248            #if defined(IMGREAD)
249               INLINE int BLENDER2_16_IMR_NZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
250            #else
251               INLINE int BLENDER2_16_NIMR_NZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
252            #endif
162253         #endif
163254      #else
164         #if defined(IMGREAD)
165            INLINE int BLENDER2_16_IMR_NZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
255         #if defined(ZCOMPARE)
256            #if defined(IMGREAD)
257               INLINE int BLENDER2_16_IMR_ZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
258            #else
259               INLINE int BLENDER2_16_NIMR_ZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
260            #endif
166261         #else
167            INLINE int BLENDER2_16_NIMR_NZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
262            #if defined(IMGREAD)
263               INLINE int BLENDER2_16_IMR_NZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
264            #else
265               INLINE int BLENDER2_16_NIMR_NZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
266            #endif
168267         #endif
169268      #endif
170269   #endif
171270#else
172   #if defined(RGBDITHER1)
173      #if defined(ZCOMPARE)
174         #if defined(IMGREAD)
175            INLINE int BLENDER2_16_IMR_ZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
271   #if defined(ALPHACOMPARE)
272      #if defined(RGBDITHER1)
273         #if defined(ZCOMPARE)
274            #if defined(IMGREAD)
275               INLINE int BLENDER2_16_IMR_ZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
276            #else
277               INLINE int BLENDER2_16_NIMR_ZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
278            #endif
176279         #else
177            INLINE int BLENDER2_16_NIMR_ZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
280            #if defined(IMGREAD)
281               INLINE int BLENDER2_16_IMR_NZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
282            #else
283               INLINE int BLENDER2_16_NIMR_NZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
284            #endif
178285         #endif
179286      #else
180         #if defined(IMGREAD)
181            INLINE int BLENDER2_16_IMR_NZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
287         #if defined(ZCOMPARE)
288            #if defined(IMGREAD)
289               INLINE int BLENDER2_16_IMR_ZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
290            #else
291               INLINE int BLENDER2_16_NIMR_ZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
292            #endif
182293         #else
183            INLINE int BLENDER2_16_NIMR_NZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
294            #if defined(IMGREAD)
295               INLINE int BLENDER2_16_IMR_NZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
296            #else
297               INLINE int BLENDER2_16_NIMR_NZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
298            #endif
184299         #endif
185300      #endif
186301   #else
187      #if defined(ZCOMPARE)
188         #if defined(IMGREAD)
189            INLINE int BLENDER2_16_IMR_ZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
302      #if defined(RGBDITHER1)
303         #if defined(ZCOMPARE)
304            #if defined(IMGREAD)
305               INLINE int BLENDER2_16_IMR_ZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
306            #else
307               INLINE int BLENDER2_16_NIMR_ZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
308            #endif
190309         #else
191            INLINE int BLENDER2_16_NIMR_ZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
310            #if defined(IMGREAD)
311               INLINE int BLENDER2_16_IMR_NZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
312            #else
313               INLINE int BLENDER2_16_NIMR_NZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
314            #endif
192315         #endif
193316      #else
194         #if defined(IMGREAD)
195            INLINE int BLENDER2_16_IMR_NZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
317         #if defined(ZCOMPARE)
318            #if defined(IMGREAD)
319               INLINE int BLENDER2_16_IMR_ZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
320            #else
321               INLINE int BLENDER2_16_NIMR_ZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
322            #endif
196323         #else
197            INLINE int BLENDER2_16_NIMR_NZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
324            #if defined(IMGREAD)
325               INLINE int BLENDER2_16_IMR_NZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
326            #else
327               INLINE int BLENDER2_16_NIMR_NZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith)
328            #endif
198329         #endif
199330      #endif
200331   #endif
r6819r6820
241372
242373   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
243374
244   BLENDER_EQUATION0(&r, &g, &b, special_bsel);
375#if defined(FORCEBLEND)
376   BLENDER_EQUATION0_FORCE(&r, &g, &b, special_bsel);
377#else
378   BLENDER_EQUATION1_FORCE(&r, &g, &b, special_bsel);
379#endif
245380
246381   blended_pixel_color.i.r = r;
247382   blended_pixel_color.i.g = g;
r6819r6820
254389
255390   inv_pixel_color.i.a = 0xff - *blender1b_a[1];
256391
257   if (!curpixel_overlap && !other_modes.force_blend)
392#if defined(FORCEBLEND)
393   if (blender2b_a[1] == &memory_color.i.a)
258394   {
395      special_bsel = 1;
396   }
397   else
398   {
399      special_bsel = 0;
400   }
401
402   BLENDER_EQUATION1_FORCE(&r, &g, &b, special_bsel);
403#else
404   if (!curpixel_overlap)
405   {
259406      r = *blender1a_r[1];
260407      g = *blender1a_g[1];
261408      b = *blender1a_b[1];
r6819r6820
271418         special_bsel = 0;
272419      }
273420
274      BLENDER_EQUATION1(&r, &g, &b, special_bsel);
421      BLENDER_EQUATION1_NFORCE(&r, &g, &b, special_bsel);
275422   }
423#endif
276424
277425#if !defined(RGBDITH1)
278426   // Hack to prevent "double-dithering" artifacts
r6819r6820
286434}
287435
288436#if !defined(RGBDITHER1)
289#if defined(ALPHACOMPARE)
290   #if defined(ZCOMPARE)
291      #if defined(IMGREAD)
292         INLINE int BLENDER1_16_IMR_ZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c)
437#if defined(FORCEBLEND)
438   #if defined(ALPHACOMPARE)
439      #if defined(ZCOMPARE)
440         #if defined(IMGREAD)
441            INLINE int BLENDER1_16_IMR_ZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c)
442         #else
443            INLINE int BLENDER1_16_NIMR_ZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c)
444         #endif
293445      #else
294         INLINE int BLENDER1_16_NIMR_ZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c)
446         #if defined(IMGREAD)
447            INLINE int BLENDER1_16_IMR_NZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c)
448         #else
449            INLINE int BLENDER1_16_NIMR_NZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c)
450         #endif
295451      #endif
296452   #else
297      #if defined(IMGREAD)
298         INLINE int BLENDER1_16_IMR_NZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c)
453      #if defined(ZCOMPARE)
454         #if defined(IMGREAD)
455            INLINE int BLENDER1_16_IMR_ZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c)
456         #else
457            INLINE int BLENDER1_16_NIMR_ZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c)
458         #endif
299459      #else
300         INLINE int BLENDER1_16_NIMR_NZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c)
460         #if defined(IMGREAD)
461            INLINE int BLENDER1_16_IMR_NZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c)
462         #else
463            INLINE int BLENDER1_16_NIMR_NZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c)
464         #endif
301465      #endif
302466   #endif
303467#else
304   #if defined(ZCOMPARE)
305      #if defined(IMGREAD)
306         INLINE int BLENDER1_16_IMR_ZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c)
468   #if defined(ALPHACOMPARE)
469      #if defined(ZCOMPARE)
470         #if defined(IMGREAD)
471            INLINE int BLENDER1_16_IMR_ZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c)
472         #else
473            INLINE int BLENDER1_16_NIMR_ZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c)
474         #endif
307475      #else
308         INLINE int BLENDER1_16_NIMR_ZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c)
476         #if defined(IMGREAD)
477            INLINE int BLENDER1_16_IMR_NZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c)
478         #else
479            INLINE int BLENDER1_16_NIMR_NZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c)
480         #endif
309481      #endif
310482   #else
311      #if defined(IMGREAD)
312         INLINE int BLENDER1_16_IMR_NZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c)
483      #if defined(ZCOMPARE)
484         #if defined(IMGREAD)
485            INLINE int BLENDER1_16_IMR_ZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c)
486         #else
487            INLINE int BLENDER1_16_NIMR_ZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c)
488         #endif
313489      #else
314         INLINE int BLENDER1_16_NIMR_NZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c)
490         #if defined(IMGREAD)
491            INLINE int BLENDER1_16_IMR_NZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c)
492         #else
493            INLINE int BLENDER1_16_NIMR_NZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c)
494         #endif
315495      #endif
316496   #endif
317497#endif
r6819r6820
356536#endif
357537
358538#if defined(ZCOMPARE)
359   if (!curpixel_overlap && !other_modes.force_blend)
360   {
361      r = *blender1a_r[0];
362      g = *blender1a_g[0];
363      b = *blender1a_b[0];
364   }
365   else
366   {
367      inv_pixel_color.i.a = 0xff - *blender1b_a[0];
539#if defined(FORCEBLEND)
540   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
368541
369      BLENDER_EQUATION0(&r, &g, &b, special_bsel);
370   }
542   BLENDER_EQUATION0_FORCE(&r, &g, &b, special_bsel);
371543#else
372   if (!other_modes.force_blend)
544   if (!curpixel_overlap)
373545   {
374546      r = *blender1a_r[0];
375547      g = *blender1a_g[0];
r6819r6820
379551   {
380552      inv_pixel_color.i.a = 0xff - *blender1b_a[0];
381553
382      BLENDER_EQUATION0(&r, &g, &b, special_bsel);
554      BLENDER_EQUATION0_NFORCE(&r, &g, &b, special_bsel);
383555   }
384556#endif
557#else
558#if defined(FORCEBLEND)
559   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
385560
561   BLENDER_EQUATION0_FORCE(&r, &g, &b, special_bsel);
562#else
563   r = *blender1a_r[0];
564   g = *blender1a_g[0];
565   b = *blender1a_b[0];
566#endif
567#endif
568
386569    return (FBWRITE_16(fb, hb, r, g, b));
387570}
388571
389#if defined(ALPHACOMPARE)
390   #if defined(ZCOMPARE)
391      #if defined(IMGREAD)
392         INLINE int BLENDER2_16_IMR_ZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
572#if defined(FORCEBLEND)
573   #if defined(ALPHACOMPARE)
574      #if defined(ZCOMPARE)
575         #if defined(IMGREAD)
576            INLINE int BLENDER2_16_IMR_ZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
577         #else
578            INLINE int BLENDER2_16_NIMR_ZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
579         #endif
393580      #else
394         INLINE int BLENDER2_16_NIMR_ZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
581         #if defined(IMGREAD)
582            INLINE int BLENDER2_16_IMR_NZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
583         #else
584            INLINE int BLENDER2_16_NIMR_NZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
585         #endif
395586      #endif
396587   #else
397      #if defined(IMGREAD)
398         INLINE int BLENDER2_16_IMR_NZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
588      #if defined(ZCOMPARE)
589         #if defined(IMGREAD)
590            INLINE int BLENDER2_16_IMR_ZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
591         #else
592            INLINE int BLENDER2_16_NIMR_ZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
593         #endif
399594      #else
400         INLINE int BLENDER2_16_NIMR_NZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
595         #if defined(IMGREAD)
596            INLINE int BLENDER2_16_IMR_NZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
597         #else
598            INLINE int BLENDER2_16_NIMR_NZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
599         #endif
401600      #endif
402601   #endif
403602#else
404   #if defined(ZCOMPARE)
405      #if defined(IMGREAD)
406         INLINE int BLENDER2_16_IMR_ZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
603   #if defined(ALPHACOMPARE)
604      #if defined(ZCOMPARE)
605         #if defined(IMGREAD)
606            INLINE int BLENDER2_16_IMR_ZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
607         #else
608            INLINE int BLENDER2_16_NIMR_ZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
609         #endif
407610      #else
408         INLINE int BLENDER2_16_NIMR_ZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
611         #if defined(IMGREAD)
612            INLINE int BLENDER2_16_IMR_NZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
613         #else
614            INLINE int BLENDER2_16_NIMR_NZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
615         #endif
409616      #endif
410617   #else
411      #if defined(IMGREAD)
412         INLINE int BLENDER2_16_IMR_NZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
618      #if defined(ZCOMPARE)
619         #if defined(IMGREAD)
620            INLINE int BLENDER2_16_IMR_ZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
621         #else
622            INLINE int BLENDER2_16_NIMR_ZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
623         #endif
413624      #else
414         INLINE int BLENDER2_16_NIMR_NZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
625         #if defined(IMGREAD)
626            INLINE int BLENDER2_16_IMR_NZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
627         #else
628            INLINE int BLENDER2_16_NIMR_NZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2)
629         #endif
415630      #endif
416631   #endif
417632#endif
r6819r6820
457672
458673   inv_pixel_color.i.a = 0xff - *blender1b_a[0];
459674
460   BLENDER_EQUATION0(&r, &g, &b, special_bsel);
675#if defined(FORCEBLEND)
676   BLENDER_EQUATION0_FORCE(&r, &g, &b, special_bsel);
677#else
678   BLENDER_EQUATION0_NFORCE(&r, &g, &b, special_bsel);
679#endif
461680
462681   blended_pixel_color.i.r = r;
463682   blended_pixel_color.i.g = g;
r6819r6820
470689
471690   inv_pixel_color.i.a = 0xff - *blender1b_a[1];
472691
473   if (!curpixel_overlap && !other_modes.force_blend)
692#if defined(FORCEBLEND)
693   if (blender2b_a[1] == &memory_color.i.a)
474694   {
695      special_bsel = 1;
696   }
697   else
698   {
699      special_bsel = 0;
700   }
701
702   BLENDER_EQUATION1_FORCE(&r, &g, &b, special_bsel);
703#else
704   if (!curpixel_overlap)
705   {
475706      r = *blender1a_r[1];
476707      g = *blender1a_g[1];
477708      b = *blender1a_b[1];
r6819r6820
487718         special_bsel = 0;
488719      }
489720
490      BLENDER_EQUATION1(&r, &g, &b, special_bsel);
721      BLENDER_EQUATION1_NFORCE(&r, &g, &b, special_bsel);
491722   }
723#endif
492724
493725   return (FBWRITE_16(fb, hb, r, g, b));
494726}
src/mame/video/rdpblend.h
r6819r6820
1INLINE int BLENDER1_16_IMR_ZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
2INLINE int BLENDER1_16_IMR_ZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
3INLINE int BLENDER1_16_IMR_NZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
4INLINE int BLENDER1_16_IMR_NZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
5INLINE int BLENDER1_16_NIMR_ZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
6INLINE int BLENDER1_16_NIMR_ZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
7INLINE int BLENDER1_16_NIMR_NZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
8INLINE int BLENDER1_16_NIMR_NZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
1INLINE int BLENDER1_16_IMR_ZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
2INLINE int BLENDER1_16_IMR_ZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
3INLINE int BLENDER1_16_IMR_NZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
4INLINE int BLENDER1_16_IMR_NZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
5INLINE int BLENDER1_16_NIMR_ZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
6INLINE int BLENDER1_16_NIMR_ZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
7INLINE int BLENDER1_16_NIMR_NZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
8INLINE int BLENDER1_16_NIMR_NZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
99
10INLINE int BLENDER2_16_IMR_ZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
11INLINE int BLENDER2_16_IMR_ZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
12INLINE int BLENDER2_16_IMR_NZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
13INLINE int BLENDER2_16_IMR_NZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
14INLINE int BLENDER2_16_NIMR_ZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
15INLINE int BLENDER2_16_NIMR_ZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
16INLINE int BLENDER2_16_NIMR_NZC_DITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
17INLINE int BLENDER2_16_NIMR_NZC_NDITH_NAC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
10INLINE int BLENDER2_16_IMR_ZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
11INLINE int BLENDER2_16_IMR_ZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
12INLINE int BLENDER2_16_IMR_NZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
13INLINE int BLENDER2_16_IMR_NZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
14INLINE int BLENDER2_16_NIMR_ZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
15INLINE int BLENDER2_16_NIMR_ZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
16INLINE int BLENDER2_16_NIMR_NZC_DITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
17INLINE int BLENDER2_16_NIMR_NZC_NDITH_NAC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
1818
19INLINE int BLENDER1_16_IMR_ZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
20INLINE int BLENDER1_16_IMR_ZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
21INLINE int BLENDER1_16_IMR_NZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
22INLINE int BLENDER1_16_IMR_NZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
23INLINE int BLENDER1_16_NIMR_ZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
24INLINE int BLENDER1_16_NIMR_ZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
25INLINE int BLENDER1_16_NIMR_NZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
26INLINE int BLENDER1_16_NIMR_NZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c, int dith);
19INLINE int BLENDER1_16_IMR_ZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
20INLINE int BLENDER1_16_IMR_ZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
21INLINE int BLENDER1_16_IMR_NZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
22INLINE int BLENDER1_16_IMR_NZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
23INLINE int BLENDER1_16_NIMR_ZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
24INLINE int BLENDER1_16_NIMR_ZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
25INLINE int BLENDER1_16_NIMR_NZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
26INLINE int BLENDER1_16_NIMR_NZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
2727
28INLINE int BLENDER2_16_IMR_ZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
29INLINE int BLENDER2_16_IMR_ZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
30INLINE int BLENDER2_16_IMR_NZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
31INLINE int BLENDER2_16_IMR_NZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
32INLINE int BLENDER2_16_NIMR_ZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
33INLINE int BLENDER2_16_NIMR_ZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
34INLINE int BLENDER2_16_NIMR_NZC_DITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
35INLINE int BLENDER2_16_NIMR_NZC_NDITH_AC(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
28INLINE int BLENDER2_16_IMR_ZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
29INLINE int BLENDER2_16_IMR_ZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
30INLINE int BLENDER2_16_IMR_NZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
31INLINE int BLENDER2_16_IMR_NZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
32INLINE int BLENDER2_16_NIMR_ZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
33INLINE int BLENDER2_16_NIMR_ZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
34INLINE int BLENDER2_16_NIMR_NZC_DITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
35INLINE int BLENDER2_16_NIMR_NZC_NDITH_AC_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
3636
37INLINE int BLENDER1_16_IMR_ZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c);
38INLINE int BLENDER1_16_IMR_NZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c);
39INLINE int BLENDER1_16_NIMR_ZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c);
40INLINE int BLENDER1_16_NIMR_NZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c);
37INLINE int BLENDER1_16_IMR_ZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c);
38INLINE int BLENDER1_16_IMR_NZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c);
39INLINE int BLENDER1_16_NIMR_ZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c);
40INLINE int BLENDER1_16_NIMR_NZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c);
4141
42INLINE int BLENDER2_16_IMR_ZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
43INLINE int BLENDER2_16_IMR_NZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
44INLINE int BLENDER2_16_NIMR_ZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
45INLINE int BLENDER2_16_NIMR_NZC_NAC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
42INLINE int BLENDER2_16_IMR_ZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
43INLINE int BLENDER2_16_IMR_NZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
44INLINE int BLENDER2_16_NIMR_ZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
45INLINE int BLENDER2_16_NIMR_NZC_NAC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
4646
47INLINE int BLENDER1_16_IMR_ZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c);
48INLINE int BLENDER1_16_IMR_NZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c);
49INLINE int BLENDER1_16_NIMR_ZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c);
50INLINE int BLENDER1_16_NIMR_NZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c);
47INLINE int BLENDER1_16_IMR_ZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c);
48INLINE int BLENDER1_16_IMR_NZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c);
49INLINE int BLENDER1_16_NIMR_ZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c);
50INLINE int BLENDER1_16_NIMR_NZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c);
5151
52INLINE int BLENDER2_16_IMR_ZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
53INLINE int BLENDER2_16_IMR_NZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
54INLINE int BLENDER2_16_NIMR_ZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
55INLINE int BLENDER2_16_NIMR_NZC_AC_ND(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
52INLINE int BLENDER2_16_IMR_ZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
53INLINE int BLENDER2_16_IMR_NZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
54INLINE int BLENDER2_16_NIMR_ZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
55INLINE int BLENDER2_16_NIMR_NZC_AC_ND_FORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
5656
57static int (*rdp_blender1_16_dith_func[16])(UINT16 *, UINT8 *, COLOR, int) =
57INLINE int BLENDER1_16_IMR_ZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
58INLINE int BLENDER1_16_IMR_ZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
59INLINE int BLENDER1_16_IMR_NZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
60INLINE int BLENDER1_16_IMR_NZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
61INLINE int BLENDER1_16_NIMR_ZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
62INLINE int BLENDER1_16_NIMR_ZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
63INLINE int BLENDER1_16_NIMR_NZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
64INLINE int BLENDER1_16_NIMR_NZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
65
66INLINE int BLENDER2_16_IMR_ZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
67INLINE int BLENDER2_16_IMR_ZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
68INLINE int BLENDER2_16_IMR_NZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
69INLINE int BLENDER2_16_IMR_NZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
70INLINE int BLENDER2_16_NIMR_ZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
71INLINE int BLENDER2_16_NIMR_ZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
72INLINE int BLENDER2_16_NIMR_NZC_DITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
73INLINE int BLENDER2_16_NIMR_NZC_NDITH_NAC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
74
75INLINE int BLENDER1_16_IMR_ZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
76INLINE int BLENDER1_16_IMR_ZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
77INLINE int BLENDER1_16_IMR_NZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
78INLINE int BLENDER1_16_IMR_NZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
79INLINE int BLENDER1_16_NIMR_ZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
80INLINE int BLENDER1_16_NIMR_ZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
81INLINE int BLENDER1_16_NIMR_NZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
82INLINE int BLENDER1_16_NIMR_NZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c, int dith);
83
84INLINE int BLENDER2_16_IMR_ZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
85INLINE int BLENDER2_16_IMR_ZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
86INLINE int BLENDER2_16_IMR_NZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
87INLINE int BLENDER2_16_IMR_NZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
88INLINE int BLENDER2_16_NIMR_ZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
89INLINE int BLENDER2_16_NIMR_ZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
90INLINE int BLENDER2_16_NIMR_NZC_DITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
91INLINE int BLENDER2_16_NIMR_NZC_NDITH_AC_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2, int dith);
92
93INLINE int BLENDER1_16_IMR_ZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c);
94INLINE int BLENDER1_16_IMR_NZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c);
95INLINE int BLENDER1_16_NIMR_ZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c);
96INLINE int BLENDER1_16_NIMR_NZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c);
97
98INLINE int BLENDER2_16_IMR_ZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
99INLINE int BLENDER2_16_IMR_NZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
100INLINE int BLENDER2_16_NIMR_ZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
101INLINE int BLENDER2_16_NIMR_NZC_NAC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
102
103INLINE int BLENDER1_16_IMR_ZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c);
104INLINE int BLENDER1_16_IMR_NZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c);
105INLINE int BLENDER1_16_NIMR_ZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c);
106INLINE int BLENDER1_16_NIMR_NZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c);
107
108INLINE int BLENDER2_16_IMR_ZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
109INLINE int BLENDER2_16_IMR_NZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
110INLINE int BLENDER2_16_NIMR_ZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
111INLINE int BLENDER2_16_NIMR_NZC_AC_ND_NFORCE(UINT16 *fb, UINT8* hb, COLOR c1, COLOR c2);
112
113static int (*rdp_blender1_16_dith_func[32])(UINT16 *, UINT8 *, COLOR, int) =
58114{
59   BLENDER1_16_NIMR_NZC_NDITH_NAC,   BLENDER1_16_NIMR_NZC_NDITH_AC,   BLENDER1_16_NIMR_NZC_DITH_NAC,   BLENDER1_16_NIMR_NZC_DITH_AC,
60   BLENDER1_16_NIMR_ZC_NDITH_NAC,    BLENDER1_16_NIMR_ZC_NDITH_AC,    BLENDER1_16_NIMR_ZC_DITH_NAC,   BLENDER1_16_NIMR_ZC_DITH_AC,
61   BLENDER1_16_IMR_NZC_NDITH_NAC,    BLENDER1_16_IMR_NZC_NDITH_AC,    BLENDER1_16_IMR_NZC_DITH_NAC,   BLENDER1_16_IMR_NZC_DITH_AC,
62   BLENDER1_16_IMR_ZC_NDITH_NAC,    BLENDER1_16_IMR_ZC_NDITH_AC,    BLENDER1_16_IMR_ZC_DITH_NAC,   BLENDER1_16_IMR_ZC_DITH_AC,
115   BLENDER1_16_NIMR_NZC_NDITH_NAC_NFORCE,   BLENDER1_16_NIMR_NZC_NDITH_AC_NFORCE,   BLENDER1_16_NIMR_NZC_DITH_NAC_NFORCE,   BLENDER1_16_NIMR_NZC_DITH_AC_NFORCE,
116   BLENDER1_16_NIMR_ZC_NDITH_NAC_NFORCE,    BLENDER1_16_NIMR_ZC_NDITH_AC_NFORCE,    BLENDER1_16_NIMR_ZC_DITH_NAC_NFORCE,   BLENDER1_16_NIMR_ZC_DITH_AC_NFORCE,
117   BLENDER1_16_IMR_NZC_NDITH_NAC_NFORCE,    BLENDER1_16_IMR_NZC_NDITH_AC_NFORCE,    BLENDER1_16_IMR_NZC_DITH_NAC_NFORCE,   BLENDER1_16_IMR_NZC_DITH_AC_NFORCE,
118   BLENDER1_16_IMR_ZC_NDITH_NAC_NFORCE,    BLENDER1_16_IMR_ZC_NDITH_AC_NFORCE,    BLENDER1_16_IMR_ZC_DITH_NAC_NFORCE,      BLENDER1_16_IMR_ZC_DITH_AC_NFORCE,
119   BLENDER1_16_NIMR_NZC_NDITH_NAC_FORCE,   BLENDER1_16_NIMR_NZC_NDITH_AC_FORCE,   BLENDER1_16_NIMR_NZC_DITH_NAC_FORCE,   BLENDER1_16_NIMR_NZC_DITH_AC_FORCE,
120   BLENDER1_16_NIMR_ZC_NDITH_NAC_FORCE,    BLENDER1_16_NIMR_ZC_NDITH_AC_FORCE,    BLENDER1_16_NIMR_ZC_DITH_NAC_FORCE,      BLENDER1_16_NIMR_ZC_DITH_AC_FORCE,
121   BLENDER1_16_IMR_NZC_NDITH_NAC_FORCE,    BLENDER1_16_IMR_NZC_NDITH_AC_FORCE,    BLENDER1_16_IMR_NZC_DITH_NAC_FORCE,      BLENDER1_16_IMR_NZC_DITH_AC_FORCE,
122   BLENDER1_16_IMR_ZC_NDITH_NAC_FORCE,    BLENDER1_16_IMR_ZC_NDITH_AC_FORCE,       BLENDER1_16_IMR_ZC_DITH_NAC_FORCE,      BLENDER1_16_IMR_ZC_DITH_AC_FORCE,
63123};
64124
65static int (*rdp_blender2_16_dith_func[16])(UINT16 *, UINT8 *, COLOR, COLOR, int) =
125static int (*rdp_blender2_16_dith_func[32])(UINT16 *, UINT8 *, COLOR, COLOR, int) =
66126{
67   BLENDER2_16_NIMR_NZC_NDITH_NAC,   BLENDER2_16_NIMR_NZC_NDITH_AC,   BLENDER2_16_NIMR_NZC_DITH_NAC,   BLENDER2_16_NIMR_NZC_DITH_AC,
68   BLENDER2_16_NIMR_ZC_NDITH_NAC,    BLENDER2_16_NIMR_ZC_NDITH_AC,    BLENDER2_16_NIMR_ZC_DITH_NAC,   BLENDER2_16_NIMR_ZC_DITH_AC,
69   BLENDER2_16_IMR_NZC_NDITH_NAC,    BLENDER2_16_IMR_NZC_NDITH_AC,    BLENDER2_16_IMR_NZC_DITH_NAC,   BLENDER2_16_IMR_NZC_DITH_AC,
70   BLENDER2_16_IMR_ZC_NDITH_NAC,    BLENDER2_16_IMR_ZC_NDITH_AC,    BLENDER2_16_IMR_ZC_DITH_NAC,   BLENDER2_16_IMR_ZC_DITH_AC,
127   BLENDER2_16_NIMR_NZC_NDITH_NAC_NFORCE,   BLENDER2_16_NIMR_NZC_NDITH_AC_NFORCE,   BLENDER2_16_NIMR_NZC_DITH_NAC_NFORCE,   BLENDER2_16_NIMR_NZC_DITH_AC_NFORCE,
128   BLENDER2_16_NIMR_ZC_NDITH_NAC_NFORCE,    BLENDER2_16_NIMR_ZC_NDITH_AC_NFORCE,    BLENDER2_16_NIMR_ZC_DITH_NAC_NFORCE,   BLENDER2_16_NIMR_ZC_DITH_AC_NFORCE,
129   BLENDER2_16_IMR_NZC_NDITH_NAC_NFORCE,    BLENDER2_16_IMR_NZC_NDITH_AC_NFORCE,    BLENDER2_16_IMR_NZC_DITH_NAC_NFORCE,   BLENDER2_16_IMR_NZC_DITH_AC_NFORCE,
130   BLENDER2_16_IMR_ZC_NDITH_NAC_NFORCE,    BLENDER2_16_IMR_ZC_NDITH_AC_NFORCE,    BLENDER2_16_IMR_ZC_DITH_NAC_NFORCE,      BLENDER2_16_IMR_ZC_DITH_AC_NFORCE,
131   BLENDER2_16_NIMR_NZC_NDITH_NAC_FORCE,   BLENDER2_16_NIMR_NZC_NDITH_AC_FORCE,   BLENDER2_16_NIMR_NZC_DITH_NAC_FORCE,   BLENDER2_16_NIMR_NZC_DITH_AC_FORCE,
132   BLENDER2_16_NIMR_ZC_NDITH_NAC_FORCE,    BLENDER2_16_NIMR_ZC_NDITH_AC_FORCE,    BLENDER2_16_NIMR_ZC_DITH_NAC_FORCE,      BLENDER2_16_NIMR_ZC_DITH_AC_FORCE,
133   BLENDER2_16_IMR_NZC_NDITH_NAC_FORCE,    BLENDER2_16_IMR_NZC_NDITH_AC_FORCE,    BLENDER2_16_IMR_NZC_DITH_NAC_FORCE,      BLENDER2_16_IMR_NZC_DITH_AC_FORCE,
134   BLENDER2_16_IMR_ZC_NDITH_NAC_FORCE,    BLENDER2_16_IMR_ZC_NDITH_AC_FORCE,       BLENDER2_16_IMR_ZC_DITH_NAC_FORCE,      BLENDER2_16_IMR_ZC_DITH_AC_FORCE,
71135};
72136
73137static int (*rdp_blender1_16_ndith_func[16])(UINT16 *, UINT8 *, COLOR) =
74138{
75   BLENDER1_16_NIMR_NZC_NAC_ND,   BLENDER1_16_NIMR_NZC_AC_ND,
76   BLENDER1_16_NIMR_ZC_NAC_ND,    BLENDER1_16_NIMR_ZC_AC_ND,
77   BLENDER1_16_IMR_NZC_NAC_ND,    BLENDER1_16_IMR_NZC_AC_ND,
78   BLENDER1_16_IMR_ZC_NAC_ND,       BLENDER1_16_IMR_ZC_AC_ND,
139   BLENDER1_16_NIMR_NZC_NAC_ND_NFORCE,   BLENDER1_16_NIMR_NZC_AC_ND_NFORCE,
140   BLENDER1_16_NIMR_ZC_NAC_ND_NFORCE,    BLENDER1_16_NIMR_ZC_AC_ND_NFORCE,
141   BLENDER1_16_IMR_NZC_NAC_ND_NFORCE,    BLENDER1_16_IMR_NZC_AC_ND_NFORCE,
142   BLENDER1_16_IMR_ZC_NAC_ND_NFORCE,    BLENDER1_16_IMR_ZC_AC_ND_NFORCE,
143   BLENDER1_16_NIMR_NZC_NAC_ND_FORCE,   BLENDER1_16_NIMR_NZC_AC_ND_FORCE,
144   BLENDER1_16_NIMR_ZC_NAC_ND_FORCE,    BLENDER1_16_NIMR_ZC_AC_ND_FORCE,
145   BLENDER1_16_IMR_NZC_NAC_ND_FORCE,    BLENDER1_16_IMR_NZC_AC_ND_FORCE,
146   BLENDER1_16_IMR_ZC_NAC_ND_FORCE,    BLENDER1_16_IMR_ZC_AC_ND_FORCE,
79147};
80148
81149static int (*rdp_blender2_16_ndith_func[16])(UINT16 *, UINT8 *, COLOR, COLOR) =
82150{
83   BLENDER2_16_NIMR_NZC_NAC_ND,   BLENDER2_16_NIMR_NZC_AC_ND,
84   BLENDER2_16_NIMR_ZC_NAC_ND,    BLENDER2_16_NIMR_ZC_AC_ND,
85   BLENDER2_16_IMR_NZC_NAC_ND,    BLENDER2_16_IMR_NZC_AC_ND,
86   BLENDER2_16_IMR_ZC_NAC_ND,       BLENDER2_16_IMR_ZC_AC_ND,
151   BLENDER2_16_NIMR_NZC_NAC_ND_NFORCE,   BLENDER2_16_NIMR_NZC_AC_ND_NFORCE,
152   BLENDER2_16_NIMR_ZC_NAC_ND_NFORCE,    BLENDER2_16_NIMR_ZC_AC_ND_NFORCE,
153   BLENDER2_16_IMR_NZC_NAC_ND_NFORCE,    BLENDER2_16_IMR_NZC_AC_ND_NFORCE,
154   BLENDER2_16_IMR_ZC_NAC_ND_NFORCE,    BLENDER2_16_IMR_ZC_AC_ND_NFORCE,
155   BLENDER2_16_NIMR_NZC_NAC_ND_FORCE,   BLENDER2_16_NIMR_NZC_AC_ND_FORCE,
156   BLENDER2_16_NIMR_ZC_NAC_ND_FORCE,    BLENDER2_16_NIMR_ZC_AC_ND_FORCE,
157   BLENDER2_16_IMR_NZC_NAC_ND_FORCE,    BLENDER2_16_IMR_NZC_AC_ND_FORCE,
158   BLENDER2_16_IMR_ZC_NAC_ND_FORCE,    BLENDER2_16_IMR_ZC_AC_ND_FORCE,
87159};
src/mame/video/rdpcc.c
r6819r6820
1/*
12#if defined(NOISE)
2   INLINE UINT32 COLOR_COMBINER1_NOISE(void)
3#else
4   INLINE UINT32 COLOR_COMBINER1_NNOISE(void)
5#endif
6{
7   COLOR c;
8#if defined(NOISE)
9   noise_color.i.r = rdp_rand();
10   noise_color.i.g = rdp_rand();
11   noise_color.i.b = rdp_rand();
12#endif
3   #define COLOR_COMBINER1_NOISE(color)
4      noise_color.i.r = rdp_rand();
5      noise_color.i.g = rdp_rand();
6      noise_color.i.b = rdp_rand();
7      color.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[1],*combiner_rgbsub_b_r[1],*combiner_rgbmul_r[1],*combiner_rgbadd_r[1]);
8      color.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[1],*combiner_rgbsub_b_g[1],*combiner_rgbmul_g[1],*combiner_rgbadd_g[1]);
9      color.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[1],*combiner_rgbsub_b_b[1],*combiner_rgbmul_b[1],*combiner_rgbadd_b[1]);
10      color.i.a = COMBINER_EQUATION(*combiner_alphasub_a[1],*combiner_alphasub_b[1],*combiner_alphamul[1],*combiner_alphaadd[1]);
11      alpha_cvg_get(&color.i.a);
12#else*/
13   #define COLOR_COMBINER1(color) \
14      color.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[1],*combiner_rgbsub_b_r[1],*combiner_rgbmul_r[1],*combiner_rgbadd_r[1]); \
15      color.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[1],*combiner_rgbsub_b_g[1],*combiner_rgbmul_g[1],*combiner_rgbadd_g[1]); \
16      color.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[1],*combiner_rgbsub_b_b[1],*combiner_rgbmul_b[1],*combiner_rgbadd_b[1]); \
17      color.i.a = COMBINER_EQUATION(*combiner_alphasub_a[1],*combiner_alphasub_b[1],*combiner_alphamul[1],*combiner_alphaadd[1]); \
18      alpha_cvg_get(&color.i.a);
19//#endif
1320
14   c.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[1],*combiner_rgbsub_b_r[1],*combiner_rgbmul_r[1],*combiner_rgbadd_r[1]);
15   c.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[1],*combiner_rgbsub_b_g[1],*combiner_rgbmul_g[1],*combiner_rgbadd_g[1]);
16   c.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[1],*combiner_rgbsub_b_b[1],*combiner_rgbmul_b[1],*combiner_rgbadd_b[1]);
17   c.i.a = COMBINER_EQUATION(*combiner_alphasub_a[1],*combiner_alphasub_b[1],*combiner_alphamul[1],*combiner_alphaadd[1]);
18
19   //Alpha coverage combiner
20   alpha_cvg_get(&c.i.a);
21
22   return c.c;
23}
24
21/*
2522#if defined(NOISE)
26   INLINE UINT32 COLOR_COMBINER2_C0_NOISE(void)
27#else
28   INLINE UINT32 COLOR_COMBINER2_C0_NNOISE(void)
29#endif
30{
31   COLOR c;
32#if defined(NOISE)
33   noise_color.i.r = rdp_rand();
34   noise_color.i.g = rdp_rand();
35   noise_color.i.b = rdp_rand();
36#endif
23   #define COLOR_COMBINER2_C0_NOISE(color)
24      noise_color.i.r = rdp_rand();
25      noise_color.i.g = rdp_rand();
26      noise_color.i.b = rdp_rand();
27      color.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[0],*combiner_rgbsub_b_r[0],*combiner_rgbmul_r[0],*combiner_rgbadd_r[0]);
28      color.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[0],*combiner_rgbsub_b_g[0],*combiner_rgbmul_g[0],*combiner_rgbadd_g[0]);
29      color.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[0],*combiner_rgbsub_b_b[0],*combiner_rgbmul_b[0],*combiner_rgbadd_b[0]);
30      color.i.a = COMBINER_EQUATION(*combiner_alphasub_a[0],*combiner_alphasub_b[0],*combiner_alphamul[0],*combiner_alphaadd[0]);
31      combined_color.c = color.c;
32#else*/
33   #define COLOR_COMBINER2_C0(color) \
34      color.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[0],*combiner_rgbsub_b_r[0],*combiner_rgbmul_r[0],*combiner_rgbadd_r[0]); \
35      color.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[0],*combiner_rgbsub_b_g[0],*combiner_rgbmul_g[0],*combiner_rgbadd_g[0]); \
36      color.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[0],*combiner_rgbsub_b_b[0],*combiner_rgbmul_b[0],*combiner_rgbadd_b[0]); \
37      color.i.a = COMBINER_EQUATION(*combiner_alphasub_a[0],*combiner_alphasub_b[0],*combiner_alphamul[0],*combiner_alphaadd[0]); \
38      combined_color.c = color.c;
39//#endif
3740
38   c.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[0],*combiner_rgbsub_b_r[0],*combiner_rgbmul_r[0],*combiner_rgbadd_r[0]);
39   c.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[0],*combiner_rgbsub_b_g[0],*combiner_rgbmul_g[0],*combiner_rgbadd_g[0]);
40   c.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[0],*combiner_rgbsub_b_b[0],*combiner_rgbmul_b[0],*combiner_rgbadd_b[0]);
41   c.i.a = COMBINER_EQUATION(*combiner_alphasub_a[0],*combiner_alphasub_b[0],*combiner_alphamul[0],*combiner_alphaadd[0]);
42   //COMBINER_EQUATION(&c->i.r, combiner_rgbsub_a_r[0],combiner_rgbsub_b_r[0],combiner_rgbmul_r[0],combiner_rgbadd_r[0]);
43   //COMBINER_EQUATION(&c->i.g, combiner_rgbsub_a_g[0],combiner_rgbsub_b_g[0],combiner_rgbmul_g[0],combiner_rgbadd_g[0]);
44   //COMBINER_EQUATION(&c->i.b, combiner_rgbsub_a_b[0],combiner_rgbsub_b_b[0],combiner_rgbmul_b[0],combiner_rgbadd_b[0]);
45   //COMBINER_EQUATION(&c->i.a, combiner_alphasub_a[0],combiner_alphasub_b[0],combiner_alphamul[0],combiner_alphaadd[0]);
4641
47   combined_color.c = c.c;
48
49   return c.c;
50}
51
52#if defined(NOISE)
53   INLINE UINT32 COLOR_COMBINER2_C1_NOISE(void)
54#else
55   INLINE UINT32 COLOR_COMBINER2_C1_NNOISE(void)
56#endif
57{
58   COLOR c;
59   c.c = texel0_color.c;
60   texel0_color.c = texel1_color.c;
61   texel1_color.c = c.c;
62
63#if defined(NOISE)
64   noise_color.i.r = rdp_rand();
65   noise_color.i.g = rdp_rand();
66   noise_color.i.b = rdp_rand();
67#endif
68
69   c.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[1],*combiner_rgbsub_b_r[1],*combiner_rgbmul_r[1],*combiner_rgbadd_r[1]);
70   c.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[1],*combiner_rgbsub_b_g[1],*combiner_rgbmul_g[1],*combiner_rgbadd_g[1]);
71   c.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[1],*combiner_rgbsub_b_b[1],*combiner_rgbmul_b[1],*combiner_rgbadd_b[1]);
72   c.i.a = COMBINER_EQUATION(*combiner_alphasub_a[1],*combiner_alphasub_b[1],*combiner_alphamul[1],*combiner_alphaadd[1]);
73   //COMBINER_EQUATION(&c->i.r, combiner_rgbsub_a_r[1],combiner_rgbsub_b_r[1],combiner_rgbmul_r[1],combiner_rgbadd_r[1]);
74   //COMBINER_EQUATION(&c->i.g, combiner_rgbsub_a_g[1],combiner_rgbsub_b_g[1],combiner_rgbmul_g[1],combiner_rgbadd_g[1]);
75   //COMBINER_EQUATION(&c->i.b, combiner_rgbsub_a_b[1],combiner_rgbsub_b_b[1],combiner_rgbmul_b[1],combiner_rgbadd_b[1]);
76   //COMBINER_EQUATION(&c->i.a, combiner_alphasub_a[1],combiner_alphasub_b[1],combiner_alphamul[1],combiner_alphaadd[1]);
77
78   alpha_cvg_get(&c.i.a);
79
80   return c.c;
81}
42/*#if defined(NOISE)
43   #define COLOR_COMBINER2_C1_NOISE(color)
44      color.c = texel0_color.c;
45      texel0_color.c = texel1_color.c;
46      texel1_color.c = color.c;
47      noise_color.i.r = rdp_rand();
48      noise_color.i.g = rdp_rand();
49      noise_color.i.b = rdp_rand();
50      color.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[1],*combiner_rgbsub_b_r[1],*combiner_rgbmul_r[1],*combiner_rgbadd_r[1]);
51      color.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[1],*combiner_rgbsub_b_g[1],*combiner_rgbmul_g[1],*combiner_rgbadd_g[1]);
52      color.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[1],*combiner_rgbsub_b_b[1],*combiner_rgbmul_b[1],*combiner_rgbadd_b[1]);
53      color.i.a = COMBINER_EQUATION(*combiner_alphasub_a[1],*combiner_alphasub_b[1],*combiner_alphamul[1],*combiner_alphaadd[1]);
54      alpha_cvg_get(&color.i.a);
55#else*/
56   #define COLOR_COMBINER2_C1(color) \
57      color.c = texel0_color.c; \
58      texel0_color.c = texel1_color.c; \
59      texel1_color.c = color.c; \
60      color.i.r = COMBINER_EQUATION(*combiner_rgbsub_a_r[1],*combiner_rgbsub_b_r[1],*combiner_rgbmul_r[1],*combiner_rgbadd_r[1]); \
61      color.i.g = COMBINER_EQUATION(*combiner_rgbsub_a_g[1],*combiner_rgbsub_b_g[1],*combiner_rgbmul_g[1],*combiner_rgbadd_g[1]); \
62      color.i.b = COMBINER_EQUATION(*combiner_rgbsub_a_b[1],*combiner_rgbsub_b_b[1],*combiner_rgbmul_b[1],*combiner_rgbadd_b[1]); \
63      color.i.a = COMBINER_EQUATION(*combiner_alphasub_a[1],*combiner_alphasub_b[1],*combiner_alphamul[1],*combiner_alphaadd[1]); \
64      alpha_cvg_get(&color.i.a);
65//#endif
src/mame/video/rdpspn16.c
r6819r6820
980980               texel0_color.c = TEXTURE_PIPELINE(sss, sst, tex_tile);
981981#endif
982982
983               c1.c = COLOR_COMBINER1();
983               COLOR_COMBINER1(c1);
984984
985985#if defined(ZCOMPARE)
986986#if !defined(ZBUF)
r6819r6820
21442144               texel1_color.c = TEXTURE_PIPELINE(sss, sst, tex_tile2);
21452145#endif
21462146
2147               c1.c = COLOR_COMBINER2_C0();
2148               c2.c = COLOR_COMBINER2_C1();
2147               COLOR_COMBINER2_C0(c1);
2148               COLOR_COMBINER2_C1(c2);
21492149
21502150#if defined(ZCOMPARE)
21512151#if !defined(ZBUF)
src/mame/video/rdptrect.c
r6819r6820
8484
8585   shade_color.c = 0;   // Needed by Pilotwings 64
8686
87   if(rect->flip)
88   {
89      int temp = rect->t;
90      rect->t = rect->s;
91      rect->s = temp;
92      temp = rect->dtdy;
93      rect->dtdy = rect->dsdx;
94      rect->dsdx= temp;
95   }
96
9787   CACHE_TEXTURE_PARAMS(tex_tile);
9888
9989   if(y1 < clipy1)
r6819r6820
119109
120110   t = ((int)(rect->t));
121111
122   for (j = y1; j < y2; j++)
112   if(rect->flip)
123113   {
114      for (j = y1; j < y2; j++)
115      {
124116         int fb_index = j * fb_width;
125117#if defined(MAGICDITHER) || defined(BAYERDITHER)
126118         int mline = (j & 3) << 2;
r6819r6820
129121
130122         for (i = x1; i < x2; i++)
131123         {
132               COLOR c;
124            COLOR c;
133125#if defined(ZUPDATE)
134               int rendered = 0;
126            int rendered = 0;
135127#endif
136128#if defined(MAGICDITHER) || defined(BAYERDITHER)
137               int dith = 0;
129            int dith = 0;
138130#endif
139               int curpixel = fb_index + i;
140               UINT16* fbcur = &fb[curpixel ^ WORD_ADDR_XOR];
141               UINT8* hbcur = &hb[curpixel ^ BYTE_ADDR_XOR];
131
132            int curpixel = fb_index + i;
133            UINT16* fbcur = &fb[curpixel ^ WORD_ADDR_XOR];
134            UINT8* hbcur = &hb[curpixel ^ BYTE_ADDR_XOR];
142135#if (defined(ZCOMPARE) || defined(ZUPDATE))
143               UINT16* zbcur = &zb[curpixel ^ WORD_ADDR_XOR];
144               UINT8* zhbcur = &zhb[curpixel ^ BYTE_ADDR_XOR];
136            UINT16* zbcur = &zb[curpixel ^ WORD_ADDR_XOR];
137            UINT8* zhbcur = &zhb[curpixel ^ BYTE_ADDR_XOR];
145138#endif
139            curpixel_cvg = 8;
146140
147               curpixel_cvg = 8;
141            texel0_color.c = TEXTURE_PIPELINE(t, s, tex_tile);
148142
149               texel0_color.c = TEXTURE_PIPELINE(s, t, tex_tile);
143            COLOR_COMBINER1(c);
150144
151               c.c = COLOR_COMBINER1();
145#if defined(MAGICDITHER)
146            dith = magic_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
147#elif defined(BAYERDITHER)
148            dith = bayer_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
149#endif
152150
151#if defined(ZCOMPARE)
152            if (z_compare(fbcur, hbcur, zbcur, zhbcur, ((UINT32)primitive_z)<<3,primitive_delta_z))
153            {
154#endif
155#if defined(MAGICDITHER) || defined(BAYERDITHER)
156#if defined(ZUPDATE)
157               rendered = BLENDER1_16_DITH(fbcur, hbcur, c, dith);
158#else
159               BLENDER1_16_DITH(fbcur, hbcur, c, dith);
160#endif
161#else
162#if defined(ZUPDATE)
163               rendered = BLENDER1_16_NDITH(fbcur, hbcur, c);
164#else
165               BLENDER1_16_NDITH(fbcur, hbcur, c);
166#endif
167#endif
168#if defined(ZCOMPARE)
169            }
170#endif
171
172#if defined(ZUPDATE)
173            if(rendered)
174            {
175               z_store(zbcur, zhbcur, ((UINT32)primitive_z) << 3,primitive_delta_z);
176            }
177#endif
178
179
180            s += (int)(rect->dsdx);
181         }
182         t += (int)(rect->dtdy);
183      }
184   }
185   else
186   {
187      for (j = y1; j < y2; j++)
188      {
189         int fb_index = j * fb_width;
190#if defined(MAGICDITHER) || defined(BAYERDITHER)
191         int mline = (j & 3) << 2;
192#endif
193
194         s = ((int)(rect->s));
195
196         for (i = x1; i < x2; i++)
197         {
198            COLOR c;
199#if defined(ZUPDATE)
200            int rendered = 0;
201#endif
202#if defined(MAGICDITHER) || defined(BAYERDITHER)
203            int dith = 0;
204#endif
205            int curpixel = fb_index + i;
206            UINT16* fbcur = &fb[curpixel ^ WORD_ADDR_XOR];
207            UINT8* hbcur = &hb[curpixel ^ BYTE_ADDR_XOR];
208#if (defined(ZCOMPARE) || defined(ZUPDATE))
209            UINT16* zbcur = &zb[curpixel ^ WORD_ADDR_XOR];
210            UINT8* zhbcur = &zhb[curpixel ^ BYTE_ADDR_XOR];
211#endif
212            curpixel_cvg = 8;
213
214            texel0_color.c = TEXTURE_PIPELINE(s, t, tex_tile);
215
216            COLOR_COMBINER1(c);
217
153218#if defined(MAGICDITHER)
154               dith = magic_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
219            dith = magic_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
155220#elif defined(BAYERDITHER)
156               dith = bayer_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
221            dith = bayer_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
157222#endif
158223
159224#if defined(ZCOMPARE)
160               if (z_compare(fbcur, hbcur, zbcur, zhbcur, ((UINT32)primitive_z)<<3,primitive_delta_z))
161               {
225            if (z_compare(fbcur, hbcur, zbcur, zhbcur, ((UINT32)primitive_z)<<3,primitive_delta_z))
226            {
162227#endif
163228#if defined(MAGICDITHER) || defined(BAYERDITHER)
164229#if defined(ZUPDATE)
165                  rendered = BLENDER1_16_DITH(fbcur, hbcur, c, dith);
230               rendered = BLENDER1_16_DITH(fbcur, hbcur, c, dith);
166231#else
167                  BLENDER1_16_DITH(fbcur, hbcur, c, dith);
232               BLENDER1_16_DITH(fbcur, hbcur, c, dith);
168233#endif
169234#else
170235#if defined(ZUPDATE)
171                  rendered = BLENDER1_16_NDITH(fbcur, hbcur, c);
236               rendered = BLENDER1_16_NDITH(fbcur, hbcur, c);
172237#else
173                  BLENDER1_16_NDITH(fbcur, hbcur, c);
238               BLENDER1_16_NDITH(fbcur, hbcur, c);
174239#endif
175240#endif
176241#if defined(ZCOMPARE)
177               }
242            }
178243#endif
179244
180245#if defined(ZUPDATE)
181               if(rendered)
182               {
183                  z_store(zbcur, zhbcur, ((UINT32)primitive_z) << 3,primitive_delta_z);
184               }
246            if(rendered)
247            {
248               z_store(zbcur, zhbcur, ((UINT32)primitive_z) << 3,primitive_delta_z);
249            }
185250#endif
186251
187252
253            fbcur++;
254            hbcur++;
255#if (defined(ZCOMPARE) || defined(ZUPDATE))
256            zbcur++;
257            zhbcur++;
258#endif
188259            s += (int)(rect->dsdx);
189260         }
190      t += (int)(rect->dtdy);
261         t += (int)(rect->dtdy);
262      }
191263   }
192264}
193265
r6819r6820
239311   int i, j;
240312   int x1, x2, y1, y2;
241313   int s, t;
242   int ss, st;
243314
244315   int clipx1, clipx2, clipy1, clipy2;
245316
r6819r6820
289360      tex_tile2 = &tile[tilenum2];
290361   }
291362
292
293363   shade_color.c = 0;   // Needed by Pilotwings 64
294364
295   if(rect->flip)
365   if(y1 < clipy1)
296366   {
297      int temp = rect->t;
298      rect->t = rect->s;
299      rect->s = temp;
300      temp = rect->dtdy;
301      rect->dtdy = rect->dsdx;
302      rect->dsdx= temp;
367      rect->t += rect->dtdy * (clipy1 - y1);
368      y1 = clipy1;
303369   }
370   if(y2 > clipy2)
371   {
372      y2 = clipy2;
373   }
374   if(x1 < clipx1)
375   {
376      rect->s += rect->dsdx * (clipx1 - x1);
377      x1 = clipx1;
378   }
379   if(x2 > clipx2)
380   {
381      x2 = clipx2;
382   }
383   rect->dsdx >>= 5;
384   rect->dtdy >>= 5;
304385
305   t = ((int)(rect->t)) << 5;
386   t = ((int)(rect->t));
306387
307   for (j = y1; j < y2; j++)
388   if(rect->flip)
308389   {
309
310      if (j >= clipy1 && j < clipy2)
390      for (j = y1; j < y2; j++)
311391      {
312         int fb_index = j * fb_width;
392         //if (j >= clipy1 && j < clipy2)
393         {
394            int fb_index = j * fb_width;
313395#if defined(MAGICDITHER) || defined(BAYERDITHER)
314         int mline = (j & 3) << 2;
396            int mline = (j & 3) << 2;
315397#endif
316         s = (int)(rect->s) << 5;
398            s = (int)(rect->s);
317399
318         for (i = x1; i < x2; i++)
319         {
320            if (i >= clipx1 && i < clipx2)
400            for (i = x1; i < x2; i++)
321401            {
322               COLOR c1, c2;
402               //if (i >= clipx1 && i < clipx2)
403               {
404                  COLOR c1, c2;
323405#if defined(ZUPDATE)
324               int rendered=0;
406                  int rendered=0;
325407#endif
326               int curpixel = fb_index + i;
327               UINT16* fbcur = &fb[curpixel ^ WORD_ADDR_XOR];
328               UINT8* hbcur = &hb[curpixel ^ BYTE_ADDR_XOR];
408                  int curpixel = fb_index + i;
409                  UINT16* fbcur = &fb[curpixel ^ WORD_ADDR_XOR];
410                  UINT8* hbcur = &hb[curpixel ^ BYTE_ADDR_XOR];
329411#if (defined(ZCOMPARE) || defined(ZUPDATE))
330               UINT16* zbcur = &zb[curpixel ^ WORD_ADDR_XOR];
331               UINT8* zhbcur = &zhb[curpixel ^ BYTE_ADDR_XOR];
412                  UINT16* zbcur = &zb[curpixel ^ WORD_ADDR_XOR];
413                  UINT8* zhbcur = &zhb[curpixel ^ BYTE_ADDR_XOR];
332414#endif
333415#if defined(MAGICDITHER) || defined(BAYERDITHER)
334               int dith = 0;
416                  int dith = 0;
335417#endif
336418
337               curpixel_cvg = 8;
419                  curpixel_cvg = 8;
338420
339               ss = s >> 5;
340               st = t >> 5;
421                  CACHE_TEXTURE_PARAMS(tex_tile);
422                  texel0_color.c = TEXTURE_PIPELINE(t, s, tex_tile);
341423
342               CACHE_TEXTURE_PARAMS(tex_tile);
343               texel0_color.c = TEXTURE_PIPELINE(ss, st, tex_tile);
424                  CACHE_TEXTURE_PARAMS(tex_tile2);
425                  texel1_color.c = TEXTURE_PIPELINE(t, s, tex_tile2);
344426
345               CACHE_TEXTURE_PARAMS(tex_tile2);
346               texel1_color.c = TEXTURE_PIPELINE(ss, st, tex_tile2);
427                  COLOR_COMBINER2_C0(c1);
428                  COLOR_COMBINER2_C1(c2);
347429
348               c1.c = COLOR_COMBINER2_C0();
349               c2.c = COLOR_COMBINER2_C1();
350
351430#if defined(MAGICDITHER)
352               dith = magic_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
431                  dith = magic_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
353432#elif defined(BAYERDITHER)
354               dith = bayer_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
433                  dith = bayer_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
355434#endif
356435
357436#if defined(ZCOMPARE)
358               if (z_compare(fbcur, hbcur, zbcur, zhbcur, ((UINT32)primitive_z)<<3,primitive_delta_z))
359               {
437                  if (z_compare(fbcur, hbcur, zbcur, zhbcur, ((UINT32)primitive_z)<<3,primitive_delta_z))
438                  {
360439#endif
361440#if defined(MAGICDITHER) || defined(BAYERDITHER)
362441#if defined(ZUPDATE)
363                  rendered = BLENDER2_16_DITH(fbcur, hbcur, c1, c2, dith);
442                     rendered = BLENDER2_16_DITH(fbcur, hbcur, c1, c2, dith);
364443#else
365                  BLENDER2_16_DITH(fbcur, hbcur, c1, c2, dith);
444                     BLENDER2_16_DITH(fbcur, hbcur, c1, c2, dith);
366445#endif
367446#else
368447#if defined(ZUPDATE)
369                  rendered = BLENDER2_16_NDITH(fbcur, hbcur, c1, c2);
448                     rendered = BLENDER2_16_NDITH(fbcur, hbcur, c1, c2);
370449#else
371                  BLENDER2_16_NDITH(fbcur, hbcur, c1, c2);
450                     BLENDER2_16_NDITH(fbcur, hbcur, c1, c2);
372451#endif
373452#endif
374453#if defined(ZCOMPARE)
454                  }
455#endif
456
457#if defined(ZUPDATE)
458                  if(rendered)
459                  {
460                     z_store(zbcur, zhbcur, ((UINT32)primitive_z) << 3,primitive_delta_z);
461                  }
462#endif
375463               }
464
465               s += (rect->dsdx);
466            }
467         }
468         t += (rect->dtdy);
469      }
470   }
471   else
472   {
473      for (j = y1; j < y2; j++)
474      {
475         //if (j >= clipy1 && j < clipy2)
476         {
477            int fb_index = j * fb_width;
478#if defined(MAGICDITHER) || defined(BAYERDITHER)
479            int mline = (j & 3) << 2;
376480#endif
481            s = (int)(rect->s);
377482
483            for (i = x1; i < x2; i++)
484            {
485               //if (i >= clipx1 && i < clipx2)
486               {
487                  COLOR c1, c2;
378488#if defined(ZUPDATE)
379               if(rendered)
380               {
381                  z_store(zbcur, zhbcur, ((UINT32)primitive_z) << 3,primitive_delta_z);
489                  int rendered=0;
490#endif
491                  int curpixel = fb_index + i;
492                  UINT16* fbcur = &fb[curpixel ^ WORD_ADDR_XOR];
493                  UINT8* hbcur = &hb[curpixel ^ BYTE_ADDR_XOR];
494#if (defined(ZCOMPARE) || defined(ZUPDATE))
495                  UINT16* zbcur = &zb[curpixel ^ WORD_ADDR_XOR];
496                  UINT8* zhbcur = &zhb[curpixel ^ BYTE_ADDR_XOR];
497#endif
498#if defined(MAGICDITHER) || defined(BAYERDITHER)
499                  int dith = 0;
500#endif
501
502                  curpixel_cvg = 8;
503
504                  CACHE_TEXTURE_PARAMS(tex_tile);
505                  texel0_color.c = TEXTURE_PIPELINE(s, t, tex_tile);
506
507                  CACHE_TEXTURE_PARAMS(tex_tile2);
508                  texel1_color.c = TEXTURE_PIPELINE(s, t, tex_tile2);
509
510                  COLOR_COMBINER2_C0(c1);
511                  COLOR_COMBINER2_C1(c2);
512
513#if defined(MAGICDITHER)
514                  dith = magic_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
515#elif defined(BAYERDITHER)
516                  dith = bayer_matrix[mline + ((i ^ WORD_ADDR_XOR) & 3)];
517#endif
518
519#if defined(ZCOMPARE)
520                  if (z_compare(fbcur, hbcur, zbcur, zhbcur, ((UINT32)primitive_z)<<3,primitive_delta_z))
521                  {
522#endif
523#if defined(MAGICDITHER) || defined(BAYERDITHER)
524#if defined(ZUPDATE)
525                     rendered = BLENDER2_16_DITH(fbcur, hbcur, c1, c2, dith);
526#else
527                     BLENDER2_16_DITH(fbcur, hbcur, c1, c2, dith);
528#endif
529#else
530#if defined(ZUPDATE)
531                     rendered = BLENDER2_16_NDITH(fbcur, hbcur, c1, c2);
532#else
533                     BLENDER2_16_NDITH(fbcur, hbcur, c1, c2);
534#endif
535#endif
536#if defined(ZCOMPARE)
537                  }
538#endif
539
540#if defined(ZUPDATE)
541                  if(rendered)
542                  {
543                     z_store(zbcur, zhbcur, ((UINT32)primitive_z) << 3,primitive_delta_z);
544                  }
545#endif
382546               }
383#endif
547
548               s += (rect->dsdx);
384549            }
385
386            s += (rect->dsdx);
387550         }
551         t += (rect->dtdy);
388552      }
389      t += (rect->dtdy);
390553   }
391554}
392555
r6819r6820
433596   int i, j;
434597   int x1, x2, y1, y2;
435598   int s, t;
436   int ss, st;
437599
438600   int clipx1, clipx2, clipy1, clipy2;
439601
r6819r6820
467629
468630   shade_color.c = 0;   // Needed by Pilotwings 64
469631
470   if(rect->flip)
632   CACHE_TEXTURE_PARAMS(tex_tile);
633
634   if(y1 < clipy1)
471635   {
472      int temp = rect->t;
473      rect->t = rect->s;
474      rect->s = temp;
475      temp = rect->dtdy;
476      rect->dtdy = rect->dsdx;
477      rect->dsdx= temp;
636      rect->t += rect->dtdy * (clipy1 - y1);
637      y1 = clipy1;
478638   }
639   if(y2 > clipy2)
640   {
641      y2 = clipy2;
642   }
643   if(x1 < clipx1)
644   {
645      rect->s += rect->dsdx * (clipx1 - x1);
646      x1 = clipx1;
647   }
648   if(x2 > clipx2)
649   {
650      x2 = clipx2;
651   }
652   rect->dsdx >>= 5;
653   rect->dtdy >>= 5;
479654
480   t = ((int)(rect->t)) << 5;
655   t = ((int)(rect->t));
481656
482   CACHE_TEXTURE_PARAMS(tex_tile);
483
484   for (j = y1; j < y2; j++)
657   if(rect->flip)
485658   {
486      int fb_index = j * fb_width;
487      if (j >= clipy1 && j < clipy2)
659      for (j = y1; j < y2; j++)
488660      {
489         s = (int)(rect->s) << 5;
661         int fb_index = j * fb_width;
662         //if (j >= clipy1 && j < clipy2)
663         {
664            s = (int)(rect->s);
490665
491         for (i = x1; i < x2; i++)
492         {
493            if (i >= clipx1 && i < clipx2)
666            for (i = x1; i < x2; i++)
494667            {
495               ss = s >> 5;
496               st = t >> 5;
668               //if (i >= clipx1 && i < clipx2)
669               {
670                  texel0_color.c = TEXTURE_PIPELINE(t, s, tex_tile);
497671
498               texel0_color.c = TEXTURE_PIPELINE(ss, st, tex_tile);
672                  curpixel_cvg = 8;
499673
500               curpixel_cvg = 8;
674                  if ((texel0_color.i.a != 0)||(!other_modes.alpha_compare_en))
675                  {
676                     fb[(fb_index + i) ^ WORD_ADDR_XOR] = ((texel0_color.i.r >> 3) << 11) | ((texel0_color.i.g >> 3) << 6) | ((texel0_color.i.b >> 3) << 1)|1;
677                  }
678               }
679               s += rect->dsdx;
680            }
681         }
682         t += rect->dtdy;
683      }
684   }
685   else
686   {
687      for (j = y1; j < y2; j++)
688      {
689         int fb_index = j * fb_width;
690         //if (j >= clipy1 && j < clipy2)
691         {
692            s = (int)(rect->s);
501693
502               if ((texel0_color.i.a != 0)||(!other_modes.alpha_compare_en))
694            for (i = x1; i < x2; i++)
695            {
696               //if (i >= clipx1 && i < clipx2)
503697               {
504                  fb[(fb_index + i) ^ WORD_ADDR_XOR] = ((texel0_color.i.r >> 3) << 11) | ((texel0_color.i.g >> 3) << 6) | ((texel0_color.i.b >> 3) << 1)|1;
698                  texel0_color.c = TEXTURE_PIPELINE(s, t, tex_tile);
699
700                  curpixel_cvg = 8;
701
702                  if ((texel0_color.i.a != 0)||(!other_modes.alpha_compare_en))
703                  {
704                     fb[(fb_index + i) ^ WORD_ADDR_XOR] = ((texel0_color.i.r >> 3) << 11) | ((texel0_color.i.g >> 3) << 6) | ((texel0_color.i.b >> 3) << 1)|1;
705                  }
505706               }
707               s += rect->dsdx;
506708            }
507            s += rect->dsdx;
508709         }
710         t += rect->dtdy;
509711      }
510      t += rect->dtdy;
511712   }
512713}
513714
src/mame/video/rdpclamp.c
r6819r6820
1212   #endif
1313#endif
1414{
15   //int dosfrac = (tex_tile->cs || !tex_tile->mask_s);
16   //int dotfrac = (tex_tile->ct || !tex_tile->mask_t);
1715#if defined(DOS)
1816   if (*S & 0x10000)
1917   {
src/mame/video/rdpupd16.c
r6819r6820
8181#if defined(FSAA)
8282            //if (/*!vibuffering &&*/ curpixel_cvg < 7 && i > 1 && j > 1 && i < (hres - 2) && j < (vres - 2))
8383            //{
84               //video_filter16(&r, &g, &b, &frame_buffer[pixels ^ WORD_ADDR_XOR],&hidden_buffer[pixels ^ BYTE_ADDR_XOR], n64_vi_width);
84               //video_filter16(&c.i.r, &c.i.g, &c.i.b, &frame_buffer[pixels ^ WORD_ADDR_XOR],&hidden_buffer[pixels ^ BYTE_ADDR_XOR], n64_vi_width);
8585            //}
8686#endif
8787            //else if (dither_filter && curpixel_cvg == 7 && i > 0 && j > 0 && i < (hres - 1) && j < (vres - 1))
r6819r6820
9292               //}
9393               //else
9494               //{
95                  //restore_filter16(&r, &g, &b, &frame_buffer[pixels ^ WORD_ADDR_XOR], pixels ^ WORD_ADDR_XOR, n64_vi_width);
95                  //restore_filter16(&c.i.r, &c.i.g, &c.i.b, &frame_buffer[pixels ^ WORD_ADDR_XOR], pixels ^ WORD_ADDR_XOR, n64_vi_width);
9696               //}
9797            //}
9898#if defined(DIVOT)
r6819r6820
104104               //}
105105               //else
106106               //{
107                  divot_filter16(&c.i.r, &c.i.g, &c.i.b, &frame_buffer[pixels ^ WORD_ADDR_XOR], pixels ^ WORD_ADDR_XOR);
107                  //divot_filter16(&c.i.r, &c.i.g, &c.i.b, &frame_buffer[pixels ^ WORD_ADDR_XOR], pixels ^ WORD_ADDR_XOR);
108108               //}
109109            }
110110#endif

Previous 15994 Revisions Next


© 1998-2018 The MESS Team