Add trailing commas to `switch` expressions
This commit is contained in:
parent
dcd78b4107
commit
a8e7c3d031
|
@ -67,7 +67,7 @@ public static class RoslynUtils
|
|||
"||" => WellKnownMemberNames.LogicalOrOperatorName,
|
||||
"~" => WellKnownMemberNames.OnesComplementOperatorName,
|
||||
// ...and some operators only exist in VB.NET (dw, you're not missing anything)
|
||||
_ => throw new ArgumentException(paramName: nameof(ods), message: "pretend this is a BHI6660 unexpected token in AST (in this case, a new kind of operator was added to C#)")
|
||||
_ => throw new ArgumentException(paramName: nameof(ods), message: "pretend this is a BHI6660 unexpected token in AST (in this case, a new kind of operator was added to C#)"),
|
||||
};
|
||||
|
||||
private static ITypeSymbol? GetThrownExceptionType(this SemanticModel model, ExpressionSyntax exprSyn)
|
||||
|
|
|
@ -46,7 +46,7 @@ public sealed class FirstOrDefaultOnStructAnalyzer : DiagnosticAnalyzer
|
|||
{
|
||||
INamedTypeSymbol nts => nts.TypeArguments[0],
|
||||
IArrayTypeSymbol ats => ats.ElementType,
|
||||
_ => throw HawkSourceAnalyzer.ReportWTF(receiverExpr, oac, message: $"[{nameof(FirstOrDefaultOnStructAnalyzer)}] receiver parameter's effective type was of an unexpected kind (neither class/struct nor array): {receiverExprType.GetType().FullName}")
|
||||
_ => throw HawkSourceAnalyzer.ReportWTF(receiverExpr, oac, message: $"[{nameof(FirstOrDefaultOnStructAnalyzer)}] receiver parameter's effective type was of an unexpected kind (neither class/struct nor array): {receiverExprType.GetType().FullName}"),
|
||||
};
|
||||
if (collectionElemType.IsValueType) DiagUseFirstOrNull.ReportAt(operation.LocWithoutReceiver(), oac);
|
||||
},
|
||||
|
|
|
@ -163,7 +163,7 @@ public class HawkSourceAnalyzer : DiagnosticAnalyzer
|
|||
{
|
||||
ERR_MSG_LIST_EXPR_END => location.SourceSpan.Slice(start: location.SourceSpan.Length - 1),
|
||||
ERR_MSG_LIST_EXPR_START => location.SourceSpan.Slice(start: 0, length: 1),
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
if (slice is not null) location = Location.Create(location.SourceTree!, slice.Value);
|
||||
DiagListExprSpacing.ReportAt(location, snac, message);
|
||||
|
|
|
@ -39,7 +39,7 @@ public sealed class ReflectionCacheGenerator : ISourceGenerator
|
|||
{
|
||||
SimpleNameSyntax simple => simple.Identifier.ValueText,
|
||||
QualifiedNameSyntax qual => $"{Ser(qual.Left)}.{Ser(qual.Right)}",
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
if (_namespace != null || syntaxNode is not NamespaceDeclarationSyntax syn) return;
|
||||
var newNS = Ser(syn.Name);
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace BizHawk.Bizware.Audio
|
|||
SeekOrigin.Begin => offset,
|
||||
SeekOrigin.Current => _pos + offset,
|
||||
SeekOrigin.End => _len + offset,
|
||||
_ => offset
|
||||
_ => offset,
|
||||
};
|
||||
|
||||
Position = newpos;
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace BizHawk.Bizware.Graphics.Controls
|
|||
IGL_OpenGL openGL => new OpenGLControl(openGL.InitGLState),
|
||||
IGL_D3D11 d3d11 => new D3D11Control(d3d11.CreateSwapChain),
|
||||
IGL_GDIPlus gdiPlus => new GDIPlusControl(gdiPlus.CreateControlRenderTarget),
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
// IGLs need the window handle in order to do things, so best create the control immediately
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace BizHawk.Bizware.Graphics
|
|||
AttribUsage.Position => "POSITION",
|
||||
AttribUsage.Color0 => "COLOR",
|
||||
AttribUsage.Texcoord0 or AttribUsage.Texcoord1 => "TEXCOORD",
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
var format = item.Components switch
|
||||
|
@ -104,7 +104,7 @@ namespace BizHawk.Bizware.Graphics
|
|||
2 => Format.R32G32_Float,
|
||||
3 => Format.R32G32B32_Float,
|
||||
4 => item.Integer ? Format.B8G8R8A8_UNorm : Format.R32G32B32A32_Float,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
_inputElements[i] = new(semanticName, item.Usage == AttribUsage.Texcoord1 ? 1 : 0, format, item.Offset, 0);
|
||||
|
|
|
@ -203,7 +203,7 @@ namespace BizHawk.Client.Common
|
|||
PCEngine pce => pce.GetSettings(),
|
||||
QuickNES quickNes => quickNes.GetSettings(),
|
||||
SMS sms => sms.GetSettings(),
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
|
||||
public PutSettingsDirtyBits PutSettings(object settings) => Emulator switch // (select) cores A-Z by value of `CoreAttribute.CoreName`
|
||||
|
@ -216,7 +216,7 @@ namespace BizHawk.Client.Common
|
|||
PCEngine pce => pce.PutSettings((PCEngine.PCESettings) settings),
|
||||
QuickNES quickNes => quickNes.PutSettings((QuickNES.QuickNESSettings) settings),
|
||||
SMS sms => sms.PutSettings((SMS.SmsSettings) settings),
|
||||
_ => PutSettingsDirtyBits.None
|
||||
_ => PutSettingsDirtyBits.None,
|
||||
};
|
||||
|
||||
public void SetRenderPlanes(params bool[] args)
|
||||
|
|
|
@ -413,7 +413,7 @@ namespace BizHawk.Client.Common
|
|||
"italic" => FontStyle.Italic,
|
||||
"strikethrough" => FontStyle.Strikeout,
|
||||
"underline" => FontStyle.Underline,
|
||||
_ => FontStyle.Regular
|
||||
_ => FontStyle.Regular,
|
||||
};
|
||||
|
||||
using var g = Graphics.FromImage(_nullGraphicsBitmap);
|
||||
|
@ -540,7 +540,7 @@ namespace BizHawk.Client.Common
|
|||
"bottomleft" => 2,
|
||||
"3" => 3,
|
||||
"bottomright" => 3,
|
||||
_ => default
|
||||
_ => default,
|
||||
};
|
||||
}
|
||||
else
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace BizHawk.Client.Common
|
|||
2 => d.PeekUshort(addr, _isBigEndian),
|
||||
3 => _isBigEndian ? ReadUnsignedBig(addr, 3, domain) : ReadUnsignedLittle(addr, 3, domain),
|
||||
4 => d.PeekUint(addr, _isBigEndian),
|
||||
_ => 0
|
||||
_ => 0,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace BizHawk.Client.Common
|
|||
"emu" => DisplaySurfaceID.EmuCore,
|
||||
"emucore" => DisplaySurfaceID.EmuCore,
|
||||
"native" => DisplaySurfaceID.Client,
|
||||
_ => throw new ArgumentException(message: $"{str} is not the name of a display surface", paramName: nameof(str))
|
||||
_ => throw new ArgumentException(paramName: nameof(str), message: $"{str} is not the name of a display surface"),
|
||||
};
|
||||
#pragma warning restore BHI1005
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
DisplaySurfaceID.EmuCore => "emucore",
|
||||
DisplaySurfaceID.Client => "client",
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
MIME_FORM_URLENC => new FormUrlEncodedContent([ new("payload", payload) ]),
|
||||
#pragma warning disable BHI1005 // exception type
|
||||
_ => throw new NotImplementedException()
|
||||
_ => throw new NotImplementedException(),
|
||||
#pragma warning restore BHI1005
|
||||
};
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
1 => FinalPresentation.eFilterOption.Bilinear,
|
||||
2 => FinalPresentation.eFilterOption.Bicubic,
|
||||
_ => FinalPresentation.eFilterOption.None
|
||||
_ => FinalPresentation.eFilterOption.None,
|
||||
};
|
||||
|
||||
// if bicubic is selected and unavailable, don't use it. use bilinear instead I guess
|
||||
|
@ -488,7 +488,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
NDS nds => new ScreenControlNDS(nds),
|
||||
Encore encore => new ScreenControl3DS(encore),
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace BizHawk.Client.Common.FilterManager
|
|||
ProgramStepType.Run => $"Run {(int) Args} ({Comment})",
|
||||
ProgramStepType.NewTarget => $"NewTarget {(Size) Args}",
|
||||
ProgramStepType.FinalTarget => "FinalTarget",
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace BizHawk.Client.Common.Filters
|
|||
{
|
||||
EDispMethod.OpenGL => Path.ChangeExtension(path, ".glsl"),
|
||||
EDispMethod.D3D11 => Path.ChangeExtension(path, ".hlsl"),
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ namespace BizHawk.Client.Common.Filters
|
|||
{
|
||||
"true" => true,
|
||||
"false" => false,
|
||||
_ => throw new InvalidOperationException("Unparsable bool in CGP file content")
|
||||
_ => throw new InvalidOperationException("Unparsable bool in CGP file content"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -291,14 +291,14 @@ namespace BizHawk.Client.Common.Filters
|
|||
{
|
||||
RetroShaderPreset.ScaleType.Absolute => (int)_sp.Scale.X,
|
||||
RetroShaderPreset.ScaleType.Source => (int)(inSize.Width * _sp.Scale.X),
|
||||
_ => _outputSize.Width
|
||||
_ => _outputSize.Width,
|
||||
};
|
||||
|
||||
_outputSize.Height = _sp.ScaleTypeY switch
|
||||
{
|
||||
RetroShaderPreset.ScaleType.Absolute => (int)_sp.Scale.Y,
|
||||
RetroShaderPreset.ScaleType.Source => (int)(inSize.Height * _sp.Scale.Y),
|
||||
_ => _outputSize.Height
|
||||
_ => _outputSize.Height,
|
||||
};
|
||||
|
||||
DeclareOutput(new SurfaceState(new(_outputSize), SurfaceDisposition.RenderTarget));
|
||||
|
@ -318,14 +318,14 @@ namespace BizHawk.Client.Common.Filters
|
|||
{
|
||||
RetroShaderPreset.ScaleType.Absolute => (int)_sp.Scale.X,
|
||||
RetroShaderPreset.ScaleType.Source => (int)(inSize.Width * _sp.Scale.X),
|
||||
_ => outsize.Width
|
||||
_ => outsize.Width,
|
||||
};
|
||||
|
||||
outsize.Height = _sp.ScaleTypeY switch
|
||||
{
|
||||
RetroShaderPreset.ScaleType.Absolute => (int)_sp.Scale.Y,
|
||||
RetroShaderPreset.ScaleType.Source => (int)(inSize.Height * _sp.Scale.Y),
|
||||
_ => outsize.Height
|
||||
_ => outsize.Height,
|
||||
};
|
||||
|
||||
return outsize;
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace BizHawk.Client.Common
|
|||
OpenAdvancedTypes.Libretro => new OpenAdvanced_Libretro(),
|
||||
OpenAdvancedTypes.LibretroNoGame => new OpenAdvanced_LibretroNoGame(),
|
||||
OpenAdvancedTypes.MAME => new OpenAdvanced_MAME(),
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
|
||||
if (ioa == null)
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace BizHawk.Client.Common.cheats
|
|||
VSystemID.Raw.SAT => Saturn(code),
|
||||
VSystemID.Raw.SMS => Sms(code),
|
||||
VSystemID.Raw.SNES => Snes(code),
|
||||
_ => new InvalidCheatCode("Cheat codes not currently supported on this system")
|
||||
_ => new InvalidCheatCode("Cheat codes not currently supported on this system"),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace BizHawk.Client.Common.cheats
|
|||
#if false
|
||||
VSystemID.Raw.SAT => "Work Ram High", // Work RAM High may be incorrect?
|
||||
#endif
|
||||
_ => null
|
||||
_ => null,
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace BizHawk.Client.Common.cheats
|
|||
'2' => WatchSize.DWord,
|
||||
'3' => WatchSize.DWord,
|
||||
'6' => WatchSize.Word,
|
||||
_ => WatchSize.Byte
|
||||
_ => WatchSize.Byte,
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -81,7 +81,7 @@ namespace BizHawk.Client.Common.cheats
|
|||
{
|
||||
WatchSize.Byte => result.Value & 0xFF,
|
||||
WatchSize.Word => result.Value & 0xFFFF,
|
||||
_ => result.Value
|
||||
_ => result.Value,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -45,8 +45,7 @@ namespace BizHawk.Client.Common.cheats
|
|||
Value = int.Parse(parseString.Remove(0, 5), NumberStyles.HexNumber),
|
||||
Size = WatchSize.Word,
|
||||
},
|
||||
_ => new InvalidCheatCode(
|
||||
"Action Replay/Pro Action Replay Codes need to be either 9 or 11 characters.")
|
||||
_ => new InvalidCheatCode("Action Replay/Pro Action Replay Codes need to be either 9 or 11 characters."),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace BizHawk.Client.Common.cheats
|
|||
"E1" => WatchSize.Byte,
|
||||
"E2" => WatchSize.Byte,
|
||||
"E3" => WatchSize.Byte,
|
||||
_ => WatchSize.Byte
|
||||
_ => WatchSize.Byte,
|
||||
};
|
||||
|
||||
var s = code.Remove(0, 2);
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace BizHawk.Client.Common
|
|||
// potentially applicable for future cores (Dolphin?)
|
||||
"User" => 0x40,
|
||||
|
||||
_ => 0x50
|
||||
_ => 0x50,
|
||||
};
|
||||
Path = path;
|
||||
System = system;
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace BizHawk.Client.Common
|
|||
DistinctKey.OemQuotes => "Apostrophe",
|
||||
DistinctKey.OemBackslash => "OEM102",
|
||||
DistinctKey.NumPadEnter => "KeypadEnter",
|
||||
_ => k.ToString()
|
||||
_ => k.ToString(),
|
||||
};
|
||||
}
|
||||
}
|
|
@ -37,7 +37,7 @@ namespace BizHawk.Client.Common
|
|||
return result switch
|
||||
{
|
||||
Dictionary<string, object> dict => _th.DictToTable(dict),
|
||||
_ => result
|
||||
_ => result,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
NES.NESSettings nhs => nhs.AllowMoreThanEightSprites,
|
||||
QuickNES.QuickNESSettings qns => qns.NumSprites != 8,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
/// <exception cref="InvalidOperationException">loaded core is not NESHawk or QuickNes</exception>
|
||||
|
@ -44,7 +44,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
NES.NESSettings nhs => pal ? nhs.PAL_BottomLine : nhs.NTSC_BottomLine,
|
||||
QuickNES.QuickNESSettings qns => qns.ClipTopAndBottom ? 231 : 239,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
/// <exception cref="InvalidOperationException">loaded core is not NESHawk or QuickNes</exception>
|
||||
|
@ -55,7 +55,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
NES.NESSettings nhs => nhs.ClipLeftAndRight,
|
||||
QuickNES.QuickNESSettings qns => qns.ClipLeftAndRight,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
/// <exception cref="InvalidOperationException">loaded core is not NESHawk or QuickNes</exception>
|
||||
|
@ -66,7 +66,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
NES.NESSettings nhs => nhs.DispBackground,
|
||||
QuickNES.QuickNESSettings => true,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
/// <exception cref="InvalidOperationException">loaded core is not NESHawk or QuickNes</exception>
|
||||
|
@ -77,7 +77,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
NES.NESSettings nhs => nhs.DispSprites,
|
||||
QuickNES.QuickNESSettings qns => qns.NumSprites > 0,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
/// <exception cref="InvalidOperationException">loaded core is not NESHawk or QuickNes</exception>
|
||||
|
@ -88,7 +88,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
NES.NESSettings nhs => pal ? nhs.PAL_TopLine : nhs.NTSC_TopLine,
|
||||
QuickNES.QuickNESSettings qns => qns.ClipTopAndBottom ? 8 : 0,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
/// <exception cref="InvalidOperationException">loaded core is not NESHawk or QuickNes</exception>
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace BizHawk.Client.Common.movie.import
|
|||
"gamepad16" => BsnesApi.BSNES_PORT1_INPUT_DEVICE.ExtendedGamepad,
|
||||
"multitap" => BsnesApi.BSNES_PORT1_INPUT_DEVICE.SuperMultitap,
|
||||
"multitap16" => BsnesApi.BSNES_PORT1_INPUT_DEVICE.Payload,
|
||||
_ => BsnesApi.BSNES_PORT1_INPUT_DEVICE.Gamepad
|
||||
_ => BsnesApi.BSNES_PORT1_INPUT_DEVICE.Gamepad,
|
||||
};
|
||||
}
|
||||
if ((portEntry = zip.GetEntry("port2")) != null)
|
||||
|
@ -79,7 +79,7 @@ namespace BizHawk.Client.Common.movie.import
|
|||
"superscope" => BsnesApi.BSNES_INPUT_DEVICE.SuperScope,
|
||||
"justifier" => BsnesApi.BSNES_INPUT_DEVICE.Justifier,
|
||||
"justifiers" => BsnesApi.BSNES_INPUT_DEVICE.Justifiers,
|
||||
_ => BsnesApi.BSNES_INPUT_DEVICE.Gamepad
|
||||
_ => BsnesApi.BSNES_INPUT_DEVICE.Gamepad,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace BizHawk.Client.Common.movie.import
|
|||
1 => "1.43",
|
||||
4 => "1.51",
|
||||
5 => "1.52",
|
||||
_ => "Unknown"
|
||||
_ => "Unknown",
|
||||
};
|
||||
|
||||
Result.Movie.Comments.Add($"{EmulationOrigin} Snes9x version {version}");
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace BizHawk.Client.Common
|
|||
{
|
||||
null => false,
|
||||
TasMovieMarker marker => Frame == marker.Frame,
|
||||
_ => false
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ namespace BizHawk.Client.Common
|
|||
WatchSize.Word => ((WordWatch) _watch).FormatValue((ushort)_val),
|
||||
WatchSize.DWord => ((DWordWatch) _watch).FormatValue((uint)_val),
|
||||
WatchSize.Separator => "",
|
||||
_ => ""
|
||||
_ => string.Empty,
|
||||
};
|
||||
|
||||
public string CompareStr
|
||||
|
@ -113,7 +113,7 @@ namespace BizHawk.Client.Common
|
|||
WatchSize.Word => ((WordWatch) _watch).FormatValue((ushort)_compare.Value),
|
||||
WatchSize.DWord => ((DWordWatch) _watch).FormatValue((uint)_compare.Value),
|
||||
WatchSize.Separator => "",
|
||||
_ => ""
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
|||
Compare.SpecificAddress => CompareSpecificAddress(_watchList).ToArray(),
|
||||
Compare.Changes => CompareChanges(_watchList).ToArray(),
|
||||
Compare.Difference => CompareDifference(_watchList).ToArray(),
|
||||
_ => ComparePrevious(_watchList).ToArray()
|
||||
_ => ComparePrevious(_watchList).ToArray(),
|
||||
};
|
||||
|
||||
if (_settings.PreviousType == PreviousType.LastSearch)
|
||||
|
@ -158,7 +158,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
|||
Compare.SpecificAddress => !CompareSpecificAddress(listOfOne).Any(),
|
||||
Compare.Changes => !CompareChanges(listOfOne).Any(),
|
||||
Compare.Difference => !CompareDifference(listOfOne).Any(),
|
||||
_ => !ComparePrevious(listOfOne).Any()
|
||||
_ => !ComparePrevious(listOfOne).Any(),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
|||
WatchSize.Byte => addresses.ToBytes(_settings),
|
||||
WatchSize.Word => addresses.ToWords(_settings),
|
||||
WatchSize.DWord => addresses.ToDWords(_settings),
|
||||
_ => addresses.ToBytes(_settings)
|
||||
_ => addresses.ToBytes(_settings),
|
||||
};
|
||||
|
||||
_watchList = (append ? _watchList.Concat(list) : list).ToArray();
|
||||
|
@ -291,7 +291,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
|||
WatchSize.Word => addresses.Where(static address => address % 2 == 0).ToWords(_settings).ToArray(),
|
||||
WatchSize.DWord when _settings.CheckMisAligned => addresses.ToDWords(_settings).ToArray(),
|
||||
WatchSize.DWord => addresses.Where(static address => address % 4 == 0).ToDWords(_settings).ToArray(),
|
||||
_ => _watchList
|
||||
_ => _watchList,
|
||||
};
|
||||
|
||||
_settings.Size = size;
|
||||
|
@ -639,7 +639,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
|||
WatchSize.Byte => (sbyte) val,
|
||||
WatchSize.Word => (short) val,
|
||||
WatchSize.DWord => (int) val,
|
||||
_ => (sbyte) val
|
||||
_ => (sbyte) val,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -655,7 +655,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
|||
WatchSize.Byte => MiniByteWatch.GetByte(watch.Address, Domain),
|
||||
WatchSize.Word => MiniWordWatch.GetUshort(watch.Address, Domain, _settings.BigEndian),
|
||||
WatchSize.DWord => MiniDWordWatch.GetUint(watch.Address, Domain, _settings.BigEndian),
|
||||
_ => MiniByteWatch.GetByte(watch.Address, Domain)
|
||||
_ => MiniByteWatch.GetByte(watch.Address, Domain),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -665,7 +665,7 @@ namespace BizHawk.Client.Common.RamSearchEngine
|
|||
{
|
||||
SearchMode.Detailed => true,
|
||||
SearchMode.Fast => (compareType != Compare.Changes),
|
||||
_ => true
|
||||
_ => true,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ namespace BizHawk.Client.Common
|
|||
WatchDisplayType.Signed => (byte)sbyte.Parse(value),
|
||||
WatchDisplayType.Hex => byte.Parse(value, NumberStyles.HexNumber),
|
||||
WatchDisplayType.Binary => Convert.ToByte(value, 2),
|
||||
_ => 0
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
PokeByte(val);
|
||||
|
@ -128,7 +128,7 @@ namespace BizHawk.Client.Common
|
|||
WatchDisplayType.Signed => ((sbyte) val).ToString(),
|
||||
WatchDisplayType.Hex => $"{val:X2}",
|
||||
WatchDisplayType.Binary => Convert.ToString(val, 2).PadLeft(8, '0').Insert(4, " "),
|
||||
_ => val.ToString()
|
||||
_ => val.ToString(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace BizHawk.Client.Common
|
|||
WatchDisplayType.FixedPoint_16_16 => (uint)(double.Parse(value, NumberFormatInfo.InvariantInfo) * 65536.0),
|
||||
WatchDisplayType.Float => NumberExtensions.ReinterpretAsUInt32(float.Parse(value, NumberFormatInfo.InvariantInfo)),
|
||||
WatchDisplayType.Binary => Convert.ToUInt32(value, 2),
|
||||
_ => 0
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
PokeDWord(val);
|
||||
|
@ -154,7 +154,7 @@ namespace BizHawk.Client.Common
|
|||
WatchDisplayType.FixedPoint_16_16 => ((int)val / 65536.0).ToString("0.######", NumberFormatInfo.InvariantInfo),
|
||||
WatchDisplayType.Float => FormatFloat(),
|
||||
WatchDisplayType.Binary => FormatBinary(),
|
||||
_ => val.ToString()
|
||||
_ => val.ToString(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ namespace BizHawk.Client.Common
|
|||
WatchSize.Byte => new ByteWatch(domain, address, type, bigEndian, note, (byte) value, (byte) prev, changeCount),
|
||||
WatchSize.Word => new WordWatch(domain, address, type, bigEndian, note, (ushort) value, (ushort) prev, changeCount),
|
||||
WatchSize.DWord => new DWordWatch(domain, address, type, bigEndian, note, (uint) value, (uint) prev, changeCount),
|
||||
_ => SeparatorWatch.NewSeparatorWatch(note)
|
||||
_ => SeparatorWatch.NewSeparatorWatch(note),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -556,7 +556,7 @@ namespace BizHawk.Client.Common
|
|||
WatchDisplayType.FixedPoint_12_4 => "Fixed Point 12.4",
|
||||
WatchDisplayType.FixedPoint_20_12 => "Fixed Point 20.12",
|
||||
WatchDisplayType.FixedPoint_16_16 => "Fixed Point 16.16",
|
||||
_ => type.ToString()
|
||||
_ => type.ToString(),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -567,7 +567,7 @@ namespace BizHawk.Client.Common
|
|||
"Fixed Point 12.4" => WatchDisplayType.FixedPoint_12_4,
|
||||
"Fixed Point 20.12" => WatchDisplayType.FixedPoint_20_12,
|
||||
"Fixed Point 16.16" => WatchDisplayType.FixedPoint_16_16,
|
||||
_ => (WatchDisplayType) Enum.Parse(typeof(WatchDisplayType), name)
|
||||
_ => (WatchDisplayType) Enum.Parse(typeof(WatchDisplayType), name),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -581,7 +581,7 @@ namespace BizHawk.Client.Common
|
|||
WatchSize.Byte => 'b',
|
||||
WatchSize.Word => 'w',
|
||||
WatchSize.DWord => 'd',
|
||||
_ => 'S'
|
||||
_ => 'S',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -594,7 +594,7 @@ namespace BizHawk.Client.Common
|
|||
'b' => WatchSize.Byte,
|
||||
'w' => WatchSize.Word,
|
||||
'd' => WatchSize.DWord,
|
||||
_ => WatchSize.Separator
|
||||
_ => WatchSize.Separator,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -613,7 +613,7 @@ namespace BizHawk.Client.Common
|
|||
WatchDisplayType.FixedPoint_20_12 => '2',
|
||||
WatchDisplayType.FixedPoint_16_16 => '3',
|
||||
WatchDisplayType.Float => 'f',
|
||||
_ => '_'
|
||||
_ => '_',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ namespace BizHawk.Client.Common
|
|||
'2' => WatchDisplayType.FixedPoint_20_12,
|
||||
'3' => WatchDisplayType.FixedPoint_16_16,
|
||||
'f' => WatchDisplayType.Float,
|
||||
_ => WatchDisplayType.Separator
|
||||
_ => WatchDisplayType.Separator,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace BizHawk.Client.Common
|
|||
WatchDisplayType.Hex => ushort.Parse(value, NumberStyles.HexNumber),
|
||||
WatchDisplayType.Binary => Convert.ToUInt16(value, 2),
|
||||
WatchDisplayType.FixedPoint_12_4 => (ushort)(double.Parse(value, NumberFormatInfo.InvariantInfo) * 16.0),
|
||||
_ => 0
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
PokeWord(val);
|
||||
|
@ -133,7 +133,7 @@ namespace BizHawk.Client.Common
|
|||
.Insert(8, " ")
|
||||
.Insert(4, " ")
|
||||
.Insert(14, " "),
|
||||
_ => val.ToString()
|
||||
_ => val.ToString(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace BizHawk.Client.DiscoHawk
|
|||
{
|
||||
DialogResult.Yes => true,
|
||||
DialogResult.No => false,
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
AudioExtractor.Extract(disc, path, filename, PromptForOverwrite);
|
||||
}
|
||||
|
|
|
@ -329,7 +329,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
16 => 2,
|
||||
8 => 1,
|
||||
_ => throw new InvalidOperationException($"only 8/16 bits audio are supported by {nameof(AviWriter)} and you chose: {a_bits}")
|
||||
_ => throw new InvalidOperationException($"only 8/16 bits audio are supported by {nameof(AviWriter)} and you chose: {a_bits}"),
|
||||
};
|
||||
|
||||
if (a_channels is not (1 or 2))
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
-1 => "Auto",
|
||||
0 => "Fastest",
|
||||
_ => $"{(int) ((100 + numericUpDown2.Value / 2) / numericUpDown2.Value)} FPS"
|
||||
_ => $"{(int) ((100 + numericUpDown2.Value / 2) / numericUpDown2.Value)} FPS",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
|
|||
MessageBoxIcon.Error => SystemIcons.Error,
|
||||
MessageBoxIcon.Exclamation => SystemIcons.Exclamation,
|
||||
MessageBoxIcon.Question => SystemIcons.Question,
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
EMsgBoxIcon.Question => MessageBoxIcon.Question,
|
||||
EMsgBoxIcon.Warning => MessageBoxIcon.Warning,
|
||||
EMsgBoxIcon.Info => MessageBoxIcon.Information,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions
|
|||
QuickNES => Properties.Resources.QuickNes,
|
||||
Snes9x => Properties.Resources.Snes9X,
|
||||
UAE => Properties.Resources.Amiga,
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace BizHawk.Client.EmuHawk.CoreExtensions
|
|||
#if false
|
||||
IGameboyCommon gb when gb.IsCGBMode() => EmulatorExtensions.SystemIDToDisplayName(VSystemID.Raw.GBC),
|
||||
#endif
|
||||
_ => EmulatorExtensions.SystemIDToDisplayName(emulator.SystemId)
|
||||
_ => EmulatorExtensions.SystemIDToDisplayName(emulator.SystemId),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -803,7 +803,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
ESoundOutputMethod.XAudio2 => XAudio2SoundOutput.GetDeviceNames(),
|
||||
ESoundOutputMethod.OpenAL => OpenALSoundOutput.GetDeviceNames(),
|
||||
_ => Enumerable.Empty<string>()
|
||||
_ => [ ],
|
||||
};
|
||||
var oldOutputMethod = Config.SoundOutputMethod;
|
||||
var oldDevice = Config.SoundDevice;
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
A7800Hawk => OpenA7800HawkGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<A7800Hawk>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenA7800HawkFilterSettingsDialog(ISettingsAdapter settable)
|
||||
|
@ -91,7 +91,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
A7800Hawk => OpenA7800HawkFilterSettingsDialog(GetSettingsAdapterForLoadedCore<A7800Hawk>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void A7800SubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
|
@ -130,7 +130,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
AppleII => OpenVirtuSettingsDialog(),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void AppleSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
|
@ -171,7 +171,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
C64 => OpenC64HawkSettingsDialog(),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void C64SubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
|
@ -192,7 +192,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
ColecoVision => OpenColecoHawkGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<ColecoVision>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void ColecoHawkSetSkipBIOSIntro(bool newValue, ISettingsAdapter settable)
|
||||
|
@ -240,7 +240,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
AmstradCPC => OpenCPCHawkSyncSettingsDialog(GetSettingsAdapterForLoadedCore<AmstradCPC>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenCPCHawkAudioSettingsDialog(ISettingsAdapter settable)
|
||||
|
@ -253,7 +253,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
AmstradCPC => OpenCPCHawkAudioSettingsDialog(GetSettingsAdapterForLoadedCore<AmstradCPC>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenCPCHawkSettingsDialog(ISettingsAdapter settable)
|
||||
|
@ -266,7 +266,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
AmstradCPC => OpenCPCHawkSettingsDialog(GetSettingsAdapterForLoadedCore<AmstradCPC>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void AmstradCpcTapesSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
|
@ -345,7 +345,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
GBHawk => OpenGBHawkSettingsDialog(),
|
||||
Sameboy => OpenSameBoySettingsDialog(),
|
||||
SubGBHawk => OpenSubGBHawkSettingsDialog(),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenSameBoyPaletteSettingsDialog(ISettingsAdapter settable)
|
||||
|
@ -358,7 +358,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
Sameboy => OpenSameBoyPaletteSettingsDialog(GetSettingsAdapterForLoadedCore<Sameboy>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void GbGpuViewerMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -374,7 +374,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
GambatteLink => OpenGambatteLinkSettingsDialog(GetSettingsAdapterForLoadedCore<GambatteLink>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
|
@ -426,7 +426,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
Intellivision => OpenIntelliHawkGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<Intellivision>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void IntVSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
|
@ -461,7 +461,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
N64 => OpenMupen64PlusGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<N64>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void N64CircularAnalogRangeMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -523,7 +523,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
NDS.ScreenRotationKind.Rotate90 => NDS.ScreenRotationKind.Rotate180,
|
||||
NDS.ScreenRotationKind.Rotate180 => NDS.ScreenRotationKind.Rotate270,
|
||||
NDS.ScreenRotationKind.Rotate270 => NDS.ScreenRotationKind.Rotate0,
|
||||
_ => settings.ScreenRotation
|
||||
_ => settings.ScreenRotation,
|
||||
};
|
||||
settings.ScreenRotation = next;
|
||||
ds.PutSettings(settings);
|
||||
|
@ -582,7 +582,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
NES => OpenNesHawkGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<NES>()),
|
||||
SubNESHawk => OpenNesHawkGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<SubNESHawk>()),
|
||||
QuickNES => OpenQuickNesGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<QuickNES>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenNesHawkGraphicsSettingsDialog(ISettingsAdapter settable)
|
||||
|
@ -603,7 +603,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
NES => OpenNesHawkGraphicsSettingsDialog(GetSettingsAdapterForLoadedCore<NES>()),
|
||||
SubNESHawk => OpenNesHawkGraphicsSettingsDialog(GetSettingsAdapterForLoadedCore<SubNESHawk>()),
|
||||
QuickNES => OpenQuickNesGraphicsSettingsDialog(GetSettingsAdapterForLoadedCore<QuickNES>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void NesSoundChannelsMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -620,7 +620,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
NES { IsVS: true } => OpenNesHawkVSSettingsDialog(GetSettingsAdapterForLoadedCore<NES>()),
|
||||
SubNESHawk { IsVs: true } => OpenNesHawkVSSettingsDialog(GetSettingsAdapterForLoadedCore<SubNESHawk>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenNesHawkAdvancedSettingsDialog(ISettingsAdapter settable, bool hasMapperProperties)
|
||||
|
@ -634,7 +634,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
NES nesHawk => OpenNesHawkAdvancedSettingsDialog(GetSettingsAdapterForLoadedCore<NES>(), nesHawk.HasMapperProperties),
|
||||
SubNESHawk subNESHawk => OpenNesHawkAdvancedSettingsDialog(GetSettingsAdapterForLoadedCore<SubNESHawk>(), subNESHawk.HasMapperProperties),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void FdsEjectDiskMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -705,7 +705,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
Octoshock => OpenOctoshockGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<Octoshock>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenOctoshockSettingsDialog(ISettingsAdapter settable, OctoshockDll.eVidStandard vidStandard, Size vidSize)
|
||||
|
@ -716,7 +716,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
var result = Emulator switch
|
||||
{
|
||||
Octoshock octoshock => OpenOctoshockSettingsDialog(GetSettingsAdapterForLoadedCore<Octoshock>(), octoshock.SystemVidStandard, octoshock.CurrentVideoSize),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
if (result.IsOk()) FrameBufferResized();
|
||||
}
|
||||
|
@ -754,7 +754,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
LibsnesCore => OpenOldBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<LibsnesCore>()),
|
||||
BsnesCore => OpenBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<BsnesCore>()),
|
||||
SubBsnesCore => OpenBSNESGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<SubBsnesCore>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void SnesGfxDebuggerMenuItem_Click(object sender, EventArgs e)
|
||||
|
@ -772,7 +772,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
LibsnesCore => OpenOldBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<LibsnesCore>()),
|
||||
BsnesCore => OpenBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<BsnesCore>()),
|
||||
SubBsnesCore => OpenBSNESSettingsDialog(GetSettingsAdapterForLoadedCore<SubBsnesCore>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void SnesSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
|
@ -868,7 +868,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
2 => s.ShowOBJ_1 = !s.ShowOBJ_1,
|
||||
3 => s.ShowOBJ_2 = !s.ShowOBJ_2,
|
||||
4 => s.ShowOBJ_3 = !s.ShowOBJ_3,
|
||||
_ => result
|
||||
_ => result,
|
||||
};
|
||||
bsnes.PutSettings(s);
|
||||
AddOnScreenMessage($"Obj {layer} Layer {(result ? "On" : "Off")}");
|
||||
|
@ -882,7 +882,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
2 => s.ShowSprites1 = !s.ShowSprites1,
|
||||
3 => s.ShowSprites2 = !s.ShowSprites2,
|
||||
4 => s.ShowSprites3 = !s.ShowSprites3,
|
||||
_ => result
|
||||
_ => result,
|
||||
};
|
||||
snes9X.PutSettings(s);
|
||||
AddOnScreenMessage($"Sprite {layer} Layer {(result ? "On" : "Off")}");
|
||||
|
@ -936,7 +936,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
Emu83 => OpenTI83PaletteSettingsDialog(GetSettingsAdapterForLoadedCore<Emu83>()),
|
||||
TI83 => OpenTI83PaletteSettingsDialog(GetSettingsAdapterForLoadedCore<TI83>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
if (result.IsOk()) AddOnScreenMessage("Palette settings saved");
|
||||
}
|
||||
|
@ -958,7 +958,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
ZXSpectrum => OpenZXHawkSyncSettingsDialog(GetSettingsAdapterForLoadedCore<ZXSpectrum>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenZXHawkGamepadSettingsDialog(ISettingsAdapter settable)
|
||||
|
@ -971,7 +971,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
ZXSpectrum => OpenZXHawkGamepadSettingsDialog(GetSettingsAdapterForLoadedCore<ZXSpectrum>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenZXHawkAudioSettingsDialog(ISettingsAdapter settable)
|
||||
|
@ -984,7 +984,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
ZXSpectrum => OpenZXHawkAudioSettingsDialog(GetSettingsAdapterForLoadedCore<ZXSpectrum>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private DialogResult OpenZXHawkSettingsDialog(ISettingsAdapter settable)
|
||||
|
@ -997,7 +997,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
=> _ = Emulator switch
|
||||
{
|
||||
ZXSpectrum => OpenZXHawkSettingsDialog(GetSettingsAdapterForLoadedCore<ZXSpectrum>()),
|
||||
_ => DialogResult.None
|
||||
_ => DialogResult.None,
|
||||
};
|
||||
|
||||
private void ZXSpectrumTapesSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
|
|
|
@ -144,7 +144,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
VSystemCategory.Consoles => consolesCoreSettingsSubmenu,
|
||||
VSystemCategory.Handhelds => handheldsCoreSettingsSubmenu,
|
||||
VSystemCategory.PCs => pcsCoreSettingsSubmenu,
|
||||
_ => otherCoreSettingsSubmenu
|
||||
_ => otherCoreSettingsSubmenu,
|
||||
};
|
||||
parentMenu.DropDownItems.Add(submenu);
|
||||
}
|
||||
|
@ -595,7 +595,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
ControllerConfig => AllowInput.All,
|
||||
HotkeyConfig => AllowInput.All,
|
||||
LuaWinform { BlocksInputWhenFocused: false } => AllowInput.All,
|
||||
_ => AllowInput.None
|
||||
_ => AllowInput.None,
|
||||
}
|
||||
);
|
||||
InitControls();
|
||||
|
@ -750,7 +750,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"false" => false,
|
||||
_ when int.TryParse(v, out var i) => i,
|
||||
_ when double.TryParse(v, out var d) => d,
|
||||
_ => v
|
||||
_ => v,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -804,7 +804,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
OSTailoredCode.WindowsVersion._11 => null,
|
||||
OSTailoredCode.WindowsVersion._10 when win10PlusVersion! < new Version(10, 0, 19045) => $"Quick reminder: Your copy of Windows 10 (build {win10PlusVersion.Build}) is no longer supported by Microsoft.\nEmuHawk will probably continue working, but please update to 22H2 for increased security.",
|
||||
OSTailoredCode.WindowsVersion._10 => null,
|
||||
_ => $"Quick reminder: Windows {winVersion.ToString().RemovePrefix('_').Replace('_', '.')} is no longer supported by Microsoft.\nEmuHawk will probably continue working, but please get a new operating system for increased security (either Windows 10+ or a GNU+Linux distro)."
|
||||
_ => $"Quick reminder: Windows {winVersion.ToString().RemovePrefix('_').Replace('_', '.')} is no longer supported by Microsoft.\nEmuHawk will probably continue working, but please get a new operating system for increased security (either Windows 10+ or a GNU+Linux distro).",
|
||||
};
|
||||
if (message is not null)
|
||||
{
|
||||
|
@ -4354,7 +4354,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
CoreNames.QuickNes => CoreNames.NesHawk,
|
||||
CoreNames.Atari2600Hawk => CoreNames.Stella,
|
||||
CoreNames.HyperNyma => CoreNames.TurboNyma,
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
return recommendedCore is null
|
||||
? true
|
||||
|
@ -4664,7 +4664,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
DialogResult.OK => true,
|
||||
DialogResult.Yes => true,
|
||||
_ => false
|
||||
_ => false,
|
||||
};
|
||||
|
||||
public bool? ShowMessageBox3(
|
||||
|
@ -4681,7 +4681,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
DialogResult.Yes => true,
|
||||
DialogResult.No => false,
|
||||
_ => null
|
||||
_ => null,
|
||||
};
|
||||
|
||||
public void StartSound() => Sound.StartSound();
|
||||
|
|
|
@ -248,7 +248,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
1 or 2 when !OSTailoredCode.IsUnixHost => dispMethod == EDispMethod.D3D11
|
||||
? (EDispMethod.OpenGL, "OpenGL")
|
||||
: (EDispMethod.D3D11, "Direct3D11"),
|
||||
_ => (EDispMethod.GdiPlus, "GDI+")
|
||||
_ => (EDispMethod.GdiPlus, "GDI+"),
|
||||
};
|
||||
|
||||
IGL CheckRenderer(IGL gl)
|
||||
|
|
|
@ -383,7 +383,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
DiscType.Dreamcast => ConsoleID.Dreamcast,
|
||||
DiscType.SonyPS2 => ConsoleID.PlayStation2,
|
||||
DiscType.JaguarCD => ConsoleID.JaguarCD,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
ESoundOutputMethod.XAudio2 => new XAudio2SoundOutput(this, config.SoundDevice),
|
||||
ESoundOutputMethod.OpenAL => new OpenALSoundOutput(this, config.SoundDevice),
|
||||
_ => new DummySoundOutput(this)
|
||||
_ => new DummySoundOutput(this),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
AmstradCPC.BorderType.Visible => "Approximates what you see on a CPC monitor",
|
||||
AmstradCPC.BorderType.Uncropped => "The full display area",
|
||||
_ => lblBorderInfo.Text
|
||||
_ => lblBorderInfo.Text,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
MAME mame => DoMAMEDialog(owner, settable, mame.CurrentDriverSettings, isMovieActive: isMovieActive),
|
||||
NymaCore core => DoNymaDialogFor(owner, settable, title, core.SettingsInfo, isMovieActive: isMovieActive),
|
||||
_ => DoDialogFor(owner, settable, title, isMovieActive: isMovieActive)
|
||||
_ => DoDialogFor(owner, settable, title, isMovieActive: isMovieActive),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"Glide64mk2" => PluginType.GlideMk2,
|
||||
"GLideN64" => PluginType.GLideN64,
|
||||
"Angrylion" => PluginType.Angrylion,
|
||||
_ => _ss.VideoPlugin
|
||||
_ => _ss.VideoPlugin,
|
||||
};
|
||||
|
||||
_ss.Core = CoreTypeDropdown.SelectedItem
|
||||
|
|
|
@ -74,7 +74,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
2 => OctoshockDll.ePeripheralType.DualShock,
|
||||
3 => OctoshockDll.ePeripheralType.DualAnalog,
|
||||
4 => OctoshockDll.ePeripheralType.NegCon,
|
||||
_ => uc.Devices8[i]
|
||||
_ => uc.Devices8[i],
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
ClientProfile.Longplay => "Longplays",
|
||||
ClientProfile.Tas => "Tool-assisted Speedruns",
|
||||
ClientProfile.N64Tas => "N64 Tool-assisted Speedruns",
|
||||
_ => "Casual Gaming"
|
||||
_ => "Casual Gaming",
|
||||
};
|
||||
|
||||
AutoCheckForUpdates.Checked = _config.UpdateAutoCheckEnabled;
|
||||
|
@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"Longplays" => ClientProfile.Longplay,
|
||||
"Tool-assisted Speedruns" => ClientProfile.Tas,
|
||||
"N64 Tool-assisted Speedruns" => ClientProfile.N64Tas,
|
||||
_ => ClientProfile.Casual
|
||||
_ => ClientProfile.Casual,
|
||||
};
|
||||
|
||||
SetCasual();
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
ZXSpectrum.BorderType.None => "No border at all",
|
||||
ZXSpectrum.BorderType.Small => "All borders 10px",
|
||||
ZXSpectrum.BorderType.Widescreen => "No top and bottom border (almost 16:9)",
|
||||
_ => lblBorderInfo.Text
|
||||
_ => lblBorderInfo.Text,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace BizHawk.Client.EmuHawk.ForDebugging
|
|||
0 => "n64",
|
||||
1 => "v64",
|
||||
2 => "z64",
|
||||
_ => null
|
||||
_ => null,
|
||||
},
|
||||
initDir: Config!.PathEntries.RomAbsolutePath());
|
||||
if (filename is not null) txtTargetFile.Text = filename;
|
||||
|
@ -54,7 +54,7 @@ namespace BizHawk.Client.EmuHawk.ForDebugging
|
|||
{
|
||||
0 => N64RomByteswapper.ToN64LittleEndian(rom),
|
||||
1 => N64RomByteswapper.ToV64ByteSwapped(rom),
|
||||
_ => N64RomByteswapper.ToZ64Native(rom)
|
||||
_ => N64RomByteswapper.ToZ64Native(rom),
|
||||
};
|
||||
File.WriteAllBytes(txtTargetFile.Text, rom);
|
||||
this.ModalMessageBox($"wrote {txtTargetFile.Text}\n{SHA1Checksum.ComputePrefixedHex(rom)}");
|
||||
|
|
|
@ -496,7 +496,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
.OrderBy(x => x.Values, _sortDetailsReverse)
|
||||
.ThenBy(x => x.Keys)
|
||||
.ToList(),
|
||||
_ => detailsList
|
||||
_ => detailsList,
|
||||
};
|
||||
|
||||
DetailsView.Items.Clear();
|
||||
|
|
|
@ -837,7 +837,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
1 => _currentDomain.PeekByte(addr),
|
||||
2 => _currentDomain.PeekUshort(addr, _bigEndian),
|
||||
4 => (int) _currentDomain.PeekUint(addr, _bigEndian),
|
||||
_ => _currentDomain.PeekByte(addr)
|
||||
_ => _currentDomain.PeekByte(addr),
|
||||
};
|
||||
|
||||
return val;
|
||||
|
@ -937,7 +937,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
3 => (currentValue <= bestValue),
|
||||
4 => (currentValue < bestValue),
|
||||
5 => (currentValue != bestValue),
|
||||
_ => false
|
||||
_ => false,
|
||||
};
|
||||
|
||||
if (!TestValue(MainComparisonType, current.Maximize, comparison.Maximize)) return false;
|
||||
|
|
|
@ -326,7 +326,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
"<" => Cheat.CompareType.LessThan,
|
||||
"<=" => Cheat.CompareType.LessThanOrEqual,
|
||||
"!=" => Cheat.CompareType.NotEqual,
|
||||
_ => Cheat.CompareType.None
|
||||
_ => Cheat.CompareType.None,
|
||||
};
|
||||
|
||||
var compare = CompareBox.ToRawInt();
|
||||
|
|
|
@ -262,7 +262,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Cheat.CompareType.LessThan => "<",
|
||||
Cheat.CompareType.LessThanOrEqual => "<=",
|
||||
Cheat.CompareType.NotEqual => "!=",
|
||||
_ => ""
|
||||
_ => string.Empty,
|
||||
};
|
||||
|
||||
break;
|
||||
|
|
|
@ -216,7 +216,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
ExternalToolApplicabilityAttributeBase.DuplicateException => "The IExternalToolForm has conflicting applicability attributes.",
|
||||
ExternalToolAttribute.MissingException => "The assembly doesn't contain a class implementing IExternalToolForm and annotated with [ExternalTool].",
|
||||
ReflectionTypeLoadException => "Something went wrong while trying to load the assembly.",
|
||||
_ => $"An exception of type {e.GetType().FullName} was thrown while trying to load the assembly and look for an IExternalToolForm:\n{e.Message}"
|
||||
_ => $"An exception of type {e.GetType().FullName} was thrown while trying to load the assembly and look for an IExternalToolForm:\n{e}",
|
||||
};
|
||||
}
|
||||
return item;
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
null => "nil",
|
||||
LuaTable table => SerializeTable(table),
|
||||
_ => output.ToString()
|
||||
_ => output.ToString(),
|
||||
});
|
||||
|
||||
if (outputs == null || outputs.Length == 0 || (outputs.Length == 1 && outputs[0] is null))
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
TextEditors.Sublime2 => IsSublimeInstalled(),
|
||||
TextEditors.NotePad => IsNotepadInstalled(),
|
||||
_ => false
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
TextEditors.Sublime2 => IsBizLuaSublimeInstalled(),
|
||||
TextEditors.NotePad => IsBizLuaNotepadInstalled(),
|
||||
_ => false
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -423,7 +423,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
LuaFile.RunState.Running => Resources.ts_h_arrow_green,
|
||||
LuaFile.RunState.Paused => Resources.Pause,
|
||||
_ => Resources.Stop
|
||||
_ => Resources.Stop,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
2 => _functionList.OrderBy(x => x.Name, _columnSort.Descending).ToList(),
|
||||
3 => _functionList.OrderBy(x => x.ParameterList, _columnSort.Descending).ToList(),
|
||||
4 => _functionList.OrderBy(x => x.Description, _columnSort.Descending).ToList(),
|
||||
_ => _functionList
|
||||
_ => _functionList,
|
||||
};
|
||||
|
||||
UpdateList();
|
||||
|
|
|
@ -376,7 +376,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
LuaStatus.OK => (WaitForFrame: false, Terminated: true),
|
||||
LuaStatus.Yield => (WaitForFrame: FrameAdvanceRequested, Terminated: false),
|
||||
_ => throw new InvalidOperationException($"{nameof(_currThread.Resume)}() returned {execResult}?")
|
||||
_ => throw new InvalidOperationException($"{nameof(_currThread.Resume)}() returned {execResult}?"),
|
||||
};
|
||||
|
||||
FrameAdvanceRequested = false;
|
||||
|
|
|
@ -182,7 +182,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
0 => rec.Pulse0,
|
||||
1 => rec.Pulse1,
|
||||
_ => default
|
||||
_ => default,
|
||||
};
|
||||
|
||||
// transform quieted notes to dead notes
|
||||
|
|
|
@ -282,7 +282,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
NameTableViewer.WhichNametable.NT_2400 => 1,
|
||||
NameTableViewer.WhichNametable.NT_2800 => 2,
|
||||
NameTableViewer.WhichNametable.NT_2C00 => 3,
|
||||
_ => 0
|
||||
_ => 0,
|
||||
};
|
||||
|
||||
tileX = e.X / 16;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
BranchNumberColumnName => (index + 1).ToString(),
|
||||
FrameColumnName => Branches[index].Frame.ToString(),
|
||||
UserTextColumnName => Branches[index].UserText,
|
||||
_ => text
|
||||
_ => text,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
DisasmColumnName => _instructions[index].Disassembly.TrimEnd(),
|
||||
RegistersColumnName => _instructions[index].RegisterInfo,
|
||||
_ => text
|
||||
_ => text,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Location = UIHelper.Scale(discManager.Location),
|
||||
Size = UIHelper.Scale(discManager.TargetSize)
|
||||
},
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
});
|
||||
}
|
||||
if (OSTailoredCode.IsUnixHost)
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
ButtonSchema => buttonControls.Contains,
|
||||
DiscManagerSchema => s => buttonControls.Contains(s) || axisControls.ContainsKey(s),
|
||||
_ => axisControls.ContainsKey
|
||||
_ => axisControls.ContainsKey,
|
||||
};
|
||||
if (!searchSetContains(controlSchema.Name))
|
||||
{
|
||||
|
|
|
@ -127,7 +127,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchSize.Byte => 0,
|
||||
WatchSize.Word => 1,
|
||||
WatchSize.DWord => 2,
|
||||
_ => SizeDropdown.SelectedIndex
|
||||
_ => SizeDropdown.SelectedIndex,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -231,7 +231,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchList.Prev => _searches[index].PreviousStr,
|
||||
WatchList.ChangesCol => _searches[index].ChangeCount.ToString(),
|
||||
WatchList.Diff => _searches[index].Diff,
|
||||
_ => text
|
||||
_ => text,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -712,7 +712,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchSize.Byte => ByteWatch.ValidTypes,
|
||||
WatchSize.Word => WordWatch.ValidTypes,
|
||||
WatchSize.DWord => DWordWatch.ValidTypes,
|
||||
_ => new List<Common.WatchDisplayType>()
|
||||
_ => [ ],
|
||||
};
|
||||
|
||||
foreach (var type in types)
|
||||
|
@ -1074,7 +1074,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchSize.Byte => ByteWatch.ValidTypes,
|
||||
WatchSize.Word => WordWatch.ValidTypes,
|
||||
WatchSize.DWord => DWordWatch.ValidTypes,
|
||||
_ => new List<Common.WatchDisplayType>()
|
||||
_ => [ ],
|
||||
};
|
||||
|
||||
foreach (var type in types)
|
||||
|
@ -1405,7 +1405,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
1 => WatchSize.Word,
|
||||
2 => WatchSize.DWord,
|
||||
_ => WatchSize.Byte
|
||||
_ => WatchSize.Byte,
|
||||
};
|
||||
|
||||
private void SizeDropdown_SelectedIndexChanged(object sender, EventArgs e)
|
||||
|
|
|
@ -820,7 +820,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
WatchSize.DWord => WatchSize.Word,
|
||||
WatchSize.Word => WatchSize.Byte,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
var a = Watch.GenerateWatch(ab.Domain, ab.Address, newSize, ab.Type, ab.BigEndian, ab.Notes);
|
||||
var b = Watch.GenerateWatch(ab.Domain, ab.Address + (int) newSize, newSize, ab.Type, ab.BigEndian, ab.Notes);
|
||||
|
|
|
@ -245,7 +245,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
Mode.New => "New Watch",
|
||||
Mode.Edit => $"Edit {(Watches.Count == 1 ? "Watch" : "Watches")}",
|
||||
Mode.Duplicate => "Duplicate Watch",
|
||||
_ => "New Watch"
|
||||
_ => "New Watch",
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
4 => DWordWatch.ValidTypes,
|
||||
2 => WordWatch.ValidTypes,
|
||||
_ => ByteWatch.ValidTypes
|
||||
_ => ByteWatch.ValidTypes,
|
||||
}).Select(Watch.DisplayTypeToString));
|
||||
DisplayTypeDropDown.SelectedItem = oldType;
|
||||
if (DisplayTypeDropDown.SelectedIndex is -1) DisplayTypeDropDown.SelectedIndex = 0;
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchSize.Byte => ByteWatch.ValidTypes.Any(t => t == _type),
|
||||
WatchSize.Word => WordWatch.ValidTypes.Any(t => t == _type),
|
||||
WatchSize.DWord => DWordWatch.ValidTypes.Any(t => t == _type),
|
||||
_ => false
|
||||
_ => false,
|
||||
};
|
||||
|
||||
if (!isTypeCompatible)
|
||||
|
@ -67,7 +67,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
WatchSize.Word => ushort.MaxValue,
|
||||
WatchSize.DWord => uint.MaxValue,
|
||||
_ => byte.MaxValue
|
||||
_ => byte.MaxValue,
|
||||
};
|
||||
|
||||
private int MaxSignedInt =>
|
||||
|
@ -75,7 +75,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
WatchSize.Word => short.MaxValue,
|
||||
WatchSize.DWord => int.MaxValue,
|
||||
_ => sbyte.MaxValue
|
||||
_ => sbyte.MaxValue,
|
||||
};
|
||||
|
||||
private int MinSignedInt =>
|
||||
|
@ -83,7 +83,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
WatchSize.Word => short.MinValue,
|
||||
WatchSize.DWord => int.MinValue,
|
||||
_ => sbyte.MinValue
|
||||
_ => sbyte.MinValue,
|
||||
};
|
||||
|
||||
private const double Max12_4 = short.MaxValue / 16.0;
|
||||
|
@ -145,7 +145,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchSize.Byte => 8,
|
||||
WatchSize.Word => 16,
|
||||
WatchSize.DWord => 32,
|
||||
_ => 8
|
||||
_ => 8,
|
||||
};
|
||||
break;
|
||||
case WatchDisplayType.Hex:
|
||||
|
@ -154,7 +154,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchSize.Byte => 2,
|
||||
WatchSize.Word => 4,
|
||||
WatchSize.DWord => 8,
|
||||
_ => 2
|
||||
_ => 2,
|
||||
};
|
||||
break;
|
||||
case WatchDisplayType.Signed:
|
||||
|
@ -163,7 +163,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchSize.Byte => 4,
|
||||
WatchSize.Word => 6,
|
||||
WatchSize.DWord => 11,
|
||||
_ => 4
|
||||
_ => 4,
|
||||
};
|
||||
break;
|
||||
case WatchDisplayType.Unsigned:
|
||||
|
@ -172,7 +172,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchSize.Byte => 3,
|
||||
WatchSize.Word => 5,
|
||||
WatchSize.DWord => 10,
|
||||
_ => 3
|
||||
_ => 3,
|
||||
};
|
||||
break;
|
||||
case WatchDisplayType.FixedPoint_12_4:
|
||||
|
@ -459,7 +459,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchDisplayType.FixedPoint_20_12 => (int)(double.Parse(Text, NumberFormatInfo.InvariantInfo) * 4096.0),
|
||||
WatchDisplayType.FixedPoint_16_16 => (int)(double.Parse(Text, NumberFormatInfo.InvariantInfo) * 65536.0),
|
||||
WatchDisplayType.Float => (int)NumberExtensions.ReinterpretAsUInt32(float.Parse(Text, NumberFormatInfo.InvariantInfo)),
|
||||
_ => int.Parse(Text)
|
||||
_ => int.Parse(Text),
|
||||
};
|
||||
}
|
||||
catch
|
||||
|
@ -487,7 +487,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
WatchDisplayType.FixedPoint_20_12 => (i / 4096.0).ToString("F5", NumberFormatInfo.InvariantInfo),
|
||||
WatchDisplayType.FixedPoint_16_16 => (i / 65536.0).ToString("F5", NumberFormatInfo.InvariantInfo),
|
||||
WatchDisplayType.Float => NumberExtensions.ReinterpretAsF32((uint)i).ToString("F6", NumberFormatInfo.InvariantInfo),
|
||||
_ => i.ToString()
|
||||
_ => i.ToString(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace BizHawk.Common
|
|||
Protection.R => MemoryProtection.Read,
|
||||
Protection.RW => MemoryProtection.Read | MemoryProtection.Write,
|
||||
Protection.RX => MemoryProtection.Read | MemoryProtection.Execute,
|
||||
_ => throw new InvalidOperationException(nameof(prot))
|
||||
_ => throw new InvalidOperationException(nameof(prot)),
|
||||
};
|
||||
|
||||
public void Protect(ulong start, ulong size, Protection prot)
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace BizHawk.Common
|
|||
Protection.R => MemoryProtection.READONLY,
|
||||
Protection.RW => MemoryProtection.READWRITE,
|
||||
Protection.RX => MemoryProtection.EXECUTE_READ,
|
||||
_ => throw new InvalidOperationException(nameof(prot))
|
||||
_ => throw new InvalidOperationException(nameof(prot)),
|
||||
};
|
||||
|
||||
public void Dispose()
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace BizHawk.Common
|
|||
SeekOrigin.Begin => offset,
|
||||
SeekOrigin.Current => _pos + offset,
|
||||
SeekOrigin.End => _length + offset,
|
||||
_ => offset
|
||||
_ => offset,
|
||||
};
|
||||
|
||||
Position = newpos;
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace BizHawk.Common
|
|||
DistinctOS.Windows => new WindowsLLManager(),
|
||||
DistinctOS.BSD => new PosixLLManager(),
|
||||
DistinctOS.Unknown => throw new NotSupportedException("Cannot link libraries with Unknown OS"),
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
});
|
||||
|
||||
public static ILinkedLibManager LinkedLibManager => _LinkedLibManager.Value;
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Common
|
|||
RomStatus.Hack => "H",
|
||||
RomStatus.NotInDatabase => "U",
|
||||
RomStatus.Unknown => "U",
|
||||
_ => ""
|
||||
_ => string.Empty,
|
||||
});
|
||||
|
||||
sb
|
||||
|
@ -121,7 +121,7 @@ namespace BizHawk.Emulation.Common
|
|||
"D" => RomStatus.Homebrew,
|
||||
"H" => RomStatus.Hack,
|
||||
"U" => RomStatus.Unknown,
|
||||
_ => RomStatus.GoodDump
|
||||
_ => RomStatus.GoodDump,
|
||||
};
|
||||
_ = iter.MoveNext();
|
||||
var knownName = lineStr.Substring(iter.Current);
|
||||
|
|
|
@ -215,7 +215,7 @@ namespace BizHawk.Emulation.Common
|
|||
0x01 => 0x25,
|
||||
0x0A => 0x18,
|
||||
0x0B => 0x1B,
|
||||
_ => throw new InvalidOperationException($"Invalid crypto method {cryptoMethod:X2}")
|
||||
_ => throw new InvalidOperationException($"Invalid crypto method {cryptoMethod:X2}"),
|
||||
};
|
||||
|
||||
// We only need the program id if we're doing seed crypto
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Common
|
|||
{
|
||||
byte b => b,
|
||||
long l and >= byte.MinValue and <= byte.MaxValue => unchecked((byte) l),
|
||||
var o => throw new Exception($"Integer literal outside u8 range: {o}")
|
||||
var o => throw new Exception($"Integer literal outside u8 range: {o}"),
|
||||
});
|
||||
continue;
|
||||
case JsonToken.EndArray:
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Common
|
|||
LIMITED_2_PLAYS_LEFT => 2,
|
||||
LIMITED_1_PLAYS_LEFT => 1,
|
||||
LIMITED_0_PLAYS_LEFT => 0,
|
||||
_ => -1
|
||||
_ => -1,
|
||||
};
|
||||
|
||||
public byte Revision
|
||||
|
|
|
@ -560,7 +560,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
ino.BCDValue = entry.Point switch
|
||||
{
|
||||
0xA0 or 0xA1 or 0xA2 => (byte)entry.Point,
|
||||
_ => ino.BCDValue
|
||||
_ => ino.BCDValue,
|
||||
};
|
||||
|
||||
var q = new SubchannelQ
|
||||
|
@ -597,7 +597,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
SessionFormat.Type20_CDXA => CUE.CueTrackType.Mode2_2352,
|
||||
SessionFormat.Type10_CDI => CUE.CueTrackType.CDI_2352,
|
||||
SessionFormat.Type00_CDROM_CDDA => CUE.CueTrackType.Mode1_2352,
|
||||
_ => pregapTrackType
|
||||
_ => pregapTrackType,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -475,7 +475,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
0 => CueTrackType.Mode1_2352,
|
||||
1 => CueTrackType.CDI_2352,
|
||||
2 => CueTrackType.Mode2_2352,
|
||||
_ => cueTrackType
|
||||
_ => cueTrackType,
|
||||
};
|
||||
}
|
||||
disc._Sectors.Add(new SS_Gap
|
||||
|
@ -511,7 +511,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
2 => 2352,
|
||||
3 => 2368,
|
||||
4 => 2448,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
var curIndex = 0;
|
||||
var relMSF = -track.IndexSectorCounts[0];
|
||||
|
@ -540,7 +540,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
2 => new SS_2352(),
|
||||
3 => new SS_2364_DeinterleavedQ(),
|
||||
4 => new SS_2448_Interleaved(),
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
synth.Blob = cdiBlob;
|
||||
synth.BlobOffset = blobOffset;
|
||||
|
|
|
@ -702,7 +702,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
ino.BCDValue = entry.Point switch
|
||||
{
|
||||
0xA0 or 0xA1 or 0xA2 => (byte)entry.Point,
|
||||
_ => ino.BCDValue
|
||||
_ => ino.BCDValue,
|
||||
};
|
||||
|
||||
// get ADR & Control from ADR_Control byte
|
||||
|
@ -782,7 +782,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
SessionFormat.Type20_CDXA => CUE.CueTrackType.Mode2_2352,
|
||||
SessionFormat.Type10_CDI => CUE.CueTrackType.CDI_2352,
|
||||
SessionFormat.Type00_CDROM_CDDA => CUE.CueTrackType.Mode1_2352,
|
||||
_ => pregapTrackType
|
||||
_ => pregapTrackType,
|
||||
};
|
||||
}
|
||||
disc._Sectors.Add(new CUE.SS_Gap()
|
||||
|
@ -840,7 +840,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
SessionFormat.Type20_CDXA => CUE.CueTrackType.Mode2_2352,
|
||||
SessionFormat.Type10_CDI => CUE.CueTrackType.CDI_2352,
|
||||
SessionFormat.Type00_CDROM_CDDA => CUE.CueTrackType.Mode1_2352,
|
||||
_ => pregapTrackType
|
||||
_ => pregapTrackType,
|
||||
};
|
||||
}
|
||||
for (var pre = 0; pre < track.ExtraBlock.Pregap; pre++)
|
||||
|
@ -898,7 +898,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
2336 => new CUE.SS_Mode2_2336(),
|
||||
2352 => new CUE.SS_2352(),
|
||||
2448 => new CUE.SS_2448_Interleaved(),
|
||||
_ => throw new InvalidOperationException($"Not supported: Sector Size {track.SectorSize}, Track Mode {track.TrackMode}")
|
||||
_ => throw new InvalidOperationException($"Not supported: Sector Size {track.SectorSize}, Track Mode {track.TrackMode}"),
|
||||
};
|
||||
|
||||
sBase.Policy = IN_DiscMountPolicy;
|
||||
|
@ -923,7 +923,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
ino.BCDValue = track.Point switch
|
||||
{
|
||||
0xA0 or 0xA1 or 0xA2 => (byte)track.Point,
|
||||
_ => ino.BCDValue
|
||||
_ => ino.BCDValue,
|
||||
};
|
||||
|
||||
// get ADR & Control from ADR_Control byte
|
||||
|
|
|
@ -469,7 +469,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
"TINF" => 12,
|
||||
"ETNF" => 20,
|
||||
"ETN2" => 32,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
if (chunkSize % trackSize != 0)
|
||||
|
@ -985,7 +985,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
SessionFormat.Type00_CDROM_CDDA => CueTrackType.Mode1_2352,
|
||||
SessionFormat.Type10_CDI => CueTrackType.CDI_2352,
|
||||
SessionFormat.Type20_CDXA => CueTrackType.Mode2_2352,
|
||||
_ => cueTrackType
|
||||
_ => cueTrackType,
|
||||
};
|
||||
}
|
||||
disc._Sectors.Add(new SS_Gap
|
||||
|
@ -1004,7 +1004,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
0x03 => new SS_Mode2_2336(),
|
||||
0x05 or 0x06 or 0x07 => new SS_2352(),
|
||||
0x0F or 0x10 or 0x11 => new SS_2448_Interleaved(),
|
||||
_ => throw new InvalidOperationException($"Invalid mode {mode}")
|
||||
_ => throw new InvalidOperationException($"Invalid mode {mode}"),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace BizHawk.Emulation.DiscSystem
|
|||
SessionFormat.Type00_CDROM_CDDA => 0x00,
|
||||
SessionFormat.Type10_CDI => 0x10,
|
||||
SessionFormat.Type20_CDXA => 0x20,
|
||||
_ => throw new InvalidOperationException("Invalid SessionFormat")
|
||||
_ => throw new InvalidOperationException("Invalid SessionFormat"),
|
||||
};
|
||||
sq.ap_frame.DecimalValue = 0;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace BizHawk.Tests.Testroms.GB
|
|||
"cgb-acid-hell" => "res.cgb_acid_hell_artifact.reference.png",
|
||||
"cgb-acid2" => "res.cgb_acid2_artifact.reference.png",
|
||||
"dmg-acid2" => $"res.dmg_acid2_artifact.reference-{(Setup.Variant.IsColour() ? "cgb" : "dmg")}.png",
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
public readonly string RomEmbedPath => TestName switch
|
||||
|
@ -26,7 +26,7 @@ namespace BizHawk.Tests.Testroms.GB
|
|||
"cgb-acid-hell" => "res.cgb_acid_hell_artifact.cgb-acid-hell.gbc",
|
||||
"cgb-acid2" => "res.cgb_acid2_artifact.cgb-acid2.gbc",
|
||||
"dmg-acid2" => "res.dmg_acid2_artifact.dmg-acid2.gb",
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
public readonly CoreSetup Setup;
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace BizHawk.Tests.Testroms.GB
|
|||
ConsoleVariant.CGB_C => biosAvailable ? SameBoySyncSettings_GBC_C_USEBIOS : SameBoySyncSettings_GBC_C_NOBIOS,
|
||||
ConsoleVariant.CGB_D => biosAvailable ? SameBoySyncSettings_GBC_D_USEBIOS : SameBoySyncSettings_GBC_D_NOBIOS,
|
||||
ConsoleVariant.DMG or ConsoleVariant.DMG_B => biosAvailable ? SameBoySyncSettings_GB_USEBIOS : SameBoySyncSettings_GB_NOBIOS,
|
||||
_ => throw new InvalidOperationException()
|
||||
_ => throw new InvalidOperationException(),
|
||||
};
|
||||
|
||||
public static DummyFrontend.ClassInitCallbackDelegate InitGBCore(CoreSetup setup, string romFilename, byte[] rom)
|
||||
|
@ -196,7 +196,7 @@ namespace BizHawk.Tests.Testroms.GB
|
|||
Settings = SameBoySettings,
|
||||
SyncSettings = GetSameBoySyncSettings(setup.Variant, setup.UseBIOS),
|
||||
}),
|
||||
_ => throw new InvalidOperationException("unknown GB core")
|
||||
_ => throw new InvalidOperationException("unknown GB core"),
|
||||
};
|
||||
var biosWaitDuration = setup.UseBIOS || setup.CoreName is CoreNames.Sameboy
|
||||
? setup.Variant.IsColour()
|
||||
|
@ -215,7 +215,7 @@ namespace BizHawk.Tests.Testroms.GB
|
|||
{
|
||||
CoreNames.Gambatte => ImageUtils.PaletteSwap(img, setup.Variant.IsColour() ? UnVividGBCPaletteMap : UnVividGBPaletteMap),
|
||||
CoreNames.Sameboy => setup.Variant.IsColour() ? ImageUtils.PaletteSwap(img, UnVividGBCPaletteMap) : img,
|
||||
_ => img
|
||||
_ => img,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ namespace BizHawk.Tests.Testroms.GB
|
|||
GBHawk gbHawk => () => gbHawk.cpu.RegPC,
|
||||
Sameboy when testCase.Setup is { UseBIOS: false, Variant: ConsoleVariant.DMG or ConsoleVariant.DMG_B }
|
||||
=> () => (long) fe.CoreAsDebuggable!.GetCpuFlagsAndRegisters()["PC"].Value - 1, // something something pre- vs. post-increment
|
||||
_ => () => (long) fe.CoreAsDebuggable!.GetCpuFlagsAndRegisters()["PC"].Value
|
||||
_ => () => (long) fe.CoreAsDebuggable!.GetCpuFlagsAndRegisters()["PC"].Value,
|
||||
};
|
||||
var domain = fe.CoreAsMemDomains!.SystemBus;
|
||||
var finished = false;
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace BizHawk.Tests.Client.Common.cheats
|
|||
null => "null",
|
||||
int i => $"0x{i:X}",
|
||||
string s => $"\"{s}\"",
|
||||
_ => o.ToString()!
|
||||
_ => o.ToString()!,
|
||||
};
|
||||
return data is null ? null : $"{methodInfo.Name}({string.Join(", ", data.Select(Format))})";
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ namespace BizHawk.Tests.Client.Common.cheats
|
|||
{
|
||||
WatchSize.Byte => valid.Value & 0xFF,
|
||||
WatchSize.Word => valid.Value & 0xFFFF,
|
||||
_ => valid.Value
|
||||
_ => valid.Value,
|
||||
},
|
||||
"wrong value");
|
||||
Assert.AreEqual(compare, valid.Compare, "wrong compare");
|
||||
|
|
Loading…
Reference in New Issue