Added Register detection. (Now missing "last" step to decode the real data passed to each register based on the modes)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4138 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
feal87@gmail.com 2010-12-24 19:14:33 +00:00
parent 4798a1c8e6
commit e51768f8c7
3 changed files with 45 additions and 4 deletions

View File

@ -269,7 +269,14 @@ namespace GSDumpGUI
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(nodePrim); frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(nodePrim);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[7]); frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[7]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[8]);
TreeNode nodeReg = new TreeNode("reg");
string[] reg = vals[8].Split(new char[]{'~'}, StringSplitOptions.RemoveEmptyEntries);
for (int j = 1; j < reg.Length; j++)
{
nodeReg.Nodes.Add(reg[j]);
}
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(nodeReg);
} }
frmMain.treeGifPacketContent.Nodes[0].ExpandAll(); frmMain.treeGifPacketContent.Nodes[0].ExpandAll();
} }

View File

@ -412,7 +412,9 @@ namespace GSDumpGUI
val += "prim~Prim Class = " + ((GS_PRIM)tag.prim.Prim).ToString() + "~IIP = " + tag.prim.IIP + "~TME = "+ tag.prim.TME + "~FGE = "+ tag.prim.FGE + "~ABE = "+ val += "prim~Prim Class = " + ((GS_PRIM)tag.prim.Prim).ToString() + "~IIP = " + tag.prim.IIP + "~TME = "+ tag.prim.TME + "~FGE = "+ tag.prim.FGE + "~ABE = "+
tag.prim.ABE + "~AA1 = "+ tag.prim.AA1 + "~FST = "+ tag.prim.FST + "~CTXT = " + tag.prim.CTXT + "~FIX = " + tag.prim.FIX + "|"; tag.prim.ABE + "~AA1 = "+ tag.prim.AA1 + "~FST = "+ tag.prim.FST + "~CTXT = " + tag.prim.CTXT + "~FIX = " + tag.prim.FIX + "|";
val += "nreg = " + (tag.nreg == 0 ? 16 : tag.nreg) + "|"; val += "nreg = " + (tag.nreg == 0 ? 16 : tag.nreg) + "|";
val += "regs = " + tag.regs; val += "regs~ ";
foreach (var itm in tag.regs)
val += itm.Descriptor.ToString() + "~";
break; break;
case GSType.VSync: case GSType.VSync:
val += "Field = " + dump.Data[i].data[0].ToString(); val += "Field = " + dump.Data[i].data[0].ToString();
@ -464,7 +466,14 @@ namespace GSDumpGUI
t.flg = (pad2PrePrimFlgNReg & 0xC000000) >> 26; t.flg = (pad2PrePrimFlgNReg & 0xC000000) >> 26;
t.nreg = (int)(pad2PrePrimFlgNReg & 0xF0000000) >> 28; t.nreg = (int)(pad2PrePrimFlgNReg & 0xF0000000) >> 28;
t.regs = regs;
t.regs = new List<GIFReg>();
for (int i = 0; i < t.nreg; i++)
{
GIFReg reg = new GIFReg();
reg.Descriptor = (GIFRegDescriptor)((regs & (Convert.ToInt32(Math.Pow(16, i + 1)) - 1)) >> i*4);
t.regs.Add(reg);
}
return t; return t;
} }
} }

View File

@ -14,7 +14,7 @@ namespace GSDumpGUI
public GIFPrim prim; public GIFPrim prim;
public Int32 flg; public Int32 flg;
public Int32 nreg; public Int32 nreg;
public Int64 regs; public List<GIFReg> regs;
} }
public class GIFPrim public class GIFPrim
@ -30,6 +30,31 @@ namespace GSDumpGUI
public Int32 FIX; public Int32 FIX;
} }
public class GIFReg
{
public GIFRegDescriptor Descriptor;
}
public enum GIFRegDescriptor
{
PRIM = 0,
RGBAQ = 1,
ST = 2,
UV = 3,
XYZF2 = 4,
XYZ2 = 5,
TEX0_1 = 6,
TEX0_2 = 7,
CLAMP_1 = 8,
CLAMP_2 = 9,
FOG = 10,
Reserved = 11,
XYZF3 = 12,
XYZ3 = 13,
AD = 14,
NOP = 15
}
public enum GIFFLG public enum GIFFLG
{ {
GIF_FLG_PACKED =0, GIF_FLG_PACKED =0,