Program.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using Gal;
  2. using Gal.OpenGL;
  3. using System;
  4. using System.IO;
  5. namespace Ryujinx
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. Config.Read();
  12. Console.Title = "Ryujinx Console";
  13. IGalRenderer Renderer = new OpenGLRenderer();
  14. Switch Ns = new Switch(Renderer);
  15. if (args.Length == 1)
  16. {
  17. if (Directory.Exists(args[0]))
  18. {
  19. string[] RomFsFiles = Directory.GetFiles(args[0], "*.istorage");
  20. if (RomFsFiles.Length > 0)
  21. {
  22. Logging.Info("Loading as cart with RomFS.");
  23. Console.Title += " - Cart (with RomFS) - " + args[0];
  24. Ns.Os.LoadCart(args[0], RomFsFiles[0]);
  25. }
  26. else
  27. {
  28. Logging.Info("Loading as cart WITHOUT RomFS.");
  29. Console.Title += " - Cart (without RomFS) - " + args[0];
  30. Ns.Os.LoadCart(args[0]);
  31. }
  32. }
  33. else if (File.Exists(args[0]))
  34. {
  35. Logging.Info("Loading as homebrew.");
  36. Console.Title += " - Homebrew - " + args[0];
  37. Ns.Os.LoadProgram(args[0]);
  38. }
  39. }
  40. else
  41. {
  42. Logging.Error("Please specify the folder with the NSOs/IStorage or a NSO/NRO.");
  43. }
  44. using (GLScreen Screen = new GLScreen(Ns, Renderer))
  45. {
  46. Screen.Run(60.0);
  47. }
  48. Ns.Os.StopAllProcesses();
  49. Ns.Dispose();
  50. }
  51. }
  52. }