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 ProcessSintaxFullAuto(string filename, byte reorderMode, byte[] xors) { BankReorderer bankReorderer = new BankReorderer(filename, filename); var usedBanks = bankReorderer.Reorder(false, Reorderings.GetSintaxBankReorderings(reorderMode)); bankReorderer.Save(); DataXorer dataXorer = new DataXorer(filename, filename); dataXorer.XorAllData(false, xors, 64); dataXorer.Save(); BankBlanker bankBlanker = new BankBlanker(filename, filename); bankBlanker.BlankUnusedBanks(usedBanks); bankBlanker.Save(); BankTrimmer bankTrimmer = new BankTrimmer(filename, filename); bankTrimmer.TrimUnusedBanks(usedBanks); bankTrimmer.Save(); }
public void ProcessSintax(string filename, byte?reorderMode, bool reorderByBankNo, string manualReorderPattern, string xorBits, int?xorRepeatCount) { if (xorBits != null) { DataXorer dataXorer = new DataXorer(filename, filename); string[] flipstrings = xorBits.Split(new [] { "|" }, new StringSplitOptions()); byte[] manualXors = ParseFlipStringsToXors(flipstrings); dataXorer.XorAllData(false, manualXors, xorRepeatCount ?? 0); dataXorer.Save(); } if (reorderMode != null || reorderByBankNo || manualReorderPattern != null) { byte[] reordering = null; var checkBankBits = false; if (reorderMode != null) { reordering = Reorderings.GetSintaxBankReorderings(reorderMode); } else if (reorderByBankNo) { checkBankBits = true; } else if (manualReorderPattern != null) { reordering = ParseReorderingString(manualReorderPattern); } BankReorderer bankReorderer = new BankReorderer(filename, filename); var usedBanks = bankReorderer.Reorder(checkBankBits, reordering); bankReorderer.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(); } }