// IGenerator public void GetDefaultDisplayFormat(out PseudoOp.PseudoOpNames pseudoOps, out Formatter.FormatConfig formatConfig) { // This is not intended to match up with the Merlin generator, which uses // the same pseudo-op for low/high ASCII but different string delimiters. We // don't change the delimiters for the display list, so instead we tweak the // opcode slightly. char hiAscii = '\u2191'; pseudoOps = new PseudoOp.PseudoOpNames() { EquDirective = "equ", OrgDirective = "org", DefineData1 = "dfb", DefineData2 = "dw", DefineData3 = "adr", DefineData4 = "adrl", DefineBigData2 = "ddb", Fill = "ds", Dense = "hex", StrGeneric = "asc", StrGenericHi = "asc" + hiAscii, StrReverse = "rev", StrReverseHi = "rev" + hiAscii, StrLen8 = "str", StrLen8Hi = "str" + hiAscii, StrLen16 = "strl", StrLen16Hi = "strl" + hiAscii, StrDci = "dci", StrDciHi = "dci" + hiAscii, }; formatConfig = new Formatter.FormatConfig(); SetFormatConfigValues(ref formatConfig); }
// IGenerator public void GetDefaultDisplayFormat(out PseudoOp.PseudoOpNames pseudoOps, out Formatter.FormatConfig formatConfig) { pseudoOps = sDataOpNames; formatConfig = new Formatter.FormatConfig(); SetFormatConfigValues(ref formatConfig); }
/// <summary> /// Imports values from PseudoOpNames struct into text fields. /// </summary> private void ImportPseudoOpNames(PseudoOp.PseudoOpNames opNames) { for (int i = 0; i < mPseudoNameMap.Length; i++) { string str = (string)mPseudoNameMap[i].PropInfo.GetValue(opNames); mPseudoNameMap[i].TextBox.Text = (str == null) ? string.Empty : str; } }
/// <summary> /// Exports values from text fields to a PseudoOpNames object. /// </summary> private PseudoOp.PseudoOpNames ExportPseudoOpNames() { PseudoOp.PseudoOpNames opNames = new PseudoOp.PseudoOpNames(); for (int i = 0; i < mPseudoNameMap.Length; i++) { // NOTE: PseudoOpNames must be a class (not a struct) or this will fail. // SetValue() would be invoked on a boxed copy that is discarded afterward. mPseudoNameMap[i].PropInfo.SetValue(opNames, mPseudoNameMap[i].TextBox.Text); } return(opNames); }
private void ApplySettings() { PseudoOp.PseudoOpNames opNames = ExportPseudoOpNames(); string pseudoCereal = opNames.Serialize(); mSettings.SetString(AppSettings.FMT_PSEUDO_OP_NAMES, pseudoCereal); mProjectView.SetAppSettings(mSettings); AsmGen.AssemblerVersionCache.QueryVersions(); SetDirty(false); }
// IGenerator public void GetDefaultDisplayFormat(out PseudoOp.PseudoOpNames pseudoOps, out Formatter.FormatConfig formatConfig) { pseudoOps = new PseudoOp.PseudoOpNames() { EquDirective = "=", OrgDirective = ".org", DefineData1 = ".byte", DefineData2 = ".word", DefineData3 = ".faraddr", DefineData4 = ".dword", DefineBigData2 = ".dbyt", Fill = ".res", StrGeneric = ".byte", StrNullTerm = ".asciiz", }; formatConfig = new Formatter.FormatConfig(); SetFormatConfigValues(ref formatConfig); }
private void EditAppSettings_Load(object sender, EventArgs e) { // Column widths. We called SaveCodeListColumnWidths() earlier, so this // should always be a valid serialized string. string widthStr = mSettings.GetString(AppSettings.CDLV_COL_WIDTHS, null); Debug.Assert(!string.IsNullOrEmpty(widthStr)); ProjectView.CodeListColumnWidths widths = ProjectView.CodeListColumnWidths.Deserialize(widthStr); Debug.Assert(widths != null); for (int i = 0; i < NUM_COLUMNS; i++) { SetShowHideButton(i, widths.Width[i]); } // Display localized font string. FontConverter cvt = new FontConverter(); currentFontDisplayLabel.Text = cvt.ConvertToString(mProjectView.CodeListViewFont); // Upper-case formatting. upperHexCheckBox.Checked = mSettings.GetBool(AppSettings.FMT_UPPER_HEX_DIGITS, false); upperOpcodeCheckBox.Checked = mSettings.GetBool( AppSettings.FMT_UPPER_OP_MNEMONIC, false); upperPseudoOpCheckBox.Checked = mSettings.GetBool( AppSettings.FMT_UPPER_PSEUDO_OP_MNEMONIC, false); upperACheckBox.Checked = mSettings.GetBool(AppSettings.FMT_UPPER_OPERAND_A, false); upperSCheckBox.Checked = mSettings.GetBool(AppSettings.FMT_UPPER_OPERAND_S, false); upperXYCheckBox.Checked = mSettings.GetBool(AppSettings.FMT_UPPER_OPERAND_XY, false); int clipIndex = mSettings.GetInt(AppSettings.CLIP_LINE_FORMAT, 0); if (clipIndex >= 0 && clipIndex < clipboardFormatComboBox.Items.Count) { clipboardFormatComboBox.SelectedIndex = clipIndex; } spacesBetweenBytesCheckBox.Checked = mSettings.GetBool(AppSettings.FMT_SPACES_BETWEEN_BYTES, false); enableDebugCheckBox.Checked = mSettings.GetBool(AppSettings.DEBUG_MENU_ENABLED, false); // Assemblers. PopulateAsmConfigItems(); showAsmIdentCheckBox.Checked = mSettings.GetBool(AppSettings.SRCGEN_ADD_IDENT_COMMENT, false); disableLabelLocalizationCheckBox.Checked = mSettings.GetBool(AppSettings.SRCGEN_DISABLE_LABEL_LOCALIZATION, false); longLabelNewLineCheckBox.Checked = mSettings.GetBool(AppSettings.SRCGEN_LONG_LABEL_NEW_LINE, false); showCycleCountsCheckBox.Checked = mSettings.GetBool(AppSettings.SRCGEN_SHOW_CYCLE_COUNTS, false); // Pseudo ops. string opStrCereal = mSettings.GetString(AppSettings.FMT_PSEUDO_OP_NAMES, null); if (!string.IsNullOrEmpty(opStrCereal)) { PseudoOp.PseudoOpNames opNames = PseudoOp.PseudoOpNames.Deserialize(opStrCereal); ImportPseudoOpNames(opNames); } else { // no data available, populate with blanks //PseudoOp.PseudoOpNames opNames = PseudoOp.sDefaultPseudoOpNames; ImportPseudoOpNames(new PseudoOp.PseudoOpNames()); } PopulateWidthDisamSettings(); string exprMode = mSettings.GetString(AppSettings.FMT_EXPRESSION_MODE, string.Empty); ExpressionMode mode; if (!Enum.TryParse <ExpressionMode>(exprMode, out mode)) { mode = ExpressionMode.Common; } SetExpressionStyle(mode); if (mInitialTab != Tab.Unknown) { settingsTabControl.SelectTab((int)mInitialTab); } mDirty = false; UpdateControls(); }