Skip to content

Commit b719360

Browse files
Revert "Don't compress most text files in states/movies (resolves #4415)"
This reverts commit 5cbc1de. On principle of the previous revert, no acceptance of any Copilot or other ML tool code.
1 parent 71448df commit b719360

File tree

5 files changed

+8
-17
lines changed

5 files changed

+8
-17
lines changed

src/BizHawk.Client.Common/movie/bk2/Bk2Movie.IO.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ protected void AddBk2Lumps(ZipStateSaver bs)
7474
bs.PutLump(BinaryStateLump.Comments, tw => tw.WriteLine(CommentsString()));
7575
bs.PutLump(BinaryStateLump.Subtitles, tw => tw.WriteLine(Subtitles.ToString()));
7676
bs.PutLump(BinaryStateLump.SyncSettings, tw => tw.WriteLine(SyncSettingsJson));
77-
bs.PutLump(BinaryStateLump.Input, WriteInputLog, zstdCompress: true);
77+
bs.PutLump(BinaryStateLump.Input, WriteInputLog);
7878

7979
if (StartsFromSavestate)
8080
{
8181
if (TextSavestate != null)
8282
{
83-
//TODO disable Zstd compression? are these meant to be editable?
8483
bs.PutLump(BinaryStateLump.CorestateText, (TextWriter tw) => tw.Write(TextSavestate));
8584
}
8685
else

src/BizHawk.Client.Common/movie/tasproj/TasBranch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void Save(ZipStateSaver bs)
150150
{
151151
tw.WriteLine(b.InputLog[i]);
152152
}
153-
}, zstdCompress: true);
153+
});
154154

155155
bs.PutLump(nframebuffer, s =>
156156
{

src/BizHawk.Client.Common/movie/tasproj/TasMovie.IO.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private void AddTasProjLumps(ZipStateSaver bs, bool isBackup = false)
2121

2222
var settings = JsonConvert.SerializeObject(TasStateManager?.Settings ?? Session.Settings.DefaultTasStateManagerSettings);
2323
bs.PutLump(BinaryStateLump.StateHistorySettings, tw => tw.WriteLine(settings));
24-
bs.PutLump(BinaryStateLump.LagLog, tw => LagLog.Save(tw), zstdCompress: true);
24+
bs.PutLump(BinaryStateLump.LagLog, tw => LagLog.Save(tw));
2525
bs.PutLump(BinaryStateLump.Markers, tw => tw.WriteLine(Markers.ToString()));
2626

2727
if (InputRollSettingsForSave != null)
@@ -32,10 +32,7 @@ private void AddTasProjLumps(ZipStateSaver bs, bool isBackup = false)
3232

3333
if (VerificationLog.Count is not 0)
3434
{
35-
bs.PutLump(
36-
BinaryStateLump.VerificationLog,
37-
tw => tw.WriteLine(VerificationLog.ToInputLog()),
38-
zstdCompress: true);
35+
bs.PutLump(BinaryStateLump.VerificationLog, tw => tw.WriteLine(VerificationLog.ToInputLog()));
3936
}
4037

4138
if (Branches.Count is not 0) Branches.Save(bs);

src/BizHawk.Client.Common/savestates/SavestateFile.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public void Create(string filename, SaveStateConfig config)
6868
{
6969
if (config.Type == SaveStateType.Text)
7070
{
71-
//TODO disable Zstd compression? are these meant to be editable?
7271
bs.PutLump(BinaryStateLump.CorestateText, tw => _statable.SaveStateText(tw));
7372
}
7473
else
@@ -113,8 +112,7 @@ public void Create(string filename, SaveStateConfig config)
113112
// this never should have been a core's responsibility
114113
tw.WriteLine("Frame {0}", _emulator.Frame);
115114
_movieSession.HandleSaveState(tw);
116-
},
117-
zstdCompress: true);
115+
});
118116
}
119117

120118
if (_userBag.Count is not 0)
@@ -129,10 +127,7 @@ public void Create(string filename, SaveStateConfig config)
129127

130128
if (_movieSession.Movie.IsActive() && _movieSession.Movie is ITasMovie)
131129
{
132-
bs.PutLump(
133-
BinaryStateLump.LagLog,
134-
tw => ((ITasMovie) _movieSession.Movie).LagLog.Save(tw),
135-
zstdCompress: true);
130+
bs.PutLump(BinaryStateLump.LagLog, tw => ((ITasMovie) _movieSession.Movie).LagLog.Save(tw));
136131
}
137132
}
138133

src/BizHawk.Client.Common/savestates/ZipStateSaver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ public void PutLump(BinaryStateLump lump, Action<BinaryWriter> callback)
5353
});
5454
}
5555

56-
public void PutLump(BinaryStateLump lump, Action<TextWriter> callback, bool zstdCompress = false)
56+
public void PutLump(BinaryStateLump lump, Action<TextWriter> callback)
5757
{
5858
PutLump(lump, s =>
5959
{
6060
TextWriter tw = new StreamWriter(s);
6161
callback(tw);
6262
tw.Flush();
63-
}, zstdCompress: zstdCompress);
63+
});
6464
}
6565

6666
public void Dispose()

0 commit comments

Comments
 (0)