Match native surface persistence policy

This commit is contained in:
gamer147
2026-07-24 20:28:59 -04:00
parent 7a11a3853d
commit 4db7e412bd
14 changed files with 299 additions and 48 deletions

View File

@@ -177,12 +177,20 @@ public static class NativeNumberedSaveCodec
=> new(
0, 0, new int[NativeNumberedSaveState.SoundEffectChannelCount],
new byte[NativeNumberedSaveState.ResourceRecordsSize],
new byte[NativeNumberedSaveState.SurfaceRecordsSize],
EmptySurfaceRecords(),
frames, Array.Empty<int>(), Array.Empty<int>(), Array.Empty<string>(),
Array.Empty<int>(), Array.Empty<int>(), Array.Empty<int>(),
Array.Empty<NativeSavedGfxObject>(), 0, 0,
new byte[NativeNumberedSaveState.GfxRecordSize]);
private static byte[] EmptySurfaceRecords()
{
byte[] result = new byte[NativeNumberedSaveState.SurfaceRecordsSize];
for (int slot = 0; slot < 1000; slot++)
WriteInt(result, slot * 20, -1);
return result;
}
private static void WriteFrame(Span<byte> payload, int offset, NativeSavedScriptFrame frame, bool terminal)
{
if (frame.ReturnIndices.Count > FrameReturnCapacity)