Program.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. Console.Title = "Ryujinx Console";
  12. IGalRenderer Renderer = new OpenGLRenderer();
  13. Switch Ns = new Switch(Renderer);
  14. if (args.Length == 1)
  15. {
  16. if (Directory.Exists(args[0]))
  17. {
  18. string[] RomFsFiles = Directory.GetFiles(args[0], "*.istorage");
  19. if (RomFsFiles.Length > 0)
  20. {
  21. Logging.Info("Loading as cart with RomFS.");
  22. Console.Title += " - Cart (with RomFS) - " + args[0];
  23. Ns.Os.LoadCart(args[0], RomFsFiles[0]);
  24. }
  25. else
  26. {
  27. Logging.Info("Loading as cart WITHOUT RomFS.");
  28. Console.Title += " - Cart (without RomFS) - " + args[0];
  29. Ns.Os.LoadCart(args[0]);
  30. }
  31. }
  32. else if (File.Exists(args[0]))
  33. {
  34. Logging.Info("Loading as homebrew.");
  35. Console.Title += " - Homebrew - " + args[0];
  36. Ns.Os.LoadProgram(args[0]);
  37. }
  38. }
  39. else
  40. {
  41. Logging.Error("Please specify the folder with the NSOs/IStorage or a NSO/NRO.");
  42. }
  43. using (GLScreen Screen = new GLScreen(Ns, Renderer))
  44. {
  45. Screen.Run(60.0);
  46. }
  47. Ns.Os.StopAllProcesses();
  48. Ns.Dispose();
  49. }
  50. }
  51. }