Exemple #1
0
        private void importTilemapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int amount = 0x80 * 0x80, vram = 0;
            int mode = Data.GetPPUReg(0x05) & 0x7;

            if (mode != 7)
            {
                int bg = bgOfInterest - 1;
                vram = ((Data.GetPPUReg(0x07 + bg) & 0xFC) << 8) & 0xFC00;
                int scSize = Data.GetPPUReg(0x07 + bg) & 0x3;
                amount = 0x20 * 0x20 * (scSize == 0 ? 1 : scSize == 3 ? 4 : 2);
            }

            ImportData   import = new ImportData("VRAM", Data.GetVRAMArray(), amount: amount, step: 3, fileStep: 1, arrOffset: vram);
            DialogResult result = import.ShowDialog();

            if (result == DialogResult.OK)
            {
                SNESGraphics.UpdateAllTiles();
                RedrawAll();
                RedrawOtherWindows();
            }
        }