public void LoadVMem(ReadFilePath filename) { try { var reader = new VmemReader(filename); lock (memoryLock) { foreach (var pair in reader.GetIndexDataPairs()) { // VmemReader returns 4 byte values, but the two first contains only the ECC which we don't need var offset = pair.Item1 * 2; underlyingMemory.WriteWord(offset, (ushort)pair.Item2); } } } catch (Exception e) { throw new RecoverableException($"Exception while loading file {filename}: {e.Message}"); } }
public void LoadVmem(string fileName) { var digestData = new ulong[romLengthInWords - 8]; try { var reader = new VmemReader(fileName); foreach (var touple in reader.GetIndexDataPairs()) { var scrambledIndex = (ulong)touple.Item1; var data = touple.Item2; LoadWord(scrambledIndex, data, digestData); } } catch (Exception e) { throw new RecoverableException(string.Format("Exception while loading file {0}: {1}", fileName, e.Message)); } CalculateDigest(digestData); }