mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-08 18:55:41 +08:00
Sdl backend (#670)
* [audio] added sdl audio backend and in-tree atrac9 decoder * [input] replaced per-platform pad readers with sdl gamepad input * [video] added sdl window and host display plumbing * [gui] added host display options and per-game render settings * [bink] synced host movie playback to the guest audio clock * [cpu] hooked windows write faults into guest image tracking * [perf] added guest and render profiling, reserved host cpu lanes * [kernel] fixed stale pthread mutex handle alias * [host] wired the sdl session, save-data paths and project references * [audio] hoisted ajm trace stackalloc out of its loop * [video] Add guest image sync setting * [build] Strip native symbols * reuse
This commit is contained in:
@@ -129,6 +129,24 @@ public static partial class KernelMemoryCompatExports
|
||||
private static readonly HashSet<string> _negativeStatCache = new(HostFsPathComparer);
|
||||
private static readonly ConcurrentDictionary<string, ulong> _aprFileSizeCache = new(HostFsPathComparer);
|
||||
private static long _nextFileDescriptor = 2;
|
||||
private static string _applicationTitleId = "UNKNOWN";
|
||||
|
||||
public static void ConfigureApplicationInfo(string? titleId)
|
||||
{
|
||||
var value = string.IsNullOrWhiteSpace(titleId) ? "UNKNOWN" : titleId.Trim();
|
||||
Span<char> sanitized = value.Length <= 128
|
||||
? stackalloc char[value.Length]
|
||||
: new char[value.Length];
|
||||
for (var index = 0; index < value.Length; index++)
|
||||
{
|
||||
var character = value[index];
|
||||
sanitized[index] = char.IsAsciiLetterOrDigit(character) || character is '-' or '_'
|
||||
? char.ToUpperInvariant(character)
|
||||
: '_';
|
||||
}
|
||||
|
||||
Volatile.Write(ref _applicationTitleId, new string(sanitized));
|
||||
}
|
||||
|
||||
internal static int AllocateGuestFileDescriptor()
|
||||
{
|
||||
@@ -5350,7 +5368,7 @@ public static partial class KernelMemoryCompatExports
|
||||
}
|
||||
else
|
||||
{
|
||||
root = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, "logs", "devlog", "app"));
|
||||
root = Path.Combine(ResolveGameLogRoot(), "devlog", "app");
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(root);
|
||||
@@ -5419,14 +5437,20 @@ public static partial class KernelMemoryCompatExports
|
||||
}
|
||||
else
|
||||
{
|
||||
root = Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, "logs", "hostapp"));
|
||||
Environment.SetEnvironmentVariable(hostappVariableName, root);
|
||||
root = Path.Combine(ResolveGameLogRoot(), "hostapp");
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(root);
|
||||
return root;
|
||||
}
|
||||
|
||||
private static string ResolveGameLogRoot() =>
|
||||
Path.GetFullPath(Path.Combine(
|
||||
AppContext.BaseDirectory,
|
||||
"user",
|
||||
"game_logs",
|
||||
Volatile.Read(ref _applicationTitleId)));
|
||||
|
||||
private static string GetPerAppWritableRoot()
|
||||
{
|
||||
var app0Root = Environment.GetEnvironmentVariable("SHARPEMU_APP0_DIR");
|
||||
|
||||
Reference in New Issue
Block a user