From d0ff8f44aebc7045010e2fcb3827f5f27534747f Mon Sep 17 00:00:00 2001 From: Xpl0itR Date: Tue, 9 Jul 2019 21:54:34 +0100 Subject: [PATCH] updated nuget package with missing dlls and changed emmauss' requested changes --- Ryujinx.HLE/ApplicationLibrary.cs | 22 +++++++------ Ryujinx.HLE/HOS/Horizon.cs | 2 +- Ryujinx/Program.cs | 2 +- Ryujinx/Ryujinx.csproj | 2 +- Ryujinx/Ui/MainWindow.cs | 52 ++++++++++++------------------- Ryujinx/Ui/SwitchSettings.cs | 2 +- 6 files changed, 37 insertions(+), 45 deletions(-) diff --git a/Ryujinx.HLE/ApplicationLibrary.cs b/Ryujinx.HLE/ApplicationLibrary.cs index 61880d8f5b..47e69858f7 100644 --- a/Ryujinx.HLE/ApplicationLibrary.cs +++ b/Ryujinx.HLE/ApplicationLibrary.cs @@ -9,12 +9,12 @@ using System.Linq; using System.Reflection; using System.Text; -namespace Ryujinx +namespace Ryujinx.HLE { public class ApplicationLibrary { private static Keyset KeySet; - private static HLE.HOS.SystemState.TitleLanguage DesiredTitleLanguage; + private static HOS.SystemState.TitleLanguage DesiredTitleLanguage; public static byte[] RyujinxNspIcon { get; private set; } public static byte[] RyujinxXciIcon { get; private set; } @@ -38,7 +38,7 @@ namespace Ryujinx public string Path; } - public static void Init(List AppDirs, Keyset keySet, HLE.HOS.SystemState.TitleLanguage desiredTitleLanguage) + public static void Init(List AppDirs, Keyset keySet, HOS.SystemState.TitleLanguage desiredTitleLanguage) { KeySet = keySet; DesiredTitleLanguage = desiredTitleLanguage; @@ -104,7 +104,9 @@ namespace Ryujinx using (FileStream file = new FileStream(applicationPath, FileMode.Open, FileAccess.Read)) { - if ((Path.GetExtension(applicationPath) == ".nsp") || (Path.GetExtension(applicationPath) == ".pfs0") || (Path.GetExtension(applicationPath) == ".xci")) + if ((Path.GetExtension(applicationPath) == ".nsp") || + (Path.GetExtension(applicationPath) == ".pfs0") || + (Path.GetExtension(applicationPath) == ".xci")) { try { @@ -120,7 +122,7 @@ namespace Ryujinx // Creates NACP class from the NACP file IFile controlNacp = controlFs.OpenFile("/control.nacp", OpenMode.Read); - Nacp controlData = new Nacp(controlNacp.AsStream()); + Nacp controlData = new Nacp(controlNacp.AsStream()); // Get the title name, title ID, developer name and version number from the NACP version = controlData.DisplayVersion; @@ -262,13 +264,15 @@ namespace Ryujinx if (Path.GetExtension(applicationPath) == ".nca") { applicationIcon = RyujinxNcaIcon; } else if (Path.GetExtension(applicationPath) == ".nso") { applicationIcon = RyujinxNsoIcon; } + string fileName = Path.GetFileName(applicationPath); + string fileExt = Path.GetExtension(applicationPath); StringBuilder titlename = new StringBuilder(); - titlename.Append(Path.GetFileName(applicationPath)); - titlename.Remove(Path.GetFileName(applicationPath).Length - Path.GetExtension(applicationPath).Length, Path.GetExtension(applicationPath).Length); + titlename.Append(fileName); + titlename.Remove(fileName.Length - fileExt.Length, fileExt.Length); titleName = titlename.ToString(); - titleId = "0000000000000000"; - version = "?"; + titleId = "0000000000000000"; + version = "?"; developer = "Unknown"; } } diff --git a/Ryujinx.HLE/HOS/Horizon.cs b/Ryujinx.HLE/HOS/Horizon.cs index 21f12f95b4..e0b7490dd8 100644 --- a/Ryujinx.HLE/HOS/Horizon.cs +++ b/Ryujinx.HLE/HOS/Horizon.cs @@ -453,7 +453,7 @@ namespace Ryujinx.HLE.HOS Nacp controlData = new Nacp(controlFile.AsStream()); TitleName = CurrentTitle = controlData.Descriptions[(int)State.DesiredTitleLanguage].Title; - TitleID = metaData.Aci0.TitleId.ToString("x16"); + TitleID = metaData.Aci0.TitleId.ToString("x16"); if (string.IsNullOrWhiteSpace(CurrentTitle)) { diff --git a/Ryujinx/Program.cs b/Ryujinx/Program.cs index 5788ff95cd..1d714988cb 100644 --- a/Ryujinx/Program.cs +++ b/Ryujinx/Program.cs @@ -26,7 +26,7 @@ namespace Ryujinx Application.Init(); Application gtkapp = new Application("Ryujinx.Ryujinx", GLib.ApplicationFlags.None); - MainWindow win = new MainWindow(args, gtkapp); + MainWindow win = new MainWindow(args, gtkapp); gtkapp.Register(GLib.Cancellable.Current); gtkapp.AddWindow(win); diff --git a/Ryujinx/Ryujinx.csproj b/Ryujinx/Ryujinx.csproj index 2bcaabec17..459e4b3133 100644 --- a/Ryujinx/Ryujinx.csproj +++ b/Ryujinx/Ryujinx.csproj @@ -34,7 +34,7 @@ - + diff --git a/Ryujinx/Ui/MainWindow.cs b/Ryujinx/Ui/MainWindow.cs index 101632aba8..9bbced1468 100644 --- a/Ryujinx/Ui/MainWindow.cs +++ b/Ryujinx/Ui/MainWindow.cs @@ -5,6 +5,7 @@ using Ryujinx.Audio; using Ryujinx.Common.Logging; using Ryujinx.Graphics.Gal; using Ryujinx.Graphics.Gal.OpenGL; +using Ryujinx.HLE; using Ryujinx.Profiler; using System; using System.Diagnostics; @@ -55,7 +56,7 @@ namespace Ryujinx.UI _audioOut = InitializeAudioEngine(); - _device = new HLE.Switch(_renderer, _audioOut); + _device = new HLE.Switch(_renderer, _audioOut); Configuration.Load(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json")); Configuration.InitialConfigure(_device); @@ -92,9 +93,7 @@ namespace Ryujinx.UI if (args.Length == 1) { - //Box.Remove(GameTableWindow); - - //Temporary code section start, remove this section and uncomment above line when game is rendered to the glarea in the gui + // Temporary code section start, remove this section when game is rendered to the GLArea in the GUI Box.Remove(GlScreen); Nfc.Sensitive = false; ReturnMain.Sensitive = false; @@ -110,7 +109,7 @@ namespace Ryujinx.UI _TableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); GameTable.Model = _TableStore; UpdateGameTable(); - //Temporary code section end + // Temporary code section end LoadApplication(args[0]); } @@ -182,15 +181,14 @@ namespace Ryujinx.UI { if (_GameLoaded) { - MessageDialog eRrOr = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "A game has already been loaded. Please close the emulator and try again"); - eRrOr.SetSizeRequest(100, 20); - eRrOr.Title = "Ryujinx - Error"; - eRrOr.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png"); - eRrOr.WindowPosition = WindowPosition.Center; - eRrOr.Run(); - eRrOr.Destroy(); + MessageDialog errorDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "A game has already been loaded. Please close the emulator and try again"); + errorDialog.SetSizeRequest(100, 20); + errorDialog.Title = "Ryujinx - Error"; + errorDialog.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png"); + errorDialog.WindowPosition = WindowPosition.Center; + errorDialog.Run(); + errorDialog.Destroy(); } - else { if (Directory.Exists(path)) @@ -310,7 +308,7 @@ namespace Ryujinx.UI try { string appdataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); - string savePath = System.IO.Path.Combine(appdataPath, "RyuFs", "nand", "user", "save", "0000000000000000", userId, _device.System.TitleID); + string savePath = System.IO.Path.Combine(appdataPath, "RyuFs", "nand", "user", "save", "0000000000000000", userId, _device.System.TitleID); double currentPlayTime = 0; using (FileStream fs = File.OpenRead(System.IO.Path.Combine(savePath, "LastPlayed.dat"))) @@ -357,27 +355,22 @@ namespace Ryujinx.UI string path = (string)_TableStore.GetValue(treeiter, 8); LoadApplication(path); - - //Box.Remove(GameTableWindow); - //Box.Add(GlScreen); } private void Load_Application_File(object o, EventArgs args) { FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept); fc.Filter = new FileFilter(); - fc.Filter.AddPattern("*.nsp"); - fc.Filter.AddPattern("*.xci"); - fc.Filter.AddPattern("*.nca"); - fc.Filter.AddPattern("*.nro"); - fc.Filter.AddPattern("*.nso"); + fc.Filter.AddPattern("*.nsp" ); + fc.Filter.AddPattern("*.pfs0"); + fc.Filter.AddPattern("*.xci" ); + fc.Filter.AddPattern("*.nca" ); + fc.Filter.AddPattern("*.nro" ); + fc.Filter.AddPattern("*.nso" ); if (fc.Run() == (int)ResponseType.Accept) { LoadApplication(fc.Filename); - - //Box.Remove(GameTableWindow); - //Box.Add(GlScreen); } fc.Destroy(); @@ -390,9 +383,6 @@ namespace Ryujinx.UI if (fc.Run() == (int)ResponseType.Accept) { LoadApplication(fc.Filename); - - //Box.Remove(GameTableWindow); - //Box.Add(GlScreen); } fc.Destroy(); @@ -414,9 +404,7 @@ namespace Ryujinx.UI private void ReturnMain_Pressed(object o, EventArgs args) { - Box.Remove(GlScreen); - Box.Add(GameTableWindow); - //will also have to write logic to kill running game + //TODO: Write logic to kill running game } private void FullScreen_Toggled(object o, EventArgs args) @@ -441,7 +429,7 @@ namespace Ryujinx.UI if (fc.Run() == (int)ResponseType.Accept) { - //Soon™ + //TODO: Write logic to emulate reading an NFC tag } fc.Destroy(); } diff --git a/Ryujinx/Ui/SwitchSettings.cs b/Ryujinx/Ui/SwitchSettings.cs index f4b7077c67..41c23b456a 100644 --- a/Ryujinx/Ui/SwitchSettings.cs +++ b/Ryujinx/Ui/SwitchSettings.cs @@ -188,7 +188,7 @@ namespace Ryujinx.UI GameDirsBox.AppendColumn("", new CellRendererText(), "text", 0); _GameDirsBoxStore = new ListStore(typeof(string)); - GameDirsBox.Model = _GameDirsBoxStore; + GameDirsBox.Model = _GameDirsBoxStore; foreach (string GameDir in SwitchConfig.GameDirs) { _GameDirsBoxStore.AppendValues(GameDir);