From 651c79abeb987424f8cf2625aee0c41ebcadbdde Mon Sep 17 00:00:00 2001 From: James Groom Date: Wed, 27 Mar 2024 02:21:50 +0000 Subject: [PATCH] Fix typos from `&&`/`||` refactoring fixes 5685befe1 --- .../AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs | 4 ++-- .../Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs | 2 +- .../SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs | 4 ++-- .../Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs | 2 +- .../Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs index ec963a3d1b..cf6acdcb39 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Datacorder/DatacorderDevice.cs @@ -222,8 +222,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // sign that the tape is no longer playing _tapeIsPlaying = false; - if (_currentDataBlockIndex >= 0 && // we are at datablock 1 or above //TODO 1-indexed then? --yoshi - _position >= _dataBlocks[_currentDataBlockIndex].DataPeriods.Count - 1) // the block is still playing back + if (_currentDataBlockIndex >= 0 // we are at datablock 1 or above //TODO 1-indexed then? --yoshi + && _position >= _dataBlocks[_currentDataBlockIndex].DataPeriods.Count - 1) // the block is still playing back { // move to the next block _currentDataBlockIndex++; diff --git a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs index 0ea40fc55e..18f07af11a 100644 --- a/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs +++ b/src/BizHawk.Emulation.Cores/Computers/AmstradCPC/Hardware/Disk/NECUPD765.FDD.cs @@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC // or the index hole being passed twice while (iHole <= 2) { - var next = trk.Sectors[index]; + var next = trk.Sectors[index]; // does the requested sector match the current sector if (next.SectorIDInfo.C == ActiveCommandParams.Cylinder && next.SectorIDInfo.H == ActiveCommandParams.Head diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs index 40d64cd53f..e4b7dd6f7e 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Datacorder/DatacorderDevice.cs @@ -200,7 +200,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum _waitEdge = 0; _position = 0; - if (_currentDataBlockIndex < 0 && _dataBlocks.Count > 0) + if (_currentDataBlockIndex < 0 && _dataBlocks.Count > 0) //TODO deleted a comment that said "block index is -1", but code is clearly "is negative"--are lower values not reachable? --yoshi { // move the index on to 0 _currentDataBlockIndex = 0; @@ -814,7 +814,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum return; // don't autostop if there is only 1 block - if (DataBlocks.Count == 1 + if (DataBlocks.Count is 1 || _dataBlocks[_currentDataBlockIndex].BlockDescription is BlockType.CSW_Recording or BlockType.WAV_Recording) { return; diff --git a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs index ba7a587167..61fee86bb6 100644 --- a/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs +++ b/src/BizHawk.Emulation.Cores/Computers/SinclairSpectrum/Hardware/Disk/NECUPD765.FDD.cs @@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum // or the index hole being passed twice while (iHole <= 2) { - var next = trk.Sectors[index]; + var next = trk.Sectors[index]; // does the requested sector match the current sector if (next.SectorIDInfo.C == ActiveCommandParams.Cylinder && next.SectorIDInfo.H == ActiveCommandParams.Head diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs index 4969dd93fa..404e8277e4 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/SNES/LibsnesCore.IMemoryDomains.cs @@ -204,7 +204,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES case LibsnesApi.SNES_MAPPER.BSXROM: if (bank is (>= 0x40 and <= 0x7F) or >= 0xC0 || (low >= 0x8000 && bank is (>= 0x00 and <= 0x3F) or (>= 0x80 and <= 0xBF)) - || (low >= 0x6000 and <= 0x7FFF && bank is >= 0x20 and <= 0x3F)) + || (low is >= 0x6000 and <= 0x7FFF && bank is >= 0x20 and <= 0x3F)) { return Api.QUERY_peek(LibsnesApi.SNES_MEMORY.SYSBUS, (uint)addr); }