diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFReg.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFReg.cs index 9f32739566..ca8e356b91 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFReg.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFReg.cs @@ -7,6 +7,17 @@ namespace GSDumpGUI abstract public class GIFReg : IGifData { 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) { diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegAD.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegAD.cs index 054743f7ac..c32b3ac183 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegAD.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegAD.cs @@ -4,14 +4,14 @@ using System.Text; namespace GSDumpGUI { - public class GIFRegAD : GIFReg + public static class GIFRegAD { 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) 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); } } } diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegFOG.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegFOG.cs index 78dcaa6565..c4b985dfe0 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegFOG.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegFOG.cs @@ -8,9 +8,11 @@ namespace GSDumpGUI { 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) { - GIFRegFOG u = new GIFRegFOG(); + GIFRegFOG u = new GIFRegFOG(addr, LowData, HighData, PackedFormat); u.Descriptor = (GIFRegDescriptor)addr; if (PackedFormat) u.F = (UInt16)(GetBit(HighData, 36, 8)); @@ -18,5 +20,10 @@ namespace GSDumpGUI u.F = GetBit(LowData, 56, 8); return u; } + + public override string ToString() + { + return Descriptor.ToString() + "@F : " + F.ToString(); + } } } diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegNOP.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegNOP.cs index 53af7b5790..d07052720b 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegNOP.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegNOP.cs @@ -6,11 +6,21 @@ namespace GSDumpGUI { 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) { - GIFRegNOP nop = new GIFRegNOP(); + GIFRegNOP nop = new GIFRegNOP(addr, LowData, HighData, PackedFormat); nop.Descriptor = GIFRegDescriptor.NOP; + return nop; } + + public override string ToString() + { + return Descriptor.ToString() + " (0x" + addr.ToString("X2") + ")"; + } } } diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegPrim.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegPrim.cs index f1e041ad67..f8cf281cd8 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegPrim.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegPrim.cs @@ -16,9 +16,11 @@ namespace GSDumpGUI public GSCTXT CTXT; 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) { - GIFRegPRIM pr = new GIFRegPRIM(); + GIFRegPRIM pr = new GIFRegPRIM(addr, LowData, HighData, PackedFormat); pr.Descriptor = (GIFRegDescriptor)addr; pr.PrimitiveType = (GS_PRIM)GetBit(LowData, 0, 3); pr.IIP = (GSIIP)GetBit(LowData, 3, 1); diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegRGBAQ.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegRGBAQ.cs index cc2939b899..41e46e3d99 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegRGBAQ.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegRGBAQ.cs @@ -12,9 +12,11 @@ namespace GSDumpGUI public int A; 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) { - GIFRegRGBAQ r = new GIFRegRGBAQ(); + GIFRegRGBAQ r = new GIFRegRGBAQ(addr, LowData, HighData, PackedFormat); r.Descriptor = (GIFRegDescriptor)addr; if (PackedFormat) { diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegST.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegST.cs index 2610a027f7..fb15980ab2 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegST.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegST.cs @@ -12,9 +12,11 @@ namespace GSDumpGUI 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) { - GIFRegST st = new GIFRegST(); + GIFRegST st = new GIFRegST(addr, LowData, HighData, PackedFormat); st.Descriptor = (GIFRegDescriptor)addr; st.S = BitConverter.ToSingle(BitConverter.GetBytes(LowData), 0); diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegTEX0.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegTEX0.cs index 1baf8ced10..1f859964ca 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegTEX0.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegTEX0.cs @@ -19,9 +19,11 @@ namespace GSDumpGUI public int CSA; 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) { - GIFRegTEX0 tex0 = new GIFRegTEX0(); + GIFRegTEX0 tex0 = new GIFRegTEX0(addr, LowData, HighData, PackedFormat); tex0.Descriptor = (GIFRegDescriptor)addr; tex0.TBP0 = (int)GetBit(LowData, 0, 14); tex0.TBW = (int)GetBit(LowData, 14, 6); diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegUV.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegUV.cs index 469bec35c8..d5ecf32131 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegUV.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegUV.cs @@ -9,9 +9,11 @@ namespace GSDumpGUI public double U; 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) { - GIFRegUV uv = new GIFRegUV(); + GIFRegUV uv = new GIFRegUV(addr, LowData, HighData, PackedFormat); uv.Descriptor = (GIFRegDescriptor)addr; if (PackedFormat) { diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegUnimpl.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegUnimpl.cs index 2171bdaeb0..c82f5a2b22 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegUnimpl.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegUnimpl.cs @@ -6,11 +6,18 @@ namespace GSDumpGUI { 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) { - GIFRegUnimpl u = new GIFRegUnimpl(); + GIFRegUnimpl u = new GIFRegUnimpl(addr, LowData, HighData, PackedFormat); u.Descriptor = (GIFRegDescriptor)addr; return u; } + + public override string ToString() + { + return Descriptor.ToString(); + } } } diff --git a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegXYZF.cs b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegXYZF.cs index 8c86ddc299..0a85e3b974 100644 --- a/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegXYZF.cs +++ b/tools/GSDumpGUI/Library/GSDump/GSData/GIFPacket/GIFReg/GIFRegXYZF.cs @@ -13,9 +13,11 @@ namespace GSDumpGUI 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) { - GIFRegXYZF xyzf = new GIFRegXYZF(); + GIFRegXYZF xyzf = new GIFRegXYZF(addr, LowData, HighData, PackedFormat); xyzf.IsXYZF = false; 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) { - GIFRegXYZF xyzf = new GIFRegXYZF(); + GIFRegXYZF xyzf = new GIFRegXYZF(addr, LowData, HighData, PackedFormat); xyzf.IsXYZF = true; if (PackedFormat && addr == (int)GIFRegDescriptor.XYZF2 && GetBit(HighData, 47, 1) == 1)