Пример #1
0
 public static void LoadRoms(string path)
 {
     using (FileStream file = new FileStream(path, FileMode.Open))
     {
         using (ZipArchive archive = new ZipArchive(file, ZipArchiveMode.Read))
         {
             var simm = ArchiveType(archive);
             Ten       = new Rom(archive, "10", simm, true, 0x6000000);
             Twenty    = new Rom(archive, "20", simm, true, 0x6800000);
             Thirty    = new Rom(archive, "30", simm, false, 0x0000000);
             ThirtyOne = new Rom(archive, "31", simm, false, 0x0800000);
             Forty     = new Rom(archive, "40", simm, false, 0x1000000);
             FortyOne  = new Rom(archive, "41", simm, false, 0x1800000);
             Fifty     = new Rom(archive, "50", simm, false, 0x2000000);
             FiftyOne  = new Rom(archive, "51", simm, false, 0x2800000);
             Path      = path;
         }
     }
 }
Пример #2
0
 private void EditorForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (e.CloseReason == CloseReason.UserClosing)
     {
         if (Rom.IsUpdated())
         {
             var result = MessageBox.Show("You have made unsaved changes to the Rom. Would you like to save them now?", "Unsaved Changes",
                                          MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
             if (result == DialogResult.Yes)
             {
                 Save();
             }
             else if (result == DialogResult.Cancel)
             {
                 e.Cancel = true;
             }
         }
     }
 }
Пример #3
0
 public void Write(Rom rom)
 {
     Array.Copy(Bytes, 0, rom.Bytes, Address, 40);
 }
Пример #4
0
 public Move(Rom rom, int address)
 {
     Address = address;
     Bytes   = new byte[40];
     Array.Copy(rom.Bytes, Address, Bytes, 0, 40);
 }
Пример #5
0
 private void SaveRom(BackgroundWorker worker, Rom rom, ZipArchive archive, bool simm, byte[] buffer = null)
 {
     infoText = $"Saving {rom.Name}";
     worker.ReportProgress(progress++);
     rom.Save(archive, simm, buffer);
 }
Пример #6
0
        public Character(int index, string name, int actionOffset, int hitboxOffset, int lookupOffset, Rom spriteRom)
        {
            Index        = index;
            Name         = name;
            ActionOffset = actionOffset;
            HitboxOffset = hitboxOffset;
            SpriteRom    = spriteRom;

            LoadPalettes();
            LoadActions();
            LoadLookupBlock(lookupOffset);
        }