mirror of https://github.com/PCSX2/pcsx2.git
GSDumpGUI: compiles again, made changes for future reconstitution of GIF primitives and packets
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4149 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
56a066c394
commit
8053998ebc
|
@ -7,6 +7,17 @@ namespace GSDumpGUI
|
||||||
abstract public class GIFReg : IGifData
|
abstract public class GIFReg : IGifData
|
||||||
{
|
{
|
||||||
public GIFRegDescriptor Descriptor;
|
public GIFRegDescriptor Descriptor;
|
||||||
|
public UInt64 LowData, HighData;
|
||||||
|
public bool PackedFormat;
|
||||||
|
|
||||||
|
private GIFReg() { }
|
||||||
|
|
||||||
|
public GIFReg(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
|
{
|
||||||
|
this.LowData = LowData;
|
||||||
|
this.HighData = HighData;
|
||||||
|
this.PackedFormat = PackedFormat;
|
||||||
|
}
|
||||||
|
|
||||||
static public UInt64 GetBit(UInt64 value, byte lower, byte count)
|
static public UInt64 GetBit(UInt64 value, byte lower, byte count)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,14 +4,14 @@ using System.Text;
|
||||||
|
|
||||||
namespace GSDumpGUI
|
namespace GSDumpGUI
|
||||||
{
|
{
|
||||||
public class GIFRegAD : GIFReg
|
public static class GIFRegAD
|
||||||
{
|
{
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
int reg = (int)GetBit(HighData, 0, 8);
|
int reg = (int)GIFReg.GetBit(HighData, 0, 8);
|
||||||
if (reg == (int)GIFRegDescriptor.AD)
|
if (reg == (int)GIFRegDescriptor.AD)
|
||||||
return GIFRegNOP.Unpack(tag, reg, LowData, HighData, PackedFormat);
|
return GIFRegNOP.Unpack(tag, reg, LowData, HighData, PackedFormat);
|
||||||
return GIFTag.GetUnpack(reg)(tag, reg, LowData, 0, false);
|
return GIFTag.GetUnpack(reg)(tag, reg, LowData, HighData, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,11 @@ namespace GSDumpGUI
|
||||||
{
|
{
|
||||||
public double F;
|
public double F;
|
||||||
|
|
||||||
|
public GIFRegFOG(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegFOG u = new GIFRegFOG();
|
GIFRegFOG u = new GIFRegFOG(addr, LowData, HighData, PackedFormat);
|
||||||
u.Descriptor = (GIFRegDescriptor)addr;
|
u.Descriptor = (GIFRegDescriptor)addr;
|
||||||
if (PackedFormat)
|
if (PackedFormat)
|
||||||
u.F = (UInt16)(GetBit(HighData, 36, 8));
|
u.F = (UInt16)(GetBit(HighData, 36, 8));
|
||||||
|
@ -18,5 +20,10 @@ namespace GSDumpGUI
|
||||||
u.F = GetBit(LowData, 56, 8);
|
u.F = GetBit(LowData, 56, 8);
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return Descriptor.ToString() + "@F : " + F.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,21 @@ namespace GSDumpGUI
|
||||||
{
|
{
|
||||||
public class GIFRegNOP : GIFReg
|
public class GIFRegNOP : GIFReg
|
||||||
{
|
{
|
||||||
|
public int addr;
|
||||||
|
|
||||||
|
public GIFRegNOP(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegNOP nop = new GIFRegNOP();
|
GIFRegNOP nop = new GIFRegNOP(addr, LowData, HighData, PackedFormat);
|
||||||
nop.Descriptor = GIFRegDescriptor.NOP;
|
nop.Descriptor = GIFRegDescriptor.NOP;
|
||||||
|
|
||||||
return nop;
|
return nop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return Descriptor.ToString() + " (0x" + addr.ToString("X2") + ")";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,11 @@ namespace GSDumpGUI
|
||||||
public GSCTXT CTXT;
|
public GSCTXT CTXT;
|
||||||
public GSFIX FIX;
|
public GSFIX FIX;
|
||||||
|
|
||||||
|
public GIFRegPRIM(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegPRIM pr = new GIFRegPRIM();
|
GIFRegPRIM pr = new GIFRegPRIM(addr, LowData, HighData, PackedFormat);
|
||||||
pr.Descriptor = (GIFRegDescriptor)addr;
|
pr.Descriptor = (GIFRegDescriptor)addr;
|
||||||
pr.PrimitiveType = (GS_PRIM)GetBit(LowData, 0, 3);
|
pr.PrimitiveType = (GS_PRIM)GetBit(LowData, 0, 3);
|
||||||
pr.IIP = (GSIIP)GetBit(LowData, 3, 1);
|
pr.IIP = (GSIIP)GetBit(LowData, 3, 1);
|
||||||
|
|
|
@ -12,9 +12,11 @@ namespace GSDumpGUI
|
||||||
public int A;
|
public int A;
|
||||||
public float Q;
|
public float Q;
|
||||||
|
|
||||||
|
public GIFRegRGBAQ(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegRGBAQ r = new GIFRegRGBAQ();
|
GIFRegRGBAQ r = new GIFRegRGBAQ(addr, LowData, HighData, PackedFormat);
|
||||||
r.Descriptor = (GIFRegDescriptor)addr;
|
r.Descriptor = (GIFRegDescriptor)addr;
|
||||||
if (PackedFormat)
|
if (PackedFormat)
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,9 +12,11 @@ namespace GSDumpGUI
|
||||||
|
|
||||||
public bool isSTQ;
|
public bool isSTQ;
|
||||||
|
|
||||||
|
public GIFRegST(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegST st = new GIFRegST();
|
GIFRegST st = new GIFRegST(addr, LowData, HighData, PackedFormat);
|
||||||
st.Descriptor = (GIFRegDescriptor)addr;
|
st.Descriptor = (GIFRegDescriptor)addr;
|
||||||
|
|
||||||
st.S = BitConverter.ToSingle(BitConverter.GetBytes(LowData), 0);
|
st.S = BitConverter.ToSingle(BitConverter.GetBytes(LowData), 0);
|
||||||
|
|
|
@ -19,9 +19,11 @@ namespace GSDumpGUI
|
||||||
public int CSA;
|
public int CSA;
|
||||||
public int CLD;
|
public int CLD;
|
||||||
|
|
||||||
|
public GIFRegTEX0(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegTEX0 tex0 = new GIFRegTEX0();
|
GIFRegTEX0 tex0 = new GIFRegTEX0(addr, LowData, HighData, PackedFormat);
|
||||||
tex0.Descriptor = (GIFRegDescriptor)addr;
|
tex0.Descriptor = (GIFRegDescriptor)addr;
|
||||||
tex0.TBP0 = (int)GetBit(LowData, 0, 14);
|
tex0.TBP0 = (int)GetBit(LowData, 0, 14);
|
||||||
tex0.TBW = (int)GetBit(LowData, 14, 6);
|
tex0.TBW = (int)GetBit(LowData, 14, 6);
|
||||||
|
|
|
@ -9,9 +9,11 @@ namespace GSDumpGUI
|
||||||
public double U;
|
public double U;
|
||||||
public double V;
|
public double V;
|
||||||
|
|
||||||
|
public GIFRegUV(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegUV uv = new GIFRegUV();
|
GIFRegUV uv = new GIFRegUV(addr, LowData, HighData, PackedFormat);
|
||||||
uv.Descriptor = (GIFRegDescriptor)addr;
|
uv.Descriptor = (GIFRegDescriptor)addr;
|
||||||
if (PackedFormat)
|
if (PackedFormat)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,11 +6,18 @@ namespace GSDumpGUI
|
||||||
{
|
{
|
||||||
public class GIFRegUnimpl : GIFReg
|
public class GIFRegUnimpl : GIFReg
|
||||||
{
|
{
|
||||||
|
public GIFRegUnimpl(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegUnimpl u = new GIFRegUnimpl();
|
GIFRegUnimpl u = new GIFRegUnimpl(addr, LowData, HighData, PackedFormat);
|
||||||
u.Descriptor = (GIFRegDescriptor)addr;
|
u.Descriptor = (GIFRegDescriptor)addr;
|
||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return Descriptor.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,11 @@ namespace GSDumpGUI
|
||||||
|
|
||||||
public bool IsXYZF;
|
public bool IsXYZF;
|
||||||
|
|
||||||
|
public GIFRegXYZF(int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
||||||
|
|
||||||
static public GIFReg UnpackXYZ(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg UnpackXYZ(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegXYZF xyzf = new GIFRegXYZF();
|
GIFRegXYZF xyzf = new GIFRegXYZF(addr, LowData, HighData, PackedFormat);
|
||||||
|
|
||||||
xyzf.IsXYZF = false;
|
xyzf.IsXYZF = false;
|
||||||
if (PackedFormat && addr == (int)GIFRegDescriptor.XYZ2 && GetBit(HighData, 47, 1) == 1)
|
if (PackedFormat && addr == (int)GIFRegDescriptor.XYZ2 && GetBit(HighData, 47, 1) == 1)
|
||||||
|
@ -40,7 +42,7 @@ namespace GSDumpGUI
|
||||||
|
|
||||||
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
static public GIFReg Unpack(GIFTag tag, int addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
||||||
{
|
{
|
||||||
GIFRegXYZF xyzf = new GIFRegXYZF();
|
GIFRegXYZF xyzf = new GIFRegXYZF(addr, LowData, HighData, PackedFormat);
|
||||||
|
|
||||||
xyzf.IsXYZF = true;
|
xyzf.IsXYZF = true;
|
||||||
if (PackedFormat && addr == (int)GIFRegDescriptor.XYZF2 && GetBit(HighData, 47, 1) == 1)
|
if (PackedFormat && addr == (int)GIFRegDescriptor.XYZF2 && GetBit(HighData, 47, 1) == 1)
|
||||||
|
|
Loading…
Reference in New Issue