address #1631 for gambatte

This commit is contained in:
feos 2019-11-20 21:25:55 +03:00
parent 4e389ab1ec
commit d15dc56e15
3 changed files with 20 additions and 7 deletions

View File

@ -166,11 +166,16 @@ namespace BizHawk.Client.Common
protected virtual void Write(string fn, bool backup = false) protected virtual void Write(string fn, bool backup = false)
{ {
if (Global.Emulator is BizHawk.Emulation.Cores.Nintendo.SubNESHawk.SubNESHawk) if (Global.Emulator is Emulation.Cores.Nintendo.SubNESHawk.SubNESHawk)
{ {
var _subnes = (BizHawk.Emulation.Cores.Nintendo.SubNESHawk.SubNESHawk)Global.Emulator; var _subnes = (Emulation.Cores.Nintendo.SubNESHawk.SubNESHawk)Global.Emulator;
Header["VBlankCount"] = _subnes.VBL_CNT.ToString(); Header["VBlankCount"] = _subnes.VBL_CNT.ToString();
} }
else if (Global.Emulator is Emulation.Cores.Nintendo.Gameboy.Gameboy)
{
var _gameboy = (Emulation.Cores.Nintendo.Gameboy.Gameboy)Global.Emulator;
Header["CycleCount"] = _gameboy.CycleCount.ToString();
}
var file = new FileInfo(fn); var file = new FileInfo(fn);
if (!file.Directory.Exists) if (!file.Directory.Exists)

View File

@ -335,6 +335,11 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
movie.HeaderEntries.Add("IsCGBMode", "1"); movie.HeaderEntries.Add("IsCGBMode", "1");
} }
if (Global.Emulator is Gameboy)
{
movie.HeaderEntries.Add("CycleCount", "0");
}
if (Global.Emulator is SMS && ((SMS) Global.Emulator).IsSG1000) if (Global.Emulator is SMS && ((SMS) Global.Emulator).IsSG1000)
{ {
movie.HeaderEntries.Add("IsSGMode", "1"); movie.HeaderEntries.Add("IsSGMode", "1");

View File

@ -268,8 +268,10 @@ namespace BizHawk.Client.EmuHawk
{ {
_autosaveTimer.Stop(); _autosaveTimer.Stop();
if (Emulator is BizHawk.Emulation.Cores.Nintendo.SubNESHawk.SubNESHawk if (Emulator.Frame != CurrentTasMovie.InputLogLength - 1)
&& Emulator.Frame != CurrentTasMovie.InputLogLength - 1) {
if (Emulator is Emulation.Cores.Nintendo.SubNESHawk.SubNESHawk
|| Emulator is Emulation.Cores.Nintendo.Gameboy.Gameboy)
{ {
var result = MessageBox.Show("This core requires emulation to be on the last frame when writing the movie, otherwise movie length may appear incorrect.\nSeek there?", "Export movie", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); var result = MessageBox.Show("This core requires emulation to be on the last frame when writing the movie, otherwise movie length may appear incorrect.\nSeek there?", "Export movie", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
if (result == DialogResult.OK) if (result == DialogResult.OK)
@ -277,6 +279,7 @@ namespace BizHawk.Client.EmuHawk
GoToFrame(CurrentTasMovie.InputLogLength - 1); GoToFrame(CurrentTasMovie.InputLogLength - 1);
} }
} }
}
var bk2 = CurrentTasMovie.ToBk2(true, true); var bk2 = CurrentTasMovie.ToBk2(true, true);
MessageStatusLabel.Text = "Exporting to .bk2..."; MessageStatusLabel.Text = "Exporting to .bk2...";