public void PatchData(PatchObject patch) { var patchDataArray = patch.patchData.ToArray(); Array.Copy(patchDataArray, 0, romData, patch.address, patchDataArray.Length); SetPatchBytes(patch.address, patchDataArray.Length); }
public List <PatchObject> GeneratePatch() { var patches = new List <PatchObject>(); PatchObject currentPatch = null; int lastAddress = 0; foreach (var pd in patchData.OrderBy(x => x.Key)) { if (lastAddress + 1 != pd.Key) { // add previous patch if (currentPatch != null) { patches.Add(currentPatch); } // new patch currentPatch = new PatchObject(); currentPatch.address = pd.Key; } // add the patch byte currentPatch.patchData.Add(pd.Value); // update our address tracker lastAddress = pd.Key; } return(patches); }
public void PatchData(PatchObject patch) { var patchDataArray = patch.patchData.ToArray(); Array.Copy(patchDataArray, 0, romData, patch.address, patchDataArray.Length); //SetPatchBytes(patch.address, patchDataArray.Length); // need to move this outside so it can be done client-side on web }
public void AddPatch(PatchObject patch) { Patches.Add(patch); }