fixed some minor issues

This commit is contained in:
Xpl0itR 2019-07-10 20:37:40 +01:00
commit 607fd55624
No known key found for this signature in database
GPG key ID: 91798184109676AD
7 changed files with 101 additions and 54 deletions

View file

@ -40,8 +40,8 @@ namespace Ryujinx.HLE
public static void Init(List<string> AppDirs, Keyset keySet, HOS.SystemState.TitleLanguage desiredTitleLanguage) public static void Init(List<string> AppDirs, Keyset keySet, HOS.SystemState.TitleLanguage desiredTitleLanguage)
{ {
KeySet = keySet; KeySet = keySet;
DesiredTitleLanguage = desiredTitleLanguage; DesiredTitleLanguage = desiredTitleLanguage;
// Loads the default application Icons // Loads the default application Icons
using (Stream resourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Ryujinx.HLE.ryujinxNSPIcon.png")) using (Stream resourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Ryujinx.HLE.ryujinxNSPIcon.png"))
@ -199,7 +199,7 @@ namespace Ryujinx.HLE
if (Path.GetExtension(applicationPath) == ".xci") { applicationIcon = RyujinxXciIcon; } if (Path.GetExtension(applicationPath) == ".xci") { applicationIcon = RyujinxXciIcon; }
else { applicationIcon = RyujinxNspIcon; } else { applicationIcon = RyujinxNspIcon; }
Logger.PrintError(LogClass.Application, $"Unable to decrypt NCA header. The header key must be incorrect. File: {applicationPath}"); Logger.PrintError(LogClass.Application, $"The file is not an NCA file or the header key is incorrect. Errored File: {applicationPath}");
} }
} }

View file

@ -30,7 +30,7 @@ namespace Ryujinx
/// <summary> /// <summary>
/// Dumps shaders in this local directory /// Dumps shaders in this local directory
/// </summary> /// </summary>
public string GraphicsShadersDumpPath { get; private set; } public string GraphicsShadersDumpPath { get; set; }
/// <summary> /// <summary>
/// Enables printing debug log messages /// Enables printing debug log messages
@ -246,11 +246,13 @@ namespace Ryujinx
{ {
GraphicsConfig.ShadersDumpPath = SwitchConfig.GraphicsShadersDumpPath; GraphicsConfig.ShadersDumpPath = SwitchConfig.GraphicsShadersDumpPath;
Logger.SetEnable(LogLevel.Debug , SwitchConfig.LoggingEnableDebug); Logger.SetEnable(LogLevel.Debug , SwitchConfig.LoggingEnableDebug );
Logger.SetEnable(LogLevel.Stub , SwitchConfig.LoggingEnableStub ); Logger.SetEnable(LogLevel.Stub , SwitchConfig.LoggingEnableStub );
Logger.SetEnable(LogLevel.Info , SwitchConfig.LoggingEnableInfo ); Logger.SetEnable(LogLevel.Info , SwitchConfig.LoggingEnableInfo );
Logger.SetEnable(LogLevel.Warning, SwitchConfig.LoggingEnableWarn ); Logger.SetEnable(LogLevel.Warning , SwitchConfig.LoggingEnableWarn );
Logger.SetEnable(LogLevel.Error , SwitchConfig.LoggingEnableError); Logger.SetEnable(LogLevel.Error , SwitchConfig.LoggingEnableError );
Logger.SetEnable(LogLevel.Guest , SwitchConfig.LoggingEnableGuest );
Logger.SetEnable(LogLevel.AccessLog, SwitchConfig.LoggingEnableFsAccessLog);
if (SwitchConfig.LoggingFilteredClasses.Length > 0) if (SwitchConfig.LoggingFilteredClasses.Length > 0)
{ {

View file

@ -6,7 +6,6 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Configurations>Debug;Release;Profile Debug;Profile Release</Configurations> <Configurations>Debug;Release;Profile Debug;Profile Release</Configurations>
<ApplicationIcon>ryujinx.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Profile Release|AnyCPU'">

View file

@ -43,7 +43,6 @@ namespace Ryujinx.UI
[GUI] MenuItem ReturnMain; [GUI] MenuItem ReturnMain;
[GUI] MenuItem Nfc; [GUI] MenuItem Nfc;
[GUI] Box Box; [GUI] Box Box;
[GUI] ScrolledWindow GameTableWindow;
[GUI] TreeView GameTable; [GUI] TreeView GameTable;
[GUI] GLArea GlScreen; [GUI] GLArea GlScreen;
#pragma warning restore 649 #pragma warning restore 649
@ -106,7 +105,7 @@ namespace Ryujinx.UI
if (SwitchSettings.SwitchConfig.GuiColumns[6]) { GameTable.AppendColumn("File Ext" , new CellRendererText() , "text" , 6); } if (SwitchSettings.SwitchConfig.GuiColumns[6]) { GameTable.AppendColumn("File Ext" , new CellRendererText() , "text" , 6); }
if (SwitchSettings.SwitchConfig.GuiColumns[7]) { GameTable.AppendColumn("File Size" , new CellRendererText() , "text" , 7); } if (SwitchSettings.SwitchConfig.GuiColumns[7]) { GameTable.AppendColumn("File Size" , new CellRendererText() , "text" , 7); }
if (SwitchSettings.SwitchConfig.GuiColumns[8]) { GameTable.AppendColumn("Path" , new CellRendererText() , "text" , 8); } if (SwitchSettings.SwitchConfig.GuiColumns[8]) { GameTable.AppendColumn("Path" , new CellRendererText() , "text" , 8); }
_TableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); _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; GameTable.Model = _TableStore;
UpdateGameTable(); UpdateGameTable();
// Temporary code section end // Temporary code section end
@ -287,9 +286,9 @@ namespace Ryujinx.UI
} }
} }
} }
catch (ArgumentNullException exception) catch (ArgumentNullException)
{ {
Logger.PrintError(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {userId}, TitleID: {_device.System.TitleID}\nException: {exception}"); Logger.PrintError(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {userId}, TitleID: {_device.System.TitleID}");
} }
} }
} }
@ -299,45 +298,50 @@ namespace Ryujinx.UI
using (GlScreen screen = new GlScreen(_device, _renderer)) using (GlScreen screen = new GlScreen(_device, _renderer))
{ {
screen.MainLoop(); screen.MainLoop();
End();
} }
} }
private static void End() private static void End()
{ {
string userId = "00000000000000000000000000000001"; string userId = "00000000000000000000000000000001";
try if (_GameLoaded)
{ {
string appdataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); try
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")))
{ {
using (StreamReader sr = new StreamReader(fs)) string appdataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
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")))
{ {
DateTime startTime = DateTime.Parse(sr.ReadLine()); using (StreamReader sr = new StreamReader(fs))
using (FileStream lpfs = File.OpenRead(System.IO.Path.Combine(savePath, "TimePlayed.dat")))
{ {
using (StreamReader lpsr = new StreamReader(lpfs)) DateTime startTime = DateTime.Parse(sr.ReadLine());
using (FileStream lpfs = File.OpenRead(System.IO.Path.Combine(savePath, "TimePlayed.dat")))
{ {
currentPlayTime = double.Parse(lpsr.ReadLine()); using (StreamReader lpsr = new StreamReader(lpfs))
{
currentPlayTime = double.Parse(lpsr.ReadLine());
}
} }
}
using (FileStream tpfs = File.OpenWrite(System.IO.Path.Combine(savePath, "TimePlayed.dat"))) using (FileStream tpfs = File.OpenWrite(System.IO.Path.Combine(savePath, "TimePlayed.dat")))
{
using (StreamWriter tpsr = new StreamWriter(tpfs))
{ {
tpsr.WriteLine(currentPlayTime + Math.Round(DateTime.UtcNow.Subtract(startTime).TotalSeconds, MidpointRounding.AwayFromZero)); using (StreamWriter tpsr = new StreamWriter(tpfs))
{
tpsr.WriteLine(currentPlayTime + Math.Round(DateTime.UtcNow.Subtract(startTime).TotalSeconds, MidpointRounding.AwayFromZero));
}
} }
} }
} }
} }
} catch (ArgumentNullException)
catch (ArgumentNullException exception) {
{ Logger.PrintError(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {userId}, TitleID: {_device.System.TitleID}");
Logger.PrintError(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {userId}, TitleID: {_device.System.TitleID}\nException: {exception}"); }
} }
Profile.FinishProfiling(); Profile.FinishProfiling();
@ -404,7 +408,7 @@ namespace Ryujinx.UI
private void ReturnMain_Pressed(object o, EventArgs args) private void ReturnMain_Pressed(object o, EventArgs args)
{ {
//TODO: Write logic to kill running game // TODO: Write logic to kill running game
} }
private void FullScreen_Toggled(object o, EventArgs args) private void FullScreen_Toggled(object o, EventArgs args)
@ -429,7 +433,7 @@ namespace Ryujinx.UI
if (fc.Run() == (int)ResponseType.Accept) if (fc.Run() == (int)ResponseType.Accept)
{ {
//TODO: Write logic to emulate reading an NFC tag // TODO: Write logic to emulate reading an NFC tag
} }
fc.Destroy(); fc.Destroy();
} }

View file

@ -60,6 +60,7 @@ namespace Ryujinx.UI
[GUI] ToggleButton BrowseDir; [GUI] ToggleButton BrowseDir;
[GUI] ToggleButton RemoveDir; [GUI] ToggleButton RemoveDir;
[GUI] Entry LogPath; [GUI] Entry LogPath;
[GUI] Entry GraphicsShadersDumpPath;
[GUI] Image ControllerImage; [GUI] Image ControllerImage;
[GUI] ComboBoxText Controller1Type; [GUI] ComboBoxText Controller1Type;
@ -183,8 +184,9 @@ namespace Ryujinx.UI
R1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonR.ToString(); R1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonR.ToString();
ZR1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonZr.ToString(); ZR1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonZr.ToString();
CustThemeDir.Buffer.Text = SwitchConfig.CustomThemePath; CustThemeDir.Buffer.Text = SwitchConfig.CustomThemePath;
FGALMSpinAdjustment.Value = SwitchConfig.FsGlobalAccessLogMode; GraphicsShadersDumpPath.Buffer.Text = SwitchConfig.GraphicsShadersDumpPath;
FGALMSpinAdjustment.Value = SwitchConfig.FsGlobalAccessLogMode;
GameDirsBox.AppendColumn("", new CellRendererText(), "text", 0); GameDirsBox.AppendColumn("", new CellRendererText(), "text", 0);
_GameDirsBoxStore = new ListStore(typeof(string)); _GameDirsBoxStore = new ListStore(typeof(string));
@ -375,12 +377,12 @@ namespace Ryujinx.UI
ButtonZr = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), ZR1.Label), ButtonZr = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), ZR1.Label),
}; };
SwitchConfig.SystemLanguage = (SystemLanguage)Enum.Parse(typeof(SystemLanguage), SystemLanguageSelect.ActiveId); SwitchConfig.SystemLanguage = (SystemLanguage)Enum.Parse(typeof(SystemLanguage), SystemLanguageSelect.ActiveId);
SwitchConfig.ControllerType = (ControllerStatus)Enum.Parse(typeof(ControllerStatus), Controller1Type.ActiveId); SwitchConfig.ControllerType = (ControllerStatus)Enum.Parse(typeof(ControllerStatus), Controller1Type.ActiveId);
SwitchConfig.CustomThemePath = CustThemeDir.Buffer.Text; SwitchConfig.CustomThemePath = CustThemeDir.Buffer.Text;
SwitchConfig.GameDirs = gameDirs; SwitchConfig.GraphicsShadersDumpPath = GraphicsShadersDumpPath.Buffer.Text;
SwitchConfig.FsGlobalAccessLogMode = (int)FGALMSpinAdjustment.Value; SwitchConfig.GameDirs = gameDirs;
SwitchConfig.FsGlobalAccessLogMode = (int)FGALMSpinAdjustment.Value;
Configuration.SaveConfig(SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json")); Configuration.SaveConfig(SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
Configuration.Configure(Device, SwitchConfig); Configuration.Configure(Device, SwitchConfig);

View file

@ -207,7 +207,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable Icon Column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -225,7 +225,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable Developer Column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -243,7 +243,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable Time Played Column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -273,7 +273,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable Title Name/ID Column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -291,7 +291,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable Version Column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -309,7 +309,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable Last Played Column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -339,7 +339,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable file extension column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -357,7 +357,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable File Size Column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -375,7 +375,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Enable or Disable aggressive CPU optimizations</property> <property name="tooltip_text" translatable="yes">Enable or Disable Path Column in the game list</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="margin_top">5</property> <property name="margin_top">5</property>
<property name="margin_bottom">5</property> <property name="margin_bottom">5</property>
@ -1729,6 +1729,46 @@
<property name="position">3</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">Graphics Shaders Dump Path</property>
<property name="label" translatable="yes">Graphics Shaders Dump Path:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="GraphicsShadersDumpPath">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Graphics Shaders Dump Path</property>
<property name="valign">center</property>
<property name="caps_lock_warning">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">4</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB