Exemplo n.º 1
0
        private void PaletteWriteButton_Click(object sender, EventArgs e)
        {
            if (PALETTE_ADDRESS.Value == 0)
            {
                R.ShowStopError("パレット領域が割り当てられていません。\r\nまずは、「新規パレット割り当て」ボタンを押して領域を確保してください。");
                return;
            }

            int paletteIndex = this.PaletteIndexComboBox.SelectedIndex;

            if (PaletteOverradeALL.Visible && PaletteOverradeALL.Checked)
            {//全部同じパレットにする
                paletteIndex = PaletteFormRef.OVERRAIDE_ALL_PALETTE;
            }
            uint newAddr = PaletteFormRef.MakePaletteUIToROM(this, (uint)PALETTE_ADDRESS.Value, true, paletteIndex);

            if (newAddr == U.NOT_FOUND)
            {
                return;
            }
            P12.Value = U.toPointer(newAddr);
            WriteButton.PerformClick();
            InputFormRef.WriteButtonToYellow(this.PaletteWriteButton, false);
            InputFormRef.ShowWriteNotifyAnimation(this, newAddr);
        }
        private void PaletteWriteButton_Click(object sender, EventArgs e)
        {
            uint addr = PaletteFormRef.MakePaletteUIToROM(this, (uint)PALETTE_ADDRESS.Value, false, this.PaletteIndexComboBox.SelectedIndex);

            InputFormRef.WriteButtonToYellow(this.PaletteWriteButton, false);

            InputFormRef.ShowWriteNotifyAnimation(this, addr);
        }
Exemplo n.º 3
0
        private void WriteButton_Click(object sender, EventArgs e)
        {
            uint addr = Program.ROM.p32(this.TSAPointer);

            byte[] tsaByte = new byte[this.Width8 * this.Height8 * 2];
            Buffer.BlockCopy(this.Map, 0, tsaByte, 0, tsaByte.Length); //(byte[])

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "TSA Editor");
            if (this.IsHeaderTSA)
            {
                uint tsaHeaderX = this.Width8;
                uint tsaHeaderY = this.Height8;

                uint tsa_width_margin = 32 - tsaHeaderX;
                tsaHeaderX += tsa_width_margin;
                tsaByte     = ImageUtil.TSAToHeaderTSA(tsaByte, (int)tsaHeaderX * 8, (int)tsaHeaderY * 8, (int)tsa_width_margin);
            }

            using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this))
            {
                uint newAddr = ImageFormRef.WriteImageData(this, addr, this.TSAPointer, tsaByte, this.IsLZ77TSA, undodata);

                InputFormRef.WriteOnePointer(this.ZImgPointer, this.image1_ZIMAGE, undodata);
                this.Image1.WritePointer(undodata);
                ImageSystemIconForm.Fix_FE8_systemmenu_battlepreview_image(U.toOffset(this.ZImgPointer), undodata);
                Program.Undo.Push(undodata);

                //パレットも書き込む.
                PFR.MakePaletteUIToROM((uint)PALETTE_ADDRESS.Value, false, this.PaletteIndexComboBox.SelectedIndex);

                InputFormRef.WriteButtonToYellow(this.AllWriteButton, false);
                InputFormRef.ShowWriteNotifyAnimation(this, newAddr);
            }

            //チップセットを読みこむときに、最初のパレットを選択しないとダメだ.
            int selectedPalette = this.PaletteIndexComboBox.SelectedIndex;

            this.PaletteIndexComboBox.SelectedIndex = 0;
            LoadChipsetInfo();  //チップセット関係の読込
            this.PaletteIndexComboBox.SelectedIndex = selectedPalette;

            LoadBattleScreen();       //ROM TSAをメモリに読み込んで
            MakeBattleScreen();       //TSA描画
            this.Battle.Invalidate(); //キャンバスの再描画
        }
Exemplo n.º 4
0
        private void PaletteWriteButton_Click(object sender, EventArgs e)
        {
            uint newAddr = PFR.MakePaletteUIToROM((uint)PALETTE_ADDRESS.Value, false, this.PaletteIndexComboBox.SelectedIndex);

            if (newAddr == U.NOT_FOUND)
            {
                return;
            }
            PALETTE_ADDRESS.Value = U.toPointer(newAddr);
            InputFormRef.WriteButtonToYellow(this.PaletteWriteButton, false);
            InputFormRef.ShowWriteNotifyAnimation(this, newAddr);
        }