public frmMain() { InitializeComponent(); saveFileDialog.InitialDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location; megaDumper = new MegaDumper(); megaDumper.ProgressChanged += MegaDumper_ProgressChanged; megaDumper.DoWork += MegaDumper_DoWork; megaDumper.RunWorkerCompleted += MegaDumper_RunWorkerCompleted; }
public void parse(byte[] raw) { this.raw = (byte[])raw.Clone(); systemType = Encoding.ASCII.GetString(raw, 0, 16).TrimEnd(); copyright = Encoding.ASCII.GetString(raw, 0x10, 16).TrimEnd(); domesticGameTitle = Encoding.ASCII.GetString(raw, 0x20, 48).TrimEnd(); overseasGameTitle = Encoding.ASCII.GetString(raw, 0x50, 48).TrimEnd(); serialNumber = Encoding.ASCII.GetString(raw, 0x80, 14).TrimEnd(); checksum = MegaDumper.SwapBytes(BitConverter.ToUInt16(raw, 0x8E)); deviceSupport = Encoding.ASCII.GetString(raw, 0x90, 16).TrimEnd(); romAddressStart = MegaDumper.SwapBytes(BitConverter.ToUInt32(raw, 0xA0)); romAddressEnd = MegaDumper.SwapBytes(BitConverter.ToUInt32(raw, 0xA0 + 4)); ramAddressStart = MegaDumper.SwapBytes(BitConverter.ToUInt32(raw, 0xA8)); ramAddressEnd = MegaDumper.SwapBytes(BitConverter.ToUInt32(raw, 0xA8 + 4)); modemSupport = Encoding.ASCII.GetString(raw, 0xBC, 12).TrimEnd(); regionSupport = Encoding.ASCII.GetString(raw, 0xF0, 3).TrimEnd(); extraMemory = new ExtraMemory(); extraMemory.parse(raw); return; }
/// <summary> /// Parse the extra memory (save game) format based on a raw sega genesis cart header /// </summary> /// <param name="raw">The raw byte header (e.g. date coming from address 0x50 on the ROM / 0x100 on an 8 bit addressable system</param> public void parse(byte[] raw) { extraMemoryType = (ExtraMemoryType)raw[0xB0 + 2]; startAddress = MegaDumper.SwapBytes(BitConverter.ToUInt32(raw, 0xB0 + 4)); endAddress = MegaDumper.SwapBytes(BitConverter.ToUInt32(raw, 0xB0 + 8)); }