Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Apps
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-15 01:37:01 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-15 01:37:01 +0300
commitb2d6cff7ced8cbf1d284b213652bf0c8c2ad88f5 (patch)
treeb181c87f8167da354350725250f04e98f2f75cb4 /Apps
parente5e6cb969f1d563f69b3b5414a8454652f18f147 (diff)
New game consoles, new images, some fixes
Diffstat (limited to 'Apps')
-rw-r--r--Apps/AppTypeCollection.cs55
-rw-r--r--Apps/NesGame.cs15
-rw-r--r--Apps/NesMiniApplication.cs9
3 files changed, 51 insertions, 28 deletions
diff --git a/Apps/AppTypeCollection.cs b/Apps/AppTypeCollection.cs
index 0464aee1..e1131aed 100644
--- a/Apps/AppTypeCollection.cs
+++ b/Apps/AppTypeCollection.cs
@@ -15,7 +15,7 @@ namespace com.clusterrr.hakchi_gui
{
public Type Class;
public string[] Extensions;
- public string DefaultApp;
+ public string[] DefaultApps;
public char Prefix;
public Image DefaultCover;
}
@@ -26,7 +26,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(FdsGame),
Extensions = new string[] {".fds"},
- DefaultApp = null,
+ DefaultApps = new string[] {},
Prefix = 'D',
DefaultCover = Resources.blank_fds
},
@@ -34,7 +34,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(NesUGame),
Extensions = new string[] {".nes", ".unf", ".unif"},
- DefaultApp = "/bin/nes",
+ DefaultApps = new string[] {"/bin/nes"},
Prefix = 'I',
DefaultCover = Resources.blank_jp
},
@@ -42,7 +42,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(SnesGame),
Extensions = new string[] { ".sfc", ".smc" },
- DefaultApp = "/bin/snes",
+ DefaultApps = new string[] {"/bin/snes"},
Prefix = 'U',
DefaultCover = Resources.blank_snes_us
},
@@ -50,7 +50,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(N64Game),
Extensions = new string[] { ".n64", ".z64", ".v64" },
- DefaultApp = "/bin/n64",
+ DefaultApps = new string[] {"/bin/n64"},
Prefix = '6',
DefaultCover = Resources.blank_n64
},
@@ -58,7 +58,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(SmsGame),
Extensions = new string[] { ".sms" },
- DefaultApp = "/bin/sms",
+ DefaultApps = new string[] {"/bin/sms"},
Prefix = 'M',
DefaultCover = Resources.blank_sms
},
@@ -66,7 +66,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(SmsGame),
Extensions = new string[] { ".sms" },
- DefaultApp = "/bin/sms",
+ DefaultApps = new string[] {"/bin/sms"},
Prefix = 'M',
DefaultCover = Resources.blank_sms
},
@@ -74,7 +74,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(GenesisGame),
Extensions = new string[] { ".gen", ".md", ".smd" },
- DefaultApp = "/bin/md",
+ DefaultApps = new string[] {"/bin/md"},
Prefix = 'G',
DefaultCover = Resources.blank_genesis
},
@@ -82,15 +82,15 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(Sega32XGame),
Extensions = new string[] { ".32x" },
- DefaultApp = "/bin/32x",
+ DefaultApps = new string[] {"/bin/32x"},
Prefix = '3',
- DefaultCover = Resources.blank_genesis // TODO: icon for 32X
+ DefaultCover = Resources.blank_32x
},
new AppInfo
{
Class = typeof(GbGame),
Extensions = new string[] { ".gb" },
- DefaultApp = "/bin/gb",
+ DefaultApps = new string[] {"/bin/gb"},
Prefix = 'B',
DefaultCover = Resources.blank_gb
},
@@ -98,7 +98,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(GbcGame),
Extensions = new string[] {".gbc"},
- DefaultApp = "/bin/gbc",
+ DefaultApps = new string[] {"/bin/gbc"},
Prefix = 'C',
DefaultCover = Resources.blank_gbc
},
@@ -106,7 +106,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(GbaGame),
Extensions = new string[] {".gba"},
- DefaultApp = "/bin/gba",
+ DefaultApps = new string[] {"/bin/gba"},
Prefix = 'A',
DefaultCover = Resources.blank_gba
},
@@ -114,7 +114,7 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(PceGame),
Extensions = new string[] {".pce"},
- DefaultApp = "/bin/pce",
+ DefaultApps = new string[] {"/bin/pce"},
Prefix = 'E',
DefaultCover = Resources.blank_pce
},
@@ -122,10 +122,26 @@ namespace com.clusterrr.hakchi_gui
{
Class = typeof(GameGearGame),
Extensions = new string[] {".gg"},
- DefaultApp = "/bin/gg",
+ DefaultApps = new string[] {"/bin/gg"},
Prefix = 'R',
- DefaultCover = Resources.blank_sms // TODO: icon for GameGear
- }
+ DefaultCover = Resources.blank_gg
+ },
+ new AppInfo
+ {
+ Class = typeof(GameGearGame),
+ Extensions = new string[] {".a26"},
+ DefaultApps = new string[] {"/bin/a26"},
+ Prefix = 'T',
+ DefaultCover = Resources.blank_2600
+ },
+ new AppInfo
+ {
+ Class = typeof(GameGearGame),
+ Extensions = new string[] {},
+ DefaultApps = new string[] {"/bin/fba", "/bin/mame", "/bin/cps2", "/bin/neogeo" },
+ Prefix = 'X',
+ DefaultCover = Resources.blank_arcade
+ },
};
public static AppInfo GetAppByExtension(string extension)
@@ -139,8 +155,9 @@ namespace com.clusterrr.hakchi_gui
public static AppInfo GetAppByExec(string exec)
{
foreach (var app in ApplicationTypes)
- if (exec.StartsWith(app.DefaultApp + " "))
- return app;
+ foreach (var cmd in app.DefaultApps)
+ if (exec.StartsWith(cmd + " "))
+ return app;
return null;
}
}
diff --git a/Apps/NesGame.cs b/Apps/NesGame.cs
index cebcbd28..652bcfed 100644
--- a/Apps/NesGame.cs
+++ b/Apps/NesGame.cs
@@ -176,13 +176,16 @@ namespace com.clusterrr.hakchi_gui
return false;
}
- public override void Save()
+ public override bool Save()
{
- if (!string.IsNullOrEmpty(gameGenie))
- File.WriteAllText(GameGeniePath, gameGenie);
- else
- File.Delete(GameGeniePath);
- base.Save();
+ if (this.hasUnsavedChanges)
+ {
+ if (!string.IsNullOrEmpty(gameGenie))
+ File.WriteAllText(GameGeniePath, gameGenie);
+ else
+ File.Delete(GameGeniePath);
+ }
+ return this.hasUnsavedChanges || base.Save();
}
public void ApplyGameGenie()
diff --git a/Apps/NesMiniApplication.cs b/Apps/NesMiniApplication.cs
index f80ff69e..fe699a06 100644
--- a/Apps/NesMiniApplication.cs
+++ b/Apps/NesMiniApplication.cs
@@ -142,7 +142,9 @@ namespace com.clusterrr.hakchi_gui
if (import != null)
return (NesMiniApplication)import.Invoke(null, new object[] { fileName, sourceFile, rawRomData });
else
- return Import(fileName, sourceFile, rawRomData, appinfo.Prefix, appinfo.DefaultApp, appinfo.DefaultCover, ConfigIni.Compress);
+ return Import(fileName, sourceFile, rawRomData, appinfo.Prefix,
+ appinfo.DefaultApps.Length > 0 ? appinfo.DefaultApps[0] : DefaultApp,
+ appinfo.DefaultCover, ConfigIni.Compress);
}
string application = extension.Length > 2 ? ("/bin/" + extension.Substring(1)) : DefaultApp;
return Import(fileName, sourceFile, rawRomData, DefaultPrefix, application, DefaultCover);
@@ -271,9 +273,9 @@ namespace com.clusterrr.hakchi_gui
hasUnsavedChanges = false;
}
- public virtual void Save()
+ public virtual bool Save()
{
- if (!hasUnsavedChanges) return;
+ if (!hasUnsavedChanges) return false;
Debug.WriteLine(string.Format("Saving application \"{0}\" as {1}", Name, Code));
Name = Regex.Replace(Name, @"'(\d)", @"`$1"); // Apostrophe + any number in game name crashes whole system. What. The. Fuck?
File.WriteAllText(ConfigPath, string.Format(
@@ -298,6 +300,7 @@ namespace com.clusterrr.hakchi_gui
(Name ?? Code).ToLower(), (Publisher ?? DefaultPublisher).ToUpper(),
Simultaneous ? 1 : 0));
hasUnsavedChanges = false;
+ return true;
}
public override string ToString()