Allow TAStudio to save cycle count in bk2 export

This commit is contained in:
Morilli 2024-09-15 21:23:52 +02:00
parent 94a24aab84
commit ec0f761bd9
1 changed files with 3 additions and 2 deletions
src/BizHawk.Client.EmuHawk/tools/TAStudio

View File

@ -237,9 +237,9 @@ namespace BizHawk.Client.EmuHawk
// TODO: can we deduplicate this logic somehow? The same code with minimal changes is copy pasted like 4 times
_autosaveTimer.Stop();
if (Emulator.HasCycleTiming())
if (Emulator.HasCycleTiming() && !CurrentTasMovie.IsAtEnd())
{
DialogController.ShowMessageBox("This core requires emulation to be on the last frame when writing the movie, otherwise movie length will appear incorrect.\nTAStudio can't handle this, so Export BK2, play it to the end, and then Save Movie.", "Warning", EMsgBoxIcon.Warning);
DialogController.ShowMessageBox("This core requires emulation to be on the last frame when writing the movie, otherwise movie length will appear incorrect.", "Warning", EMsgBoxIcon.Warning);
}
string filename = CurrentTasMovie.Filename;
@ -260,6 +260,7 @@ namespace BizHawk.Client.EmuHawk
Cursor = Cursors.WaitCursor;
var bk2 = CurrentTasMovie.ToBk2();
bk2.Filename = fileInfo.FullName;
bk2.Attach(Emulator); // required to be able to save the cycle count for ICycleTiming emulators
bk2.Save();
MessageStatusLabel.Text = $"{bk2.Name} exported.";
Cursor = Cursors.Default;