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