/[pcsx2_0.9.7]/trunk/plugins/zzogl-pg/opengl/NewRegs.cpp
ViewVC logotype

Contents of /trunk/plugins/zzogl-pg/opengl/NewRegs.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 280 - (show annotations) (download)
Thu Dec 23 12:02:12 2010 UTC (9 years, 2 months ago) by william
File size: 29586 byte(s)
re-commit (had local access denied errors when committing)
1 /* ZZ Open GL graphics plugin
2 * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
3 * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20 #include "GS.h"
21 #include "Mem.h"
22 #include "NewRegs.h"
23 #include "PS2Etypes.h"
24
25 #include "targets.h"
26
27 #ifdef USE_OLD_REGS
28 #include "Regs.h"
29 #else
30 #include "ZZoglVB.h"
31 #include "ZZoglDrawing.h"
32
33 #ifdef _MSC_VER
34 #pragma warning(disable:4244)
35 #endif
36
37 GIFRegHandler g_GIFPackedRegHandlers[16];
38 GIFRegHandler g_GIFRegHandlers[256];
39 GIFRegHandler g_GIFTempRegHandlers[16] = {0};
40
41 // values for keeping track of changes
42 u32 s_uTex1Data[2][2] = {{0, }};
43 u32 s_uClampData[2] = {0, };
44
45 //u32 results[65535] = {0, };
46
47 void __gifCall GIFPackedRegHandlerNull(const u32* data)
48 {
49 FUNCLOG
50 ZZLog::Debug_Log("Unexpected packed reg handler %8.8lx_%8.8lx %x.", data[0], data[1], data[2]);
51 }
52
53 // All these just call their non-packed equivalent.
54 void __gifCall GIFPackedRegHandlerPRIM(const u32* data) { GIFRegHandlerPRIM(data); }
55
56 template <u32 i>
57 void __gifCall GIFPackedRegHandlerTEX0(const u32* data)
58 {
59 GIFRegHandlerTEX0<i>(data);
60 }
61
62 template <u32 i>
63 void __gifCall GIFPackedRegHandlerCLAMP(const u32* data)
64 {
65 GIFRegHandlerCLAMP<i>(data);
66 }
67
68 void __gifCall GIFPackedRegHandlerTEX0_1(const u32* data) { GIFRegHandlerTEX0<0>(data); }
69 void __gifCall GIFPackedRegHandlerTEX0_2(const u32* data) { GIFRegHandlerTEX0<1>(data); }
70 void __gifCall GIFPackedRegHandlerCLAMP_1(const u32* data) { GIFRegHandlerCLAMP<0>(data); }
71 void __gifCall GIFPackedRegHandlerCLAMP_2(const u32* data) { GIFRegHandlerCLAMP<1>(data); }
72 void __gifCall GIFPackedRegHandlerXYZF3(const u32* data) { GIFRegHandlerXYZF3(data); }
73 void __gifCall GIFPackedRegHandlerXYZ3(const u32* data) { GIFRegHandlerXYZ3(data); }
74
75 void __gifCall GIFPackedRegHandlerRGBA(const u32* data)
76 {
77 FUNCLOG
78
79 GIFPackedRGBA* r = (GIFPackedRGBA*)(data);
80 gs.rgba = (r->R | (r->G << 8) | (r->B << 16) | (r->A << 24));
81 gs.vertexregs.rgba = gs.rgba;
82 gs.vertexregs.q = gs.q;
83
84 ZZLog::Greg_Log("Packed RGBA: 0x%x", gs.rgba);
85 }
86
87 void __gifCall GIFPackedRegHandlerSTQ(const u32* data)
88 {
89 FUNCLOG
90 GIFPackedSTQ* r = (GIFPackedSTQ*)(data);
91 gs.vertexregs.s = r->S;
92 gs.vertexregs.t = r->T;
93 gs.q = r->Q;
94 ZZLog::Greg_Log("Packed STQ: 0x%x, 0x%x, %f", r->S, r->T, r->Q);
95 }
96
97 void __gifCall GIFPackedRegHandlerUV(const u32* data)
98 {
99 FUNCLOG
100 GIFPackedUV* r = (GIFPackedUV*)(data);
101 gs.vertexregs.u = r->U;
102 gs.vertexregs.v = r->V;
103 ZZLog::Greg_Log("Packed UV: 0x%x, 0x%x", r->U, r->V);
104 }
105
106 void __gifCall GIFPackedRegHandlerXYZF2(const u32* data)
107 {
108 FUNCLOG
109 GIFPackedXYZF2* r = (GIFPackedXYZF2*)(data);
110 gs.add_vertex(r->X, r->Y,r->Z, r->F);
111
112 // Fix Vertexes up later.
113 ZZKick->KickVertex(!!(r->ADC));
114 ZZLog::Greg_Log("Packed XYZF2: 0x%x, 0x%x, 0x%x, %f", r->X, r->Y, r->Z, r->F);
115 }
116
117 void __gifCall GIFPackedRegHandlerXYZ2(const u32* data)
118 {
119 FUNCLOG
120 GIFPackedXYZ2* r = (GIFPackedXYZ2*)(data);
121 gs.add_vertex(r->X, r->Y,r->Z);
122
123 // Fix Vertexes up later.
124 ZZKick->KickVertex(!!(r->ADC));
125 ZZLog::Greg_Log("Packed XYZ2: 0x%x, 0x%x, 0x%x", r->X, r->Y, r->Z);
126 }
127
128 void __gifCall GIFPackedRegHandlerFOG(const u32* data)
129 {
130 FUNCLOG
131 GIFPackedFOG* r = (GIFPackedFOG*)(data);
132 gs.vertexregs.f = r->F;
133 ZZLog::Greg_Log("Packed FOG: 0x%x", r->F);
134 }
135
136 void __gifCall GIFPackedRegHandlerA_D(const u32* data)
137 {
138 FUNCLOG
139 GIFPackedA_D* r = (GIFPackedA_D*)(data);
140
141 g_GIFRegHandlers[r->ADDR](data);
142 ZZLog::Greg_Log("Packed A_D: 0x%x", r->ADDR);
143 }
144
145 void __gifCall GIFPackedRegHandlerNOP(const u32* data)
146 {
147 FUNCLOG
148 }
149
150 void __gifCall GIFRegHandlerNull(const u32* data)
151 {
152 FUNCLOG
153 #ifdef _DEBUG
154
155 if ((((uptr)&data[2])&0xffff) == 0) return;
156
157 // 0x7f happens on a lot of games
158 if (data[2] != 0x7f && (data[0] || data[1]))
159 {
160 ZZLog::Debug_Log("Unexpected reg handler %x %x %x.", data[0], data[1], data[2]);
161 }
162
163 #endif
164 }
165
166 void __gifCall GIFRegHandlerRGBAQ(const u32* data)
167 {
168 FUNCLOG
169 GIFRegRGBAQ* r = (GIFRegRGBAQ*)(data);
170 gs.rgba = (r->R | (r->G << 8) | (r->B << 16) | (r->A << 24));
171 gs.vertexregs.rgba = gs.rgba;
172 gs.vertexregs.q = r->Q;
173 ZZLog::Greg_Log("RGBAQ: 0x%x, 0x%x, 0x%x, %f", r->R, r->G, r->B, r->A, r->Q);
174 }
175
176 void __gifCall GIFRegHandlerST(const u32* data)
177 {
178 FUNCLOG
179 GIFRegST* r = (GIFRegST*)(data);
180 gs.vertexregs.s = r->S;
181 gs.vertexregs.t = r->T;
182 ZZLog::Greg_Log("ST: 0x%x, 0x%x", r->S, r->T);
183 }
184
185 void __gifCall GIFRegHandlerUV(const u32* data)
186 {
187 // Baroque breaks if u&v are 16 bits instead of 14.
188 FUNCLOG
189 GIFRegUV* r = (GIFRegUV*)(data);
190 gs.vertexregs.u = r->U;
191 gs.vertexregs.v = r->V;
192 ZZLog::Greg_Log("UV: 0x%x, 0x%x", r->U, r->V);
193 }
194
195 void __gifCall GIFRegHandlerXYZF2(const u32* data)
196 {
197 FUNCLOG
198 GIFRegXYZF* r = (GIFRegXYZF*)(data);
199 gs.add_vertex(r->X, r->Y,r->Z, r->F);
200
201 ZZKick->KickVertex(false);
202 ZZLog::Greg_Log("XYZF2: 0x%x, 0x%x, 0x%x, %f", r->X, r->Y, r->Z, r->F);
203 }
204
205 void __gifCall GIFRegHandlerXYZ2(const u32* data)
206 {
207 FUNCLOG
208 GIFRegXYZ* r = (GIFRegXYZ*)(data);
209 gs.add_vertex(r->X, r->Y,r->Z);
210
211 ZZKick->KickVertex(false);
212 ZZLog::Greg_Log("XYZF2: 0x%x, 0x%x, 0x%x", r->X, r->Y, r->Z);
213 }
214
215 template <u32 i>
216 void __gifCall GIFRegHandlerTEX0(const u32* data)
217 {
218 // Used on Mana Khemias opening dialog.
219 FUNCLOG
220
221 GIFRegTEX0* r = (GIFRegTEX0*)(data);
222 u32 psm = ZZOglGet_psm_TexBitsFix(data[0]);
223
224 ZZLog::Greg_Log("TEX0_%d: 0x%x", i, data);
225
226 // Worry about this later.
227 if (!NoHighlights(i)) return;
228
229 if (m_Blocks[psm].bpp == 0)
230 {
231 // kh and others
232 return;
233 }
234
235 // Order is important.
236 vb[i].uNextTex0Data[0] = r->ai32[0];
237 vb[i].uNextTex0Data[1] = r->ai32[1];
238 vb[i].bNeedTexCheck = 1;
239
240 // don't update unless necessary
241 if (PSMT_ISCLUT(psm))
242 {
243 if (CheckChangeInClut(data[1], psm))
244 {
245 // loading clut, so flush whole texture
246 vb[i].FlushTexData();
247 }
248 else if (r->CSA != (vb[i].uCurTex0.CSA))
249 {
250 // check if csa is the same!! (ffx bisaid island, grass)
251 Flush(i); // flush any previous entries
252 }
253 }
254 }
255
256 template <u32 i>
257 void __gifCall GIFRegHandlerCLAMP(const u32* data)
258 {
259 FUNCLOG
260 clampInfo& clamp = vb[i].clamp;
261 GIFRegCLAMP* r = (GIFRegCLAMP*)(data);
262
263 // Worry about this later.
264 if (!NoHighlights(i)) return;
265
266 if ((s_uClampData[i] != data[0]) || (((clamp.minv >> 8) | (clamp.maxv << 2)) != (data[1]&0x0fff)))
267 {
268 Flush(i);
269
270 vb[i].bTexConstsSync = false;
271 }
272
273 s_uClampData[i] = data[0];
274
275 clamp.wms = r->WMS;
276 clamp.wmt = r->WMT;
277 clamp.minu = r->MINU;
278 clamp.maxu = r->MAXU;
279 clamp.minv = r->MINV;
280 clamp.maxv = r->MAXV;
281 ZZLog::Greg_Log("CLAMP_%d: 0x%x", i, data);
282 }
283
284 void __gifCall GIFRegHandlerFOG(const u32* data)
285 {
286 FUNCLOG
287 GIFRegFOG* r = (GIFRegFOG*)(data);
288 gs.vertexregs.f = r->F;
289 ZZLog::Greg_Log("FOG: 0x%x", r->F);
290 }
291
292 void __gifCall GIFRegHandlerXYZF3(const u32* data)
293 {
294 FUNCLOG
295 GIFRegXYZF* r = (GIFRegXYZF*)(data);
296 gs.add_vertex(r->X, r->Y,r->Z, r->F);
297
298 ZZKick->KickVertex(true);
299 ZZLog::Greg_Log("XYZF3: 0x%x, 0x%x, 0x%x, %f", r->X, r->Y, r->Z, r->F);
300 }
301
302 void __gifCall GIFRegHandlerXYZ3(const u32* data)
303 {
304 FUNCLOG
305 GIFRegXYZ* r = (GIFRegXYZ*)(data);
306 gs.add_vertex(r->X, r->Y,r->Z);
307
308 ZZKick->KickVertex(true);
309 ZZLog::Greg_Log("XYZ3: 0x%x, 0x%x, 0x%x", r->X, r->Y, r->Z);
310 }
311
312 void __gifCall GIFRegHandlerNOP(const u32* data)
313 {
314 FUNCLOG
315 }
316
317 template <u32 i>
318 void __fastcall GIFRegHandlerTEX1(const u32* data)
319 {
320 FUNCLOG
321 GIFRegTEX1* r = (GIFRegTEX1*)(data);
322 tex1Info& tex1 = vb[i].tex1;
323
324 // Worry about this later.
325 if (!NoHighlights(i)) return;
326
327 if (conf.bilinear == 1 && (tex1.mmag != r->MMAG || tex1.mmin != r->MMIN))
328 {
329 Flush(i);
330 vb[i].bVarsTexSync = false;
331 }
332
333 tex1.lcm = r->LCM;
334
335 tex1.mxl = r->MXL;
336 tex1.mmag = r->MMAG;
337 tex1.mmin = r->MMIN;
338 tex1.mtba = r->MTBA;
339 tex1.l = r->L;
340 tex1.k = r->K;
341 ZZLog::Greg_Log("TEX1_%d: 0x%x", i, data);
342 }
343
344 template <u32 i>
345 void __gifCall GIFRegHandlerTEX2(const u32* data)
346 {
347 FUNCLOG
348 tex0Info& tex0 = vb[i].tex0;
349
350 vb[i].FlushTexData();
351
352 u32 psm = ZZOglGet_psm_TexBitsFix(data[0]);
353
354 u32* s_uTex0Data = vb[i].uCurTex0Data;
355
356 // don't update unless necessary
357 // if( ZZOglGet_psm_TexBitsFix(*s_uTex0Data) == ZZOglGet_psm_TexBitsFix(data[0]) ) { // psm is the same
358 if (ZZOglAllExceptClutIsSame(s_uTex0Data, data))
359 {
360 if (!PSMT_ISCLUT(psm)) return;
361
362 // have to write the CLUT again if changed
363 if (ZZOglClutMinusCLDunchanged(s_uTex0Data, data))
364 {
365 tex0.cld = ZZOglGet_cld_TexBits(data[1]);
366
367 if (tex0.cld != 0)
368 {
369 texClutWrite(i);
370 // invalidate to make sure target didn't change!
371 vb[i].bVarsTexSync = false;
372 }
373
374 return;
375 }
376 }
377
378 Flush(i);
379
380 vb[i].bVarsTexSync = false;
381 vb[i].bTexConstsSync = false;
382
383 s_uTex0Data[0] = (s_uTex0Data[0] & ~0x03f00000) | (psm << 20);
384 s_uTex0Data[1] = (s_uTex0Data[1] & 0x1f) | (data[1] & ~0x1f);
385
386 tex0.psm = ZZOglGet_psm_TexBitsFix(data[0]);
387
388 if (PSMT_ISCLUT(tex0.psm)) CluttingForFlushedTex(&tex0, data[1], i);
389 ZZLog::Greg_Log("TEX2_%d: 0x%x", i, data);
390 }
391
392 template <u32 i>
393 void __gifCall GIFRegHandlerXYOFFSET(const u32* data)
394 {
395 FUNCLOG
396 // Affects that Mana Khemia opening dialog (when i == 0).
397 GIFRegXYOFFSET* r = (GIFRegXYOFFSET*)(data);
398 vb[i].offset.x = r->OFX;
399 vb[i].offset.y = r->OFY;
400 ZZLog::Greg_Log("XYOFFSET_%d: 0x%x, 0x%x", i, r->OFX, r->OFY);
401 }
402
403 // Fill out the vertex queue(prim) and the attributes.
404 void __gifCall GIFRegHandlerPRIM(const u32 *data)
405 {
406 FUNCLOG
407 GIFRegPRIM* r = (GIFRegPRIM*)(data);
408
409 //if (data[0] & ~0x3ff)
410 //{
411 //ZZLog::Warn_Log("Warning: unknown bits in prim %8.8lx_%8.8lx", data[1], data[0]);
412 //}
413
414 gs.primC = 0;
415 prim->prim = r->PRIM;
416 gs._prim[0].prim = r->PRIM;
417 gs._prim[1].prim = r->PRIM;
418 gs._prim[1]._val = (data[0] >> 3) & 0xff; // Setting the next 8 flags after prim at once.
419
420 gs.new_tri_fan = !(r->PRIM ^ PRIM_TRIANGLE_FAN);
421 ZZKick->DirtyValidPrevPrim();
422
423 Prim();
424 ZZLog::Greg_Log("PRIM");
425 }
426
427 // Fill out an alternate set of attributes.
428 void __gifCall GIFRegHandlerPRMODE(const u32* data)
429 {
430 FUNCLOG
431 //GIFRegPRMODE* r = (GIFRegPRMODE*)(data);
432 // Re-examine all code dealing with PRIMs in a bit.
433 gs._prim[0]._val = (data[0] >> 3) & 0xff;
434
435 if (gs.prac == 0) Prim();
436 ZZLog::Greg_Log("PRMODE");
437 }
438
439 // Switch between the primary set of attributes (gs._prim[1]) and the secondary (gs._prim[0]).
440 void __gifCall GIFRegHandlerPRMODECONT(const u32* data)
441 {
442 FUNCLOG
443 // Turns all the text into colored blocks on the initial Mana Khemia dialog if not run.
444 GIFRegPRMODECONT* r = (GIFRegPRMODECONT*)(data);
445 gs.prac = r->AC;
446 prim = &gs._prim[gs.prac];
447
448 Prim();
449 ZZLog::Greg_Log("PRMODECONT");
450 }
451
452 void __gifCall GIFRegHandlerTEXCLUT(const u32* data)
453 {
454 FUNCLOG
455 // Affects background coloration of initial Mana Khemia dialog.
456 GIFRegTEXCLUT* r = (GIFRegTEXCLUT*)(data);
457
458 vb[0].FlushTexData();
459 vb[1].FlushTexData();
460
461 // Fixme.
462 gs.clut.cbw = r->CBW << 6;
463 gs.clut.cou = r->COU << 4;
464 gs.clut.cov = r->COV;
465 ZZLog::Greg_Log("TEXCLUT: CBW:0x%x, COU:0x%x, COV:0x%x",r->CBW, r->COU, r->COV);
466 }
467
468 void __gifCall GIFRegHandlerSCANMSK(const u32* data)
469 {
470 FUNCLOG
471 GIFRegSCANMSK* r = (GIFRegSCANMSK*)(data);
472
473 if(r->MSK != gs.smask)
474 {
475 FlushBoth();
476 // ResolveC(&vb[0]);
477 // ResolveZ(&vb[0]);
478 }
479
480 gs.smask = r->MSK;
481 ZZLog::Greg_Log("SCANMSK: 0x%x",r->MSK);
482 }
483
484 template <u32 i>
485 void __gifCall GIFRegHandlerMIPTBP1(const u32* data)
486 {
487 FUNCLOG
488 GIFRegMIPTBP1* r = (GIFRegMIPTBP1*)(data);
489 /*if(PRIM->CTXT == i && r != miptbp0)
490 {
491 Flush();
492 }*/
493
494 miptbpInfo& miptbp0 = vb[i].miptbp0;
495 miptbp0.tbp[0] = r->TBP1;
496 miptbp0.tbw[0] = r->TBW1;
497 miptbp0.tbp[1] = r->TBP2;
498 miptbp0.tbw[1] = r->TBW2;
499 miptbp0.tbp[2] = r->TBP3;
500 miptbp0.tbw[2] = r->TBW3;
501 ZZLog::Greg_Log("MIPTBP1_%d: TBP/TBW: (0x%x, 0x%x), (0x%x, 0x%x), (0x%x, 0x%x)", i, r->TBP1, r->TBW1, r->TBP2, r->TBW2, r->TBP3, r->TBW3);
502 }
503
504 template <u32 i>
505 void __gifCall GIFRegHandlerMIPTBP2(const u32* data)
506 {
507 FUNCLOG
508 GIFRegMIPTBP2* r = (GIFRegMIPTBP2*)(data);
509 // Yep.
510
511 miptbpInfo& miptbp1 = vb[i].miptbp1;
512 miptbp1.tbp[0] = r->TBP4;
513 miptbp1.tbw[0] = r->TBW4;
514 miptbp1.tbp[1] = r->TBP5;
515 miptbp1.tbw[1] = r->TBW5;
516 miptbp1.tbp[2] = r->TBP6;
517 miptbp1.tbw[2] = r->TBW6;
518 ZZLog::Greg_Log("MIPTBP2_%d: TBP/TBW: (0x%x, 0x%x), (0x%x, 0x%x), (0x%x, 0x%x)", i, r->TBP4, r->TBW4, r->TBP5, r->TBW5, r->TBP6, r->TBW6);
519 }
520
521 void __gifCall GIFRegHandlerTEXA(const u32* data)
522 {
523 FUNCLOG
524 // Background of initial Mana Khemia dialog.
525 GIFRegTEXA* r = (GIFRegTEXA*)(data);
526
527 if ((r->AEM != gs.texa.aem) || (r->TA0 != gs.texa.ta[0]) || (r->TA1 != gs.texa.ta[1]))
528 {
529 FlushBoth();
530
531 vb[0].bTexConstsSync = false;
532 vb[1].bTexConstsSync = false;
533 }
534
535 gs.texa.aem = r->AEM;
536 gs.texa.ta[0] = r->TA0;
537 gs.texa.ta[1] = r->TA1;
538 gs.texa.fta[0] = r->TA0 / 255.0f;
539 gs.texa.fta[1] = r->TA1 / 255.0f;
540 ZZLog::Greg_Log("TEXA: AEM:0x%x, TA0:0x%x, TA1:0x%x", r->AEM, r->TA0, r->TA1);
541 }
542
543 void __gifCall GIFRegHandlerFOGCOL(const u32* data)
544 {
545 FUNCLOG
546 GIFRegFOGCOL* r = (GIFRegFOGCOL*)(data);
547
548 if (gs.fogcol != r->ai32[0])
549 {
550 FlushBoth();
551 }
552
553 SetFogColor(r);
554 gs.fogcol = r->ai32[0];
555 ZZLog::Greg_Log("FOGCOL: 0x%x", r->ai32[0]);
556 }
557
558 void __gifCall GIFRegHandlerTEXFLUSH(const u32* data)
559 {
560 FUNCLOG
561 // GSdx doesn't even do anything here.
562 SetTexFlush();
563 ZZLog::Greg_Log("TEXFLUSH");
564 }
565
566 template <u32 i>
567 void __gifCall GIFRegHandlerSCISSOR(const u32* data)
568 {
569 FUNCLOG
570 GIFRegSCISSOR* r = (GIFRegSCISSOR*)(data);
571 Rect2& scissor = vb[i].scissor;
572
573 Rect2 newscissor;
574
575 // << 3?
576 newscissor.x0 = r->SCAX0 << 3;
577 newscissor.x1 = r->SCAX1 << 3;
578 newscissor.y0 = r->SCAY0 << 3;
579 newscissor.y1 = r->SCAY1 << 3;
580
581 if (newscissor.x1 != scissor.x1 || newscissor.y1 != scissor.y1 ||
582 newscissor.x0 != scissor.x0 || newscissor.y0 != scissor.y0)
583 {
584 Flush(i);
585
586 // flush everything
587 vb[i].bNeedFrameCheck = 1;
588 }
589
590 scissor = newscissor;
591
592 //Hmm...
593 /*
594 if(PRIM->CTXT == i && r->SCISSOR != m_env.CTXT[i].SCISSOR)
595 {
596 Flush();
597 }
598
599 m_env.CTXT[i].SCISSOR = (GSVector4i)r->SCISSOR;
600
601 m_env.CTXT[i].UpdateScissor();*/
602 ZZLog::Greg_Log("SCISSOR%d", i);
603 }
604
605 template <u32 i>
606 void __gifCall GIFRegHandlerALPHA(const u32* data)
607 {
608 FUNCLOG
609 // Mana Khemia Opening Dialog (when i = 0).
610 GIFRegALPHA* r = (GIFRegALPHA*)(data);
611 alphaInfo newalpha;
612
613 newalpha.a = r->A;
614 newalpha.b = r->B;
615 newalpha.c = r->C;
616 newalpha.d = r->D;
617 newalpha.fix = r->FIX;
618
619 if (newalpha.a == 3) newalpha.a = 0;
620 if (newalpha.b == 3) newalpha.b = 0;
621 if (newalpha.c == 3) newalpha.c = 0;
622 if (newalpha.d == 3) newalpha.d = 0;
623
624 if ((newalpha.abcd != vb[i].alpha.abcd) || (newalpha.fix != vb[i].alpha.fix))
625 {
626 Flush(i);
627 }
628
629 vb[i].alpha = newalpha;
630 ZZLog::Greg_Log("ALPHA%d: A:0x%x B:0x%x C:0x%x D:0x%x FIX:0x%x ", i, r->A, r->B, r->C, r->D, r->FIX);
631 }
632
633 void __gifCall GIFRegHandlerDIMX(const u32* data)
634 {
635 FUNCLOG
636
637 GIFRegDIMX* r = (GIFRegDIMX*)(data);
638 // Not even handled? Fixme.
639 bool update = false;
640
641 if (r->i64 != gs.dimx.i64)
642 {
643 FlushBoth();
644
645 update = true;
646 }
647
648 gs.dimx.i64 = r->i64;
649
650 if (update)
651 {
652 //gs.UpdateDIMX();
653 }
654 ZZLog::Greg_Log("DIMX");
655 }
656
657 void __gifCall GIFRegHandlerDTHE(const u32* data)
658 {
659 FUNCLOG
660 GIFRegDTHE* r = (GIFRegDTHE*)(data);
661
662 if (r->DTHE != gs.dthe)
663 {
664 FlushBoth();
665 }
666
667 gs.dthe = r->DTHE;
668 ZZLog::Greg_Log("DTHE: 0x%x ", r->DTHE);
669 }
670
671 void __gifCall GIFRegHandlerCOLCLAMP(const u32* data)
672 {
673 FUNCLOG
674 GIFRegCOLCLAMP* r = (GIFRegCOLCLAMP*)(data);
675
676 if (r->CLAMP != gs.colclamp)
677 {
678 FlushBoth();
679 }
680
681 gs.colclamp = r->CLAMP;
682 ZZLog::Greg_Log("COLCLAMP: 0x%x ", r->CLAMP);
683 }
684
685 template <u32 i>
686 void __gifCall GIFRegHandlerTEST(const u32* data)
687 {
688 FUNCLOG
689 pixTest* test = &vb[i].test;
690 GIFRegTEST* r = (GIFRegTEST*)(data);
691
692 if (test->_val != r->ai32[0])
693 {
694 Flush(i);
695 }
696
697 test->_val = r->ai32[0];
698 ZZLog::Greg_Log("TEST%d", i);
699 }
700
701 void __gifCall GIFRegHandlerPABE(const u32* data)
702 {
703 FUNCLOG
704 GIFRegPABE* r = (GIFRegPABE*)(data);
705
706 if (gs.pabe != r->PABE)
707 {
708 FlushBoth();
709 // SetAlphaChanged(0, GPUREG_PABE);
710 // SetAlphaChanged(1, GPUREG_PABE);
711 }
712
713 gs.pabe = r->PABE;
714 ZZLog::Greg_Log("PABE: 0x%x ", r->PABE);
715 }
716
717 template <u32 i>
718 void __gifCall GIFRegHandlerFBA(const u32* data)
719 {
720 FUNCLOG
721 GIFRegFBA* r = (GIFRegFBA*)(data);
722
723 if (r->FBA != vb[i].fba.fba)
724 {
725 FlushBoth();
726 }
727
728 vb[i].fba.fba = r->FBA;
729 ZZLog::Greg_Log("FBA%d: 0x%x ", i, r->FBA);
730 }
731
732 template<u32 i>
733 void __gifCall GIFRegHandlerFRAME(const u32* data)
734 {
735 FUNCLOG
736 // Affects opening dialogs, movie, and menu on Mana Khemia.
737
738 GIFRegFRAME* r = (GIFRegFRAME*)(data);
739 frameInfo& gsfb = vb[i].gsfb;
740
741 int fbw = r->FBW * 64;
742 int fbp = r->FBP * 32;
743 int fbh = 0;
744
745 if (gs.dthe != 0)
746 {
747 // Dither here.
748 //ZZLog::Error_Log("frameWrite: Dither!");
749 }
750
751 if ((gsfb.fbp == fbp) &&
752 (gsfb.fbw == fbw) &&
753 (gsfb.psm == r->PSM) &&
754 (gsfb.fbm == ZZOglGet_fbm_FrameBitsFix(data[0], data[1])))
755 {
756 return;
757 }
758
759 FlushBoth();
760 if (r->FBW > 0) fbh = ZZOgl_fbh_Calc(r->FBP, r->FBW, r->PSM);
761
762 gsfb.fbp = fbp;
763 gsfb.fbw = fbw;
764 gsfb.psm = r->PSM;
765 gsfb.fbh = fbh;
766 gsfb.fbm = ZZOglGet_fbm_FrameBitsFix(data[0], data[1]);
767
768
769 vb[i].bNeedFrameCheck = 1;
770 ZZLog::Greg_Log("FRAME_%d", i);
771 }
772
773 template <u32 i>
774 void __gifCall GIFRegHandlerZBUF(const u32* data)
775 {
776 FUNCLOG
777 // I'll wait a bit on this one.
778 GIFRegZBUF* r = (GIFRegZBUF*)(data);
779 ZZLog::Greg_Log("ZBUF_1");
780
781 zbufInfo& zbuf = vb[i].zbuf;
782 int psm = (0x30 | r->PSM);
783 int zbp = r->ZBP * 32;
784
785 if (zbuf.zbp == zbp &&
786 zbuf.psm == psm &&
787 zbuf.zmsk == r->ZMSK)
788 {
789 return;
790 }
791
792 // error detection
793 if (m_Blocks[psm].bpp == 0) return;
794
795 FlushBoth();
796
797 zbuf.zbp = zbp;
798 zbuf.psm = psm;
799 zbuf.zmsk = r->ZMSK;
800
801 vb[i].zprimmask = 0xffffffff;
802
803 if (zbuf.psm > 0x31) vb[i].zprimmask = 0xffff;
804
805 vb[i].bNeedZCheck = 1;
806 }
807
808 void __gifCall GIFRegHandlerBITBLTBUF(const u32* data)
809 {
810 FUNCLOG
811 // Required for *all* graphics. (Checked on Mana Khemia)
812
813 GIFRegBITBLTBUF* r = (GIFRegBITBLTBUF*)(data);
814 // Wonder why the shift?
815 gs.srcbufnew.bp = r->SBP; // * 64;
816 gs.srcbufnew.bw = r->SBW << 6;
817 gs.srcbufnew.psm = r->SPSM;
818 gs.dstbufnew.bp = r->DBP; // * 64;
819 gs.dstbufnew.bw = r->DBW << 6;
820 gs.dstbufnew.psm = r->DPSM;
821
822 if (gs.dstbufnew.bw == 0) gs.dstbufnew.bw = 64;
823 // GSdx does this:
824
825 /*if((gs.srcbufnew.bw & 1) && (gs.srcbufnew.psm == PSM_PSMT8 || gs.srcbufnew.psm == PSM_PSMT4))
826 {
827 gs.srcbufnew.bw &= ~1;
828 }
829
830 if((gs.dstbufnew.bw & 1) && (gs.dstbufnew.psm == PSM_PSMT8 || gs.dstbufnew.psm == PSM_PSMT4))
831 {
832 gs.dstbufnew.bw &= ~1; // namcoXcapcom: 5, 11, refered to as 4, 10 in TEX0.TBW later
833 }*/
834 ZZLog::Greg_Log("BITBLTBUF");
835 }
836
837 void __gifCall GIFRegHandlerTRXPOS(const u32* data)
838 {
839 // Affects Mana Khemia opening background.
840 FUNCLOG
841 GIFRegTRXPOS* r = (GIFRegTRXPOS*)(data);
842
843 gs.trxposnew.sx = r->SSAX;
844 gs.trxposnew.sy = r->SSAY;
845 gs.trxposnew.dx = r->DSAX;
846 gs.trxposnew.dy = r->DSAY;
847 gs.trxposnew.dirx = r->DIRX;
848 gs.trxposnew.diry = r->DIRY;
849 ZZLog::Greg_Log("TRXPOS: SSA:(0x%x/0x%x) DSA:(0x%x/0x%x) DIR:(0x%x/0x%x)", r->SSAX, r->SSAY, r->DSAX, r->DSAY, r->DIRX, r->DIRY);
850 }
851
852 void __gifCall GIFRegHandlerTRXREG(const u32* data)
853 {
854 FUNCLOG
855 GIFRegTRXREG* r = (GIFRegTRXREG*)(data);
856 gs.imageWtemp = r->RRW;
857 gs.imageHtemp = r->RRH;
858 ZZLog::Greg_Log("TRXREG: RRW: 0x%x, RRH: 0x%x", r->RRW, r->RRH);
859 }
860
861 void __gifCall GIFRegHandlerTRXDIR(const u32* data)
862 {
863 FUNCLOG
864 GIFRegTRXDIR* r = (GIFRegTRXDIR*)(data);
865 // Oh dear...
866
867 // terminate any previous transfers
868
869 switch (gs.imageTransfer)
870 {
871 case 0: // host->loc
872 TerminateHostLocal();
873 break;
874
875 case 1: // loc->host
876 TerminateLocalHost();
877 break;
878 }
879
880 gs.srcbuf = gs.srcbufnew;
881 gs.dstbuf = gs.dstbufnew;
882 gs.trxpos = gs.trxposnew;
883
884 gs.imageTransfer = r->XDIR;
885 gs.imageWnew = gs.imageWtemp;
886 gs.imageHnew = gs.imageHtemp;
887
888 if (gs.imageWnew > 0 && gs.imageHnew > 0)
889 {
890 switch (gs.imageTransfer)
891 {
892 case 0: // host->loc
893 InitTransferHostLocal();
894 break;
895
896 case 1: // loc->host
897 InitTransferLocalHost();
898 break;
899
900 case 2:
901 TransferLocalLocal();
902 break;
903
904 case 3:
905 gs.imageTransfer = -1;
906 break;
907
908 default:
909 assert(0);
910 }
911 }
912 else
913 {
914 #if defined(ZEROGS_DEVBUILD)
915 ZZLog::Warn_Log("Dummy transfer.");
916 #endif
917 gs.imageTransfer = -1;
918 }
919 ZZLog::Greg_Log("TRXDIR");
920 }
921
922 void __gifCall GIFRegHandlerHWREG(const u32* data)
923 {
924 FUNCLOG
925
926 if (gs.imageTransfer == 0)
927 {
928 TransferHostLocal(data, 2);
929 }
930 else
931 {
932 #if defined(ZEROGS_DEVBUILD)
933 ZZLog::Error_Log("ZeroGS: HWREG!? %8.8x_%8.8x", data[0], data[1]);
934 //assert(0);
935 #endif
936 }
937 ZZLog::Greg_Log("HWREG");
938 }
939
940 extern int g_GSMultiThreaded;
941
942 void __gifCall GIFRegHandlerSIGNAL(const u32* data)
943 {
944 FUNCLOG
945
946 if (!g_GSMultiThreaded)
947 {
948 SIGLBLID->SIGID = (SIGLBLID->SIGID & ~data[1]) | (data[0] & data[1]);
949
950 if (gs.CSRw & 0x1)
951 {
952 CSR->SIGNAL = 1;
953 }
954
955 if (!IMR->SIGMSK && GSirq) GSirq();
956 }
957 }
958
959 void __gifCall GIFRegHandlerFINISH(const u32* data)
960 {
961 FUNCLOG
962
963 if (!g_GSMultiThreaded)
964 {
965 if (gs.CSRw & 0x2) CSR->FINISH = 1;
966
967 if (!IMR->FINISHMSK && GSirq) GSirq();
968 }
969 }
970
971 void __gifCall GIFRegHandlerLABEL(const u32* data)
972 {
973 FUNCLOG
974
975 if (!g_GSMultiThreaded)
976 {
977 SIGLBLID->LBLID = (SIGLBLID->LBLID & ~data[1]) | (data[0] & data[1]);
978 }
979 }
980
981
982 void SetMultithreaded()
983 {
984 // Some older versions of PCSX2 didn't properly set the irq callback to NULL
985 // in multithreaded mode (possibly because ZeroGS itself would assert in such
986 // cases), and didn't bind them to a dummy callback either. PCSX2 handles all
987 // IRQs internally when multithreaded anyway -- so let's ignore them here:
988
989 if (g_GSMultiThreaded)
990 {
991 g_GIFRegHandlers[GIF_A_D_REG_SIGNAL] = &GIFRegHandlerNull;
992 g_GIFRegHandlers[GIF_A_D_REG_FINISH] = &GIFRegHandlerNull;
993 g_GIFRegHandlers[GIF_A_D_REG_LABEL] = &GIFRegHandlerNull;
994 }
995 else
996 {
997 g_GIFRegHandlers[GIF_A_D_REG_SIGNAL] = &GIFRegHandlerSIGNAL;
998 g_GIFRegHandlers[GIF_A_D_REG_FINISH] = &GIFRegHandlerFINISH;
999 g_GIFRegHandlers[GIF_A_D_REG_LABEL] = &GIFRegHandlerLABEL;
1000 }
1001 }
1002
1003 void ResetRegs()
1004 {
1005 for (int i = 0; i < 16; i++)
1006 {
1007 g_GIFPackedRegHandlers[i] = &GIFPackedRegHandlerNull;
1008 }
1009
1010 g_GIFPackedRegHandlers[GIF_REG_PRIM] = &GIFPackedRegHandlerPRIM;
1011 g_GIFPackedRegHandlers[GIF_REG_RGBA] = &GIFPackedRegHandlerRGBA;
1012 g_GIFPackedRegHandlers[GIF_REG_STQ] = &GIFPackedRegHandlerSTQ;
1013 g_GIFPackedRegHandlers[GIF_REG_UV] = &GIFPackedRegHandlerUV;
1014 g_GIFPackedRegHandlers[GIF_REG_XYZF2] = &GIFPackedRegHandlerXYZF2;
1015 g_GIFPackedRegHandlers[GIF_REG_XYZ2] = &GIFPackedRegHandlerXYZ2;
1016 g_GIFPackedRegHandlers[GIF_REG_TEX0_1] = &GIFPackedRegHandlerTEX0<0>;
1017 g_GIFPackedRegHandlers[GIF_REG_TEX0_2] = &GIFPackedRegHandlerTEX0<1>;
1018 g_GIFPackedRegHandlers[GIF_REG_CLAMP_1] = &GIFPackedRegHandlerCLAMP<0>;
1019 g_GIFPackedRegHandlers[GIF_REG_CLAMP_2] = &GIFPackedRegHandlerCLAMP<1>;
1020 g_GIFPackedRegHandlers[GIF_REG_FOG] = &GIFPackedRegHandlerFOG;
1021 g_GIFPackedRegHandlers[GIF_REG_XYZF3] = &GIFPackedRegHandlerXYZF3;
1022 g_GIFPackedRegHandlers[GIF_REG_XYZ3] = &GIFPackedRegHandlerXYZ3;
1023 g_GIFPackedRegHandlers[GIF_REG_A_D] = &GIFPackedRegHandlerA_D;
1024 g_GIFPackedRegHandlers[GIF_REG_NOP] = &GIFPackedRegHandlerNOP;
1025
1026 for (int i = 0; i < 256; i++)
1027 {
1028 g_GIFRegHandlers[i] = &GIFPackedRegHandlerNull;
1029 }
1030
1031 g_GIFRegHandlers[GIF_A_D_REG_PRIM] = &GIFRegHandlerPRIM;
1032 g_GIFRegHandlers[GIF_A_D_REG_RGBAQ] = &GIFRegHandlerRGBAQ;
1033 g_GIFRegHandlers[GIF_A_D_REG_ST] = &GIFRegHandlerST;
1034 g_GIFRegHandlers[GIF_A_D_REG_UV] = &GIFRegHandlerUV;
1035 g_GIFRegHandlers[GIF_A_D_REG_XYZF2] = &GIFRegHandlerXYZF2;
1036 g_GIFRegHandlers[GIF_A_D_REG_XYZ2] = &GIFRegHandlerXYZ2;
1037 g_GIFRegHandlers[GIF_A_D_REG_TEX0_1] = &GIFRegHandlerTEX0<0>;
1038 g_GIFRegHandlers[GIF_A_D_REG_TEX0_2] = &GIFRegHandlerTEX0<1>;
1039 g_GIFRegHandlers[GIF_A_D_REG_CLAMP_1] = &GIFRegHandlerCLAMP<0>;
1040 g_GIFRegHandlers[GIF_A_D_REG_CLAMP_2] = &GIFRegHandlerCLAMP<1>;
1041 g_GIFRegHandlers[GIF_A_D_REG_FOG] = &GIFRegHandlerFOG;
1042 g_GIFRegHandlers[GIF_A_D_REG_XYZF3] = &GIFRegHandlerXYZF3;
1043 g_GIFRegHandlers[GIF_A_D_REG_XYZ3] = &GIFRegHandlerXYZ3;
1044 g_GIFRegHandlers[GIF_A_D_REG_NOP] = &GIFRegHandlerNOP;
1045 g_GIFRegHandlers[GIF_A_D_REG_TEX1_1] = &GIFRegHandlerTEX1<0>;
1046 g_GIFRegHandlers[GIF_A_D_REG_TEX1_2] = &GIFRegHandlerTEX1<1>;
1047 g_GIFRegHandlers[GIF_A_D_REG_TEX2_1] = &GIFRegHandlerTEX2<0>;
1048 g_GIFRegHandlers[GIF_A_D_REG_TEX2_2] = &GIFRegHandlerTEX2<1>;
1049 g_GIFRegHandlers[GIF_A_D_REG_XYOFFSET_1] = &GIFRegHandlerXYOFFSET<0>;
1050 g_GIFRegHandlers[GIF_A_D_REG_XYOFFSET_2] = &GIFRegHandlerXYOFFSET<1>;
1051 g_GIFRegHandlers[GIF_A_D_REG_PRMODECONT] = &GIFRegHandlerPRMODECONT;
1052 g_GIFRegHandlers[GIF_A_D_REG_PRMODE] = &GIFRegHandlerPRMODE;
1053 g_GIFRegHandlers[GIF_A_D_REG_TEXCLUT] = &GIFRegHandlerTEXCLUT;
1054 g_GIFRegHandlers[GIF_A_D_REG_SCANMSK] = &GIFRegHandlerSCANMSK;
1055 g_GIFRegHandlers[GIF_A_D_REG_MIPTBP1_1] = &GIFRegHandlerMIPTBP1<0>;
1056 g_GIFRegHandlers[GIF_A_D_REG_MIPTBP1_2] = &GIFRegHandlerMIPTBP1<1>;
1057 g_GIFRegHandlers[GIF_A_D_REG_MIPTBP2_1] = &GIFRegHandlerMIPTBP2<0>;
1058 g_GIFRegHandlers[GIF_A_D_REG_MIPTBP2_2] = &GIFRegHandlerMIPTBP2<1>;
1059 g_GIFRegHandlers[GIF_A_D_REG_TEXA] = &GIFRegHandlerTEXA;
1060 g_GIFRegHandlers[GIF_A_D_REG_FOGCOL] = &GIFRegHandlerFOGCOL;
1061 g_GIFRegHandlers[GIF_A_D_REG_TEXFLUSH] = &GIFRegHandlerTEXFLUSH;
1062 g_GIFRegHandlers[GIF_A_D_REG_SCISSOR_1] = &GIFRegHandlerSCISSOR<0>;
1063 g_GIFRegHandlers[GIF_A_D_REG_SCISSOR_2] = &GIFRegHandlerSCISSOR<1>;
1064 g_GIFRegHandlers[GIF_A_D_REG_ALPHA_1] = &GIFRegHandlerALPHA<0>;
1065 g_GIFRegHandlers[GIF_A_D_REG_ALPHA_2] = &GIFRegHandlerALPHA<1>;
1066 g_GIFRegHandlers[GIF_A_D_REG_DIMX] = &GIFRegHandlerDIMX;
1067 g_GIFRegHandlers[GIF_A_D_REG_DTHE] = &GIFRegHandlerDTHE;
1068 g_GIFRegHandlers[GIF_A_D_REG_COLCLAMP] = &GIFRegHandlerCOLCLAMP;
1069 g_GIFRegHandlers[GIF_A_D_REG_TEST_1] = &GIFRegHandlerTEST<0>;
1070 g_GIFRegHandlers[GIF_A_D_REG_TEST_2] = &GIFRegHandlerTEST<1>;
1071 g_GIFRegHandlers[GIF_A_D_REG_PABE] = &GIFRegHandlerPABE;
1072 g_GIFRegHandlers[GIF_A_D_REG_FBA_1] = &GIFRegHandlerFBA<0>;
1073 g_GIFRegHandlers[GIF_A_D_REG_FBA_2] = &GIFRegHandlerFBA<1>;
1074 g_GIFRegHandlers[GIF_A_D_REG_FRAME_1] = &GIFRegHandlerFRAME<0>;
1075 g_GIFRegHandlers[GIF_A_D_REG_FRAME_2] = &GIFRegHandlerFRAME<1>;
1076 g_GIFRegHandlers[GIF_A_D_REG_ZBUF_1] = &GIFRegHandlerZBUF<0>;
1077 g_GIFRegHandlers[GIF_A_D_REG_ZBUF_2] = &GIFRegHandlerZBUF<1>;
1078 g_GIFRegHandlers[GIF_A_D_REG_BITBLTBUF] = &GIFRegHandlerBITBLTBUF;
1079 g_GIFRegHandlers[GIF_A_D_REG_TRXPOS] = &GIFRegHandlerTRXPOS;
1080 g_GIFRegHandlers[GIF_A_D_REG_TRXREG] = &GIFRegHandlerTRXREG;
1081 g_GIFRegHandlers[GIF_A_D_REG_TRXDIR] = &GIFRegHandlerTRXDIR;
1082 g_GIFRegHandlers[GIF_A_D_REG_HWREG] = &GIFRegHandlerHWREG;
1083 SetMultithreaded();
1084 }
1085
1086 void WriteTempRegs()
1087 {
1088 memcpy(g_GIFTempRegHandlers, g_GIFPackedRegHandlers, sizeof(g_GIFTempRegHandlers));
1089 }
1090
1091 void SetFrameSkip(bool skip)
1092 {
1093 if (skip)
1094 {
1095 g_GIFPackedRegHandlers[GIF_REG_PRIM] = &GIFPackedRegHandlerNOP;
1096 g_GIFPackedRegHandlers[GIF_REG_RGBA] = &GIFPackedRegHandlerNOP;
1097 g_GIFPackedRegHandlers[GIF_REG_STQ] = &GIFPackedRegHandlerNOP;
1098 g_GIFPackedRegHandlers[GIF_REG_UV] = &GIFPackedRegHandlerNOP;
1099 g_GIFPackedRegHandlers[GIF_REG_XYZF2] = &GIFPackedRegHandlerNOP;
1100 g_GIFPackedRegHandlers[GIF_REG_XYZ2] = &GIFPackedRegHandlerNOP;
1101 g_GIFPackedRegHandlers[GIF_REG_CLAMP_1] = &GIFPackedRegHandlerNOP;
1102 g_GIFPackedRegHandlers[GIF_REG_CLAMP_2] = &GIFPackedRegHandlerNOP;
1103 g_GIFPackedRegHandlers[GIF_REG_FOG] = &GIFPackedRegHandlerNOP;
1104 g_GIFPackedRegHandlers[GIF_REG_XYZF3] = &GIFPackedRegHandlerNOP;
1105 g_GIFPackedRegHandlers[GIF_REG_XYZ3] = &GIFPackedRegHandlerNOP;
1106
1107 g_GIFRegHandlers[GIF_A_D_REG_PRIM] = &GIFRegHandlerNOP;
1108 g_GIFRegHandlers[GIF_A_D_REG_RGBAQ] = &GIFRegHandlerNOP;
1109 g_GIFRegHandlers[GIF_A_D_REG_ST] = &GIFRegHandlerNOP;
1110 g_GIFRegHandlers[GIF_A_D_REG_UV] = &GIFRegHandlerNOP;
1111 g_GIFRegHandlers[GIF_A_D_REG_XYZF2] = &GIFRegHandlerNOP;
1112 g_GIFRegHandlers[GIF_A_D_REG_XYZ2] = &GIFRegHandlerNOP;
1113 g_GIFRegHandlers[GIF_A_D_REG_XYZF3] = &GIFRegHandlerNOP;
1114 g_GIFRegHandlers[GIF_A_D_REG_XYZ3] = &GIFRegHandlerNOP;
1115 g_GIFRegHandlers[GIF_A_D_REG_PRMODECONT] = &GIFRegHandlerNOP;
1116 g_GIFRegHandlers[GIF_A_D_REG_PRMODE] = &GIFRegHandlerNOP;
1117 }
1118 else
1119 {
1120 g_GIFPackedRegHandlers[GIF_REG_PRIM] = &GIFPackedRegHandlerPRIM;
1121 g_GIFPackedRegHandlers[GIF_REG_RGBA] = &GIFPackedRegHandlerRGBA;
1122 g_GIFPackedRegHandlers[GIF_REG_STQ] = &GIFPackedRegHandlerSTQ;
1123 g_GIFPackedRegHandlers[GIF_REG_UV] = &GIFPackedRegHandlerUV;
1124 g_GIFPackedRegHandlers[GIF_REG_XYZF2] = &GIFPackedRegHandlerXYZF2;
1125 g_GIFPackedRegHandlers[GIF_REG_XYZ2] = &GIFPackedRegHandlerXYZ2;
1126 g_GIFPackedRegHandlers[GIF_REG_CLAMP_1] = &GIFPackedRegHandlerCLAMP<0>;
1127 g_GIFPackedRegHandlers[GIF_REG_CLAMP_2] = &GIFPackedRegHandlerCLAMP<1>;
1128 g_GIFPackedRegHandlers[GIF_REG_FOG] = &GIFPackedRegHandlerFOG;
1129 g_GIFPackedRegHandlers[GIF_REG_XYZF3] = &GIFPackedRegHandlerXYZF3;
1130 g_GIFPackedRegHandlers[GIF_REG_XYZ3] = &GIFPackedRegHandlerXYZ3;
1131
1132 g_GIFRegHandlers[GIF_A_D_REG_PRIM] = &GIFRegHandlerPRIM;
1133 g_GIFRegHandlers[GIF_A_D_REG_RGBAQ] = &GIFRegHandlerRGBAQ;
1134 g_GIFRegHandlers[GIF_A_D_REG_ST] = &GIFRegHandlerST;
1135 g_GIFRegHandlers[GIF_A_D_REG_UV] = &GIFRegHandlerUV;
1136 g_GIFRegHandlers[GIF_A_D_REG_XYZF2] = &GIFRegHandlerXYZF2;
1137 g_GIFRegHandlers[GIF_A_D_REG_XYZ2] = &GIFRegHandlerXYZ2;
1138 g_GIFRegHandlers[GIF_A_D_REG_XYZF3] = &GIFRegHandlerXYZF3;
1139 g_GIFRegHandlers[GIF_A_D_REG_XYZ3] = &GIFRegHandlerXYZ3;
1140 g_GIFRegHandlers[GIF_A_D_REG_PRMODECONT] = &GIFRegHandlerPRMODECONT;
1141 g_GIFRegHandlers[GIF_A_D_REG_PRMODE] = &GIFRegHandlerPRMODE;
1142 }
1143 }
1144 #endif

  ViewVC Help
Powered by ViewVC 1.1.22