@@ -15,6 +15,9 @@ namespace RetroGOG
1515{
1616 public partial class frmPluginSelect : Form
1717 {
18+ IDictionary < string , string > plugin_codes = new Dictionary < string , string > ( ) ;
19+ IDictionary < string , string > core_codes = new Dictionary < string , string > ( ) ;
20+
1821 public frmPluginSelect ( )
1922 {
2023 InitializeComponent ( ) ;
@@ -38,6 +41,53 @@ private void btnBack_Click(object sender, EventArgs e)
3841
3942 private void frmPluginSelect_Load ( object sender , EventArgs e )
4043 {
44+ // Build dictionaries
45+ plugin_codes . Add ( "The 3DO Company - 3DO" , "3do_9d81c0ec-5646-4b1a-b809-e7e61e1d3577" ) ;
46+ plugin_codes . Add ( "Nintendo - Nintendo 3DS" , "3ds_f6acd3ed-2c31-47d6-bae4-07b6714c1e55" ) ;
47+ plugin_codes . Add ( "Atari - 2600" , "atari_830528d9-e621-48e9-8ed4-e03a4853843e" ) ;
48+ plugin_codes . Add ( "Sega - Dreamcast" , "dc_5d181ffd-48dc-4330-aa58-6f646e76a5c8" ) ;
49+ plugin_codes . Add ( "Nintendo - Game Boy" , "gb_4345afe1-a2c3-4c58-93d3-373c53a90a92" ) ;
50+ plugin_codes . Add ( "Nintendo - Game Boy Advance" , "gba_16a78ef5-fba6-4629-b83c-ef47adab5aab" ) ;
51+ plugin_codes . Add ( "Nintendo - Game Boy Color" , "gbc_9b53fc85-af7c-4ce2-af31-0d95234d783a" ) ;
52+ plugin_codes . Add ( "Atari - Jaguar" , "jaguar_b9773549-9c20-4729-b23d-f683762ce73a" ) ;
53+ plugin_codes . Add ( "Nintendo - Nintendo 64" , "n64_a3824d31-c2d3-4a1a-b321-7d0764da5513" ) ;
54+ plugin_codes . Add ( "Nintendo - GameCube" , "ncube_602422b9-ced5-476e-911a-7fa0adf0f7f7" ) ;
55+ plugin_codes . Add ( "Nintendo - Nintendo DS" , "nds_4704ed29-f516-4fd8-8477-ddbcdb7cedfc" ) ;
56+ plugin_codes . Add ( "Nintendo - Nintendo Entertainment System" , "nes_e2c630e1-3cbe-4dbd-9235-5e6a2d2955ad" ) ;
57+ plugin_codes . Add ( "Nintendo - Wii" , "nwii_2d0e97ac-0406-4e5f-a85b-ab5b1a042cba" ) ;
58+ plugin_codes . Add ( "NEC - PC Engine - TurboGrafx 16" , "pce_c0ffd4b8-41c3-46b8-b0f7-5f4e4bafc68a" ) ;
59+ plugin_codes . Add ( "Sony - PlayStation" , "ps1_ff02c67d-5962-4e79-a3a3-928814edb270" ) ;
60+ plugin_codes . Add ( "Sony - PlayStation 2" , "ps2_50ad79eb-393c-4f95-98ce-59f095ae47ea" ) ;
61+ plugin_codes . Add ( "Sony - PlayStation Portable" , "psp_05487532-ba29-411b-b799-784262d275bd" ) ;
62+ plugin_codes . Add ( "Sega - Saturn" , "saturn_bd6ec091-8ee0-440a-9e26-71bbf21c05af" ) ;
63+ plugin_codes . Add ( "Sega - Mega-CD - Sega CD" , "segacd_ec7197bf-a4e4-4b86-81b9-38ea7d56f3b2" ) ;
64+ plugin_codes . Add ( "Sega - Mega Drive - Genesis" , "segag_e3ac94e7-945e-459d-bc1e-676cff8173f9" ) ;
65+ plugin_codes . Add ( "Sega - Master System - Mark III" , "sms_c6689bfb-7ba4-4d24-98e3-bd2dc339926b" ) ;
66+ plugin_codes . Add ( "Nintendo - Super Nintendo Entertainment System" , "snes_bc831044-f772-4391-8c22-529f42cb9799" ) ;
67+
68+ core_codes . Add ( "The 3DO Company - 3DO" , "opera_libretro.dll" ) ;
69+ core_codes . Add ( "Nintendo - Nintendo 3DS" , "citra_libretro.dll" ) ;
70+ core_codes . Add ( "Atari - 2600" , "stella_libretro.dll" ) ;
71+ core_codes . Add ( "Sega - Dreamcast" , "flycast_libretro.dll" ) ;
72+ core_codes . Add ( "Nintendo - Game Boy" , "mgba_libretro.dll" ) ;
73+ core_codes . Add ( "Nintendo - Game Boy Advance" , "mgba_libretro.dll" ) ;
74+ core_codes . Add ( "Nintendo - Game Boy Color" , "mgba_libretro.dll" ) ;
75+ core_codes . Add ( "Atari - Jaguar" , "virtualjaguar_libretro.dll" ) ;
76+ core_codes . Add ( "Nintendo - Nintendo 64" , "mupen64plus_next_libretro.dll" ) ;
77+ core_codes . Add ( "Nintendo - GameCube" , "dolphin_libretro.dll" ) ;
78+ core_codes . Add ( "Nintendo - Nintendo DS" , "desmume_libretro.dll" ) ;
79+ core_codes . Add ( "Nintendo - Nintendo Entertainment System" , "mesen_libretro.dll" ) ;
80+ core_codes . Add ( "Nintendo - Wii" , "dolphin_libretro.dll" ) ;
81+ core_codes . Add ( "NEC - PC Engine - TurboGrafx 16" , "mednafen_pce_fast_libretro.dll" ) ;
82+ core_codes . Add ( "Sony - PlayStation" , "pcsx_rearmed_libretro.dll" ) ;
83+ core_codes . Add ( "Sony - PlayStation 2" , "play_libretro.dll" ) ;
84+ core_codes . Add ( "Sony - PlayStation Portable" , "ppsspp_libretro.dll" ) ;
85+ core_codes . Add ( "Sega - Saturn" , "mednafen_saturn_libretro.dll" ) ;
86+ core_codes . Add ( "Sega - Mega-CD - Sega CD" , "genesis_plus_gx_libretro.dll" ) ;
87+ core_codes . Add ( "Sega - Mega Drive - Genesis" , "genesis_plus_gx_libretro.dll" ) ;
88+ core_codes . Add ( "Sega - Master System - Mark III" , "genesis_plus_gx_libretro.dll" ) ;
89+ core_codes . Add ( "Nintendo - Super Nintendo Entertainment System" , "snes9x_libretro.dll" ) ;
90+
4191 tmrCheck . Enabled = true ;
4292 string playlistpath = Globals . RAPath . Replace ( "retroarch.exe" , "playlists\\ " ) ;
4393 string [ ] strPlaylists = Directory . GetFiles ( playlistpath ) ;
@@ -47,7 +97,11 @@ private void frmPluginSelect_Load(object sender, EventArgs e)
4797 {
4898 if ( name . Substring ( Math . Max ( 0 , name . Length - 4 ) ) == ".lpl" )
4999 {
50- chbPlaylists . Items . Add ( name . Replace ( playlistpath , "" ) . Replace ( ".lpl" , "" ) , true ) ;
100+ string playlist_name = name . Replace ( playlistpath , "" ) . Replace ( ".lpl" , "" ) ;
101+ if ( plugin_codes . ContainsKey ( playlist_name ) )
102+ {
103+ chbPlaylists . Items . Add ( playlist_name , true ) ;
104+ }
51105 }
52106 }
53107 }
@@ -101,56 +155,6 @@ private void btnNext_Click(object sender, EventArgs e)
101155 barProgress . Value = 0 ;
102156 barProgress . Maximum = chbPlaylists . CheckedItems . Count ;
103157
104- // Build dictionaries
105- IDictionary < string , string > plugin_codes = new Dictionary < string , string > ( ) ;
106- plugin_codes . Add ( "The 3DO Company - 3DO" , "3do_9d81c0ec-5646-4b1a-b809-e7e61e1d3577" ) ;
107- plugin_codes . Add ( "Nintendo - Nintendo 3DS" , "3ds_f6acd3ed-2c31-47d6-bae4-07b6714c1e55" ) ;
108- plugin_codes . Add ( "Atari - 2600" , "atari_830528d9-e621-48e9-8ed4-e03a4853843e" ) ;
109- plugin_codes . Add ( "Sega - Dreamcast" , "dc_5d181ffd-48dc-4330-aa58-6f646e76a5c8" ) ;
110- plugin_codes . Add ( "Nintendo - Game Boy" , "gb_4345afe1-a2c3-4c58-93d3-373c53a90a92" ) ;
111- plugin_codes . Add ( "Nintendo - Game Boy Advance" , "gba_16a78ef5-fba6-4629-b83c-ef47adab5aab" ) ;
112- plugin_codes . Add ( "Nintendo - Game Boy Color" , "gbc_9b53fc85-af7c-4ce2-af31-0d95234d783a" ) ;
113- plugin_codes . Add ( "Atari - Jaguar" , "jaguar_b9773549-9c20-4729-b23d-f683762ce73a" ) ;
114- plugin_codes . Add ( "Nintendo - Nintendo 64" , "n64_a3824d31-c2d3-4a1a-b321-7d0764da5513" ) ;
115- plugin_codes . Add ( "Nintendo - GameCube" , "ncube_602422b9-ced5-476e-911a-7fa0adf0f7f7" ) ;
116- plugin_codes . Add ( "Nintendo - Nintendo DS" , "nds_4704ed29-f516-4fd8-8477-ddbcdb7cedfc" ) ;
117- plugin_codes . Add ( "Nintendo - Nintendo Entertainment System" , "nes_e2c630e1-3cbe-4dbd-9235-5e6a2d2955ad" ) ;
118- plugin_codes . Add ( "Nintendo - Wii" , "nwii_2d0e97ac-0406-4e5f-a85b-ab5b1a042cba" ) ;
119- plugin_codes . Add ( "NEC - PC Engine - TurboGrafx 16" , "pce_c0ffd4b8-41c3-46b8-b0f7-5f4e4bafc68a" ) ;
120- plugin_codes . Add ( "Sony - PlayStation" , "ps1_ff02c67d-5962-4e79-a3a3-928814edb270" ) ;
121- plugin_codes . Add ( "Sony - PlayStation 2" , "ps2_50ad79eb-393c-4f95-98ce-59f095ae47ea" ) ;
122- plugin_codes . Add ( "Sony - PlayStation Portable" , "psp_05487532-ba29-411b-b799-784262d275bd" ) ;
123- plugin_codes . Add ( "Sega - Saturn" , "saturn_bd6ec091-8ee0-440a-9e26-71bbf21c05af" ) ;
124- plugin_codes . Add ( "Sega - Mega-CD - Sega CD" , "segacd_ec7197bf-a4e4-4b86-81b9-38ea7d56f3b2" ) ;
125- plugin_codes . Add ( "Sega - Mega Drive - Genesis" , "segag_e3ac94e7-945e-459d-bc1e-676cff8173f9" ) ;
126- plugin_codes . Add ( "Sega - Master System - Mark III" , "sms_c6689bfb-7ba4-4d24-98e3-bd2dc339926b" ) ;
127- plugin_codes . Add ( "Nintendo - Super Nintendo Entertainment System" , "snes_bc831044-f772-4391-8c22-529f42cb9799" ) ;
128-
129- IDictionary < string , string > core_codes = new Dictionary < string , string > ( ) ;
130- core_codes . Add ( "The 3DO Company - 3DO" , "opera_libretro.dll" ) ;
131- core_codes . Add ( "Nintendo - Nintendo 3DS" , "citra_libretro.dll" ) ;
132- core_codes . Add ( "Atari - 2600" , "stella_libretro.dll" ) ;
133- core_codes . Add ( "Sega - Dreamcast" , "flycast_libretro.dll" ) ;
134- core_codes . Add ( "Nintendo - Game Boy" , "mgba_libretro.dll" ) ;
135- core_codes . Add ( "Nintendo - Game Boy Advance" , "mgba_libretro.dll" ) ;
136- core_codes . Add ( "Nintendo - Game Boy Color" , "mgba_libretro.dll" ) ;
137- core_codes . Add ( "Atari - Jaguar" , "virtualjaguar_libretro.dll" ) ;
138- core_codes . Add ( "Nintendo - Nintendo 64" , "mupen64plus_next_libretro.dll" ) ;
139- core_codes . Add ( "Nintendo - GameCube" , "dolphin_libretro.dll" ) ;
140- core_codes . Add ( "Nintendo - Nintendo DS" , "desmume_libretro.dll" ) ;
141- core_codes . Add ( "Nintendo - Nintendo Entertainment System" , "mesen_libretro.dll" ) ;
142- core_codes . Add ( "Nintendo - Wii" , "dolphin_libretro.dll" ) ;
143- core_codes . Add ( "NEC - PC Engine - TurboGrafx 16" , "mednafen_pce_fast_libretro.dll" ) ;
144- core_codes . Add ( "Sony - PlayStation" , "pcsx_rearmed_libretro.dll" ) ;
145- core_codes . Add ( "Sony - PlayStation 2" , "play_libretro.dll" ) ;
146- core_codes . Add ( "Sony - PlayStation Portable" , "ppsspp_libretro.dll" ) ;
147- core_codes . Add ( "Sega - Saturn" , "mednafen_saturn_libretro.dll" ) ;
148- core_codes . Add ( "Sega - Mega-CD - Sega CD" , "genesis_plus_gx_libretro.dll" ) ;
149- core_codes . Add ( "Sega - Mega Drive - Genesis" , "genesis_plus_gx_libretro.dll" ) ;
150- core_codes . Add ( "Sega - Master System - Mark III" , "genesis_plus_gx_libretro.dll" ) ;
151- core_codes . Add ( "Nintendo - Super Nintendo Entertainment System" , "snes9x_libretro.dll" ) ;
152-
153-
154158 // Download latest galaxy API for plugins
155159 using ( var client = new WebClient ( ) )
156160 {
@@ -160,42 +164,45 @@ private void btnNext_Click(object sender, EventArgs e)
160164
161165 foreach ( string item in chbPlaylists . CheckedItems )
162166 {
163- // Create Plugin directory
164- Directory . CreateDirectory ( Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " ) ;
165-
166- using ( var client = new WebClient ( ) )
167+ if ( plugin_codes . ContainsKey ( item ) )
167168 {
168- // Download Plugin from Github
169- client . Headers . Add ( "user-agent" , "RetroGOG" ) ;
170- client . DownloadFile ( "https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes [ item ] + "/manifest.json" , Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " + "manifest.json" ) ;
171- client . DownloadFile ( "https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes [ item ] + "/plugin.py" , Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " + "plugin.py" ) ;
172- client . DownloadFile ( "https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes [ item ] + "/version.py" , Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " + "version.py" ) ;
173-
174- // Download Galaxy API and decompress
175- if ( Directory . Exists ( Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ galaxy\\ " ) )
176- {
177- Directory . Delete ( Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ galaxy\\ " , true ) ;
178- }
179- System . IO . Compression . ZipFile . ExtractToDirectory ( Globals . GOGPluginPath + "\\ galaxy_api.zip" , Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ galaxy\\ " ) ;
169+ // Create Plugin directory
170+ Directory . CreateDirectory ( Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " ) ;
180171
181- // Write user_config.py file
182- string [ ] lines = new string [ 3 ] ;
183- lines [ 0 ] = "# This file automatically generated by RetroGOG" ;
184- lines [ 1 ] = "emu_path = \" " + Globals . RAPath . Replace ( "\\ " , "/" ) . Replace ( "retroarch.exe" , "" ) + "\" " ;
185- if ( File . Exists ( Globals . RAPath . Replace ( "retroarch.exe" , "cores\\ " ) + core_codes [ item ] ) )
172+ using ( var client = new WebClient ( ) )
186173 {
187- lines [ 2 ] = "core = \" " + core_codes [ item ] + "\" " ;
174+ // Download Plugin from Github
175+ client . Headers . Add ( "user-agent" , "RetroGOG" ) ;
176+ client . DownloadFile ( "https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes [ item ] + "/manifest.json" , Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " + "manifest.json" ) ;
177+ client . DownloadFile ( "https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes [ item ] + "/plugin.py" , Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " + "plugin.py" ) ;
178+ client . DownloadFile ( "https://raw.githubusercontent.com/jshackles/RetroGOG/master/plugins/" + plugin_codes [ item ] + "/version.py" , Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " + "version.py" ) ;
179+
180+ // Download Galaxy API and decompress
181+ if ( Directory . Exists ( Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ galaxy\\ " ) )
182+ {
183+ Directory . Delete ( Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ galaxy\\ " , true ) ;
184+ }
185+ System . IO . Compression . ZipFile . ExtractToDirectory ( Globals . GOGPluginPath + "\\ galaxy_api.zip" , Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ galaxy\\ " ) ;
186+
187+ // Write user_config.py file
188+ string [ ] lines = new string [ 3 ] ;
189+ lines [ 0 ] = "# This file automatically generated by RetroGOG" ;
190+ lines [ 1 ] = "emu_path = \" " + Globals . RAPath . Replace ( "\\ " , "/" ) . Replace ( "retroarch.exe" , "" ) + "\" " ;
191+ if ( File . Exists ( Globals . RAPath . Replace ( "retroarch.exe" , "cores\\ " ) + core_codes [ item ] ) )
192+ {
193+ lines [ 2 ] = "core = \" " + core_codes [ item ] + "\" " ;
194+ }
195+ else
196+ {
197+ Form frmCoreSelect = new frmCoreSelect ( ) ;
198+ frmCoreSelect . Text = item ;
199+ frmCoreSelect . ShowDialog ( this ) ;
200+ lines [ 2 ] = "core = \" " + Globals . TempCore + "\" " ;
201+ }
202+ System . IO . File . WriteAllLines ( Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " + "user_config.py" , lines ) ;
203+
204+ barProgress . Value = barProgress . Value + 1 ;
188205 }
189- else
190- {
191- Form frmCoreSelect = new frmCoreSelect ( ) ;
192- frmCoreSelect . Text = item ;
193- frmCoreSelect . ShowDialog ( this ) ;
194- lines [ 2 ] = "core = \" " + Globals . TempCore + "\" " ;
195- }
196- System . IO . File . WriteAllLines ( Globals . GOGPluginPath + "\\ " + plugin_codes [ item ] + "\\ " + "user_config.py" , lines ) ;
197-
198- barProgress . Value = barProgress . Value + 1 ;
199206 }
200207 }
201208 }
0 commit comments