OCD: Fix non-critial compiler warnings in my code

This commit is contained in:
Asnivor 2019-01-25 15:45:15 +00:00
parent 766de68e18
commit 76070cd89d
21 changed files with 65 additions and 59 deletions

View File

@ -10,8 +10,6 @@ namespace BizHawk.Client.EmuHawk
{
public partial class AmstradCPCPokeMemory : Form
{
private AmstradCPC.AmstradCPCSettings _settings;
public AmstradCPCPokeMemory()
{
InitializeComponent();

View File

@ -10,8 +10,6 @@ namespace BizHawk.Client.EmuHawk
{
public partial class ZXSpectrumPokeMemory : Form
{
private ZXSpectrum.ZXSpectrumSettings _settings;
public ZXSpectrumPokeMemory()
{
InitializeComponent();

View File

@ -238,7 +238,6 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
// output the data splitting and tabbing as neccessary
var arr = d.Value.Split(' ');
int cnt = 0;
List<string> builder = new List<string>();
string working = "";

View File

@ -394,6 +394,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
sectorSize = 0x80 << ActiveCommandParams.SectorSize;
}
var mtc = maxTransferCap;
// get the current track
var track = ActiveDrive.Disk.DiskTracks.Where(a => a.TrackNumber == ActiveDrive.CurrentTrackID).FirstOrDefault();
@ -655,6 +657,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
int buffPos = 0;
int sectorSize = 0;
int maxTransferCap = 0;
if (maxTransferCap > 0) { }
// calculate requested size of data required
if (ActiveCommandParams.SectorSize == 0)
@ -967,6 +970,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
int buffPos = 0;
int sectorSize = 0;
int maxTransferCap = 0;
if (maxTransferCap > 0) { }
// calculate requested size of data required
if (ActiveCommandParams.SectorSize == 0)
@ -1031,7 +1035,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
break;
}
FloppyDisk.Sector sector = null;
//FloppyDisk.Sector sector = null;
ActiveDrive.SectorIndex = 0;
int secCount = 0;
@ -1371,7 +1375,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
// get the first sector
var track = ActiveDrive.Disk.DiskTracks[ActiveCommandParams.Cylinder];
int secIndex = 0;
//int secIndex = 0;
for (int s = 0; s < track.Sectors.Length; s++)
{
if (track.Sectors[s].SectorID == endSecID)
@ -1422,7 +1426,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
byte endSecID = ActiveCommandParams.EOT;
bool lastSec = false;
var track = ActiveDrive.Disk.DiskTracks[ActiveCommandParams.Cylinder];
int secIndex = 0;
//int secIndex = 0;
for (int s = 0; s < track.Sectors.Length; s++)
{
@ -1664,7 +1668,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
// get the first sector
var track = ActiveDrive.Disk.DiskTracks[ActiveCommandParams.Cylinder];
int secIndex = 0;
//int secIndex = 0;
for (int s = 0; s < track.Sectors.Length; s++)
{
if (track.Sectors[s].SectorID == endSecID)
@ -1715,7 +1719,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
byte endSecID = ActiveCommandParams.EOT;
bool lastSec = false;
var track = ActiveDrive.Disk.DiskTracks[ActiveCommandParams.Cylinder];
int secIndex = 0;
//int secIndex = 0;
for (int s = 0; s < track.Sectors.Length; s++)
{
@ -2397,18 +2401,12 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
break;
}
//if (!CheckTiming())
//{
// UnSetBit(MSR_EXM, ref StatusMain);
//}
return StatusMain;
}
private int testCount = 0;
/// <summary>
/// Handles CPU reading from the data register
/// </summary>
/// <returns></returns>
private byte ReadDataRegister()
{
// default return value

View File

@ -1103,7 +1103,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
ScreenLines.Clear();
return ScreenBuffer;
/*
switch (borderType)
{
// crop to 768x272 (544)
@ -1139,18 +1139,19 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
}
return croppedBuffer;
*/
/*
var slWidth = BufferWidth;
return ScreenBuffer;
var slWidth = BufferWidth;
return ScreenBuffer;
break;
break;
}
return ScreenBuffer;
}
}
*/
//return ScreenBuffer;
}
public void SetupScreenSize()
public void SetupScreenSize()
{
SysBufferWidth = 800;
SysBufferHeight = 600;

View File

@ -28,8 +28,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private short[] _audioBuffer;
private int _audioBufferIndex;
private int _lastStateRendered;
private int _clockCyclesPerFrame;
private int _cyclesPerSample;
//private int _clockCyclesPerFrame;
//private int _cyclesPerSample;
#endregion

View File

@ -216,14 +216,14 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
private int CurrentPen;
private int ScreenMode;
private int INTScanlineCnt;
private int VSYNCDelyCnt;
//private int VSYNCDelyCnt;
private int[][] Lookup = new int[4][];
private bool DoModeUpdate;
//private bool DoModeUpdate;
private int LatchedMode;
private int buffPos;
//private int LatchedMode;
//private int buffPos;
public bool FrameEnd;
@ -387,7 +387,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
for (int i = 0; i < 17; i++)
PenColours[i] = 0;
INTScanlineCnt = 0;
VSYNCDelyCnt = 0;
//VSYNCDelyCnt = 0;
}
#endregion

View File

@ -77,7 +77,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
tb.PauseInMS = db.PauseInMS;
double multiplier = (double)4 / (double)3.5;
double cycleScale = ((40 << 16) / 35);
//double cycleScale = ((40 << 16) / 35);
double origPeriods = db.DataPeriods.Count();
for (int i = 0; i < origPeriods; i++)
@ -1372,7 +1372,8 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
// get text length
int strLen = data[_position++];
string title = "Info: ";
string title = string.Empty;
title = "Info: ";
switch (type)
{

View File

@ -51,6 +51,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
set { _blockData = value; }
}
/*
/// <summary>
/// An array of bytearray encoded strings (stored in this format for easy Bizhawk serialization)
/// Its basically tape information
@ -74,6 +75,7 @@ namespace BizHawk.Emulation.Cores.Computers.AmstradCPC
return data;
}
}
*/
#region Block Meta Data

View File

@ -362,6 +362,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
// calculate maximum transfer capacity
if (!CMD_FLAG_MF)
maxTransferCap = 3328;
if (maxTransferCap == 0) { }
}
else
{
@ -655,6 +657,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
int buffPos = 0;
int sectorSize = 0;
int maxTransferCap = 0;
if (maxTransferCap > 0) { }
// calculate requested size of data required
if (ActiveCommandParams.SectorSize == 0)
@ -967,6 +970,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
int buffPos = 0;
int sectorSize = 0;
int maxTransferCap = 0;
if (maxTransferCap > 0) { }
// calculate requested size of data required
if (ActiveCommandParams.SectorSize == 0)
@ -1031,7 +1035,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
break;
}
FloppyDisk.Sector sector = null;
//FloppyDisk.Sector sector = null;
ActiveDrive.SectorIndex = 0;
int secCount = 0;
@ -1371,7 +1375,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
// get the first sector
var track = ActiveDrive.Disk.DiskTracks[ActiveCommandParams.Cylinder];
int secIndex = 0;
//int secIndex = 0;
for (int s = 0; s < track.Sectors.Length; s++)
{
if (track.Sectors[s].SectorID == endSecID)
@ -1422,7 +1426,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
byte endSecID = ActiveCommandParams.EOT;
bool lastSec = false;
var track = ActiveDrive.Disk.DiskTracks[ActiveCommandParams.Cylinder];
int secIndex = 0;
//int secIndex = 0;
for (int s = 0; s < track.Sectors.Length; s++)
{
@ -1664,7 +1668,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
// get the first sector
var track = ActiveDrive.Disk.DiskTracks[ActiveCommandParams.Cylinder];
int secIndex = 0;
//int secIndex = 0;
for (int s = 0; s < track.Sectors.Length; s++)
{
if (track.Sectors[s].SectorID == endSecID)
@ -1715,7 +1719,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
byte endSecID = ActiveCommandParams.EOT;
bool lastSec = false;
var track = ActiveDrive.Disk.DiskTracks[ActiveCommandParams.Cylinder];
int secIndex = 0;
//int secIndex = 0;
for (int s = 0; s < track.Sectors.Length; s++)
{
@ -2404,7 +2408,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
return StatusMain;
}
private int testCount = 0;
//private int testCount = 0;
/// <summary>
/// Handles CPU reading from the data register
/// </summary>

View File

@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// </summary>
public class CursorJoystick : IJoystick
{
private int _joyLine;
//private int _joyLine;
private SpectrumBase _machine;
#region Construction
@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public CursorJoystick(SpectrumBase machine, int playerNumber)
{
_machine = machine;
_joyLine = 0;
//_joyLine = 0;
_playerNumber = playerNumber;
ButtonCollection = new List<string>

View File

@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// </summary>
public class SinclairJoystick1 : IJoystick
{
private int _joyLine;
//private int _joyLine;
private SpectrumBase _machine;
#region Construction
@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public SinclairJoystick1(SpectrumBase machine, int playerNumber)
{
_machine = machine;
_joyLine = 0;
//_joyLine = 0;
_playerNumber = playerNumber;
ButtonCollection = new List<string>

View File

@ -9,7 +9,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// </summary>
public class SinclairJoystick2 : IJoystick
{
private int _joyLine;
//private int _joyLine;
private SpectrumBase _machine;
#region Construction
@ -17,7 +17,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public SinclairJoystick2(SpectrumBase machine, int playerNumber)
{
_machine = machine;
_joyLine = 0;
//_joyLine = 0;
_playerNumber = playerNumber;
ButtonCollection = new List<string>

View File

@ -59,7 +59,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
}
catch (Exception ex)
{
var e = ex.ToString();
}
}

View File

@ -141,9 +141,9 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
s1Pos += blockSize;
}
}
catch (Exception ex)
catch (Exception)
{
}

View File

@ -335,7 +335,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
}
// add block pause
int actualPause = PAUSE_MS * 1000;
//int actualPause = PAUSE_MS * 1000;
//dataPeriods.Add(actualPause);
// default pause for tap files

View File

@ -1312,9 +1312,10 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
// get text length
int strLen = data[_position++];
string title = "Info: ";
string title = String.Empty;
title = "Info: ";
switch (type)
switch (type)
{
case 0x00:
title = "Full Title: ";

View File

@ -51,6 +51,8 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
set { _blockData = value; }
}
/*
/// <summary>
/// An array of bytearray encoded strings (stored in this format for easy Bizhawk serialization)
/// Its basically tape information
@ -74,6 +76,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
return data;
}
}
*/
#region Block Meta Data

View File

@ -37,7 +37,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
/// <summary>
/// Position counter
/// </summary>
private int _position = 0;
//private int _position = 0;
#region Construction
@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
"This is not a valid WAV format file");
}
_position = 0;
//_position = 0;
MemoryStream stream = new MemoryStream();
stream.Write(data, 0, data.Length);

View File

@ -390,7 +390,7 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
// output the data splitting and tabbing as neccessary
var arr = d.Value.Split(' ');
int cnt = 0;
//int cnt = 0;
List<string> builder = new List<string>();
string working = "";

View File

@ -840,7 +840,7 @@ namespace BizHawk.Emulation.DiscSystem
currBlobIndex++;
mdfBlob = disc.DisposableResources[currBlobIndex] as Disc.Blob_RawFile;
int userSector = 2048;
//int userSector = 2048;
switch (track.SectorSize)
{
case 2448:
@ -848,7 +848,7 @@ namespace BizHawk.Emulation.DiscSystem
{
Policy = IN_DiscMountPolicy
};
userSector = 2352;
//userSector = 2352;
break;
case 2048:
default:
@ -856,7 +856,7 @@ namespace BizHawk.Emulation.DiscSystem
{
Policy = IN_DiscMountPolicy
};
userSector = 2048;
//userSector = 2048;
break;
//throw new Exception("Not supported: Sector Size " + track.SectorSize);