Skip to content

Commit

Permalink
Rerun dotnet format after manual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TiKevin83 committed Aug 20, 2023
1 parent c8c593a commit 046ff90
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 61 deletions.
8 changes: 4 additions & 4 deletions src/BizHawk.Client.Common/tools/Watch/Watch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static Watch GenerateWatch(MemoryDomain domain, long address, WatchSize s
/// <returns>True if both watch are equals; otherwise, false</returns>
public static bool operator ==(Watch a, Watch b)
{
if (ReferenceEquals(a, null) || ReferenceEquals(b, null))
if (a is null || b is null)
{
return false;
}
Expand All @@ -171,7 +171,7 @@ public static Watch GenerateWatch(MemoryDomain domain, long address, WatchSize s
/// <returns>True if they are equals; otherwise, false</returns>
public static bool operator ==(Watch a, Cheat b)
{
if (ReferenceEquals(a, null) || ReferenceEquals(b, null))
if (a is null || b is null)
{
return false;
}
Expand Down Expand Up @@ -325,7 +325,7 @@ public void ClearChangeCount()
/// <returns>True if both object are equals; otherwise, false</returns>
public bool Equals(Watch other)
{
if (ReferenceEquals(other, null))
if (other is null)
{
return false;
}
Expand All @@ -342,7 +342,7 @@ public bool Equals(Watch other)
/// <returns>True if both object are equals; otherwise, false</returns>
public bool Equals(Cheat other)
{
return !ReferenceEquals(other, null)
return other is not null
&& _domain == other.Domain
&& Address == other.Address
&& Size == other.Size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ private class WatchEqualityComparer : IEqualityComparer<Watch>
/// <returns>True if <see cref="Watch"/> are equal; otherwise, false</returns>
public bool Equals(Watch x, Watch y)
{
if (ReferenceEquals(x, null))
if (x is null)
{
return ReferenceEquals(y, null);
return y is null;
}

if (ReferenceEquals(y, null))
if (y is null)
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override int GetHashCode()

public static bool operator ==(Cell a, Cell b)
{
return a?.Equals(b) ?? ReferenceEquals(b, null);
return a?.Equals(b) ?? b is null;
}

public static bool operator !=(Cell a, Cell b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected ConsoleID SystemIdToConsoleId()
VSystemID.Raw.GB => ConsoleID.GB,
VSystemID.Raw.GBA => ConsoleID.GBA,
VSystemID.Raw.GBC => ConsoleID.GBC, // Not actually used
VSystemID.Raw.GBL when Emu is ILinkedGameBoyCommon { First: { IsCGBMode: true } } => ConsoleID.GBC,
VSystemID.Raw.GBL when Emu is ILinkedGameBoyCommon { First.IsCGBMode: true } => ConsoleID.GBC,
VSystemID.Raw.GBL => ConsoleID.GB, // actually can be a mix of GB and GBC
VSystemID.Raw.GEN when Emu is GPGX { IsMegaCD: true } => ConsoleID.SegaCD,
VSystemID.Raw.GEN when Emu is PicoDrive { Is32XActive: true } => ConsoleID.Sega32X,
Expand Down
6 changes: 2 additions & 4 deletions src/BizHawk.Common/EndiannessUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public static void MutatingByteSwap32(Span<byte> a)
fixed (byte* p = &a[0]) for (var i = 0; i < l; i += 4)
{
(p[i + 3], p[i]) = (p[i], p[i + 3]);
var b = p[i + 1];
p[i + 1] = p[i + 2];
p[i + 2] = b;
}
(p[i + 2], p[i + 1]) = (p[i + 1], p[i + 2]);
}
#else
Debug.Assert(a.Length % 4 == 0);
var ints = MemoryMarshal.Cast<byte, uint>(a);
Expand Down
4 changes: 1 addition & 3 deletions src/BizHawk.Emulation.Cores/CPUs/Z80A/Operations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,7 @@ public void ADDS_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)
public void EXCH_16_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)
{
(Regs[src_l], Regs[dest_l]) = (Regs[dest_l], Regs[src_l]);
var temp = Regs[dest_h];
Regs[dest_h] = Regs[src_h];
Regs[src_h] = temp;
(Regs[src_h], Regs[dest_h]) = (Regs[dest_h], Regs[src_h]);
}

public void SBC_16_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
*/
public partial class NECUPD765
{
/// <summary>
/// The current Z80 cycle
/// </summary>
private long CurrentCPUCycle
{
get
{
if (_machine == null)
return 0;
else
return _machine.CPU.TotalExecutedCycles;
}
}

/// <summary>
/// The last CPU cycle when the FDC accepted an IO read/write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,11 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
*/
public partial class NECUPD765
{
/// <summary>
/// The current Z80 cycle
/// </summary>
private long CurrentCPUCycle
{
get
{
if (_machine == null)
return 0;
else
return _machine.CPU.TotalExecutedCycles;
}
}

/// <summary>
/// The last CPU cycle when the FDC accepted an IO read/write
/// </summary>
private long LastCPUCycle;
/// <summary>
/// The last CPU cycle when the FDC accepted an IO read/write
/// </summary>
private long LastCPUCycle;

/// <summary>
/// The current delay figure (in Z80 t-states)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,7 @@ private struct CDLog_MapResults
}

private delegate CDLog_MapResults MapMemoryDelegate(ushort addr, bool write);
private readonly MapMemoryDelegate MapMemory;
#pragma warning restore CS0649
private ICodeDataLog CDL;

private void RunCDL(ushort address, CDLog_Flags flags)
{
if (MapMemory != null)
{
CDLog_MapResults results = MapMemory(address, false);
switch (results.Type)
{
case CDLog_AddrType.None: break;
case CDLog_AddrType.RAM: CDL["RAM"][results.Address] |= (byte)flags; break;
case CDLog_AddrType.ROM: CDL["ROM"][results.Address] |= (byte)flags; break;
}
}
}
}
}

0 comments on commit 046ff90

Please sign in to comment.