2010-12-25 17:18:13 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace GSDumpGUI
|
|
|
|
|
{
|
2010-12-29 08:41:15 +00:00
|
|
|
|
[Serializable]
|
2010-12-26 01:00:11 +00:00
|
|
|
|
public class GIFRegPRIM : GIFReg
|
2010-12-25 17:18:13 +00:00
|
|
|
|
{
|
|
|
|
|
public GS_PRIM PrimitiveType;
|
|
|
|
|
public GSIIP IIP;
|
|
|
|
|
public bool TME;
|
|
|
|
|
public bool FGE;
|
|
|
|
|
public bool ABE;
|
|
|
|
|
public bool AA1;
|
|
|
|
|
public GSFST FST;
|
|
|
|
|
public GSCTXT CTXT;
|
|
|
|
|
public GSFIX FIX;
|
|
|
|
|
|
2010-12-28 18:31:45 +00:00
|
|
|
|
public GIFRegPRIM(byte addr, UInt64 LowData, UInt64 HighData, bool PackedFormat) : base(addr, LowData, HighData, PackedFormat) { }
|
2010-12-26 12:22:37 +00:00
|
|
|
|
|
2010-12-28 18:31:45 +00:00
|
|
|
|
static public GIFReg Unpack(GIFTag tag, byte addr, UInt64 LowData, UInt64 HighData, bool PackedFormat)
|
2010-12-25 17:18:13 +00:00
|
|
|
|
{
|
2010-12-26 12:22:37 +00:00
|
|
|
|
GIFRegPRIM pr = new GIFRegPRIM(addr, LowData, HighData, PackedFormat);
|
2010-12-26 01:00:11 +00:00
|
|
|
|
pr.Descriptor = (GIFRegDescriptor)addr;
|
|
|
|
|
pr.PrimitiveType = (GS_PRIM)GetBit(LowData, 0, 3);
|
|
|
|
|
pr.IIP = (GSIIP)GetBit(LowData, 3, 1);
|
|
|
|
|
pr.TME = Convert.ToBoolean(GetBit(LowData, 4, 1));
|
|
|
|
|
pr.FGE = Convert.ToBoolean(GetBit(LowData, 5, 1));
|
|
|
|
|
pr.ABE = Convert.ToBoolean(GetBit(LowData, 6, 1));
|
|
|
|
|
pr.AA1 = Convert.ToBoolean(GetBit(LowData, 7, 1));
|
|
|
|
|
pr.FST = (GSFST)(GetBit(LowData, 8, 1));
|
|
|
|
|
pr.CTXT = (GSCTXT)(GetBit(LowData, 9, 1));
|
|
|
|
|
pr.FIX = (GSFIX)(GetBit(LowData, 10, 1));
|
2010-12-25 17:18:13 +00:00
|
|
|
|
return pr;
|
|
|
|
|
}
|
2010-12-26 01:00:11 +00:00
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return Descriptor.ToString() + "@Primitive Type : " + PrimitiveType.ToString() + "@IIP : " + IIP.ToString() + "@TME : " + TME.ToString() + "@FGE : " + FGE.ToString()
|
|
|
|
|
+ "@ABE : " + ABE.ToString() + "@AA1 : " + AA1.ToString() + "@FST : " + FST.ToString() + "@CTXT : " + CTXT.ToString() + "@FIX : " + FIX.ToString();
|
|
|
|
|
}
|
2010-12-25 17:18:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum GSIIP
|
|
|
|
|
{
|
|
|
|
|
FlatShading=0,
|
|
|
|
|
Gouraud=1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum GSFST
|
|
|
|
|
{
|
|
|
|
|
STQValue=0,
|
|
|
|
|
UVValue=1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum GSCTXT
|
|
|
|
|
{
|
|
|
|
|
Context1 =0,
|
|
|
|
|
Context2 =1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum GSFIX
|
|
|
|
|
{
|
|
|
|
|
Unfixed =0,
|
|
|
|
|
Fixed = 1
|
|
|
|
|
}
|
|
|
|
|
}
|