/[pcsx2_0.9.7]/trunk/pcsx2/Vif_Codes.cpp
ViewVC logotype

Annotation of /trunk/pcsx2/Vif_Codes.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 401 - (hide annotations) (download)
Fri Feb 25 17:31:09 2011 UTC (9 years, 4 months ago) by william
File size: 20847 byte(s)
Auto Commited Import of: pcsx2-0.9.7-DEBUG (upstream: v0.9.7.4358 local: v0.9.7.313-latest) in ./trunk
1 william 31 /* PCSX2 - PS2 Emulator for PCs
2     * Copyright (C) 2002-2010 PCSX2 Dev Team
3     *
4     * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5     * of the GNU Lesser General Public License as published by the Free Software Found-
6     * ation, either version 3 of the License, or (at your option) any later version.
7     *
8     * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9     * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10     * PURPOSE. See the GNU General Public License for more details.
11     *
12     * You should have received a copy of the GNU General Public License along with PCSX2.
13     * If not, see <http://www.gnu.org/licenses/>.
14     */
15    
16     #include "PrecompiledHeader.h"
17     #include "Common.h"
18     #include "GS.h"
19     #include "Gif.h"
20     #include "Vif_Dma.h"
21     #include "newVif.h"
22     #include "VUmicro.h"
23    
24 william 62 #define vifOp(vifCodeName) _vifT int __fastcall vifCodeName(int pass, const u32 *data)
25 william 31 #define pass1 if (pass == 0)
26     #define pass2 if (pass == 1)
27     #define pass3 if (pass == 2)
28     #define vif1Only() { if (!idx) return vifCode_Null<idx>(pass, (u32*)data); }
29     vifOp(vifCode_Null);
30    
31     //------------------------------------------------------------------
32     // Vif0/Vif1 Misc Functions
33     //------------------------------------------------------------------
34    
35 william 62 static __fi void vifFlush(int idx) {
36 william 31 if (!idx) vif0FLUSH();
37     else vif1FLUSH();
38     }
39    
40 william 62 static __fi void vuExecMicro(int idx, u32 addr) {
41 william 191 VIFregisters& vifRegs = vifXRegs;
42 william 62 int startcycles = 0;
43     //vifFlush(idx);
44 william 31
45 william 62 //if(vifX.vifstalled == true) return;
46    
47     if (vifRegs.itops > (idx ? 0x3ffu : 0xffu)) {
48     Console.WriteLn("VIF%d ITOP overrun! %x", idx, vifRegs.itops);
49     vifRegs.itops &= (idx ? 0x3ffu : 0xffu);
50 william 31 }
51    
52 william 62 vifRegs.itop = vifRegs.itops;
53 william 31
54     if (idx) {
55     // in case we're handling a VIF1 execMicro, set the top with the tops value
56 william 62 vifRegs.top = vifRegs.tops & 0x3ff;
57 william 31
58     // is DBF flag set in VIF_STAT?
59 william 62 if (vifRegs.stat.DBF) {
60 william 31 // it is, so set tops with base, and clear the stat DBF flag
61 william 62 vifRegs.tops = vifRegs.base;
62     vifRegs.stat.DBF = false;
63 william 31 }
64     else {
65     // it is not, so set tops with base + offset, and set stat DBF flag
66 william 62 vifRegs.tops = vifRegs.base + vifRegs.ofst;
67     vifRegs.stat.DBF = true;
68 william 31 }
69     }
70    
71 william 62 if(!idx)startcycles = VU0.cycle;
72     else startcycles = VU1.cycle;
73    
74 william 31 if (!idx) vu0ExecMicro(addr);
75     else vu1ExecMicro(addr);
76 william 62
77 william 401 if(!idx) { g_vu0Cycles += (VU0.cycle-startcycles); g_packetsizeonvu = vif0.vifpacketsize; }
78     else { g_vu1Cycles += (VU1.cycle-startcycles); g_packetsizeonvu = vif1.vifpacketsize; }
79     //DevCon.Warning("Ran VU%x, VU0 Cycles %x, VU1 Cycles %x, start %x cycle %x", idx, g_vu0Cycles, g_vu1Cycles, startcycles, VU1.cycle);
80 william 62 GetVifX.vifstalled = true;
81 william 31 }
82    
83     u8 schedulepath3msk = 0;
84    
85     void Vif1MskPath3() {
86    
87 william 62 vif1Regs.mskpath3 = schedulepath3msk & 0x1;
88     GIF_LOG("VIF MSKPATH3 %x gif str %x path3 status %x", vif1Regs.mskpath3, gifch.chcr.STR, GSTransferStatus.PTH3);
89     gifRegs.stat.M3P = vif1Regs.mskpath3;
90    
91     if (!vif1Regs.mskpath3)
92     {
93 william 401 MSKPATH3_LOG("Disabling Path3 Mask");
94 william 62 //if(GSTransferStatus.PTH3 > TRANSFER_MODE && gif->chcr.STR) GSTransferStatus.PTH3 = TRANSFER_MODE;
95     //DevCon.Warning("Mask off");
96     //if(GSTransferStatus.PTH3 >= PENDINGSTOP_MODE) GSTransferStatus.PTH3 = IDLE_MODE;
97     if(gifRegs.stat.P3Q)
98 william 31 {
99 william 401 MSKPATH3_LOG("Path3 Waiting to Transfer, triggering");
100     gsInterrupt();
101 william 31 }
102 william 62
103 william 401 }
104     else
105     {
106     MSKPATH3_LOG("Path3 Mask Enabled");
107     }
108     // else if(!gif->chcr.STR && GSTransferStatus.PTH3 == IDLE_MODE) GSTransferStatus.PTH3 = STOPPED_MODE;//else DevCon.Warning("Mask on");
109 william 31
110     schedulepath3msk = 0;
111     }
112    
113     //------------------------------------------------------------------
114     // Vif0/Vif1 Code Implementations
115     //------------------------------------------------------------------
116    
117     vifOp(vifCode_Base) {
118     vif1Only();
119 william 62 pass1 { vif1Regs.base = vif1Regs.code & 0x3ff; vif1.cmd = 0; }
120     pass3 { VifCodeLog("Base"); }
121 william 31 return 0;
122     }
123    
124 william 62 extern bool SIGNAL_IMR_Pending;
125 william 280 static __aligned16 u32 partial_write[4];
126     static uint partial_count = 0;
127 william 62
128     template<int idx> __fi int _vifCode_Direct(int pass, const u8* data, bool isDirectHL) {
129 william 31 pass1 {
130     vif1Only();
131 william 62 int vifImm = (u16)vif1Regs.code;
132 william 31 vif1.tag.size = vifImm ? (vifImm*4) : (65536*4);
133 william 62 vif1.vifstalled = true;
134     gifRegs.stat.P2Q = true;
135     if (gifRegs.stat.PSE) // temporarily stop
136     {
137     Console.WriteLn("Gif dma temp paused? VIF DIRECT");
138     vif1.GifWaitState = 3;
139     vif1Regs.stat.VGW = true;
140     }
141     //Should cause this to split here to try and time PATH3 right.
142     return 0;
143 william 31 }
144     pass2 {
145     vif1Only();
146 william 62
147 william 401 //Only check if Path 1 or 3 are busy, else we dont care :D
148     if (GSTransferStatus.PTH3 < STOPPED_MODE || gifRegs.stat.P1Q == true)
149 william 31 {
150 william 401 //If currently transferring PATH2, or GIF is in image mode (or waiting) and we are using DIRECT command and path1 isnt waiting
151     if(gifRegs.stat.APATH == GIF_APATH2 || ((GSTransferStatus.PTH3 <= IMAGE_MODE && (vif1.cmd & 0x7f) == 0x50) && gifRegs.stat.P1Q == false))
152 william 62 {
153     //Do nothing, allow it
154     vif1Regs.stat.VGW = false;
155     //if(gifRegs.stat.APATH != GIF_APATH2)DevCon.Warning("Continue DIRECT/HL %x P3 %x APATH %x P1Q %x", vif1.cmd, GSTransferStatus.PTH3, gifRegs.stat.APATH, gifRegs.stat.P1Q);
156     }
157     else
158     {
159 william 401 //Using Direct/HL while Path3 is busy or Path 1 is busy
160 william 62 //DevCon.Warning("Stall DIRECT/HL %x P3 %x APATH %x P1Q %x", vif1.cmd, GSTransferStatus.PTH3, gifRegs.stat.APATH, gifRegs.stat.P1Q);
161     vif1Regs.stat.VGW = true; // PATH3 is in image mode (DIRECTHL), or busy (BOTH no IMT)
162     vif1.GifWaitState = 0;
163     vif1.vifstalled = true;
164     return 0;
165     }
166     }
167     if(SIGNAL_IMR_Pending == true)
168     {
169 william 280 //DevCon.Warning("Path 2 Paused (At start)");
170 william 31 vif1.vifstalled = true;
171     return 0;
172     }
173 william 62 if (gifRegs.stat.PSE) // temporarily stop
174     {
175     Console.WriteLn("Gif dma temp paused? VIF DIRECT");
176     vif1.GifWaitState = 3;
177     vif1.vifstalled = true;
178     vif1Regs.stat.VGW = true;
179     return 0;
180     }
181 william 31
182 william 62 // HACK ATTACK!
183     // we shouldn't be clearing the queue flag here at all. Ideally, the queue statuses
184     // should be checked, handled, and cleared from the EOP check in GIFPath only. --air
185     gifRegs.stat.clear_flags(GIF_STAT_P2Q);
186 william 31
187 william 62 uint minSize = aMin(vif1.vifpacketsize, vif1.tag.size);
188     uint ret;
189 william 31
190 william 280 if(minSize < 4 || partial_count > 0)
191 william 62 {
192     // When TTE==1, the VIF might end up sending us 8-byte packets instead of the usual 16-byte
193     // variety, if DIRECT tags cross chain dma boundaries. The actual behavior of real hardware
194     // is unknown at this time, but it seems that games *only* ever try to upload zero'd data
195     // in this situation.
196     //
197     // Games that use TTE==1 and DIRECT in this fashion: ICO
198     //
199     // Because DIRECT normally has a strict QWC alignment requirement, and this funky behavior
200     // only seems to happen on TTE mode transfers with their split-64-bit packets, there shouldn't
201     // be any need to worry about queuing more than 16 bytes of data,
202     //
203    
204 william 280
205 william 62
206 william 280 ret = 0;
207     minSize = aMin(minSize, 4-partial_count);
208 william 62 for( uint i=0; i<(minSize & 3); ++i)
209 william 280 {
210 william 62 partial_write[partial_count++] = ((u32*)data)[i];
211 william 280 ret++;
212     }
213 william 62
214     pxAssume( partial_count <= 4 );
215 william 280
216 william 62 if (partial_count == 4)
217     {
218     GetMTGS().PrepDataPacket(GIF_PATH_2, 1);
219     GIFPath_CopyTag(GIF_PATH_2, (u128*)partial_write, 1);
220     GetMTGS().SendDataPacket();
221     partial_count = 0;
222 william 31 }
223 william 62 }
224     else
225     {
226     if (!minSize)
227     DevCon.Warning("VIF DIRECT (PATH2): No Data Transfer?");
228    
229     // TTE=1 mode is the only time we should be getting DIRECT packet sizes that are
230     // not a multiple of QWC, and those are assured to be under 128 bits in size.
231     // So if this assert is triggered then it probably means something else is amiss.
232     pxAssertMsg((minSize & 3) == 0, "DIRECT packet size is not a multiple of QWC." );
233    
234     GetMTGS().PrepDataPacket(GIF_PATH_2, minSize/4);
235     ret = GIFPath_CopyTag(GIF_PATH_2, (u128*)data, minSize/4)*4;
236 william 31 GetMTGS().SendDataPacket();
237 william 62 }
238    
239     vif1.tag.size -= ret;
240    
241     if(vif1.tag.size == 0)
242     {
243 william 31 vif1.cmd = 0;
244     }
245 william 62 vif1.vifstalled = true;
246 william 31 return ret;
247     }
248     return 0;
249     }
250    
251     vifOp(vifCode_Direct) {
252 william 62 pass3 { VifCodeLog("Direct"); }
253 william 31 return _vifCode_Direct<idx>(pass, (u8*)data, 0);
254     }
255    
256     vifOp(vifCode_DirectHL) {
257 william 62 pass3 { VifCodeLog("DirectHL"); }
258 william 31 return _vifCode_Direct<idx>(pass, (u8*)data, 1);
259     }
260    
261     // ToDo: FixMe
262     vifOp(vifCode_Flush) {
263     vif1Only();
264 william 62 vifStruct& vifX = GetVifX;
265     pass1 { vifFlush(idx); vifX.cmd = 0; }
266     pass3 { VifCodeLog("Flush"); }
267 william 31 return 0;
268     }
269    
270     // ToDo: FixMe
271     vifOp(vifCode_FlushA) {
272     vif1Only();
273 william 62 vifStruct& vifX = GetVifX;
274 william 31 pass1 {
275 william 62 vifFlush(idx);
276 william 31 // Gif is already transferring so wait for it.
277 william 401 if (gifRegs.stat.P1Q || GSTransferStatus.PTH3 < STOPPED_MODE) {
278 william 62 //DevCon.Warning("VIF FlushA Wait MSK = %x", vif1Regs.mskpath3);
279     //
280 william 401 MSKPATH3_LOG("Waiting for Path3 to Flush");
281 william 31 //DevCon.WriteLn("FlushA path3 Wait! PTH3 MD %x STR %x", GSTransferStatus.PTH3, gif->chcr.STR);
282 william 62 vif1Regs.stat.VGW = true;
283     vifX.GifWaitState = 1;
284 william 31 vifX.vifstalled = true;
285 william 62 } // else DevCon.WriteLn("FlushA path3 no Wait! PTH3 MD %x STR %x", GSTransferStatus.PTH3, gif->chcr.STR);
286    
287 william 31 vifX.cmd = 0;
288     }
289 william 62 pass3 { VifCodeLog("FlushA"); }
290 william 31 return 0;
291     }
292    
293     // ToDo: FixMe
294     vifOp(vifCode_FlushE) {
295 william 62 vifStruct& vifX = GetVifX;
296 william 31 pass1 { vifFlush(idx); vifX.cmd = 0; }
297 william 62 pass3 { VifCodeLog("FlushE"); }
298 william 31 return 0;
299     }
300    
301     vifOp(vifCode_ITop) {
302 william 62 pass1 { vifXRegs.itops = vifXRegs.code & 0x3ff; GetVifX.cmd = 0; }
303     pass3 { VifCodeLog("ITop"); }
304 william 31 return 0;
305     }
306    
307     vifOp(vifCode_Mark) {
308 william 62 vifStruct& vifX = GetVifX;
309 william 31 pass1 {
310 william 62 vifXRegs.mark = (u16)vifXRegs.code;
311     vifXRegs.stat.MRK = true;
312 william 31 vifX.cmd = 0;
313     }
314 william 62 pass3 { VifCodeLog("Mark"); }
315 william 31 return 0;
316     }
317    
318 william 62 static __fi void _vifCode_MPG(int idx, u32 addr, const u32 *data, int size) {
319 william 31 VURegs& VUx = idx ? VU1 : VU0;
320     pxAssume(VUx.Micro > 0);
321    
322 william 62 if (memcmp_mmx(VUx.Micro + addr, data, size*4)) {
323     // Clear VU memory before writing!
324     // (VUs expect size to be 32-bit scale, same as VIF's internal working sizes)
325     if (!idx) CpuVU0->Clear(addr, size);
326     else CpuVU1->Clear(addr, size);
327     memcpy_fast(VUx.Micro + addr, data, size*4);
328 william 31 }
329     }
330    
331     vifOp(vifCode_MPG) {
332 william 62 vifStruct& vifX = GetVifX;
333 william 31 pass1 {
334 william 62 int vifNum = (u8)(vifXRegs.code >> 16);
335     vifX.tag.addr = (u16)(vifXRegs.code << 3) & (idx ? 0x3fff : 0xfff);
336 william 31 vifX.tag.size = vifNum ? (vifNum*2) : 512;
337 william 62 //vifFlush(idx);
338 william 31 return 1;
339     }
340     pass2 {
341     if (vifX.vifpacketsize < vifX.tag.size) { // Partial Transfer
342 william 62 if((vifX.tag.addr + vifX.vifpacketsize*4) > (idx ? 0x4000 : 0x1000)) {
343 william 31 DevCon.Warning("Vif%d MPG Split Overflow", idx);
344     }
345     _vifCode_MPG(idx, vifX.tag.addr, data, vifX.vifpacketsize);
346 william 62 vifX.tag.addr += vifX.vifpacketsize * 4;
347 william 31 vifX.tag.size -= vifX.vifpacketsize;
348     return vifX.vifpacketsize;
349     }
350     else { // Full Transfer
351 william 62 if((vifX.tag.addr + vifX.tag.size*4) > (idx ? 0x4000 : 0x1000)) {
352 william 31 DevCon.Warning("Vif%d MPG Split Overflow", idx);
353     }
354     _vifCode_MPG(idx, vifX.tag.addr, data, vifX.tag.size);
355     int ret = vifX.tag.size;
356     vifX.tag.size = 0;
357     vifX.cmd = 0;
358     return ret;
359     }
360     }
361 william 62 pass3 { VifCodeLog("MPG"); }
362 william 31 return 0;
363     }
364    
365     vifOp(vifCode_MSCAL) {
366 william 62 vifStruct& vifX = GetVifX;
367     pass1 { vifFlush(idx); vuExecMicro(idx, (u16)(vifXRegs.code) << 3); vifX.cmd = 0;}
368     pass3 { VifCodeLog("MSCAL"); }
369 william 31 return 0;
370     }
371    
372     vifOp(vifCode_MSCALF) {
373 william 62 vifStruct& vifX = GetVifX;
374     pass1 { vifFlush(idx); vuExecMicro(idx, (u16)(vifXRegs.code) << 3); vifX.cmd = 0; }
375     pass3 { VifCodeLog("MSCALF"); }
376 william 31 return 0;
377     }
378    
379     vifOp(vifCode_MSCNT) {
380 william 62 vifStruct& vifX = GetVifX;
381     pass1 { vifFlush(idx); vuExecMicro(idx, -1); vifX.cmd = 0; }
382     pass3 { VifCodeLog("MSCNT"); }
383 william 31 return 0;
384     }
385    
386     // ToDo: FixMe
387     vifOp(vifCode_MskPath3) {
388     vif1Only();
389 william 401 pass1 {
390     MSKPATH3_LOG("Direct MSKPATH3");
391    
392     schedulepath3msk = 0x10 | (vif1Regs.code >> 15) & 0x1;
393    
394    
395     if(vif1ch.chcr.STR && vif1.lastcmd != 0x13)vif1.vifstalled = true;
396     else Vif1MskPath3();
397    
398 william 62 vif1.cmd = 0;
399 william 31 }
400 william 62 pass3 { VifCodeLog("MskPath3"); }
401 william 31 return 0;
402     }
403    
404     vifOp(vifCode_Nop) {
405 william 62 pass1 { GetVifX.cmd = 0; }
406     pass3 { VifCodeLog("Nop"); }
407 william 31 return 0;
408     }
409    
410     // ToDo: Review Flags
411     vifOp(vifCode_Null) {
412 william 62 vifStruct& vifX = GetVifX;
413 william 31 pass1 {
414     // if ME1, then force the vif to interrupt
415 william 62 if (!(vifXRegs.err.ME1)) { // Ignore vifcode and tag mismatch error
416 william 31 Console.WriteLn("Vif%d: Unknown VifCmd! [%x]", idx, vifX.cmd);
417 william 62 vifXRegs.stat.ER1 = true;
418     vifX.vifstalled = true;
419 william 31 //vifX.irq++;
420     }
421     vifX.cmd = 0;
422     }
423     pass2 { Console.Error("Vif%d bad vifcode! [CMD = %x]", idx, vifX.cmd); }
424 william 62 pass3 { VifCodeLog("Null"); }
425 william 31 return 0;
426     }
427    
428     vifOp(vifCode_Offset) {
429     vif1Only();
430     pass1 {
431 william 62 vif1Regs.stat.DBF = false;
432     vif1Regs.ofst = vif1Regs.code & 0x3ff;
433     vif1Regs.tops = vif1Regs.base;
434     vif1.cmd = 0;
435 william 31 }
436 william 62 pass3 { VifCodeLog("Offset"); }
437 william 31 return 0;
438     }
439    
440 william 191 template<int idx> static __fi int _vifCode_STColRow(const u32* data, u32* pmem2) {
441 william 62 vifStruct& vifX = GetVifX;
442    
443     int ret = min(4 - vifX.tag.addr, vifX.vifpacketsize);
444 william 31 pxAssume(vifX.tag.addr < 4);
445     pxAssume(ret > 0);
446    
447     switch (ret) {
448     case 4:
449     pmem2[3] = data[3];
450     case 3:
451     pmem2[2] = data[2];
452     case 2:
453     pmem2[1] = data[1];
454     case 1:
455     pmem2[0] = data[0];
456     break;
457     jNO_DEFAULT
458     }
459    
460     vifX.tag.addr += ret;
461     vifX.tag.size -= ret;
462     if (!vifX.tag.size) vifX.cmd = 0;
463    
464     return ret;
465     }
466    
467     vifOp(vifCode_STCol) {
468 william 62 vifStruct& vifX = GetVifX;
469 william 31 pass1 {
470     vifX.tag.addr = 0;
471     vifX.tag.size = 4;
472     return 1;
473     }
474     pass2 {
475 william 191 return _vifCode_STColRow<idx>(data, &vifX.MaskCol._u32[vifX.tag.addr]);
476 william 31 }
477 william 62 pass3 { VifCodeLog("STCol"); }
478 william 31 return 0;
479     }
480    
481     vifOp(vifCode_STRow) {
482 william 62 vifStruct& vifX = GetVifX;
483    
484 william 31 pass1 {
485     vifX.tag.addr = 0;
486     vifX.tag.size = 4;
487     return 1;
488     }
489     pass2 {
490 william 191 return _vifCode_STColRow<idx>(data, &vifX.MaskRow._u32[vifX.tag.addr]);
491 william 31 }
492 william 62 pass3 { VifCodeLog("STRow"); }
493 william 31 return 0;
494     }
495    
496     vifOp(vifCode_STCycl) {
497 william 62 vifStruct& vifX = GetVifX;
498 william 31 pass1 {
499 william 62 vifXRegs.cycle.cl = (u8)(vifXRegs.code);
500     vifXRegs.cycle.wl = (u8)(vifXRegs.code >> 8);
501 william 31 vifX.cmd = 0;
502     }
503 william 62 pass3 { VifCodeLog("STCycl"); }
504 william 31 return 0;
505     }
506    
507     vifOp(vifCode_STMask) {
508 william 62 vifStruct& vifX = GetVifX;
509 william 31 pass1 { vifX.tag.size = 1; }
510 william 62 pass2 { vifXRegs.mask = data[0]; vifX.tag.size = 0; vifX.cmd = 0; }
511     pass3 { VifCodeLog("STMask"); }
512 william 31 return 1;
513     }
514    
515     vifOp(vifCode_STMod) {
516 william 62 pass1 { vifXRegs.mode = vifXRegs.code & 0x3; GetVifX.cmd = 0; }
517     pass3 { VifCodeLog("STMod"); }
518 william 31 return 0;
519     }
520    
521 william 273 template< uint idx >
522     static uint calc_addr(bool flg)
523     {
524     VIFregisters& vifRegs = vifXRegs;
525    
526     uint retval = vifRegs.code;
527     if (idx && flg) retval += vifRegs.tops;
528     return retval & (idx ? 0x3ff : 0xff);
529     }
530    
531 william 31 vifOp(vifCode_Unpack) {
532     pass1 {
533 william 191 vifUnpackSetup<idx>(data);
534 william 31 return 1;
535     }
536 william 191 pass2 { return nVifUnpack<idx>((u8*)data); }
537 william 273 pass3 {
538     vifStruct& vifX = GetVifX;
539     VIFregisters& vifRegs = vifXRegs;
540     uint vl = vifX.cmd & 0x03;
541     uint vn = (vifX.cmd >> 2) & 0x3;
542     bool flg = (vifRegs.code >> 15) & 1;
543     static const char* const vntbl[] = { "S", "V2", "V3", "V4" };
544     static const uint vltbl[] = { 32, 16, 8, 5 };
545    
546     VifCodeLog("Unpack %s_%u (%s) @ 0x%04X%s (cl=%u wl=%u num=0x%02X)",
547     vntbl[vn], vltbl[vl], (vifX.cmd & 0x10) ? "masked" : "unmasked",
548     calc_addr<idx>(flg), flg ? "(FLG)" : "",
549     vifRegs.cycle.cl, vifRegs.cycle.wl, (vifXRegs.code >> 16) & 0xff
550     );
551     }
552 william 31 return 0;
553     }
554    
555     //------------------------------------------------------------------
556     // Vif0/Vif1 Code Tables
557     //------------------------------------------------------------------
558    
559 william 62 __aligned16 FnType_VifCmdHandler* const vifCmdHandler[2][128] =
560     {
561     {
562     vifCode_Nop<0> , vifCode_STCycl<0> , vifCode_Offset<0> , vifCode_Base<0> , vifCode_ITop<0> , vifCode_STMod<0> , vifCode_MskPath3<0>, vifCode_Mark<0>, /*0x00*/
563     vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x08*/
564     vifCode_FlushE<0> , vifCode_Flush<0> , vifCode_Null<0> , vifCode_FlushA<0> , vifCode_MSCAL<0> , vifCode_MSCALF<0> , vifCode_Null<0> , vifCode_MSCNT<0>, /*0x10*/
565     vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x18*/
566     vifCode_STMask<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x20*/
567     vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x28*/
568     vifCode_STRow<0> , vifCode_STCol<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x30*/
569     vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x38*/
570     vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x40*/
571     vifCode_Null<0> , vifCode_Null<0> , vifCode_MPG<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x48*/
572     vifCode_Direct<0> , vifCode_DirectHL<0>, vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x50*/
573     vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0> , vifCode_Null<0>, /*0x58*/
574     vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Null<0>, /*0x60*/
575     vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0>, /*0x68*/
576     vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Null<0>, /*0x70*/
577     vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Null<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> , vifCode_Unpack<0> /*0x78*/
578     },
579     {
580     vifCode_Nop<1> , vifCode_STCycl<1> , vifCode_Offset<1> , vifCode_Base<1> , vifCode_ITop<1> , vifCode_STMod<1> , vifCode_MskPath3<1>, vifCode_Mark<1>, /*0x00*/
581     vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x08*/
582     vifCode_FlushE<1> , vifCode_Flush<1> , vifCode_Null<1> , vifCode_FlushA<1> , vifCode_MSCAL<1> , vifCode_MSCALF<1> , vifCode_Null<1> , vifCode_MSCNT<1>, /*0x10*/
583     vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x18*/
584     vifCode_STMask<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x20*/
585     vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x28*/
586     vifCode_STRow<1> , vifCode_STCol<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x30*/
587     vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x38*/
588     vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x40*/
589     vifCode_Null<1> , vifCode_Null<1> , vifCode_MPG<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x48*/
590     vifCode_Direct<1> , vifCode_DirectHL<1>, vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x50*/
591     vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1> , vifCode_Null<1>, /*0x58*/
592     vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Null<1>, /*0x60*/
593     vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1>, /*0x68*/
594     vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Null<1>, /*0x70*/
595     vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Null<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> , vifCode_Unpack<1> /*0x78*/
596     }
597 william 31 };

  ViewVC Help
Powered by ViewVC 1.1.22