public void LaunchGame(GameInformation game) { game.IgnoreDispose = true; if (game.HostPath != null) { // Need to have the UMD instance reload to the game string gamePath = game.HostPath; Debug.Assert(gamePath != null); _emulator.Umd.Eject(); if (_emulator.Umd.Load(gamePath, false) == false) { // Failed to load } // Regrab game info game = GameLoader.FindGame(_emulator.Umd); Properties.Settings.Default.LastPlayedGame = gamePath; Properties.Settings.Default.Save(); } _emulator.SwitchToGame(game); this.DialogResult = DialogResult.OK; this.Close(); }
public static List <GameInformation> FindGames(string path) { List <GameInformation> games = new List <GameInformation>(); foreach (string umdFile in Directory.GetFiles(path, "*.iso")) { string umdPath = Path.Combine(path, umdFile); IUmdDevice device = (new Noxa.Emulation.Psp.Media.Iso.IsoFileSystem()).CreateInstance(null, new ComponentParameters()) as IUmdDevice; device.Load(umdPath, true); GameInformation info = GameLoader.FindGame(device); games.Add(info); } return(games); }
static void Main(string[] args) { //string path = @"C:\Dev\Noxa.Emulation\UMD Images"; string path = @"F:\UMD Images"; string resultDir = Path.Combine(path, "Reports"); foreach (string umdPath in Directory.GetFiles(path, "*.iso")) { Console.WriteLine("-------------------------------------------------------------------------------"); Console.WriteLine("- UMD ISO: " + Path.GetFileName(umdPath)); Console.WriteLine("-------------------------------------------------------------------------------"); try { TestHost host = new TestHost(); host.CreateInstance(); TestInstance instance = host.CurrentInstance as TestInstance; instance.Umd.Load(umdPath, false); GameInformation game = GameLoader.FindGame(instance.Umd); Console.WriteLine(string.Format("Loading game {0} ({1})", game.Parameters.Title, game.Parameters.DiscID)); LoadResults results = instance.SwitchToGame(game); if (results.Successful == true) { Console.WriteLine("Imports: {0}, Exports: {1}", results.Imports.Count, results.Exports.Count); GameLoader.GenerateReport(instance, game, results, resultDir); } else { Console.WriteLine("!!!! Failed to load"); } instance.Destroy(); } catch (Exception ex) { Console.WriteLine("Exception while processing: " + ex.ToString()); Debugger.Break(); } Console.WriteLine(""); GC.Collect(); } }
private GameInformation LoadGameFromUmd(string gamePath) { //try { if (File.Exists(gamePath) == false) { return(null); } //Type deviceType = _emulator.Umd.Factory; //IComponent component = ( IComponent )Activator.CreateInstance( deviceType ); //Debug.Assert( component != null ); //if( component == null ) // throw new InvalidOperationException(); //ComponentParameters parameters = new ComponentParameters(); //parameters[ "path" ] = gamePath; //IUmdDevice umdDevice = component.CreateInstance( _emulator, parameters ) as IUmdDevice; //Debug.Assert( umdDevice != null ); //if( umdDevice == null ) // throw new InvalidOperationException(); IUmdDevice umdDevice = _emulator.Umd; if (umdDevice.Load(gamePath, true) == false) { return(null); } GameInformation game = GameLoader.FindGame(umdDevice); if (game != null) { game.HostPath = gamePath; } umdDevice.Cleanup(); return(game); } //catch { //Debug.Assert( false ); //return null; } }