diff --git a/BizHawk.MultiClient/HawkFile.cs b/BizHawk.MultiClient/HawkFile.cs index c76b1c6542..2ba53199dc 100644 --- a/BizHawk.MultiClient/HawkFile.cs +++ b/BizHawk.MultiClient/HawkFile.cs @@ -14,12 +14,7 @@ namespace BizHawk.MultiClient /// /// returns whether a bound file exists. if there is no bound file, it can't exist /// - public bool Exists { get { if (!rootExists) return false; return boundStream != null; } } - - /// - /// returns whether the root exists (the actual physical file) - /// - public bool RootExists { get { return rootExists; } } + public bool Exists { get { return exists; } } /// /// gets the directory containing the root @@ -32,7 +27,7 @@ namespace BizHawk.MultiClient public Stream GetStream() { if (boundStream == null) - throw new InvalidOperationException("HawkFil: Can't call GetStream() before youve successfully bound something!"); + throw new InvalidOperationException("HawkFile: Can't call GetStream() before youve successfully bound something!"); return boundStream; } @@ -61,11 +56,6 @@ namespace BizHawk.MultiClient /// public bool IsArchive { get { return extractor != null; } } - public static bool PathExists(string path) - { - using (var hf = new HawkFile(path)) - return hf.Exists; - } public class ArchiveItem { @@ -84,6 +74,7 @@ namespace BizHawk.MultiClient } //--- + bool exists; bool rootExists; string rootPath; string memberPath; @@ -108,6 +99,7 @@ namespace BizHawk.MultiClient return; rootPath = path; + exists = true; AnalyzeArchive(path); if (extractor == null) @@ -128,6 +120,8 @@ namespace BizHawk.MultiClient return; } } + + exists = false; } } diff --git a/BizHawk.MultiClient/MainForm.Designer.cs b/BizHawk.MultiClient/MainForm.Designer.cs index 9c53544457..83edabc84a 100644 --- a/BizHawk.MultiClient/MainForm.Designer.cs +++ b/BizHawk.MultiClient/MainForm.Designer.cs @@ -155,7 +155,7 @@ this.rAMPokeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.hexEditorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.luaConsoleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.nESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.NESToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pPUViewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.nameTableViewerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.gameGenieCodesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -173,7 +173,7 @@ this.viewToolStripMenuItem, this.configToolStripMenuItem, this.toolsToolStripMenuItem, - this.nESToolStripMenuItem, + this.NESToolStripMenuItem, this.helpToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; @@ -1178,13 +1178,13 @@ // // nESToolStripMenuItem // - this.nESToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.NESToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.pPUViewerToolStripMenuItem, this.nameTableViewerToolStripMenuItem, this.gameGenieCodesToolStripMenuItem}); - this.nESToolStripMenuItem.Name = "nESToolStripMenuItem"; - this.nESToolStripMenuItem.Size = new System.Drawing.Size(38, 20); - this.nESToolStripMenuItem.Text = "&NES"; + this.NESToolStripMenuItem.Name = "nESToolStripMenuItem"; + this.NESToolStripMenuItem.Size = new System.Drawing.Size(38, 20); + this.NESToolStripMenuItem.Text = "&NES"; // // pPUViewerToolStripMenuItem // @@ -1381,7 +1381,7 @@ private System.Windows.Forms.ToolStripMenuItem saveConfigToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem loadConfigToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem replayInputLogToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem nESToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem NESToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem pPUViewerToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem nameTableViewerToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem gameGenieCodesToolStripMenuItem; diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index 4b254a24a5..ee7b339f74 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -381,10 +381,10 @@ namespace BizHawk.MultiClient switch (system) { case "NES": - nESToolStripMenuItem.Visible = true; + NESToolStripMenuItem.Visible = true; break; default: - nESToolStripMenuItem.Visible = false; + NESToolStripMenuItem.Visible = false; break; } } @@ -394,7 +394,7 @@ namespace BizHawk.MultiClient using (var file = new HawkFile(path)) { //if the provided file doesnt even exist, give up! - if (!file.RootExists) return false; + if (!file.Exists) return false; //try binding normal rom extensions first if (!file.IsBound) @@ -1097,7 +1097,7 @@ namespace BizHawk.MultiClient private void MainForm_Load(object sender, EventArgs e) { //Hide platform specific menus until an appropriate ROM is loaded - nESToolStripMenuItem.Visible = false; + NESToolStripMenuItem.Visible = false; } private void frameSkipToolStripMenuItem_DropDownOpened(object sender, EventArgs e) diff --git a/BizHawk.MultiClient/RomGame.cs b/BizHawk.MultiClient/RomGame.cs index 2e698651b5..fb59ce492c 100644 --- a/BizHawk.MultiClient/RomGame.cs +++ b/BizHawk.MultiClient/RomGame.cs @@ -46,7 +46,7 @@ namespace BizHawk.MultiClient using (var patchFile = new HawkFile(patch)) { patchFile.BindFirstOf("IPS"); - if(patchFile.Exists) + if(patchFile.IsBound) IPS.Patch(RomData, patchFile.GetStream()); } }