Modified a little the code to be more modular. Should not change the behaviour.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4112 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
feal87@gmail.com 2010-12-20 16:28:59 +00:00
parent 9c9e2b8c51
commit 39780dcc10
5 changed files with 51 additions and 19 deletions

View File

@ -55,8 +55,9 @@
<Compile Include="Forms\frmMain.Designer.cs"> <Compile Include="Forms\frmMain.Designer.cs">
<DependentUpon>frmMain.cs</DependentUpon> <DependentUpon>frmMain.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Library\GSDump\GSData.cs" /> <Compile Include="Library\GSDump\GSData\GSData.cs" />
<Compile Include="Library\GSDump\GSDump.cs" /> <Compile Include="Library\GSDump\GSDump.cs" />
<Compile Include="Library\GSDump\GSData\GSTransfer.cs" />
<Compile Include="Library\GSDXWrapper.cs" /> <Compile Include="Library\GSDXWrapper.cs" />
<Compile Include="Library\NativeMethods.cs" /> <Compile Include="Library\NativeMethods.cs" />
<Compile Include="Core\Program.cs" /> <Compile Include="Core\Program.cs" />

View File

@ -200,30 +200,30 @@ namespace GSDumpGUI
switch (itm.id) switch (itm.id)
{ {
case GSType.Transfer: case GSType.Transfer:
switch (itm.data[0]) switch (((GSTransfer)itm).Path)
{ {
case 0: case GSTransferPath.Path1Old:
fixed (byte* gifdata = itm.data) fixed (byte* gifdata = itm.data)
{ {
GSgifTransfer(new IntPtr(gifdata + 1), (itm.data.Length - 1) / 16); GSgifTransfer(new IntPtr(gifdata), (itm.data.Length) / 16);
} }
break; break;
case 1: case GSTransferPath.Path2:
fixed (byte* gifdata = itm.data) fixed (byte* gifdata = itm.data)
{ {
GSgifTransfer2(new IntPtr(gifdata + 1), (itm.data.Length - 1) /16); GSgifTransfer2(new IntPtr(gifdata), (itm.data.Length) /16);
} }
break; break;
case 2: case GSTransferPath.Path3:
fixed (byte* gifdata = itm.data) fixed (byte* gifdata = itm.data)
{ {
GSgifTransfer3(new IntPtr(gifdata + 1), (itm.data.Length - 1) /16); GSgifTransfer3(new IntPtr(gifdata), (itm.data.Length) /16);
} }
break; break;
case 3: case GSTransferPath.Path1New:
fixed (byte* gifdata = itm.data) fixed (byte* gifdata = itm.data)
{ {
GSgifTransfer(new IntPtr(gifdata + 1), (itm.data.Length - 1) /16); GSgifTransfer(new IntPtr(gifdata), (itm.data.Length) /16);
} }
break; break;
} }

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace GSDumpGUI
{
public class GSTransfer : GSData
{
public GSTransferPath Path;
}
public enum GSTransferPath
{
Path1Old = 0,
Path2 = 1,
Path3 = 2,
Path1New = 3
}
}

View File

@ -46,34 +46,46 @@ namespace GSDumpGUI
while (br.PeekChar() != -1) while (br.PeekChar() != -1)
{ {
GSData data = new GSData(); GSType id = (GSType)br.ReadByte();
data.id = (GSType)br.ReadByte(); switch (id)
switch (data.id)
{ {
case GSType.Transfer: case GSType.Transfer:
GSTransfer data = new GSTransfer();
byte index = br.ReadByte(); byte index = br.ReadByte();
data.id = id;
data.Path = (GSTransferPath)index;
Int32 size = br.ReadInt32(); Int32 size = br.ReadInt32();
List<byte> Data = new List<byte>(); List<byte> Data = new List<byte>();
Data.Add(index);
Data.AddRange(br.ReadBytes(size)); Data.AddRange(br.ReadBytes(size));
data.data = Data.ToArray(); data.data = Data.ToArray();
dmp.Data.Add(data);
break; break;
case GSType.VSync: case GSType.VSync:
data.data = br.ReadBytes(1); GSData dataV = new GSData();
dataV.id = id;
dataV.data = br.ReadBytes(1);
dmp.Data.Add(dataV);
break; break;
case GSType.ReadFIFO2: case GSType.ReadFIFO2:
GSData dataR = new GSData();
dataR.id = id;
Int32 sF = br.ReadInt32(); Int32 sF = br.ReadInt32();
data.data = BitConverter.GetBytes(sF); dataR.data = BitConverter.GetBytes(sF);
dmp.Data.Add(dataR);
break; break;
case GSType.Registers: case GSType.Registers:
data.data = br.ReadBytes(8192); GSData dataRR = new GSData();
dataRR.id = id;
dataRR.data = br.ReadBytes(8192);
dmp.Data.Add(dataRR);
break; break;
default: default:
break; break;
} }
dmp.Data.Add(data);
} }
br.Close(); br.Close();