Exemple #1
0
        public BCMData(BinaryReader bReader)
        {
            Int64 header = bReader.ReadInt64();

            if (header != BCM_HEADER_A)
            {
                Log(header.ToString() + " is not expected BCM header... error.");
                return;
            }
            header = bReader.ReadInt64();
            if (header != BCM_HEADER_B)
            {
                Log(header.ToString() + " is not expected BCM header... error.");
                return;
            }

            bReader.BaseStream.Seek(16, SeekOrigin.Begin);
            UInt16 size_unknown_list = bReader.ReadUInt16();

            Log(size_unknown_list + " size of unknown list");

            bReader.BaseStream.Seek(18, SeekOrigin.Begin);
            UInt16 size_motion_list = bReader.ReadUInt16();

            Log(size_motion_list + " size of motion list");

            bReader.BaseStream.Seek(20, SeekOrigin.Begin);
            UInt16 size_input_list = bReader.ReadUInt16();

            Log(size_input_list + " size of input list");

            bReader.BaseStream.Seek(22, SeekOrigin.Begin);
            UInt16 size_cancel_list = bReader.ReadUInt16();

            Log(size_cancel_list + " size of cancel list of lists");


            bReader.BaseStream.Seek(24, SeekOrigin.Begin);
            UInt32 addr_unknown_list = bReader.ReadUInt32();

            Log(addr_unknown_list + " pointer to unknown list");

            bReader.BaseStream.Seek(28, SeekOrigin.Begin);
            UInt32 addr_unknown_name_table = bReader.ReadUInt32();

            Log(addr_unknown_name_table + " pointer to unknown name table");

            bReader.BaseStream.Seek(32, SeekOrigin.Begin);
            UInt32 addr_motion_list = bReader.ReadUInt32();

            Log(addr_motion_list + " pointer to motion list");

            bReader.BaseStream.Seek(36, SeekOrigin.Begin);
            UInt32 addr_motion_name_table = bReader.ReadUInt32();

            Log(addr_motion_name_table + " pointer to motion name table");

            bReader.BaseStream.Seek(40, SeekOrigin.Begin);
            UInt32 addr_input_list = bReader.ReadUInt32();

            Log(addr_input_list + " pointer to inputs");

            bReader.BaseStream.Seek(44, SeekOrigin.Begin);
            UInt32 addr_input_name_table = bReader.ReadUInt32();

            Log(addr_input_name_table + " pointer to input name table");

            bReader.BaseStream.Seek(48, SeekOrigin.Begin);
            UInt32 addr_cancel_list = bReader.ReadUInt32();

            Log(addr_cancel_list + " pointer to cancel table");

            bReader.BaseStream.Seek(52, SeekOrigin.Begin);
            UInt32 addr_cancel_name_table = bReader.ReadUInt32();

            Log(addr_cancel_name_table + " pointer to cancel name table");

            // unknownlist
            UnknownList = new List <BCMUnknown>(size_unknown_list);
            for (int i = 0; i < size_unknown_list; i++)
            {
                BCMUnknown b = new BCMUnknown();
                bReader.BaseStream.Seek(addr_unknown_list + (BCM_UNKNOWN_SIZE * i), SeekOrigin.Begin);
                b.data = AEDataTools.SlurpBytes(bReader, BCM_UNKNOWN_SIZE);
                bReader.BaseStream.Seek(addr_unknown_name_table + (sizeof(UInt32) * i), SeekOrigin.Begin);
                UInt32 nameAddr = bReader.ReadUInt32();
                bReader.BaseStream.Seek(nameAddr, SeekOrigin.Begin);
                b.name = AEDataTools.SlurpString(bReader);
                Log(i + ". " + b.name);
                UnknownList.Add(b);
            }

            // motionlist
            MotionList = new List <BCMMotion>(size_motion_list);
            for (int i = 0; i < size_motion_list; i++)
            {
                BCMMotion b = new BCMMotion();
                bReader.BaseStream.Seek(addr_motion_list + (BCM_MOTION_SIZE * i), SeekOrigin.Begin);
                b.data = AEDataTools.SlurpBytes(bReader, BCM_MOTION_SIZE);
                //Log(b.data[0] + " and " + b.data[BCM_MOTION_SIZE-1]);
                bReader.BaseStream.Seek(addr_motion_name_table + (sizeof(UInt32) * i), SeekOrigin.Begin);
                UInt32 nameAddr = bReader.ReadUInt32();
                bReader.BaseStream.Seek(nameAddr, SeekOrigin.Begin);
                b.name = AEDataTools.SlurpString(bReader);
                Log(i + ". " + b.name);
                MotionList.Add(b);
            }

            // inputlist

            InputList = new List <BCMInput>(size_input_list);
            for (int i = 0; i < size_input_list; i++)
            {
                BCMInput b = new BCMInput();
                bReader.BaseStream.Seek(addr_input_list + (BCM_INPUT_SIZE * i), SeekOrigin.Begin);
                b.data = AEDataTools.SlurpBytes(bReader, BCM_INPUT_SIZE);
                bReader.BaseStream.Seek(addr_input_name_table + (sizeof(UInt32) * i), SeekOrigin.Begin);
                UInt32 nameAddr = bReader.ReadUInt32();
                bReader.BaseStream.Seek(nameAddr, SeekOrigin.Begin);
                b.name = AEDataTools.SlurpString(bReader);
                Log(i + ". " + b.name);
                InputList.Add(b);
            }

            // cancellist

            CancelList = new List <BCMCancel>(size_cancel_list);

            for (int i = 0; i < size_cancel_list; i++)
            {
                BCMCancel b = new BCMCancel();
                bReader.BaseStream.Seek(addr_cancel_list + (8 * i), SeekOrigin.Begin);
                UInt32 cSize = bReader.ReadUInt32();
                UInt32 cAddr = bReader.ReadUInt32();
                bReader.BaseStream.Seek(addr_cancel_list + (8 * i) + cAddr, SeekOrigin.Begin);
                b.list = AEDataTools.SlurpUInt16(bReader, (int)(cSize * 2));

                bReader.BaseStream.Seek(addr_cancel_name_table + (sizeof(UInt32) * i), SeekOrigin.Begin);
                UInt32 nameAddr = bReader.ReadUInt32();
                bReader.BaseStream.Seek(nameAddr, SeekOrigin.Begin);
                b.name = AEDataTools.SlurpString(bReader);
                Log(i + ". " + b.name);
                CancelList.Add(b);
            }
        }
Exemple #2
0
        public BACData(BinaryReader bReader)
        {
            //AELogger.Log(bReader.ReadInt64() + " " + bReader.ReadInt64(), true, true);
            Int64 header = bReader.ReadInt64();

            if (header != BAC_HEADER_A)
            {
                AELogger.Log(header.ToString() + " is not expected BAC header... error.");
                return;
            }
            header = bReader.ReadInt32();
            if (header != BAC_HEADER_B)
            {
                AELogger.Log(header.ToString() + " is not expected BAC header... error.");
                return;
            }

            bReader.BaseStream.Seek(12, SeekOrigin.Begin);
            UInt16 size_anim_list = bReader.ReadUInt16();

            AELogger.Log(size_anim_list + " size of anim list");

            bReader.BaseStream.Seek(14, SeekOrigin.Begin);
            UInt16 size_anim_b_list = bReader.ReadUInt16();

            AELogger.Log(size_anim_b_list + " size of anim b list");

            bReader.BaseStream.Seek(16, SeekOrigin.Begin);
            UInt16 size_hit_list = bReader.ReadUInt16();

            AELogger.Log(size_hit_list + " size of hit list");

            bReader.BaseStream.Seek(20, SeekOrigin.Begin);
            UInt32 addr_anim_table = bReader.ReadUInt32();

            AELogger.Log(addr_anim_table.ToString("X") + " address of animation table");

            bReader.BaseStream.Seek(24, SeekOrigin.Begin);
            UInt32 addr_anim_table_b = bReader.ReadUInt32();

            AELogger.Log(addr_anim_table_b.ToString("X") + " address of animation table b?");

            bReader.BaseStream.Seek(28, SeekOrigin.Begin);
            UInt32 addr_anim_name_table = bReader.ReadUInt32();

            AELogger.Log(addr_anim_name_table.ToString("X") + " address of animation name table");

            bReader.BaseStream.Seek(32, SeekOrigin.Begin);
            UInt32 addr_anim_name_table_b = bReader.ReadUInt32();

            AELogger.Log(addr_anim_name_table_b.ToString("X") + " address of animation name table b");

            bReader.BaseStream.Seek(36, SeekOrigin.Begin);
            UInt32 addr_hit_table = bReader.ReadUInt32();

            AELogger.Log(addr_hit_table.ToString("X") + " address of hit table");

            //672
            bReader.BaseStream.Seek(40, SeekOrigin.Begin);
            hitboxBytes = AEDataTools.SlurpBytes(bReader, BAC_HITBOX_SIZE);

            AnimList     = new List <BACAnim>(size_anim_list);
            LongestAnim  = 0;
            ShortestAnim = 4263493;
            for (UInt32 i = 0; i < size_anim_list; i++)
            {
                BACAnim b = new BACAnim();
                bReader.BaseStream.Seek(i * sizeof(UInt32) + addr_anim_table, SeekOrigin.Begin);
                UInt32 aAddr = bReader.ReadUInt32();
                UInt32 bAddr = bReader.ReadUInt32();
                while (bAddr == 0)
                {
                    bAddr = bReader.ReadUInt32();
                }

                if (aAddr != 0)
                {
                    bReader.BaseStream.Seek(aAddr, SeekOrigin.Begin);
                    b.bEmpty = false;
                    b.data   = animFromBytes(AEDataTools.SlurpBytes(bReader, (int)(bAddr - aAddr)));
                    if ((int)(bAddr - aAddr) > LongestAnim)
                    {
                        LongestAnim = (int)(bAddr - aAddr);
                    }
                    if ((int)(bAddr - aAddr) < ShortestAnim)
                    {
                        ShortestAnim = (int)(bAddr - aAddr);
                    }

                    bReader.BaseStream.Seek(addr_anim_name_table + (sizeof(UInt32) * i), SeekOrigin.Begin);
                    UInt32 nameAddr = bReader.ReadUInt32();
                    bReader.BaseStream.Seek(nameAddr, SeekOrigin.Begin);
                    b.name = AEDataTools.SlurpString(bReader);
                    AELogger.Log(i.ToString("X4") + ". " + b.name);
                    AnimList.Add(b);
                }
                else
                {
                    b.bEmpty = true;
                    AELogger.Log(i.ToString("X4") + ". empty one");
                    AnimList.Add(b);
                }
            }
            bReader.BaseStream.Seek(addr_hit_table, SeekOrigin.Begin);
            UInt32 addr_hit_table_start = bReader.ReadUInt32();

            AnimList_b = new List <BACAnim>(size_anim_b_list);
            for (UInt32 i = 0; i < size_anim_b_list; i++)
            {
                BACAnim b = new BACAnim();
                bReader.BaseStream.Seek(i * sizeof(UInt32) + addr_anim_table_b, SeekOrigin.Begin);
                UInt32 aAddr = bReader.ReadUInt32();
                UInt32 bAddr = bReader.ReadUInt32();
                while (bAddr == 0)
                {
                    bAddr = bReader.ReadUInt32();
                }
                bAddr = Math.Min(bAddr, addr_hit_table_start);

                if (aAddr != 0)
                {
                    bReader.BaseStream.Seek(aAddr, SeekOrigin.Begin);
                    b.bEmpty = false;
                    b.data   = animFromBytes(AEDataTools.SlurpBytes(bReader, (int)(bAddr - aAddr)));

                    bReader.BaseStream.Seek(addr_anim_name_table_b + (sizeof(UInt32) * (i)), SeekOrigin.Begin);
                    UInt32 nameAddr = bReader.ReadUInt32();
                    bReader.BaseStream.Seek(nameAddr, SeekOrigin.Begin);
                    b.name = AEDataTools.SlurpString(bReader);
                    AELogger.Log(i.ToString("X4") + "_b. " + b.name);
                    AnimList_b.Add(b);
                }
                else
                {
                    b.bEmpty = true;
                    AELogger.Log(i.ToString("X4") + "_b. empty one");
                    AnimList_b.Add(b);
                }
            }

            bReader.BaseStream.Seek(addr_anim_table, SeekOrigin.Begin);
            UInt32 addr_hit_table_end = bReader.ReadUInt32();

            HitList = new List <BACHit>(size_hit_list);
            for (UInt32 i = 0; i < size_hit_list; i++)
            {
                BACHit b = new BACHit();
                bReader.BaseStream.Seek(i * sizeof(UInt32) + addr_hit_table, SeekOrigin.Begin);
                UInt32 aAddr = bReader.ReadUInt32();

                if (aAddr != 0)
                {
                    bReader.BaseStream.Seek(aAddr, SeekOrigin.Begin);
                    b.bEmpty  = false;
                    b.subhits = new List <BACSubHit>(BACHit.SUBHIT_COUNT);
                    for (int j = 0; j < BACHit.SUBHIT_COUNT; j++)
                    {
                        BACSubHit bs = new BACSubHit();
                        bs.data = AEDataTools.SlurpBytes(bReader, BAC_SUB_HIT_SIZE);
                        b.subhits.Add(bs);
                    }

                    HitList.Add(b);
                }
                else
                {
                    b.bEmpty = true;
                    HitList.Add(b);
                }
            }
            // hits
            // 80 per hit
            // standing, crouching, jumping hit
            // s c j block
            // s c j counterhit
            // 3 more?
            // 80 * 12 = 960


            /*
             * bReader.BaseStream.Seek(, SeekOrigin.Begin);
             * UInt32  = bReader.ReadUInt32();
             * AELogger.Log(+"");
             */

            AELogger.Log(AnimList.Count + " is anim list size");
            AELogger.Log(AnimList_b.Count + " is anim list b size");
            AELogger.Log(HitList.Count + " is hit list size");
        }