From 2838a5412ae470bf90c47e15331a4607d89a36ea Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Sat, 15 Apr 2023 21:33:51 -0700 Subject: [PATCH] Fix DeltaSerializer's `GetDelta` Fixes AppleII/C64 states sometimes crashing when a disk change actually happens --- src/BizHawk.Common/DeltaSerializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BizHawk.Common/DeltaSerializer.cs b/src/BizHawk.Common/DeltaSerializer.cs index b51b2dda39..5003046791 100644 --- a/src/BizHawk.Common/DeltaSerializer.cs +++ b/src/BizHawk.Common/DeltaSerializer.cs @@ -91,10 +91,10 @@ namespace BizHawk.Common while (index < end && orignalAsBytes[index] == currentAsBytes[index]) { index++; + same++; } } - same = index - blockStart; MemoryMarshal.Write(ret.Slice(retSize, 4), ref same); retSize += 4; }