From 1fad6f4a88a62b141c843aceeb13d92c6d9e8f70 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 5 Dec 2014 00:34:57 +0000 Subject: [PATCH] AsSaveRam() --- BizHawk.Client.EmuHawk/MainForm.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 323399d00e..ab94c756ff 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -1425,7 +1425,7 @@ namespace BizHawk.Client.EmuHawk } else { - var oldram = (Global.Emulator as ISaveRam).CloneSaveRam(); + var oldram = Global.Emulator.AsSaveRam().CloneSaveRam(); if (oldram == null) { // we're eating this one now. the possible negative consequence is that a user could lose @@ -1442,7 +1442,7 @@ namespace BizHawk.Client.EmuHawk } } - (Global.Emulator as ISaveRam).StoreSaveRam(sram); + Global.Emulator.AsSaveRam().StoreSaveRam(sram); } catch (IOException) { @@ -1476,7 +1476,7 @@ namespace BizHawk.Client.EmuHawk } var writer = new BinaryWriter(new FileStream(path, FileMode.Create, FileAccess.Write)); - var saveram = (Global.Emulator as ISaveRam).CloneSaveRam(); + var saveram = Global.Emulator.AsSaveRam().CloneSaveRam(); writer.Write(saveram, 0, saveram.Length); writer.Close(); @@ -3473,7 +3473,7 @@ namespace BizHawk.Client.EmuHawk GlobalWin.OSD.AddMessage("SRAM cleared."); } } - else if (Global.Emulator.HasSaveRam() && (Global.Emulator as ISaveRam).SaveRamModified) + else if (Global.Emulator.HasSaveRam() && Global.Emulator.AsSaveRam().SaveRamModified) { SaveRam(); }