Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d1b30fbe08 | ||
|
4505a7f162 | ||
|
ccbbaddbcb |
@@ -21,7 +21,7 @@
|
||||
<PackageVersion Include="LibHac" Version="0.19.0" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
|
||||
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.2.0" />
|
||||
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.3.0" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
|
||||
<PackageVersion Include="MsgPack.Cli" Version="1.0.1" />
|
||||
|
@@ -1352,9 +1352,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
{
|
||||
string logPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");
|
||||
|
||||
if (ReleaseInformation.IsValid)
|
||||
if (LoggerModule.LogDirectoryPath != null)
|
||||
{
|
||||
logPath = Path.Combine(AppDataManager.BaseDirPath, "Logs");
|
||||
logPath = LoggerModule.LogDirectoryPath;
|
||||
}
|
||||
|
||||
new DirectoryInfo(logPath).Create();
|
||||
|
@@ -23,7 +23,7 @@ namespace Ryujinx.Common.Logging.Targets
|
||||
public static FileStream PrepareLogFile(string path)
|
||||
{
|
||||
// Ensure directory is present
|
||||
DirectoryInfo logDir = new(Path.Combine(path, "Logs"));
|
||||
DirectoryInfo logDir = new(path);
|
||||
try
|
||||
{
|
||||
logDir.Create();
|
||||
|
@@ -427,11 +427,11 @@ namespace Ryujinx.Headless.SDL2
|
||||
|
||||
if (!option.DisableFileLog)
|
||||
{
|
||||
FileStream logFile = FileLogTarget.PrepareLogFile(AppDomain.CurrentDomain.BaseDirectory);
|
||||
FileStream logFile = FileLogTarget.PrepareLogFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs"));
|
||||
|
||||
if (logFile == null)
|
||||
{
|
||||
logFile = FileLogTarget.PrepareLogFile(AppDataManager.BaseDirPath);
|
||||
logFile = FileLogTarget.PrepareLogFile(Path.Combine(AppDataManager.BaseDirPath, "Logs"));
|
||||
|
||||
if (logFile == null)
|
||||
{
|
||||
|
@@ -181,6 +181,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
}
|
||||
|
||||
Span<uint> dataWords = Span<uint>.Empty;
|
||||
Span<uint> dataWordsPadded = Span<uint>.Empty;
|
||||
|
||||
if (meta.DataWordsCount != 0)
|
||||
{
|
||||
@@ -189,6 +190,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
int padding = (dataOffsetAligned - dataOffset) / sizeof(uint);
|
||||
|
||||
dataWords = MemoryMarshal.Cast<byte, uint>(data)[padding..meta.DataWordsCount];
|
||||
dataWordsPadded = MemoryMarshal.Cast<byte, uint>(data)[..meta.DataWordsCount];
|
||||
|
||||
data = data[(meta.DataWordsCount * sizeof(uint))..];
|
||||
}
|
||||
@@ -209,6 +211,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
ReceiveBuffers = receiveBuffers,
|
||||
ExchangeBuffers = exchangeBuffers,
|
||||
DataWords = dataWords,
|
||||
DataWordsPadded = dataWordsPadded,
|
||||
ReceiveList = receiveList,
|
||||
CopyHandles = copyHandles,
|
||||
MoveHandles = moveHandles,
|
||||
|
@@ -9,6 +9,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc
|
||||
public Span<HipcBufferDescriptor> ReceiveBuffers;
|
||||
public Span<HipcBufferDescriptor> ExchangeBuffers;
|
||||
public Span<uint> DataWords;
|
||||
public Span<uint> DataWordsPadded;
|
||||
public Span<HipcReceiveListEntry> ReceiveList;
|
||||
public Span<int> CopyHandles;
|
||||
public Span<int> MoveHandles;
|
||||
|
@@ -206,7 +206,7 @@ namespace Ryujinx.Horizon.Sdk.Sf
|
||||
}
|
||||
else
|
||||
{
|
||||
var data = MemoryMarshal.Cast<uint, byte>(context.Request.Data.DataWords);
|
||||
var data = MemoryMarshal.Cast<uint, byte>(context.Request.Data.DataWordsPadded);
|
||||
var recvPointerSizes = MemoryMarshal.Cast<byte, ushort>(data[runtimeMetadata.UnfixedOutPointerSizeOffset..]);
|
||||
|
||||
size = recvPointerSizes[unfixedRecvPointerIndex++];
|
||||
|
@@ -9,6 +9,8 @@ namespace Ryujinx.Ui.Common.Configuration
|
||||
{
|
||||
public static class LoggerModule
|
||||
{
|
||||
public static string LogDirectoryPath { get; private set; }
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
ConfigurationState.Instance.Logger.EnableDebug.Event += ReloadEnableDebug;
|
||||
@@ -82,21 +84,26 @@ namespace Ryujinx.Ui.Common.Configuration
|
||||
{
|
||||
if (e.NewValue)
|
||||
{
|
||||
FileStream logFile = FileLogTarget.PrepareLogFile(AppDomain.CurrentDomain.BaseDirectory);
|
||||
string logDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");
|
||||
FileStream logFile = FileLogTarget.PrepareLogFile(logDir);
|
||||
|
||||
if (logFile == null)
|
||||
{
|
||||
logFile = FileLogTarget.PrepareLogFile(AppDataManager.BaseDirPath);
|
||||
logDir = Path.Combine(AppDataManager.BaseDirPath, "Logs");
|
||||
logFile = FileLogTarget.PrepareLogFile(logDir);
|
||||
|
||||
if (logFile == null)
|
||||
{
|
||||
Logger.Error?.Print(LogClass.Application, "No writable log directory available. Make sure either the application directory or the Ryujinx directory is writable.");
|
||||
LogDirectoryPath = null;
|
||||
Logger.RemoveTarget("file");
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
LogDirectoryPath = logDir;
|
||||
|
||||
Logger.AddTarget(new AsyncLogTargetWrapper(
|
||||
new FileLogTarget("file", logFile),
|
||||
1000,
|
||||
|
@@ -1378,9 +1378,9 @@ namespace Ryujinx.Ui
|
||||
{
|
||||
string logPath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");
|
||||
|
||||
if (ReleaseInformation.IsValid)
|
||||
if (LoggerModule.LogDirectoryPath != null)
|
||||
{
|
||||
logPath = System.IO.Path.Combine(AppDataManager.BaseDirPath, "Logs");
|
||||
logPath = LoggerModule.LogDirectoryPath;
|
||||
}
|
||||
|
||||
new DirectoryInfo(logPath).Create();
|
||||
|
Reference in New Issue
Block a user