While waiting for understanding better how to make Gsdx more sane...

1) Added some basic GIF parser to detect some basic information about the packets. (Still no registers, had little time. :P)
2) Little fixes to allow better navigation.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4133 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
feal87@gmail.com 2010-12-24 08:45:54 +00:00
parent 718b04a20d
commit 1b5b9b055f
7 changed files with 281 additions and 61 deletions

View File

@ -176,6 +176,7 @@ namespace GSDumpGUI
frmMain.btnStep.Enabled = frmMain.chkDebugMode.Checked;
frmMain.cmdGoToStart.Enabled = frmMain.chkDebugMode.Checked;
frmMain.cmdGoToNextVSync.Enabled = frmMain.chkDebugMode.Checked;
frmMain.treeGifPacketContent.Enabled = frmMain.chkDebugMode.Checked;
if (frmMain.chkDebugMode.Checked == false)
frmMain.treTreeView.Nodes.Clear();
@ -195,19 +196,19 @@ namespace GSDumpGUI
case "Transfer":
TreeNode tn2 = new TreeNode();
tn2.Name = parts[0];
tn2.Text = parts[0] + " - " + parts[1] + " - " + parts[2];
tn2.Text = parts[0] + " - " + parts[1] + " - " + parts[2] + " - " + parts[3] + " byte";
nodes.Add(tn2);
break;
case "ReadFIFO2":
TreeNode tn3 = new TreeNode();
tn3.Name = parts[0];
tn3.Text = parts[0] + " - " + parts[1];
tn3.Text = parts[0] + " - " + parts[1] + " - " + parts[2] + " byte";
nodes.Add(tn3);
break;
case "VSync":
TreeNode tn = new TreeNode();
tn.Name = parts[0];
tn.Text = parts[0] + " - " + parts[1];
tn.Text = parts[0] + " - " + parts[1] + " - " + parts[2] + " byte";
tn.Nodes.AddRange(nodes.ToArray());
parents.Add(tn);
@ -216,7 +217,7 @@ namespace GSDumpGUI
case "Registers":
TreeNode tn4 = new TreeNode();
tn4.Name = parts[0];
tn4.Text = parts[0] + " - " + parts[1];
tn4.Text = parts[0] + " - " + parts[1] + " - " + parts[2] + " byte";
nodes.Add(tn4);
break;
}
@ -240,6 +241,37 @@ namespace GSDumpGUI
}
}), new object[] { null });
break;
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)
{
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].ExpandAll();
}), new object[] { null });
break;
default:
break;
}
@ -300,6 +332,14 @@ namespace GSDumpGUI
Client.Send(msg);
}
break;
case MessageType.PacketInfo:
int id = (int)Mess.Parameters[0];
msg = new TCPMessage();
msg.MessageType = MessageType.PacketInfo;
msg.Parameters.Add(wrap.GetGifPacketInfo(dump, id));
Client.Send(msg);
break;
case MessageType.Step:
case MessageType.RunToCursor:
case MessageType.RunToNextVSync:
@ -381,6 +421,7 @@ namespace GSDumpGUI
frmMain.cmdGoToStart.Enabled = frmMain.chkDebugMode.Checked;
frmMain.cmdGoToNextVSync.Enabled = frmMain.chkDebugMode.Checked;
frmMain.treTreeView.Nodes.Clear();
frmMain.treeGifPacketContent.Nodes.Clear();
}
}), new object[] { null});
}

View File

@ -79,12 +79,16 @@
this.treTreeView = new System.Windows.Forms.TreeView();
this.cmdGoToStart = new System.Windows.Forms.Button();
this.cmdGoToNextVSync = new System.Windows.Forms.Button();
this.txtGifPacketSize = new System.Windows.Forms.Label();
this.lblGIFPacketSize = new System.Windows.Forms.Label();
this.treeGifPacketContent = new System.Windows.Forms.TreeView();
this.lblContent = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pctBox)).BeginInit();
this.SuspendLayout();
//
// txtGSDXDirectory
//
this.txtGSDXDirectory.Location = new System.Drawing.Point(703, 25);
this.txtGSDXDirectory.Location = new System.Drawing.Point(871, 26);
this.txtGSDXDirectory.Name = "txtGSDXDirectory";
this.txtGSDXDirectory.Size = new System.Drawing.Size(243, 20);
this.txtGSDXDirectory.TabIndex = 0;
@ -94,7 +98,7 @@
// lblDirectory
//
this.lblDirectory.AutoSize = true;
this.lblDirectory.Location = new System.Drawing.Point(706, 9);
this.lblDirectory.Location = new System.Drawing.Point(874, 10);
this.lblDirectory.Name = "lblDirectory";
this.lblDirectory.Size = new System.Drawing.Size(82, 13);
this.lblDirectory.TabIndex = 1;
@ -102,7 +106,7 @@
//
// cmdBrowseGSDX
//
this.cmdBrowseGSDX.Location = new System.Drawing.Point(952, 23);
this.cmdBrowseGSDX.Location = new System.Drawing.Point(1120, 24);
this.cmdBrowseGSDX.Name = "cmdBrowseGSDX";
this.cmdBrowseGSDX.Size = new System.Drawing.Size(29, 23);
this.cmdBrowseGSDX.TabIndex = 2;
@ -113,7 +117,7 @@
//
// cmdBrowseDumps
//
this.cmdBrowseDumps.Location = new System.Drawing.Point(952, 66);
this.cmdBrowseDumps.Location = new System.Drawing.Point(1120, 67);
this.cmdBrowseDumps.Name = "cmdBrowseDumps";
this.cmdBrowseDumps.Size = new System.Drawing.Size(29, 23);
this.cmdBrowseDumps.TabIndex = 5;
@ -125,7 +129,7 @@
// lblDumpDirectory
//
this.lblDumpDirectory.AutoSize = true;
this.lblDumpDirectory.Location = new System.Drawing.Point(703, 53);
this.lblDumpDirectory.Location = new System.Drawing.Point(871, 54);
this.lblDumpDirectory.Name = "lblDumpDirectory";
this.lblDumpDirectory.Size = new System.Drawing.Size(85, 13);
this.lblDumpDirectory.TabIndex = 4;
@ -133,7 +137,7 @@
//
// txtDumpsDirectory
//
this.txtDumpsDirectory.Location = new System.Drawing.Point(703, 69);
this.txtDumpsDirectory.Location = new System.Drawing.Point(871, 70);
this.txtDumpsDirectory.Name = "txtDumpsDirectory";
this.txtDumpsDirectory.Size = new System.Drawing.Size(243, 20);
this.txtDumpsDirectory.TabIndex = 3;
@ -143,9 +147,9 @@
// lstGSDX
//
this.lstGSDX.FormattingEnabled = true;
this.lstGSDX.Location = new System.Drawing.Point(367, 24);
this.lstGSDX.Location = new System.Drawing.Point(454, 26);
this.lstGSDX.Name = "lstGSDX";
this.lstGSDX.Size = new System.Drawing.Size(330, 199);
this.lstGSDX.Size = new System.Drawing.Size(411, 199);
this.lstGSDX.TabIndex = 1;
//
// lstDumps
@ -153,7 +157,7 @@
this.lstDumps.FormattingEnabled = true;
this.lstDumps.Location = new System.Drawing.Point(12, 24);
this.lstDumps.Name = "lstDumps";
this.lstDumps.Size = new System.Drawing.Size(349, 199);
this.lstDumps.Size = new System.Drawing.Size(433, 199);
this.lstDumps.TabIndex = 0;
this.lstDumps.SelectedIndexChanged += new System.EventHandler(this.lstDumps_SelectedIndexChanged);
//
@ -169,7 +173,7 @@
// GsdxList
//
this.GsdxList.AutoSize = true;
this.GsdxList.Location = new System.Drawing.Point(364, 9);
this.GsdxList.Location = new System.Drawing.Point(451, 11);
this.GsdxList.Name = "GsdxList";
this.GsdxList.Size = new System.Drawing.Size(56, 13);
this.GsdxList.TabIndex = 10;
@ -177,7 +181,7 @@
//
// cmdStart
//
this.cmdStart.Location = new System.Drawing.Point(802, 164);
this.cmdStart.Location = new System.Drawing.Point(970, 165);
this.cmdStart.Name = "cmdStart";
this.cmdStart.Size = new System.Drawing.Size(182, 58);
this.cmdStart.TabIndex = 11;
@ -188,7 +192,7 @@
//
// cmdConfigGSDX
//
this.cmdConfigGSDX.Location = new System.Drawing.Point(802, 102);
this.cmdConfigGSDX.Location = new System.Drawing.Point(970, 103);
this.cmdConfigGSDX.Name = "cmdConfigGSDX";
this.cmdConfigGSDX.Size = new System.Drawing.Size(88, 56);
this.cmdConfigGSDX.TabIndex = 12;
@ -204,7 +208,7 @@
this.txtLog.Name = "txtLog";
this.txtLog.ReadOnly = true;
this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.txtLog.Size = new System.Drawing.Size(351, 208);
this.txtLog.Size = new System.Drawing.Size(448, 208);
this.txtLog.TabIndex = 13;
this.txtLog.TabStop = false;
//
@ -219,7 +223,7 @@
//
// cmdOpenIni
//
this.cmdOpenIni.Location = new System.Drawing.Point(896, 102);
this.cmdOpenIni.Location = new System.Drawing.Point(1064, 103);
this.cmdOpenIni.Name = "cmdOpenIni";
this.cmdOpenIni.Size = new System.Drawing.Size(88, 56);
this.cmdOpenIni.TabIndex = 15;
@ -241,7 +245,7 @@
// rdaDX9HW
//
this.rdaDX9HW.AutoSize = true;
this.rdaDX9HW.Location = new System.Drawing.Point(708, 137);
this.rdaDX9HW.Location = new System.Drawing.Point(876, 138);
this.rdaDX9HW.Name = "rdaDX9HW";
this.rdaDX9HW.Size = new System.Drawing.Size(68, 17);
this.rdaDX9HW.TabIndex = 18;
@ -253,7 +257,7 @@
// rdaDX10HW
//
this.rdaDX10HW.AutoSize = true;
this.rdaDX10HW.Location = new System.Drawing.Point(708, 160);
this.rdaDX10HW.Location = new System.Drawing.Point(876, 161);
this.rdaDX10HW.Name = "rdaDX10HW";
this.rdaDX10HW.Size = new System.Drawing.Size(74, 17);
this.rdaDX10HW.TabIndex = 19;
@ -265,7 +269,7 @@
// rdaDX9SW
//
this.rdaDX9SW.AutoSize = true;
this.rdaDX9SW.Location = new System.Drawing.Point(708, 183);
this.rdaDX9SW.Location = new System.Drawing.Point(876, 184);
this.rdaDX9SW.Name = "rdaDX9SW";
this.rdaDX9SW.Size = new System.Drawing.Size(67, 17);
this.rdaDX9SW.TabIndex = 20;
@ -277,7 +281,7 @@
// rdaDX10SW
//
this.rdaDX10SW.AutoSize = true;
this.rdaDX10SW.Location = new System.Drawing.Point(708, 206);
this.rdaDX10SW.Location = new System.Drawing.Point(876, 207);
this.rdaDX10SW.Name = "rdaDX10SW";
this.rdaDX10SW.Size = new System.Drawing.Size(73, 17);
this.rdaDX10SW.TabIndex = 21;
@ -289,7 +293,7 @@
// lblOverride
//
this.lblOverride.AutoSize = true;
this.lblOverride.Location = new System.Drawing.Point(703, 102);
this.lblOverride.Location = new System.Drawing.Point(871, 103);
this.lblOverride.Name = "lblOverride";
this.lblOverride.Size = new System.Drawing.Size(94, 13);
this.lblOverride.TabIndex = 22;
@ -299,7 +303,7 @@
//
this.rdaNone.AutoSize = true;
this.rdaNone.Checked = true;
this.rdaNone.Location = new System.Drawing.Point(707, 118);
this.rdaNone.Location = new System.Drawing.Point(875, 119);
this.rdaNone.Name = "rdaNone";
this.rdaNone.Size = new System.Drawing.Size(51, 17);
this.rdaNone.TabIndex = 23;
@ -312,7 +316,7 @@
// lblInternalLog
//
this.lblInternalLog.AutoSize = true;
this.lblInternalLog.Location = new System.Drawing.Point(626, 233);
this.lblInternalLog.Location = new System.Drawing.Point(725, 233);
this.lblInternalLog.Name = "lblInternalLog";
this.lblInternalLog.Size = new System.Drawing.Size(63, 13);
this.lblInternalLog.TabIndex = 25;
@ -320,12 +324,12 @@
//
// txtIntLog
//
this.txtIntLog.Location = new System.Drawing.Point(629, 249);
this.txtIntLog.Location = new System.Drawing.Point(728, 249);
this.txtIntLog.Multiline = true;
this.txtIntLog.Name = "txtIntLog";
this.txtIntLog.ReadOnly = true;
this.txtIntLog.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.txtIntLog.Size = new System.Drawing.Size(351, 208);
this.txtIntLog.Size = new System.Drawing.Size(421, 208);
this.txtIntLog.TabIndex = 24;
this.txtIntLog.TabStop = false;
//
@ -504,7 +508,7 @@
//
this.chkDebugMode.AutoSize = true;
this.chkDebugMode.Enabled = false;
this.chkDebugMode.Location = new System.Drawing.Point(629, 501);
this.chkDebugMode.Location = new System.Drawing.Point(758, 497);
this.chkDebugMode.Name = "chkDebugMode";
this.chkDebugMode.Size = new System.Drawing.Size(88, 17);
this.chkDebugMode.TabIndex = 46;
@ -525,7 +529,7 @@
// btnStep
//
this.btnStep.Enabled = false;
this.btnStep.Location = new System.Drawing.Point(629, 575);
this.btnStep.Location = new System.Drawing.Point(758, 571);
this.btnStep.Name = "btnStep";
this.btnStep.Size = new System.Drawing.Size(108, 40);
this.btnStep.TabIndex = 49;
@ -537,7 +541,7 @@
// btnRunToSelection
//
this.btnRunToSelection.Enabled = false;
this.btnRunToSelection.Location = new System.Drawing.Point(629, 621);
this.btnRunToSelection.Location = new System.Drawing.Point(758, 617);
this.btnRunToSelection.Name = "btnRunToSelection";
this.btnRunToSelection.Size = new System.Drawing.Size(108, 40);
this.btnRunToSelection.TabIndex = 50;
@ -551,13 +555,14 @@
this.treTreeView.Enabled = false;
this.treTreeView.Location = new System.Drawing.Point(420, 503);
this.treTreeView.Name = "treTreeView";
this.treTreeView.Size = new System.Drawing.Size(200, 276);
this.treTreeView.Size = new System.Drawing.Size(332, 276);
this.treTreeView.TabIndex = 51;
this.treTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treTreeView_AfterSelect);
//
// cmdGoToStart
//
this.cmdGoToStart.Enabled = false;
this.cmdGoToStart.Location = new System.Drawing.Point(629, 529);
this.cmdGoToStart.Location = new System.Drawing.Point(758, 525);
this.cmdGoToStart.Name = "cmdGoToStart";
this.cmdGoToStart.Size = new System.Drawing.Size(108, 40);
this.cmdGoToStart.TabIndex = 52;
@ -569,7 +574,7 @@
// cmdGoToNextVSync
//
this.cmdGoToNextVSync.Enabled = false;
this.cmdGoToNextVSync.Location = new System.Drawing.Point(629, 671);
this.cmdGoToNextVSync.Location = new System.Drawing.Point(758, 667);
this.cmdGoToNextVSync.Name = "cmdGoToNextVSync";
this.cmdGoToNextVSync.Size = new System.Drawing.Size(108, 40);
this.cmdGoToNextVSync.TabIndex = 53;
@ -578,11 +583,51 @@
this.cmdGoToNextVSync.UseVisualStyleBackColor = true;
this.cmdGoToNextVSync.Click += new System.EventHandler(this.cmdGoToNextVSync_Click);
//
// txtGifPacketSize
//
this.txtGifPacketSize.AutoSize = true;
this.txtGifPacketSize.Location = new System.Drawing.Point(873, 502);
this.txtGifPacketSize.Name = "txtGifPacketSize";
this.txtGifPacketSize.Size = new System.Drawing.Size(0, 13);
this.txtGifPacketSize.TabIndex = 55;
//
// lblGIFPacketSize
//
this.lblGIFPacketSize.AutoSize = true;
this.lblGIFPacketSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblGIFPacketSize.Location = new System.Drawing.Point(873, 487);
this.lblGIFPacketSize.Name = "lblGIFPacketSize";
this.lblGIFPacketSize.Size = new System.Drawing.Size(95, 13);
this.lblGIFPacketSize.TabIndex = 54;
this.lblGIFPacketSize.Text = "Gif Packet Size";
//
// treeGifPacketContent
//
this.treeGifPacketContent.Enabled = false;
this.treeGifPacketContent.Location = new System.Drawing.Point(871, 541);
this.treeGifPacketContent.Name = "treeGifPacketContent";
this.treeGifPacketContent.Size = new System.Drawing.Size(278, 238);
this.treeGifPacketContent.TabIndex = 57;
//
// lblContent
//
this.lblContent.AutoSize = true;
this.lblContent.Enabled = false;
this.lblContent.Location = new System.Drawing.Point(871, 525);
this.lblContent.Name = "lblContent";
this.lblContent.Size = new System.Drawing.Size(101, 13);
this.lblContent.TabIndex = 56;
this.lblContent.Text = "GIF Packet Content";
//
// GSDumpGUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(988, 790);
this.ClientSize = new System.Drawing.Size(1164, 790);
this.Controls.Add(this.treeGifPacketContent);
this.Controls.Add(this.lblContent);
this.Controls.Add(this.txtGifPacketSize);
this.Controls.Add(this.lblGIFPacketSize);
this.Controls.Add(this.cmdGoToNextVSync);
this.Controls.Add(this.cmdGoToStart);
this.Controls.Add(this.treTreeView);
@ -699,6 +744,10 @@
public System.Windows.Forms.Button btnRunToSelection;
public System.Windows.Forms.Button cmdGoToStart;
public System.Windows.Forms.Button cmdGoToNextVSync;
public System.Windows.Forms.Label txtGifPacketSize;
private System.Windows.Forms.Label lblGIFPacketSize;
public System.Windows.Forms.TreeView treeGifPacketContent;
public System.Windows.Forms.Label lblContent;
}
}

View File

@ -328,20 +328,6 @@ namespace GSDumpGUI
if (e.KeyCode == Keys.F1)
cmdConfigGSDX_Click(sender, e);
if ((e.KeyCode == Keys.Down))
{
e.Handled = true;
if (lstDumps.Items.Count > lstDumps.SelectedIndex + 1)
lstDumps.SelectedIndex++;
}
if ((e.KeyCode == Keys.Up))
{
e.Handled = true;
if (lstDumps.SelectedIndex > 0)
lstDumps.SelectedIndex--;
}
if ((e.KeyCode == Keys.F2))
SelectedRad++;
}
@ -442,5 +428,17 @@ namespace GSDumpGUI
msg.MessageType = MessageType.RunToNextVSync;
Program.Clients.Find(a => a.IPAddress == lstProcesses.SelectedItem.ToString()).Send(msg);
}
private void treTreeView_AfterSelect(object sender, TreeViewEventArgs e)
{
if (treTreeView.SelectedNode != null)
{
TCPMessage msg = new TCPMessage();
msg.MessageType = MessageType.PacketInfo;
msg.Parameters.Add(Convert.ToInt32(treTreeView.SelectedNode.Text.Split(new string[] { " - " }, StringSplitOptions.None)[0]));
Program.Clients.Find(a => a.IPAddress == lstProcesses.SelectedItem.ToString()).Send(msg);
}
treTreeView.SelectedNode = e.Node;
}
}
}

View File

@ -55,6 +55,7 @@
<Compile Include="Forms\frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon>
</Compile>
<Compile Include="Library\GSDump\GSData\GIFTag.cs" />
<Compile Include="Library\GSDump\GSData\GSData.cs" />
<Compile Include="Library\GSDump\GSDump.cs" />
<Compile Include="Library\GSDump\GSData\GSTransfer.cs" />

View File

@ -13,6 +13,7 @@ namespace GSDumpGUI
public delegate void GSgifTransfer2(IntPtr data, int size);
public delegate void GSgifTransfer3(IntPtr data, int size);
public delegate void GSVSync(byte field);
public delegate void GSreset();
public delegate void GSreadFIFO2(IntPtr data, int size);
public delegate void GSsetGameCRC(int crc, int options);
public delegate int GSfreeze(int mode, IntPtr data);
@ -43,6 +44,7 @@ namespace GSDumpGUI
private GSshutdown GSshutdown;
private GSsetBaseMem GSsetBaseMem;
private GSinit GSinit;
private GSreset GSreset;
private Boolean Loaded;
@ -125,6 +127,7 @@ namespace GSDumpGUI
IntPtr funcaddrGIF3 = NativeMethods.GetProcAddress(hmod, "GSgifTransfer3");
IntPtr funcaddrVSync = NativeMethods.GetProcAddress(hmod, "GSvsync");
IntPtr funcaddrSetBaseMem = NativeMethods.GetProcAddress(hmod, "GSsetBaseMem");
IntPtr funcaddrGSReset = NativeMethods.GetProcAddress(hmod, "GSreset");
IntPtr funcaddrOpen = NativeMethods.GetProcAddress(hmod, "GSopen");
IntPtr funcaddrSetCRC = NativeMethods.GetProcAddress(hmod, "GSsetGameCRC");
IntPtr funcaddrClose = NativeMethods.GetProcAddress(hmod, "GSclose");
@ -147,6 +150,7 @@ namespace GSDumpGUI
this.GSclose = (GSclose)Marshal.GetDelegateForFunctionPointer(funcaddrClose, typeof(GSclose));
this.GSshutdown = (GSshutdown)Marshal.GetDelegateForFunctionPointer(funcaddrShutdown, typeof(GSshutdown));
this.GSfreeze = (GSfreeze)Marshal.GetDelegateForFunctionPointer(funcaddrFreeze, typeof(GSfreeze));
this.GSreset = (GSreset)Marshal.GetDelegateForFunctionPointer(funcaddrGSReset, typeof(GSreset));
this.GSreadFIFO2 = (GSreadFIFO2)Marshal.GetDelegateForFunctionPointer(funcaddrGSreadFIFO2, typeof(GSreadFIFO2));
this.GSinit = (GSinit)Marshal.GetDelegateForFunctionPointer(funcaddrinit, typeof(GSinit));
@ -181,8 +185,6 @@ namespace GSDumpGUI
Running = true;
ExternalEvent = new AutoResetEvent(true);
int lastVSyncField;
GSinit();
byte[] tempregisters = new byte[8192];
Array.Copy(dump.Registers, tempregisters, 8192);
@ -192,6 +194,7 @@ namespace GSDumpGUI
Int32 HWND = 0;
GSopen(new IntPtr(&HWND), "", rendererOverride);
GSsetGameCRC(dump.CRC, 0);
fixed (byte* freeze = dump.StateData)
{
byte[] GSFreez = new byte[8];
@ -216,7 +219,9 @@ namespace GSDumpGUI
break;
}
GSreset();
Marshal.Copy(dump.Registers, 0, new IntPtr(pointer), 8192);
GSsetBaseMem(new IntPtr(pointer));
GSfreeze(0, new IntPtr(fr));
for (int i = 0; i < dump.Data.Count; i++)
@ -234,8 +239,6 @@ namespace GSDumpGUI
GSData g = new GSData();
g.id = GSType.VSync;
g.data = new byte[1];
g.data[0] = 0;
Step(g, pointer);
TCPMessage Msg = new TCPMessage();
@ -274,21 +277,17 @@ namespace GSDumpGUI
{
case MessageType.Step:
RunTo = i;
i = -1;
break;
case MessageType.RunToCursor:
RunTo = (int)Mess.Parameters[0];
i = -1;
break;
case MessageType.RunToNextVSync:
RunTo = dump.Data.FindIndex(i, a => a.id == GSType.VSync);
i = -1;
break;
default:
break;
}
Marshal.Copy(dump.Registers, 0, new IntPtr(pointer), 8192);
GSfreeze(0, new IntPtr(fr));
break;
}
}
}
@ -308,7 +307,7 @@ namespace GSDumpGUI
private unsafe void Step(GSData itm, byte* registers)
{
/*"C:\Users\Alessio\Desktop\Plugins\Dll\gsdx-sse4-r3878.dll" "C:\Users\Alessio\Desktop\Plugins\Dumps\gsdx_20101219182059.gs" "GSReplay" 0*/
/*"C:\Users\Alessio\Desktop\Plugins\Dll\GSdx-SSE4.dll" "C:\Users\Alessio\Desktop\Plugins\Dumps\gsdx_20101222215004.gs" "GSReplay" 0*/
switch (itm.id)
{
case GSType.Transfer:
@ -344,7 +343,7 @@ namespace GSDumpGUI
}
break;
case GSType.VSync:
GSVSync(itm.data[0]);
GSVSync((*((int*)(registers + 4096)) & 0x2000) > 0 ? (byte)1 : (byte)0);
break;
case GSType.ReadFIFO2:
fixed (byte* FIFO = itm.data)
@ -378,15 +377,94 @@ namespace GSDumpGUI
act += dump.Data[i].id.ToString() + "|";
if (dump.Data[i].GetType().IsSubclassOf(typeof(GSData)))
{
act += ((GSTransfer)dump.Data[i]).Path.ToString();
act += ((GSTransfer)dump.Data[i]).Path.ToString() + "|";
act += ((GSTransfer)dump.Data[i]).data.Length;
}
else
{
act += ((GSData)dump.Data[i]).data.Length;
}
Data.Add(act);
}
return Data;
}
internal String GetGifPacketInfo(GSDump dump, int i)
{
string val = dump.Data[i].data.Length.ToString() + "|";
switch (dump.Data[i].id)
{
case GSType.Transfer:
GIFTag tag = ExtractGifTag(dump.Data[i].data);
val += "Transfer Path " + ((GSTransfer)dump.Data[i]).Path.ToString() + "|";
val += "NLoop = " + tag.nloop + "|";
//val += "Pad1 = " + tag._pad1 + "|";
//val += "Pad2 = " + tag._pad2 + "|";
val += "eop = " + tag.eop + "|";
val += "flg = " + ((GIFFLG)tag.flg).ToString() + "|";
val += "pre = " + tag.pre + "|";
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 + "|";
val += "nreg = " + tag.nreg + "|";
val += "regs = " + tag.regs;
break;
case GSType.VSync:
val += "Field = " + dump.Data[i].data[0].ToString();
break;
case GSType.ReadFIFO2:
val += "ReadFIFO2 : Size = " + BitConverter.ToInt32(dump.Data[i].data, 0).ToString() + " byte";
break;
case GSType.Registers:
val += "Registers";
break;
default:
break;
}
return val;
}
internal GIFTag ExtractGifTag(byte[] data)
{
Int16 nloopEOP = 0;
Int16 pad1 = 0;
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);
GIFTag t = new GIFTag();
t.nloop = (nloopEOP & 0x7FFF);
t.eop = (nloopEOP & 0x8000) >> 15;
t._pad1 = pad1;
t._pad2 = (pad2PrePrimFlgNReg & 0x00003FFF);
t.pre = (pad2PrePrimFlgNReg & 0x00004000) >> 14;
int prim = (pad2PrePrimFlgNReg & 0x03FF8000) >> 15;
GIFPrim pri = new GIFPrim();
pri.Prim = (prim & 0x007);
pri.IIP = (prim & 0x008) >> 3;
pri.TME = (prim & 0x010) >> 4;
pri.FGE = (prim & 0x020) >> 5;
pri.ABE = (prim & 0x040) >> 6;
pri.AA1 = (prim & 0x080) >> 7;
pri.FST = (prim & 0x100) >> 8;
pri.CTXT = (prim & 0x200) >> 9;
pri.FIX = (prim & 0x400) >> 10;
t.prim = pri;
t.flg = (pad2PrePrimFlgNReg & 0xC000000) >> 26;
t.nreg = (int)(pad2PrePrimFlgNReg & 0xF0000000) >> 28;
t.regs = regs;
return t;
}
}
}

View File

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace GSDumpGUI
{
public class GIFTag
{
public Int32 nloop;
public Int32 eop;
public Int32 _pad1;
public Int32 _pad2;
public Int32 pre;
public GIFPrim prim;
public Int32 flg;
public Int32 nreg;
public Int64 regs;
}
public class GIFPrim
{
public Int32 Prim;
public Int32 IIP;
public Int32 TME;
public Int32 FGE;
public Int32 ABE;
public Int32 AA1;
public Int32 FST;
public Int32 CTXT;
public Int32 FIX;
}
public enum GIFFLG
{
GIF_FLG_PACKED =0,
GIF_FLG_REGLIST =1,
GIF_FLG_IMAGE = 2,
GIF_FLG_IMAGE2 = 3
}
public enum GS_PRIM
{
GS_POINTLIST = 0,
GS_LINELIST = 1,
GS_LINESTRIP = 2,
GS_TRIANGLELIST = 3,
GS_TRIANGLESTRIP = 4,
GS_TRIANGLEFAN = 5,
GS_SPRITE = 6,
GS_INVALID = 7,
}
}

View File

@ -116,6 +116,7 @@ namespace TCPLibrary.MessageBased.Core
GetDebugMode,
SetDebugMode,
DebugState,
PacketInfo,
Step,
RunToCursor,