Set TitleName and TitleId in more cases. Fix TitleID naming style

This commit is contained in:
Alex Barney 2019-11-02 16:16:07 -07:00
commit 92efd41197
3 changed files with 21 additions and 13 deletions

View file

@ -111,7 +111,7 @@ namespace Ryujinx.HLE.HOS
public string TitleName { get; private set; } public string TitleName { get; private set; }
public string TitleID { get; private set; } public string TitleId { get; private set; }
public IntegrityCheckLevel FsIntegrityCheckLevel { get; set; } public IntegrityCheckLevel FsIntegrityCheckLevel { get; set; }
@ -375,6 +375,12 @@ namespace Ryujinx.HLE.HOS
{ {
TitleName = CurrentTitle = ControlData.Value TitleName = CurrentTitle = ControlData.Value
.Titles[(int) State.DesiredTitleLanguage].Name.ToString(); .Titles[(int) State.DesiredTitleLanguage].Name.ToString();
if (string.IsNullOrWhiteSpace(TitleName))
{
TitleName = CurrentTitle = ControlData.Value.Titles.ToArray()
.FirstOrDefault(x => x.Name[0] != 0).Name.ToString();
}
} }
} }
} }
@ -501,13 +507,15 @@ namespace Ryujinx.HLE.HOS
LoadExeFs(codeFs, out Npdm metaData); LoadExeFs(codeFs, out Npdm metaData);
TitleId = metaData.Aci0.TitleId.ToString("x16");
if (controlNca != null) if (controlNca != null)
{ {
ReadControlData(controlNca); ReadControlData(controlNca);
} }
else else
{ {
TitleID = CurrentTitle = metaData.Aci0.TitleId.ToString("x16"); CurrentTitle = TitleId;
} }
} }
@ -547,7 +555,7 @@ namespace Ryujinx.HLE.HOS
} }
} }
TitleID = CurrentTitle = metaData.Aci0.TitleId.ToString("x16"); TitleId = CurrentTitle = metaData.Aci0.TitleId.ToString("x16");
LoadNso("rtld"); LoadNso("rtld");
LoadNso("main"); LoadNso("main");
@ -614,7 +622,7 @@ namespace Ryujinx.HLE.HOS
if (string.IsNullOrWhiteSpace(metaData.TitleName)) if (string.IsNullOrWhiteSpace(metaData.TitleName))
{ {
metaData.TitleName = nacp.Titles.ToArray().FirstOrDefault(x => x.Name[0] != 0).ToString(); metaData.TitleName = nacp.Titles.ToArray().FirstOrDefault(x => x.Name[0] != 0).Name.ToString();
} }
metaData.Aci0.TitleId = nacp.PresenceGroupId; metaData.Aci0.TitleId = nacp.PresenceGroupId;
@ -650,7 +658,7 @@ namespace Ryujinx.HLE.HOS
ContentManager.LoadEntries(); ContentManager.LoadEntries();
TitleName = CurrentTitle = metaData.TitleName; TitleName = CurrentTitle = metaData.TitleName;
TitleID = metaData.Aci0.TitleId.ToString("x16"); TitleId = metaData.Aci0.TitleId.ToString("x16");
ProgramLoader.LoadStaticObjects(this, metaData, new IExecutable[] { staticObject }); ProgramLoader.LoadStaticObjects(this, metaData, new IExecutable[] { staticObject });
} }

View file

@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Arp
return new ApplicationLaunchProperty return new ApplicationLaunchProperty
{ {
TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleID), 0), TitleId = BitConverter.ToInt64(StringUtils.HexToBytes(context.Device.System.TitleId), 0),
Version = 0x00, Version = 0x00,
BaseGameStorageId = (byte)StorageId.NandSystem, BaseGameStorageId = (byte)StorageId.NandSystem,
UpdateGameStorageId = (byte)StorageId.None UpdateGameStorageId = (byte)StorageId.None

View file

@ -274,12 +274,12 @@ namespace Ryujinx.UI
if (DiscordIntegrationEnabled) if (DiscordIntegrationEnabled)
{ {
if (File.ReadAllLines(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "RPsupported.dat")).Contains(_device.System.TitleID)) if (File.ReadAllLines(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "RPsupported.dat")).Contains(_device.System.TitleId))
{ {
DiscordPresence.Assets.LargeImageKey = _device.System.TitleID; DiscordPresence.Assets.LargeImageKey = _device.System.TitleId;
} }
string state = _device.System.TitleID; string state = _device.System.TitleId;
if (state == null) if (state == null)
{ {
@ -311,7 +311,7 @@ namespace Ryujinx.UI
try try
{ {
string savePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "nand", "user", "save", "0000000000000000", _userId, _device.System.TitleID); string savePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "nand", "user", "save", "0000000000000000", _userId, _device.System.TitleId);
if (File.Exists(System.IO.Path.Combine(savePath, "TimePlayed.dat")) == false) if (File.Exists(System.IO.Path.Combine(savePath, "TimePlayed.dat")) == false)
{ {
@ -341,7 +341,7 @@ namespace Ryujinx.UI
} }
catch (ArgumentNullException) catch (ArgumentNullException)
{ {
Logger.PrintWarning(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {_userId}, TitleID: {_device.System.TitleID}"); Logger.PrintWarning(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {_userId}, TitleID: {_device.System.TitleId}");
} }
} }
} }
@ -364,7 +364,7 @@ namespace Ryujinx.UI
{ {
try try
{ {
string savePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "nand", "user", "save", "0000000000000000", _userId, _device.System.TitleID); string savePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "RyuFS", "nand", "user", "save", "0000000000000000", _userId, _device.System.TitleId);
double currentPlayTime = 0; double currentPlayTime = 0;
using (FileStream stream = File.OpenRead(System.IO.Path.Combine(savePath, "LastPlayed.dat"))) using (FileStream stream = File.OpenRead(System.IO.Path.Combine(savePath, "LastPlayed.dat")))
@ -393,7 +393,7 @@ namespace Ryujinx.UI
} }
catch (ArgumentNullException) catch (ArgumentNullException)
{ {
Logger.PrintWarning(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {_userId}, TitleID: {_device.System.TitleID}"); Logger.PrintWarning(LogClass.Application, $"Could not access save path to retrieve time/last played data using: UserID: {_userId}, TitleID: {_device.System.TitleId}");
} }
} }