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); }
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; } }