Example #1
0
        public OptionsForm(Disassembler op, Assembler ap, LabelContainer lc, MainFormOptions mf)
        {
            InitializeComponent();
            disassembler = op;
            assembler = ap;
            lcs = lc;
            mfo = mf;
            printOffsetsCheckBox.Checked = op.PrintOffsets;
            hideDataSectionsCheckBox.Checked = op.HideDefinedData;
            printBitPatternCheckBox.Checked = op.PrintBitPattern;
            printCommentsCheckBox.Checked = op.PrintComments;
            wordWrapCheckBox.Checked = mf.isWordWrap;
            switch (op.PrintedOffsetFormat)
            {
                case OffsetFormat.BankOffset:
                    offsetNumberFormatBox.SelectedIndex = 0;
                    break;

                case OffsetFormat.Hex:
                    offsetNumberFormatBox.SelectedIndex = 1;
                    break;

                case OffsetFormat.Decimal:
                    offsetNumberFormatBox.SelectedIndex = 2;
                    break;
            }
            switch (op.InstructionNumberFormat)
            {
                case OffsetFormat.Hex:
                    instructionNumberFormatBox.SelectedIndex = 0;
                    break;

                case OffsetFormat.Decimal:
                    instructionNumberFormatBox.SelectedIndex = 1;
                    break;
            }
            dsmColor00Box.Text = op.GameboyFormatChars.Length > 0 ? op.GameboyFormatChars[0].ToString() : "0";
            dsmColor01Box.Text = op.GameboyFormatChars.Length > 1 ? op.GameboyFormatChars[1].ToString() : "1";
            dsmColor10Box.Text = op.GameboyFormatChars.Length > 2 ? op.GameboyFormatChars[2].ToString() : "2";
            dsmColor11Box.Text = op.GameboyFormatChars.Length > 3 ? op.GameboyFormatChars[3].ToString() : "3";

            asmColor00Box.Text = ap.GameboyFormatChars.Length > 0 ? ap.GameboyFormatChars[0].ToString() : "0";
            asmColor01Box.Text = ap.GameboyFormatChars.Length > 1 ? ap.GameboyFormatChars[1].ToString() : "1";
            asmColor10Box.Text = ap.GameboyFormatChars.Length > 2 ? ap.GameboyFormatChars[2].ToString() : "2";
            asmColor11Box.Text = ap.GameboyFormatChars.Length > 3 ? ap.GameboyFormatChars[3].ToString() : "3";
        }
Example #2
0
        public OptionsForm(Disassembler op, Assembler ap, LabelContainer lc, MainFormOptions mf)
        {
            InitializeComponent();
            disassembler = op;
            assembler    = ap;
            lcs          = lc;
            mfo          = mf;
            printOffsetsCheckBox.Checked     = op.PrintOffsets;
            hideDataSectionsCheckBox.Checked = op.HideDefinedData;
            printBitPatternCheckBox.Checked  = op.PrintBitPattern;
            printCommentsCheckBox.Checked    = op.PrintComments;
            wordWrapCheckBox.Checked         = mf.isWordWrap;
            switch (op.PrintedOffsetFormat)
            {
            case OffsetFormat.BankOffset:
                offsetNumberFormatBox.SelectedIndex = 0;
                break;

            case OffsetFormat.Hex:
                offsetNumberFormatBox.SelectedIndex = 1;
                break;

            case OffsetFormat.Decimal:
                offsetNumberFormatBox.SelectedIndex = 2;
                break;
            }
            switch (op.InstructionNumberFormat)
            {
            case OffsetFormat.Hex:
                instructionNumberFormatBox.SelectedIndex = 0;
                break;

            case OffsetFormat.Decimal:
                instructionNumberFormatBox.SelectedIndex = 1;
                break;
            }
            dsmColor00Box.Text = op.GameboyFormatChars.Length > 0 ? op.GameboyFormatChars[0].ToString() : "0";
            dsmColor01Box.Text = op.GameboyFormatChars.Length > 1 ? op.GameboyFormatChars[1].ToString() : "1";
            dsmColor10Box.Text = op.GameboyFormatChars.Length > 2 ? op.GameboyFormatChars[2].ToString() : "2";
            dsmColor11Box.Text = op.GameboyFormatChars.Length > 3 ? op.GameboyFormatChars[3].ToString() : "3";

            asmColor00Box.Text = ap.GameboyFormatChars.Length > 0 ? ap.GameboyFormatChars[0].ToString() : "0";
            asmColor01Box.Text = ap.GameboyFormatChars.Length > 1 ? ap.GameboyFormatChars[1].ToString() : "1";
            asmColor10Box.Text = ap.GameboyFormatChars.Length > 2 ? ap.GameboyFormatChars[2].ToString() : "2";
            asmColor11Box.Text = ap.GameboyFormatChars.Length > 3 ? ap.GameboyFormatChars[3].ToString() : "3";
        }