diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-10-09 15:04:08 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2017-10-09 15:15:07 +0300 |
commit | d976ea7e4279db18c52feb5c0007ec1459827be9 (patch) | |
tree | f81505f0198c0321b61245e09034221b29629dcd /WorkerForm.cs | |
parent | 4b3a7c567d13bad64a55d70b4b7854a51a520be3 (diff) |
Typo
Diffstat (limited to 'WorkerForm.cs')
-rw-r--r-- | WorkerForm.cs | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/WorkerForm.cs b/WorkerForm.cs index 9b3dec83..07ae772c 100644 --- a/WorkerForm.cs +++ b/WorkerForm.cs @@ -83,7 +83,22 @@ namespace com.clusterrr.hakchi_gui string selectedFile = null;
public NesMiniApplication[] addedApplications;
public static int NandCTotal, NandCUsed, NandCFree, WritedGamesSize, SaveStatesSize;
- public const long ReservedMemory = 10;
+ public static long ReservedMemory
+ {
+ get
+ {
+ switch (ConfigIni.ConsoleType)
+ {
+ default:
+ case MainForm.ConsoleType.NES:
+ case MainForm.ConsoleType.Famicom:
+ return 10;
+ case MainForm.ConsoleType.SNES:
+ case MainForm.ConsoleType.SuperFamicom:
+ return 10;
+ }
+ }
+ }
public WorkerForm(MainForm parentForm)
{
@@ -137,7 +152,7 @@ namespace com.clusterrr.hakchi_gui "c3378edfc1b96a5268a066d5fbe12d89", // Super Famicom Mini (JAP)
};
correctKeys[MainForm.ConsoleType.NES] =
- correctKeys[MainForm.ConsoleType.Famicom] =
+ correctKeys[MainForm.ConsoleType.Famicom] =
new string[] { "bb8f49e0ae5acc8d5f9b7fa40efbd3e7" };
correctKeys[MainForm.ConsoleType.SNES] =
correctKeys[MainForm.ConsoleType.SuperFamicom] =
@@ -348,14 +363,14 @@ namespace com.clusterrr.hakchi_gui catch { }
}
- void ShowError(Exception ex, bool dontStop = false)
+ void ShowError(Exception ex, bool dontStop = false, string prefix = null)
{
if (Disposing) return;
try
{
if (InvokeRequired)
{
- Invoke(new Action<Exception, bool>(ShowError), new object[] { ex, dontStop });
+ Invoke(new Action<Exception, bool, string>(ShowError), new object[] { ex, dontStop, prefix });
return;
}
TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Error);
@@ -367,7 +382,7 @@ namespace com.clusterrr.hakchi_gui //if (ex is MadWizard.WinUSBNet.USBException) // TODO
// MessageBox.Show(this, message + "\r\n" + Resources.PleaseTryAgainUSB, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
//else
- MessageBox.Show(this, message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ MessageBox.Show(this, (!string.IsNullOrEmpty(prefix) ? (prefix + ": ") : "") + message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
TaskbarProgress.SetState(this, TaskbarProgress.TaskbarStates.Normal);
if (!dontStop)
{
@@ -1266,6 +1281,7 @@ namespace com.clusterrr.hakchi_gui addedApplications = null;
NesMiniApplication.ParentForm = this;
NesMiniApplication.NeedPatch = null;
+ NesMiniApplication.Need3rdPartyEmulator = null;
NesGame.IgnoreMapper = null;
SnesGame.NeedAutoDownloadCover = null;
int count = 0;
@@ -1361,8 +1377,16 @@ namespace com.clusterrr.hakchi_gui catch (Exception ex)
{
if (ex is ThreadAbortException) return null;
- Debug.WriteLine(ex.Message + ex.StackTrace);
- ShowError(ex, true);
+ if (ex.InnerException != null && !string.IsNullOrEmpty(ex.InnerException.Message))
+ {
+ Debug.WriteLine(ex.InnerException.Message + ex.InnerException.StackTrace);
+ ShowError(ex.InnerException, true, Path.GetFileName(sourceFileName));
+ }
+ else
+ {
+ Debug.WriteLine(ex.Message + ex.StackTrace);
+ ShowError(ex, true, Path.GetFileName(sourceFileName));
+ }
}
if (app != null)
apps.Add(app);
|