Little temporary fix for the gif parser. More work to do later on

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4135 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
feal87@gmail.com 2010-12-24 11:47:24 +00:00
parent 33bed6a5d5
commit 8b1134a2e5
2 changed files with 56 additions and 29 deletions

View File

@ -244,32 +244,41 @@ namespace GSDumpGUI
case MessageType.PacketInfo:
frmMain.Invoke(new Action<object>(delegate(object e)
{
string[] vals = Mess.Parameters[0].ToString().Split('|');
frmMain.txtGifPacketSize.Text = vals[0] + " bytes";
frmMain.treeGifPacketContent.Nodes.Clear();
frmMain.treeGifPacketContent.Nodes.Add(vals[1]);
if (vals.Length > 2)
if (Mess.Parameters[0].ToString() != "No Data Available")
{
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[2]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[3]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[4]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[5]);
string[] vals = Mess.Parameters[0].ToString().Split('|');
frmMain.txtGifPacketSize.Text = vals[0] + " bytes";
TreeNode nodePrim = new TreeNode("Prim");
string[] prim = vals[6].Split('~');
for (int j = 1; j < prim.Length; j++)
frmMain.treeGifPacketContent.Nodes.Clear();
frmMain.treeGifPacketContent.Nodes.Add(vals[1]);
if (vals.Length > 2)
{
nodePrim.Nodes.Add(prim[j]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[2]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[3]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[4]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[5]);
TreeNode nodePrim = new TreeNode("Prim");
string[] prim = vals[6].Split('~');
for (int j = 1; j < prim.Length; j++)
{
nodePrim.Nodes.Add(prim[j]);
}
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(nodePrim);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[7]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[8]);
}
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(nodePrim);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[7]);
frmMain.treeGifPacketContent.Nodes[0].Nodes.Add(vals[8]);
frmMain.treeGifPacketContent.Nodes[0].ExpandAll();
}
else
{
frmMain.treeGifPacketContent.Nodes.Clear();
frmMain.treeGifPacketContent.Nodes.Add(Mess.Parameters[0].ToString());
}
frmMain.treeGifPacketContent.Nodes[0].ExpandAll();
}), new object[] { null });
break;
default:

View File

@ -396,6 +396,28 @@ namespace GSDumpGUI
internal String GetGifPacketInfo(GSDump dump, int i)
{
int nloop = 0;
for (int j = 0; j <= i; j++)
{
if (nloop != 0 && j==i)
return "No Data Available";
if (nloop != 0)
{
nloop--;
}
else
{
switch (dump.Data[i].id)
{
case GSType.Transfer:
GIFTag tag = ExtractGifTag(dump.Data[j].data);
if (tag.nloop != 0)
nloop = tag.nloop;
break;
}
}
}
string val = dump.Data[i].data.Length.ToString() + "|";
switch (dump.Data[i].id)
@ -437,14 +459,10 @@ namespace GSDumpGUI
Int32 pad2PrePrimFlgNReg = 0;
Int64 regs = 0;
if (data.Length >= 16)
nloopEOP = BitConverter.ToInt16(data, 0);
if (data.Length >= 32)
pad1 = BitConverter.ToInt16(data, 16);
if (data.Length >= 64)
pad2PrePrimFlgNReg = BitConverter.ToInt32(data, 32);
if (data.Length >= 128)
regs = BitConverter.ToInt64(data, 64);
nloopEOP = BitConverter.ToInt16(data, 0);
pad1 = BitConverter.ToInt16(data, 2);
pad2PrePrimFlgNReg = BitConverter.ToInt32(data, 4);
regs = BitConverter.ToInt64(data, 8);
GIFTag t = new GIFTag();
t.nloop = (nloopEOP & 0x7FFF);