Ejemplo n.º 1
0
        public void ProcessBbdFullAuto(string filename, byte bitScrambleMode, byte reorderMode)
        {
            BitDescrambler bitDescrambler = new BitDescrambler(filename, filename);

            bitDescrambler.ReorderAllBytes(Reorderings.GetBbdDataReorderings(bitScrambleMode));
            bitDescrambler.Save();

            BankReorderer reorderer = new BankReorderer(filename, filename);
            var           usedBanks = reorderer.Reorder(false, Reorderings.GetBbdBankReorderings(reorderMode));

            reorderer.Save();

            BankTrimmer bankTrimmer = new BankTrimmer(filename, filename);

            bankTrimmer.TrimUnusedBanks(usedBanks);
            bankTrimmer.Save();
        }
Ejemplo n.º 2
0
        public void ProcessBbd(string filename, string bitDescramblePattern, byte?reorderMode, bool reorderByBankNo,
                               string manualReorderPattern)
        {
            if (bitDescramblePattern != null)
            {
                BitDescrambler bitDescrambler = new BitDescrambler(filename, filename);
                byte[]         reordering     = ParseReorderingString(bitDescramblePattern);
                bitDescrambler.ReorderAllBytes(reordering);
                bitDescrambler.Save();
            }

            if (reorderMode != null || reorderByBankNo || manualReorderPattern != null)
            {
                byte[] reordering    = null;
                var    checkBankBits = false;
                if (reorderMode != null)
                {
                    reordering = Reorderings.GetBbdBankReorderings(reorderMode);
                }
                else if (reorderByBankNo)
                {
                    checkBankBits = true;
                }
                else if (manualReorderPattern != null)
                {
                    reordering = ParseReorderingString(manualReorderPattern);
                }
                BankReorderer reorderer = new BankReorderer(filename, filename);
                var           usedBanks = reorderer.Reorder(checkBankBits, reordering);
                reorderer.Save();

                BankTrimmer bankTrimmer = new BankTrimmer(filename, filename);
                bankTrimmer.TrimUnusedBanks(usedBanks);
                bankTrimmer.Save();
            }
        }