Exemplo n.º 1
0
        public MoveToFreeSapceForm()
        {
            InitializeComponent();

            //移動後に再スキャンをしないといけないので、時間のかかるスキャンは停止する
            Program.AsmMapFileAsmCache.StopRequest();

            this.NewDataInit.SelectedIndex = 0;                                    //1行目でコピー
            this.DataPointerList.Items.Clear();
            this.TreatmentOldData.SelectedIndex = 0;                               //元データは 0クリア
            this.PaddingSpace.SelectedIndex     = 1;                               //前方16バイトの余白
            this.CondFreeSpace.SelectedIndex    = OptionForm.rom_extends_option(); // 0x09000000以降の拡張領域で、0x00がFREE_SPACE_SIZE個+必要データ数連続している領域
            this.FreeSpaceList.Items.Clear();
            this.CallbackAfterRun = null;

            InputFormRef.WriteButtonToYellow(this.RunButton, true);
            SimpleShowNewSize.ForeColor  = OptionForm.Color_InputDecimal_ForeColor();
            SimpleShowDiffSize.ForeColor = OptionForm.Color_InputDecimal_ForeColor();
            ShowMoveSize.ForeColor       = OptionForm.Color_InputDecimal_ForeColor();
            ShowNewSize.ForeColor        = OptionForm.Color_InputDecimal_ForeColor();

            SimpleNewDataCount.Focus();
        }
Exemplo n.º 2
0
        public void FromInputFormRef(InputFormRef inputFormRef, Func <uint, uint, int> callbackAfterRun)
        {
            this.CallbackAfterRun = callbackAfterRun;
            if (inputFormRef.ReadStartAddress == null)
            {
                MoveAddress.Value = inputFormRef.BaseAddress;
            }
            else
            {
                MoveAddress.Value = inputFormRef.ReadStartAddress.Value;
            }
            MoveBlockSize.Value = inputFormRef.BlockSize;
            DataCount.Value     = inputFormRef.DataCount;


            //テキトウなサイズに設定
            if (inputFormRef.DataCount <= 2)
            {
                NewDataCount.Value = 5;
            }
            else if (inputFormRef.DataCount <= 5)
            {
                NewDataCount.Value = 10;
            }
            else if (inputFormRef.DataCount <= 10)
            {
                NewDataCount.Value = 20;
            }
            else if (inputFormRef.DataCount <= 0xff)
            {
                NewDataCount.Value = 0xff;
            }
            else if (inputFormRef.DataCount <= 0x1000)
            {
                NewDataCount.Value = 0x1000;
            }
            else if (inputFormRef.DataCount <= 0x2000)
            {
                NewDataCount.Value = 0x2000;
            }
            else if (inputFormRef.DataCount <= 0x4000)
            {
                NewDataCount.Value = 0x4000;
            }
            else if (inputFormRef.DataCount <= 0x7fff)
            {
                NewDataCount.Value = 0x7fff;
            }
            else if (inputFormRef.DataCount <= 0xffff)
            {
                NewDataCount.Value = 0xffff;
            }
            else
            {
                NewDataCount.Value = inputFormRef.DataCount * 2;
            }

            uint expandsmax = inputFormRef.AddressListExpandsMax;

            if (expandsmax != U.NOT_FOUND)
            {//拡張上限が設定されている場合はそこで止める.
                if (NewDataCount.Value > expandsmax)
                {
                    NewDataCount.Value = expandsmax;
                }
                SimpleNewDataCount.Maximum = expandsmax;
                NewDataCount.Maximum       = expandsmax;
            }

            //0件目が無効値だった場合2番目で埋める.
            NewDataInit.SelectedIndex = CalcFillDataOnListExpamds(inputFormRef);

            SearchDataButton_Click(this, new EventArgs());
            SearchFreespaceButton_Click(this, new EventArgs());

            SimpleNewDataCount.Focus();
        }