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(); }
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(); } }