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

AppTypeCollection.cs « Apps - github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3c3402e762f11d362a493de94dfbd81a180bb926 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
using com.clusterrr.hakchi_gui.Properties;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;

namespace com.clusterrr.hakchi_gui
{
    static class AppTypeCollection
    {
        //public delegate NesMiniApplication 

        public class AppInfo
        {
            public string SystemName;
            public List<Type> Class;
            public string[] Extensions;
            public string[] DefaultApps;
            public char Prefix;
            public Image DefaultCover;
        }

        public static AppInfo[] ApplicationTypes = new AppInfo[]
        {
            new AppInfo
            {
                SystemName = "Famicom Disk System",
                Class = new List<Type>(){typeof(FdsGame) },
                Extensions = new string[] {".fds"},
                DefaultApps = new string[] {},
                Prefix = 'D',
                DefaultCover = Resources.blank_fds
            },
            new AppInfo
            {
                SystemName = "NES",
                Class = new List<Type>(){typeof(NesUGame),typeof(NesGame) },
                Extensions = new string[] {".nes", ".unf", ".unif"},
                DefaultApps = new string[] {"/bin/nes"},
                Prefix = 'I',
                DefaultCover = Resources.blank_jp
            },
           new AppInfo
            {
                SystemName = "NES Default Game",
                Class = new List<Type>(){typeof(NesDefaultGame),typeof(NesGame) },
                Extensions = new string[] {},
                DefaultApps = new string[] {},
                Prefix = 'S',
                DefaultCover = Resources.blank_nes
            },
            new AppInfo
            {
                SystemName = "SNES",
                Class = new List<Type>(){typeof(SnesGame) },
                Extensions = new string[] { ".sfc", ".smc" },
                DefaultApps = new string[] {"/bin/snes"},
                Prefix = 'U',
                DefaultCover = Resources.blank_snes_us
            },
            new AppInfo
            {
                SystemName = "Nintendo 64",
                Class = new List<Type>(){typeof(N64Game) },
                Extensions = new string[] { ".n64", ".z64", ".v64" },
                DefaultApps = new string[] {"/bin/n64"},
                Prefix = '6',
                DefaultCover = Resources.blank_n64
            },
            new AppInfo
            {
                SystemName = "Sega Master System",
                Class = new List<Type>(){typeof(SmsGame) },
                Extensions = new string[] { ".sms" },
                DefaultApps = new string[] {"/bin/sms"},
                Prefix = 'M',
                DefaultCover = Resources.blank_sms
            },
            new AppInfo
            {
                SystemName = "Sega Genesis",
                Class = new List<Type>(){typeof(GenesisGame) },
                Extensions = new string[] { ".gen", ".md", ".smd" },
                DefaultApps = new string[] {"/bin/md"},
                Prefix = 'G',
                DefaultCover = Resources.blank_genesis
            },
            new AppInfo
            {
                SystemName = "Sega 32X",
                Class = new List<Type>(){ typeof(Sega32XGame) },
                Extensions = new string[] { ".32x" },
                DefaultApps = new string[] {"/bin/32x"},
                Prefix = '3',
                DefaultCover = Resources.blank_32x
            },
            new AppInfo
            {
                SystemName = "GameBoy",
                Class = new List<Type>(){typeof(GbGame) },
                Extensions = new string[] { ".gb" },
                DefaultApps = new string[] {"/bin/gb"},
                Prefix = 'B',
                DefaultCover = Resources.blank_gb
            },
            ///bin/a78 /usr/share/games/nes/kachikachi/CLV-Z-AGEPI/Ms._Pac-Man__USA_.7z
            new AppInfo
            {
                SystemName = "Atari 7800",
                Class = new List<Type>(){typeof(UnknowSystem) },
                Extensions = new string[]{".a78"},
                DefaultApps = new string[]{ "/bin/a78" },
                Prefix = 'Z',
                DefaultCover = Resources.blank_app
            },
            new AppInfo
            {
                SystemName = "Atari Lynx",
                Class = new List<Type>(){typeof(UnknowSystem) },
                Extensions = new string[]{".lnx"},
                DefaultApps = new string[]{ "/bin/lnx" },
                Prefix = 'Z',
                DefaultCover = Resources.blank_app
            },
          
            new AppInfo
            {
                SystemName = "SuperGrafx",
                Class = new List<Type>(){typeof(UnknowSystem) },
                Extensions = new string[]{".pce"},
                DefaultApps = new string[]{ "/bin/sgfx" },
                Prefix = 'E',
                DefaultCover = Resources.blank_pce
            },
        
            new AppInfo
            {
                SystemName = "NeoGeo Pocket (Color)",
                Class = new List<Type>(){typeof(UnknowSystem) },
                Extensions = new string[]{".ngc"},
                DefaultApps = new string[]{ "/bin/ngc" },
                Prefix = 'E',
                DefaultCover = Resources.blank_app
            },
             new AppInfo
            {
                SystemName = "NeoGeo Pocket",
                Class = new List<Type>(){typeof(UnknowSystem) },
                Extensions = new string[]{".ngp"},
                DefaultApps = new string[]{ "/bin/ngp" },
                Prefix = 'E',
                DefaultCover = Resources.blank_app
            },
            new AppInfo
            {
                SystemName = "GameBoy Color",
                Class = new List<Type>(){typeof(GbcGame) },
                Extensions = new string[] {".gbc"},
                DefaultApps = new string[] {"/bin/gbc"},
                Prefix = 'C',
                DefaultCover = Resources.blank_gbc
            },
            new AppInfo
            {
                SystemName = "GameBoy Advance",
                Class = new List<Type>(){typeof(GbaGame) },
                Extensions = new string[] {".gba"},
                DefaultApps = new string[] {"/bin/gba"},
                Prefix = 'A',
                DefaultCover = Resources.blank_gba
            },
            new AppInfo
            {
                SystemName = "PC Engine",
                Class = new List<Type>(){typeof(PceGame) },
                Extensions = new string[] {".pce"},
                DefaultApps = new string[] {"/bin/pce"},
                Prefix = 'E',
                DefaultCover = Resources.blank_pce
            },
            new AppInfo
            {
                SystemName = "Sega GameGear",
                Class = new List<Type>(){typeof(GameGearGame) },
                Extensions = new string[] {".gg"},
                DefaultApps = new string[] {"/bin/gg"},
                Prefix = 'R',
                DefaultCover = Resources.blank_gg
            },
            new AppInfo
            {
                SystemName="Atari 2600",
                Class = new List<Type>(){typeof(Atari2600Game) },
                Extensions = new string[] {".a26"},
                DefaultApps = new string[] {"/bin/a26"},
                Prefix = 'T',
                DefaultCover = Resources.blank_2600
            },
            new AppInfo
            {
                SystemName = "Arcade",
                Class = new List<Type>(){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 GetAppByClass(Type theClass)
        {
            foreach (var app in ApplicationTypes)
                if(app.Class.Contains(theClass))
                    return app;
            AppInfo inf = new AppInfo();
            inf.SystemName = "Unknow";
            return inf;
        }
        public static AppInfo GetAppByExtension(string extension)
        {
            foreach (var app in ApplicationTypes)
                if (Array.IndexOf(app.Extensions, extension) >= 0)
                    return app;
            return null;
        }

        public static AppInfo GetAppByExec(string exec)
        {
            foreach (var app in ApplicationTypes)
                foreach (var cmd in app.DefaultApps)
                    if (exec.StartsWith(cmd + " "))
                        return app;
            AppInfo inf = new AppInfo();
            inf.SystemName = "Unknow";
            return inf;
        }
    }
}