Add version IDs to the other working cores

Add toggle for saving screenshot with savestate. Update loadstate code to not die when encountering a state without a screenshot
This commit is contained in:
beirich 2011-09-15 23:32:21 +00:00
parent f7109d5f17
commit 7a272192fb
7 changed files with 1790 additions and 1774 deletions

View File

@ -8,6 +8,7 @@ using BizHawk.Emulation.CPUs.Z80;
namespace BizHawk.Emulation.Consoles.Calculator
{
[CoreVersion("0.8.1", FriendlyName = "TI-83")]
public class TI83 : IEmulator
{
//hardware

View File

@ -10,6 +10,7 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx
{
public enum NecSystemType { TurboGrafx, TurboCD, SuperGrafx }
[CoreVersion("1.2.1", FriendlyName = "TurboHawk16")]
public sealed partial class PCEngine : IEmulator
{
// ROM

View File

@ -16,6 +16,7 @@ using BizHawk.Emulation.Sound;
namespace BizHawk.Emulation.Consoles.Sega
{
[CoreVersion("1.0.1", FriendlyName = "Sega 8-bit")]
public sealed partial class SMS : IEmulator
{
// Constants

View File

@ -127,6 +127,7 @@
public bool InputConfigAutoTab = true;
public bool ShowLogWindow = false;
public bool BackupSavestates = true;
public bool SaveScreenshotWithStates = true;
public int AutofireOn = 1;
public int AutofireOff = 1;
public bool AutofireLagFrames = true;

File diff suppressed because it is too large Load Diff

View File

@ -1106,6 +1106,7 @@ namespace BizHawk.MultiClient
singleInstanceModeToolStripMenuItem.Checked = Global.Config.SingleInstanceMode;
enableContextMenuToolStripMenuItem.Checked = Global.Config.ShowContextMenu;
backupSavestatesToolStripMenuItem.Checked = Global.Config.BackupSavestates;
saveScreenshotWithSavestatesToolStripMenuItem.Checked = Global.Config.SaveScreenshotWithStates;
}
private void MainForm_Load(object sender, EventArgs e)
@ -1317,6 +1318,11 @@ namespace BizHawk.MultiClient
Global.Config.BackupSavestates ^= true;
}
void screenshotWithSavestatesToolStripMenuItem_Click(object sender, EventArgs e)
{
Global.Config.SaveScreenshotWithStates ^= true;
}
private void undoSavestateToolStripMenuItem_Click(object sender, EventArgs e)
{
string path = PathManager.SaveStatePrefix(Global.Game) + "." + "QuickSave" + SaveSlot + ".State";

View File

@ -1758,9 +1758,11 @@ namespace BizHawk.MultiClient
{
Global.Emulator.SaveStateText(writer);
HandleMovieSaveState(writer);
writer.WriteLine("[MULTICLIENT]");
writer.Write("FRAMEBUFFER "); Global.Emulator.VideoProvider.GetVideoBuffer().SaveAsHex(writer);
writer.WriteLine("[/MULTICLIENT]");
if (Global.Config.SaveScreenshotWithStates)
{
writer.Write("Framebuffer ");
Global.Emulator.VideoProvider.GetVideoBuffer().SaveAsHex(writer);
}
writer.Close();
Global.RenderPanel.AddMessage("Saved state: " + name);
@ -1792,25 +1794,19 @@ namespace BizHawk.MultiClient
var reader = new StreamReader(path);
Global.Emulator.LoadStateText(reader);
reader = new StreamReader(path);
while (true)
{
string[] args = reader.ReadLine().Split(' ');
if (args[0].Trim() == "") continue;
if (args[0] != "[MULTICLIENT]") continue;
break;
}
while (true)
{
string[] args = reader.ReadLine().Split(' ');
if (args[0].Trim() == "") continue;
if (args[0] == "[/MULTICLIENT]") break;
if (args[0] == "FRAMEBUFFER")
string str = reader.ReadLine();
if (str == null) break;
if (str.Trim() == "") continue;
string[] args = str.Split(' ');
if (args[0] == "Framebuffer")
Global.Emulator.VideoProvider.GetVideoBuffer().ReadFromHex(args[1]);
}
UpdateTools();
reader.Close();
reader.Close();
UpdateTools();
Global.RenderPanel.AddMessage("Loaded state: " + name);
}
else