コード例 #1
0
        static void WriteColumn32(int y, int dstIndex, int srcIndex, int srcpitch, byte[] src, ref byte[] dst)
        {
            var i            = ((y >> 1) & 3);
            var srcMemStr    = new MemoryStream(src);
            var dstMemStr    = new MemoryStream(dst);
            var srcBinRead   = new BinaryReader(srcMemStr);
            var dstBinWriter = new BinaryWriter(dstMemStr);

            dstBinWriter.BaseStream.Position = i * 4 * 16 + dstIndex;
            srcBinRead.BaseStream.Position   = srcIndex;

            Util.GSVector4i v0 = Util.GSVector4i.Read(srcBinRead);
            Util.GSVector4i v1 = Util.GSVector4i.Read(srcBinRead);
            srcBinRead.BaseStream.Position = srcIndex + srcpitch;
            Util.GSVector4i v2 = Util.GSVector4i.Read(srcBinRead);
            Util.GSVector4i v3 = Util.GSVector4i.Read(srcBinRead);

            Util.GSVector4i.sw64(ref v0, ref v2, ref v1, ref v3);

            v0.Write(dstBinWriter);
            v1.Write(dstBinWriter);
            v2.Write(dstBinWriter);
            v3.Write(dstBinWriter);

            srcBinRead.Close();
            dstBinWriter.Close();
        }
コード例 #2
0
        public GSVector4i uph64(GSVector4i a)
        {
            var result = new GSVector4i();

            result.vec.u64[0] = this.vec.u64[1];
            result.vec.u64[1] = a.vec.u64[1];

            return(result);
        }
コード例 #3
0
        public static void sw64(ref GSVector4i a, ref GSVector4i b, ref GSVector4i c, ref GSVector4i d)
        {
            GSVector4i e = (GSVector4i)a.MemberwiseClone();
            GSVector4i f = (GSVector4i)c.MemberwiseClone();

            a = e.upl64(b);
            c = e.uph64(b);
            b = f.upl64(d);
            d = f.uph64(d);
        }
コード例 #4
0
        public static GSVector4i Read(BinaryReader reader)
        {
            var vec     = new GSVector4i();
            var byteVec = reader.ReadBytes(16);

            fixed(byte *b = byteVec, dst = vec.vec.u8)
            {
                byte *pd = dst;
                byte *ps = b;

                for (var i = 0; i < 16; ++i)
                {
                    *pd = *ps;
                    pd++;
                    ps++;
                }
            }

            return(vec);
        }