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; } } }
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; } } } }
public void Write(Rom rom) { Array.Copy(Bytes, 0, rom.Bytes, Address, 40); }
public Move(Rom rom, int address) { Address = address; Bytes = new byte[40]; Array.Copy(rom.Bytes, Address, Bytes, 0, 40); }
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); }
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); }