update some code with new pattern matching expressions

and comment out lbp+rtx check
This commit is contained in:
13xforever
2023-04-15 20:38:55 +05:00
parent d130b2f501
commit 445bad95c7
4 changed files with 75 additions and 31 deletions

View File

@@ -235,17 +235,17 @@ internal static partial class LogParserResult
var linesToRemoveB = Math.Min(colBToRemove, Math.Max(linesToRemove, linesToRemove + colB.lines.Count - colA.lines.Count));
var linesToSkip = colAToRemove - linesToRemoveA;
var tmp = colA.lines;
colA.lines = new(tmp.Count - linesToRemoveA);
foreach (var t in tmp)
if (!t.EndsWith("N/A") || linesToSkip-- > 0)
colA.lines.Add(t);
var tmpLines = colA.lines;
colA.lines = new(tmpLines.Count - linesToRemoveA);
foreach (var l in tmpLines)
if (!l.EndsWith("N/A") || linesToSkip-- > 0)
colA.lines.Add(l);
linesToSkip = colBToRemove - linesToRemoveB;
tmp = colB.lines;
colB.lines = new(tmp.Count - linesToRemoveB);
for (var i = 0; i < tmp.Count; i++)
if (!tmp[i].EndsWith("N/A") || linesToSkip-- > 0)
colB.lines.Add(tmp[i]);
tmpLines = colB.lines;
colB.lines = new(tmpLines.Count - linesToRemoveB);
for (var i = 0; i < tmpLines.Count; i++)
if (!tmpLines[i].EndsWith("N/A") || linesToSkip-- > 0)
colB.lines.Add(tmpLines[i]);
AddSettingsSection(builder, colA.name!, colA.lines, isCustomSettings);
AddSettingsSection(builder, colB.name!, colB.lines, isCustomSettings);

View File

@@ -288,7 +288,7 @@ internal static partial class LogParserResult
items["driver_version_parsed"] = driverVersion.ToString();
if (IsNvidia(gpuInfo))
{
var isWindows = items["os_type"] is string os && os != "Linux";
var isWindows = items["os_type"] is not null and not "Linux";
var minVersion = isWindows ? NvidiaRecommendedWindowsVersion : NvidiaRecommendedLinuxVersion;
if (driverVersion < minVersion)
notes.Add($"❗ Please update your nVidia GPU driver to at least version {minVersion}");

View File

@@ -55,7 +55,7 @@ internal static partial class LogParserResult
&& items["os_type"] != "Linux")
{
if (Version.TryParse(items["os_version"], out var winVer)
&& (winVer.Major < 10 || (winVer.Major == 10 && winVer.Build < 18362))) // everything before win 10 1903
&& winVer is { Major: <10 } or { Major: 10, Build: <18362 }) // everything before win 10 1903
{
if (items["thread_scheduler"] == "OS")
{
@@ -106,10 +106,6 @@ internal static partial class LogParserResult
notes.Add("⚠️ NTSC PS1 Classics should use `Resolution` of `720x480`");
}
}
/*
if (items["aspect_ratio"] is string strAr && strAr != "4:3")
notes.Add("⚠️ PS1 Classics should use `Aspect Ratio` of 4:3");
*/
}
else if (selectedRes != "1280x720")
{
@@ -188,7 +184,7 @@ internal static partial class LogParserResult
if (multiItems["rsx_not_supported_feature"].Contains("alpha-to-one for multisampling"))
{
if (items["msaa"] is string msaa && msaa != "Disabled")
if (items["msaa"] is not null and not "Disabled")
generalNotes.Add(" The driver or GPU does not support all required features for proper MSAA implementation, which may result in minor visual artifacts");
}
var isWireframeBugPossible = items["gpu_info"] is string gpuInfo
@@ -200,7 +196,7 @@ internal static partial class LogParserResult
if (!isWireframeBugPossible)
notes.Add(" `Anti-aliasing` is disabled, which may result in visual artifacts");
}
else if (items["msaa"] is string msaa && msaa != "Disabled")
else if (items["msaa"] is not null and not "Disabled")
{
if (isWireframeBugPossible)
notes.Add("⚠️ Please disable `Anti-aliasing` if you experience wireframe-like visual artifacts");
@@ -381,8 +377,8 @@ internal static partial class LogParserResult
if (items["game_title"] != "vsh.self")
notes.Add("⚠️ Please use `Load liblv2.sprx only` as a `Library loader`");
}
bool warnLibraryOverrides = items["library_list_hle"] is string hleLibList && hleLibList != "None";
if (items["library_list_lle"] is string lleLibList && lleLibList != "None")
bool warnLibraryOverrides = items["library_list_hle"] is not null and not "None";
if (items["library_list_lle"] is string lleLibList and not "None")
{
if (lleLibList.Contains("sysutil"))
notes.Add("❗ Never override `sysutil` firmware modules");
@@ -613,7 +609,7 @@ internal static partial class LogParserResult
}
if (items["spu_loop_detection"] == EnabledMark)
notes.Add(" If you have distorted audio, try disabling `SPU Loop Detection`");
if (items["frame_limit"] is string frameLimit && frameLimit != "Off")
if (items["frame_limit"] is not null and not "Off")
notes.Add("⚠️ `Frame Limiter` is not required, please disable");
if (items["write_color_buffers"] is EnabledMark)
notes.Add("⚠️ `Write Color Buffers` is not required, please disable");
@@ -649,7 +645,7 @@ internal static partial class LogParserResult
&& threshold < 500)
notes.Add("⚠️ `Resolution Scale` over 100% requires `Resolution Scale Threshold` set to `512x512`");
if (items["af_override"] is string af && af != "Auto")
if (items["af_override"] is not null and not "Auto")
notes.Add("⚠️ Please use `Auto` for `Anisotropic Filter Override`");
}
}
@@ -771,7 +767,7 @@ internal static partial class LogParserResult
{
if (serial is "NPEB00258" or "NPUB30162" or "NPJB00068")
{
if (items["resolution"] is string res && res != "1920x1080")
if (items["resolution"] is not null and not "1920x1080")
notes.Add("⚠️ For perfect sprite scaling without borders set `Resolution` to `1920x1080`");
if (items["game_version"] is string gameVer
&& Version.TryParse(gameVer, out var v)
@@ -826,16 +822,16 @@ internal static partial class LogParserResult
if (!DesIds.Contains(serial))
return;
if (items["spu_block_size"] is string spuBlockSize && spuBlockSize != "Safe")
if (items["spu_block_size"] is not null and not "Safe")
notes.Add(" Please set `SPU Block Size` to `Safe` to reduce crash rate");
if (items["frame_limit"] is string frameLimit && frameLimit != "Off")
if (items["frame_limit"] is not null and not "Off")
notes.Add("⚠️ `Frame Limiter` should be `Off`");
if (items["spu_loop_detection"] == EnabledMark)
notes.Add("⚠️ `SPU Loop Detection` is `Enabled`, and can cause visual artifacts");
if (items["spu_threads"] is string spuThreads && spuThreads != "Auto")
if (items["spu_threads"] is not null and not "Auto")
notes.Add("⚠️ Please set `SPU Thread Count` to `Auto` for best performance");
if (serial != "BLES00932" && serial != "BLUS30443")
@@ -942,7 +938,7 @@ internal static partial class LogParserResult
if (!TlouIds.Contains(serial))
return;
if (items["spu_block_size"] is string spuBlockSize && spuBlockSize != "Safe")
if (items["spu_block_size"] is not null and not "Safe")
notes.Add(" Please set `SPU Block Size` to `Safe` to reduce crash rate");
if (items["cpu_blit"] == EnabledMark)
notes.Add("⚠️ Please disable `Force CPU Blit`");
@@ -1088,7 +1084,7 @@ internal static partial class LogParserResult
else if (ppuHashes.Overlaps(KnownPdf2ndPatches))
generalNotes.Add(" This game has an FPS unlock patch");
}
if (items["frame_limit"] is string frameLimit && frameLimit != "Off")
if (items["frame_limit"] is not null and not "Off")
notes.Add("⚠️ `Frame Limiter` should be `Off`");
if (!ppuHashes.Overlaps(KnownPdf2ndPatches))
@@ -1110,7 +1106,8 @@ internal static partial class LogParserResult
if (items["game_version"] is string gameVer
&& Version.TryParse(gameVer, out var v)
&& v > new Version(1, 05) && v < new Version(1, 10))
&& v > new Version(1, 05)
&& v < new Version(1, 10))
generalNotes.Add(" Game versions between 1.05 and 1.10 can fail to boot with HDD space error");
}
@@ -1258,9 +1255,11 @@ internal static partial class LogParserResult
if (!AllLbpGames.Contains(serial))
return;
/*
if (items["gpu_info"] is string gpu
&& (gpu.Contains("RTX ") || gpu.Contains("GTX 16")))
generalNotes.Add("⚠️ LittleBigPlanet games may fail to boot on nVidia Turing or newer GPUs ");
*/
if (Lbp1Ids.Contains(serial))
{
@@ -1275,9 +1274,9 @@ internal static partial class LogParserResult
private static void CheckVshSettings(NameValueCollection items, List<string> notes, List<string> generalNotes)
{
if (items["write_color_buffers"] is string wcb && wcb != EnabledMark)
if (items["write_color_buffers"] is not null and not EnabledMark)
notes.Add(" `Write Color Buffers` should be enabled for proper visuals");
if (items["cpu_blit"] is string cpuBlit && cpuBlit != EnabledMark)
if (items["cpu_blit"] is not null and not EnabledMark)
notes.Add(" `Force CPU Blit` should be enabled for proper visuals");
}

View File

@@ -1,29 +1,74 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=6D9CA448_002D60C1_002D4D66_002D91D6_002DEC6C586508E6_002Fd_003ADatabase_002Fd_003AMigrations/@EntryIndexedValue">ExplicitlyExcluded</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ASMJIT/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Bandicam/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BCAS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BCES/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BCJS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BCKS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BCUS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=bdcamvk/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=bdvd/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BLES/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=blit/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BLJM/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BLJS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BLKS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BLUS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Celeron/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=CJS7/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Confusables/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cubeb/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=desync/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=EBOOT/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=edat/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=framerate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=getllar/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Homoglyph/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Jojo/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Killzone/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=liblv/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=libvdec/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=lwmutex/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Metacritic/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MLAA/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=mtrsx/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Multithreaded/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Nier/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=npdrm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NPEA/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NPEB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NPHA/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NPHB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NPJA/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NPJB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NPUA/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NPUB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NTSC/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=piratethink/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Preemptions/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=putlluc/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=RADV/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=recompiler/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Rpcs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=RWCB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=RWDB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ryzen/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=shaders/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Skylake/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sprx/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Sudoer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Syscalls/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sysutil/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=thonk/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=thonkang/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Tlou/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=USRDIR/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=vblank/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Vidia/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=vsync/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Vulkan/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=xaudio/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=xfloat/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Zalgo/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=zcull/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>