Enable SA1400 and fix noncompliance (except in Cores)

"Access modifier should be declared"
This commit is contained in:
YoshiRulz 2020-09-08 21:39:21 +10:00
parent 4bf50e6e51
commit 5488c80f4d
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
49 changed files with 215 additions and 211 deletions

View File

@ -454,9 +454,6 @@
<!-- Statement should not use unnecessary parenthesis -->
<Rule Id="SA1119" Action="Hidden" />
<!-- Access modifier should be declared -->
<Rule Id="SA1400" Action="Hidden" />
<!-- Fields should be private -->
<Rule Id="SA1401" Action="Hidden" />

View File

@ -100,7 +100,7 @@ namespace BizHawk.BizInvoke
public IntPtr GetProcAddrOrThrow(string entryPoint) => EntryPoints.TryGetValue(entryPoint, out var ret) ? ret : throw new InvalidOperationException($"could not find {entryPoint} in exports");
}
static readonly Dictionary<Type, DelegateStorage> Impls = new Dictionary<Type, DelegateStorage>();
private static readonly Dictionary<Type, DelegateStorage> Impls = new Dictionary<Type, DelegateStorage>();
public static IImportResolver GetExvoker(object o, ICallingConventionAdapter a)

View File

@ -48,7 +48,7 @@ namespace BizHawk.Bizware.BizwareGL
return LoadArtInternal(new BitmapBuffer(path, new BitmapLoadOptions()));
}
Art LoadArtInternal(BitmapBuffer tex)
private Art LoadArtInternal(BitmapBuffer tex)
{
AssertIsOpen(true);
@ -150,16 +150,16 @@ namespace BizHawk.Bizware.BizwareGL
/// <summary>
/// This is used to remember the original bitmap sources for art files. Once the ArtManager is closed forever, this will be purged
/// </summary>
readonly Dictionary<Art, BitmapBuffer> ArtLooseTextureAssociation = new Dictionary<Art, BitmapBuffer>();
private readonly Dictionary<Art, BitmapBuffer> ArtLooseTextureAssociation = new Dictionary<Art, BitmapBuffer>();
/// <summary>
/// Physical texture resources, which exist after this ArtManager has been closed
/// </summary>
readonly List<Texture2d> ManagedTextures = new List<Texture2d>();
private readonly List<Texture2d> ManagedTextures = new List<Texture2d>();
/// <summary>
/// All the Arts managed by this instance
/// </summary>
readonly List<Art> ManagedArts = new List<Art>();
private readonly List<Art> ManagedArts = new List<Art>();
}
}

View File

@ -288,7 +288,7 @@ namespace BizHawk.Bizware.BizwareGL
HasAlpha = false;
}
void LoadInternal(Stream stream, Bitmap bitmap, BitmapLoadOptions options)
private void LoadInternal(Stream stream, Bitmap bitmap, BitmapLoadOptions options)
{
bool cleanup = options.CleanupAlpha0;
bool needsPad = true;
@ -475,7 +475,7 @@ namespace BizHawk.Bizware.BizwareGL
}
}
void InitSize(int width, int height)
private void InitSize(int width, int height)
{
Pixels = new int[width * height];
Width = width;

View File

@ -17,7 +17,7 @@ namespace BizHawk.Bizware.BizwareGL
Owner = gl;
}
readonly OpenTK.Graphics.Color4[] CornerColors =
private readonly OpenTK.Graphics.Color4[] CornerColors =
{
new OpenTK.Graphics.Color4(1.0f,1.0f,1.0f,1.0f),
new OpenTK.Graphics.Color4(1.0f,1.0f,1.0f,1.0f),
@ -57,7 +57,7 @@ namespace BizHawk.Bizware.BizwareGL
SetModulateColor(sd.Color.White);
}
ImageAttributes CurrentImageAttributes;
private ImageAttributes CurrentImageAttributes;
public void SetModulateColor(sd.Color color)
{
//white is really no color at all
@ -86,15 +86,15 @@ namespace BizHawk.Bizware.BizwareGL
CurrentImageAttributes.SetColorMatrix(colorMatrix,ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
}
sd.Color CurrentModulateColor = sd.Color.White;
private sd.Color CurrentModulateColor = sd.Color.White;
IBlendState CurrentBlendState;
private IBlendState CurrentBlendState;
public void SetBlendState(IBlendState rsBlend)
{
CurrentBlendState = rsBlend;
}
MatrixStack _Projection, _Modelview;
private MatrixStack _Projection, _Modelview;
public MatrixStack Projection
{
get => _Projection;
@ -194,7 +194,7 @@ namespace BizHawk.Bizware.BizwareGL
DrawInternal(art, x, y, width, height);
}
void PrepDraw(sd.Graphics g, Texture2d tex)
private void PrepDraw(sd.Graphics g, Texture2d tex)
{
var tw = tex.Opaque as GDIPTextureWrapper;
//TODO - we can support bicubic for the final presentation..
@ -237,17 +237,17 @@ namespace BizHawk.Bizware.BizwareGL
g.Transform = new sd.Drawing2D.Matrix(mat.M11, mat.M12, mat.M21, mat.M22, mat.M41, mat.M42);
}
unsafe void DrawInternal(Art art, float x, float y, float w, float h)
private unsafe void DrawInternal(Art art, float x, float y, float w, float h)
{
DrawInternal(art.BaseTexture, x, y, w, h, art.u0, art.v0, art.u1, art.v1);
}
unsafe void DrawInternal(Texture2d tex, float x, float y, float w, float h)
private unsafe void DrawInternal(Texture2d tex, float x, float y, float w, float h)
{
DrawInternal(tex, x, y, w, h, 0, 0, 1, 1);
}
unsafe void DrawInternal(Texture2d tex, float x, float y, float w, float h, float u0, float v0, float u1, float v1)
private unsafe void DrawInternal(Texture2d tex, float x, float y, float w, float h, float u0, float v0, float u1, float v1)
{
var g = ((dynamic) Gdi).GetCurrentGraphics() as sd.Graphics;
PrepDraw(g, tex);
@ -273,7 +273,7 @@ namespace BizHawk.Bizware.BizwareGL
g.Transform = new sd.Drawing2D.Matrix(); //.Reset() doesn't work ? ?
}
unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
private unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
{
}

View File

@ -50,7 +50,7 @@ namespace BizHawk.Bizware.BizwareGL
CurrPipeline = DefaultPipeline = Owner.CreatePipeline(VertexLayout, vs, ps, true, "xgui");
}
readonly OpenTK.Graphics.Color4[] CornerColors = new OpenTK.Graphics.Color4[4] {
private readonly OpenTK.Graphics.Color4[] CornerColors = new OpenTK.Graphics.Color4[4] {
new OpenTK.Graphics.Color4(1.0f,1.0f,1.0f,1.0f),new OpenTK.Graphics.Color4(1.0f,1.0f,1.0f,1.0f),new OpenTK.Graphics.Color4(1.0f,1.0f,1.0f,1.0f),new OpenTK.Graphics.Color4(1.0f,1.0f,1.0f,1.0f)
};
@ -114,7 +114,7 @@ namespace BizHawk.Bizware.BizwareGL
Owner.SetBlendState(rsBlend);
}
MatrixStack _Projection, _Modelview;
private MatrixStack _Projection, _Modelview;
public MatrixStack Projection
{
get => _Projection;
@ -221,7 +221,7 @@ namespace BizHawk.Bizware.BizwareGL
DrawInternal(art, x, y, width, height);
}
unsafe void DrawInternal(Texture2d tex, float x, float y, float w, float h)
private unsafe void DrawInternal(Texture2d tex, float x, float y, float w, float h)
{
Art art = new Art((ArtManager)null);
art.Width = w;
@ -232,7 +232,7 @@ namespace BizHawk.Bizware.BizwareGL
DrawInternal(art, x, y, w, h, false, tex.IsUpsideDown);
}
unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
private unsafe void DrawInternal(Art art, float x, float y, float w, float h, bool fx, bool fy)
{
//TEST: d3d shouldn't ever use this, it was a gl hack. maybe we can handle it some other way in gl (fix the projection? take a render-to-texture arg to the gui view transforms?)
fy = false;
@ -261,7 +261,7 @@ namespace BizHawk.Bizware.BizwareGL
}
}
unsafe void PrepDrawSubrectInternal(Texture2d tex)
private unsafe void PrepDrawSubrectInternal(Texture2d tex)
{
if (sTexture != tex)
{
@ -289,7 +289,7 @@ namespace BizHawk.Bizware.BizwareGL
}
}
unsafe void EmitRectangleInternal(float x, float y, float w, float h, float u0, float v0, float u1, float v1)
private unsafe void EmitRectangleInternal(float x, float y, float w, float h, float u0, float v0, float u1, float v1)
{
float* pData = stackalloc float[32];
pData[0] = x;
@ -333,7 +333,7 @@ namespace BizHawk.Bizware.BizwareGL
#endif
}
unsafe void DrawSubrectInternal(Texture2d tex, float x, float y, float w, float h, float u0, float v0, float u1, float v1)
private unsafe void DrawSubrectInternal(Texture2d tex, float x, float y, float w, float h, float u0, float v0, float u1, float v1)
{
PrepDrawSubrectInternal(tex);
EmitRectangleInternal(x, y, w, h, u0, v0, u1, v1);
@ -342,14 +342,14 @@ namespace BizHawk.Bizware.BizwareGL
public bool IsActive { get; private set; }
public IGL Owner { get; }
readonly VertexLayout VertexLayout;
Pipeline CurrPipeline;
readonly Pipeline DefaultPipeline;
private readonly VertexLayout VertexLayout;
private Pipeline CurrPipeline;
private readonly Pipeline DefaultPipeline;
//state cache
Texture2d sTexture;
private Texture2d sTexture;
#if DEBUG
bool BlendStateSet;
private bool BlendStateSet;
#endif
//shaders are hand-coded for each platform to make sure they stay as fast as possible

View File

@ -29,7 +29,7 @@ namespace BizHawk.Bizware.BizwareGL
public bool IsDirty;
readonly Stack<Matrix4> stack = new Stack<Matrix4>();
private readonly Stack<Matrix4> stack = new Stack<Matrix4>();
/// <summary>
/// This is made public for performance reasons, to avoid lame copies of the matrix when necessary. Don't mess it up!

View File

@ -38,14 +38,14 @@ namespace BizHawk.Bizware.BizwareGL
/// Allows us to create PipelineUniforms on the fly, in case a non-existing one has been requested.
/// Shader compilers will optimize out unused uniforms, and we wont have a record of it in the uniforms population loop
/// </summary>
class SpecialWorkingDictionary : Dictionary<string, PipelineUniform>
private class SpecialWorkingDictionary : Dictionary<string, PipelineUniform>
{
public SpecialWorkingDictionary(Pipeline owner)
{
Owner = owner;
}
Pipeline Owner;
private Pipeline Owner;
public new PipelineUniform this[string key]
{
get
@ -63,8 +63,8 @@ namespace BizHawk.Bizware.BizwareGL
}
}
readonly SpecialWorkingDictionary UniformsDictionary;
IDictionary<string, PipelineUniform> Uniforms => UniformsDictionary;
private readonly SpecialWorkingDictionary UniformsDictionary;
private IDictionary<string, PipelineUniform> Uniforms => UniformsDictionary;
public IEnumerable<PipelineUniform> GetUniforms() => Uniforms.Values;

View File

@ -24,7 +24,7 @@ namespace BizHawk.Bizware.BizwareGL
}
public IEnumerable<UniformInfo> UniformInfos => _UniformInfos;
readonly List<UniformInfo> _UniformInfos = new List<UniformInfo>();
private readonly List<UniformInfo> _UniformInfos = new List<UniformInfo>();
/// <returns>the first and only <see cref="UniformInfo"/></returns>
/// <exception cref="InvalidOperationException">more than one <see cref="UniformInfo"/> exists</exception>

View File

@ -133,7 +133,7 @@ namespace BizHawk.Bizware.BizwareGL
public IGL Owner { get; }
readonly VertexLayout VertexLayout;
private readonly VertexLayout VertexLayout;
public Pipeline Pipeline;
}
}

View File

@ -20,7 +20,7 @@ namespace BizHawk.Bizware.BizwareGL
public bool Available { get; private set; }
public string Errors { get; set; }
int RefCount;
private int RefCount;
public void Release()
{

View File

@ -210,7 +210,7 @@ namespace BizHawk.Bizware.BizwareGL
}
/// <summary>Computes the ratio of used surface area.</summary>
float Occupancy()
private float Occupancy()
{
int totalSurfaceArea = binWidth * binHeight;
int usedSurfaceArea = UsedSurfaceArea(root);

View File

@ -24,7 +24,7 @@ namespace BizHawk.Bizware.BizwareGL
public object Opaque { get; }
public IGL Owner { get; }
int RefCount;
private int RefCount;
public void Release()
{
@ -78,7 +78,7 @@ namespace BizHawk.Bizware.BizwareGL
}
public MyDictionary Items { get; }
bool Closed = false;
private bool Closed = false;
}
}

View File

@ -18,7 +18,7 @@ using BizHawk.Emulation.DiscSystem;
namespace BizHawk.Client.DiscoHawk
{
static class Program
internal static class Program
{
static Program()
{
@ -39,7 +39,7 @@ namespace BizHawk.Client.DiscoHawk
}
[STAThread]
static void Main(string[] args)
private static void Main(string[] args)
{
SubMain(args);
}
@ -58,7 +58,7 @@ namespace BizHawk.Client.DiscoHawk
public static extern bool FreeLibrary(IntPtr hModule);
}
static void SubMain(string[] args)
private static void SubMain(string[] args)
{
// MICROSOFT BROKE DRAG AND DROP IN WINDOWS 7. IT DOESN'T WORK ANYMORE
// WELL, OBVIOUSLY IT DOES SOMETIMES. I DON'T REMEMBER THE DETAILS OR WHY WE HAD TO DO THIS SHIT
@ -114,16 +114,17 @@ namespace BizHawk.Client.DiscoHawk
//declared here instead of a more usual place to avoid dependencies on the more usual place
#if WINDOWS
[DllImport("kernel32.dll", SetLastError = true)]
static extern bool SetDllDirectory(string lpPathName);
private static extern bool SetDllDirectory(string lpPathName);
[DllImport("kernel32.dll", EntryPoint = "DeleteFileW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern bool DeleteFileW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName);
static void RemoveMOTW(string path)
private static extern bool DeleteFileW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName);
private static void RemoveMOTW(string path)
{
DeleteFileW($"{path}:Zone.Identifier");
}
static void WhackAllMOTW(string dllDir)
private static void WhackAllMOTW(string dllDir)
{
var todo = new Queue<DirectoryInfo>(new[] { new DirectoryInfo(dllDir) });
while (todo.Count > 0)

View File

@ -68,8 +68,8 @@ namespace BizHawk.Client.EmuHawk
// thread communication
// synchronized queue with custom messages
// it seems like there are 99999 ways to do everything in C#, so i'm sure this is not the best
System.Collections.Concurrent.BlockingCollection<object> threadQ;
System.Threading.Thread workerT;
private System.Collections.Concurrent.BlockingCollection<object> threadQ;
private System.Threading.Thread workerT;
private void threadproc()
{
@ -562,7 +562,7 @@ namespace BizHawk.Client.EmuHawk
{
}
unsafe class AviWriterSegment : IDisposable
private unsafe class AviWriterSegment : IDisposable
{
static AviWriterSegment()
{
@ -627,7 +627,7 @@ namespace BizHawk.Client.EmuHawk
private static bool FAILED(int hr) => hr < 0;
static unsafe int AVISaveOptions(IntPtr stream, ref AVIWriterImports.AVICOMPRESSOPTIONS opts, IntPtr owner)
private static unsafe int AVISaveOptions(IntPtr stream, ref AVIWriterImports.AVICOMPRESSOPTIONS opts, IntPtr owner)
{
fixed (AVIWriterImports.AVICOMPRESSOPTIONS* _popts = &opts)
{
@ -638,7 +638,7 @@ namespace BizHawk.Client.EmuHawk
}
}
Parameters parameters;
private Parameters parameters;
/// <exception cref="InvalidOperationException">unmanaged call failed</exception>
public void OpenFile(string destPath, Parameters parameters, CodecToken videoCodecToken)
@ -861,7 +861,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void FlushBufferedAudio()
private unsafe void FlushBufferedAudio()
{
int todo = outStatus.audio_buffered_shorts;
int todo_realsamples = todo / 2;

View File

@ -23,17 +23,17 @@ namespace BizHawk.Client.EmuHawk
if (OSTailoredCode.IsUnixHost) textBox1.Text = string.Join("\n", textBox1.Text.Split('\n').Take(3)) + $"\n\n(Linux user: Create a symlink with the below filename pointing to the ffmpeg binary with version {FFmpegService.Version}.)";
}
int pct = 0;
bool exiting = false;
bool succeeded = false;
bool failed = false;
private int pct = 0;
private bool exiting = false;
private bool succeeded = false;
private bool failed = false;
void ThreadProc()
private void ThreadProc()
{
Download();
}
void Download()
private void Download()
{
//the temp file is owned by this thread
var fn = TempFileManager.GetTempFilename("ffmpeg_download", ".7z", false);

View File

@ -141,12 +141,12 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// precooked gif header
/// </summary>
static byte[] GifAnimation = { 33, 255, 11, 78, 69, 84, 83, 67, 65, 80, 69, 50, 46, 48, 3, 1, 0, 0, 0 };
private static byte[] GifAnimation = { 33, 255, 11, 78, 69, 84, 83, 67, 65, 80, 69, 50, 46, 48, 3, 1, 0, 0, 0 };
/// <summary>
/// little endian frame length in 10ms units
/// </summary>
byte[] Delay = {100, 0};
private byte[] Delay = {100, 0};
public void AddFrame(IVideoProvider source)
{

View File

@ -107,7 +107,7 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// variable length value, unsigned
/// </summary>
static void WriteVarU(int v, Stream stream)
private static void WriteVarU(int v, Stream stream)
{
if (v < 0)
{
@ -141,7 +141,7 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// arbitrary sequence of bytes with length prepended
/// </summary>
static void WriteBytes(byte[] b, Stream stream)
private static void WriteBytes(byte[] b, Stream stream)
{
WriteVarU(b.Length, stream);
stream.Write(b, 0, b.Length);
@ -338,7 +338,7 @@ namespace BizHawk.Client.EmuHawk
// audio packets waiting to be written
private readonly Queue<NutFrame> _audioQueue;
readonly ReusableBufferPool<byte> _bufferPool = new ReusableBufferPool<byte>(12);
private readonly ReusableBufferPool<byte> _bufferPool = new ReusableBufferPool<byte>(12);
/// <summary>
/// write out the main header

View File

@ -106,7 +106,7 @@ namespace BizHawk.Client.EmuHawk
// ReSharper disable once UnusedAutoPropertyAccessor.Local
[RequiredService]
IEmulator Emulator { get; set; }
private IEmulator Emulator { get; set; }
protected override string WindowTitleStatic => "Core Features";

View File

@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
DoCopy();
}
void DoCopy()
private void DoCopy()
{
string txt = txtException.Text;
Clipboard.SetText(txt);
@ -67,7 +67,7 @@ namespace BizHawk.Client.EmuHawk
}
//http://stackoverflow.com/questions/2636065/alpha-in-forecolor
class MyLabel : Label
private class MyLabel : Label
{
protected override void OnPaint(PaintEventArgs e)
{

View File

@ -18,14 +18,14 @@ namespace BizHawk.Client.EmuHawk
public class CustomCheckBox : CheckBox
{
Color _checkBackColor = SystemColors.Control;
private Color _checkBackColor = SystemColors.Control;
public Color CheckBackColor
{
get => _checkBackColor;
set { _checkBackColor = value; Refresh(); }
}
bool? _forceChecked;
private bool? _forceChecked;
public bool? ForceChecked
{
get => _forceChecked;

View File

@ -10,7 +10,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
/// <summary>
/// A customizable Dialog box with 3 buttons, custom icon, and checkbox.
/// </summary>
partial class MsgBox : Form
internal partial class MsgBox : Form
{
private readonly Icon _msgIcon;
private static readonly int FormYMargin = UIHelper.ScaleY(10);

View File

@ -12,9 +12,9 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
public class RetainedViewportPanel : Control
{
Thread threadPaint;
EventWaitHandle ewh;
volatile bool killSignal;
private Thread threadPaint;
private EventWaitHandle ewh;
private volatile bool killSignal;
public Func<Bitmap,bool> ReleaseCallback;
@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk
public bool ScaleImage = true;
void DoPaint()
private void DoPaint()
{
if (bmp != null)
{
@ -86,7 +86,7 @@ namespace BizHawk.Client.EmuHawk
CleanupDisposeQueue();
}
void PaintProc()
private void PaintProc()
{
for (; ; )
{
@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
}
}
void CleanupDisposeQueue()
private void CleanupDisposeQueue()
{
lock (this)
{
@ -116,9 +116,9 @@ namespace BizHawk.Client.EmuHawk
}
}
Queue<Bitmap> DisposeQueue = new Queue<Bitmap>();
private Queue<Bitmap> DisposeQueue = new Queue<Bitmap>();
void SignalPaint()
private void SignalPaint()
{
if (threadPaint == null)
DoPaint();
@ -139,7 +139,7 @@ namespace BizHawk.Client.EmuHawk
SignalPaint();
}
Bitmap bmp;
private Bitmap bmp;
/// <summary>bit of a hack; use at your own risk</summary>
/// <returns>you probably shouldn't modify this?</returns>

View File

@ -460,7 +460,7 @@ namespace BizHawk.Client.EmuHawk
UpdateSourceInternal(job);
}
Filters.BaseFilter CreateCoreScreenControl()
private Filters.BaseFilter CreateCoreScreenControl()
{
if (GlobalWin.Emulator is MelonDS nds)
{
@ -529,7 +529,7 @@ namespace BizHawk.Client.EmuHawk
public int VsyncDenominator => throw new InvalidOperationException();
}
void FixRatio(float x, float y, int inw, int inh, out int outW, out int outH)
private void FixRatio(float x, float y, int inw, int inh, out int outW, out int outH)
{
float ratio = x / y;
if (ratio <= 1)

View File

@ -177,22 +177,22 @@ namespace BizHawk.Client.EmuHawk.Filters
public IGL GL;
public IGuiRenderer GuiRenderer;
MelonDS nds;
private MelonDS nds;
//TODO: actually use this
bool nop = false;
private bool nop = false;
//matrices used for transforming screens
Matrix4 matTop, matBot;
Matrix4 matTopInvert, matBotInvert;
private Matrix4 matTop, matBot;
private Matrix4 matTopInvert, matBotInvert;
//final output area size
Size outputSize;
private Size outputSize;
static float Round(float f) { return (float)Math.Round(f); }
private static float Round(float f) { return (float)Math.Round(f); }
//TODO: put somewhere in extension methods useful for fixing deficiencies in opentk matrix types
static Vector2 Transform(Matrix4 m, Vector2 v)
private static Vector2 Transform(Matrix4 m, Vector2 v)
{
var r = new Vector4(v.X,v.Y,0,1) * m;
return new Vector2(r.X, r.Y);
@ -210,7 +210,7 @@ namespace BizHawk.Client.EmuHawk.Filters
DeclareInput(SurfaceDisposition.Texture);
}
void CrunchNumbers()
private void CrunchNumbers()
{
MatrixStack top = new MatrixStack(), bot = new MatrixStack();

View File

@ -17,7 +17,8 @@ namespace BizHawk.Client.EmuHawk.Filters
public class RetroShaderChain : IDisposable
{
private static readonly Regex RxInclude = new Regex(@"^(\s)?\#include(\s)+(""|<)(.*)?(""|>)", RegexOptions.Multiline | RegexOptions.IgnoreCase);
static string ResolveIncludes(string content, string baseDirectory)
private static string ResolveIncludes(string content, string baseDirectory)
{
for (; ; )
{

View File

@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk
public bool Vsync;
void GLControlWrapper_SlimDX_Resize(object sender, EventArgs e)
private void GLControlWrapper_SlimDX_Resize(object sender, EventArgs e)
{
_sdx.RefreshControlSwapChain(this);
}

View File

@ -45,7 +45,7 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
public bool MainWindow;
void GraphicsControl_Paint(object sender, PaintEventArgs e)
private void GraphicsControl_Paint(object sender, PaintEventArgs e)
{
OnPaint(e);
}
@ -53,7 +53,7 @@ namespace BizHawk.Client.EmuHawk
public readonly IGL IGL;
private readonly IGraphicsControl _igc;
readonly Control _managed;
private readonly Control _managed;
public virtual void SetVsync(bool state) { _igc.SetVsync(state); }
public virtual void SwapBuffers() { _igc.SwapBuffers(); }

View File

@ -67,8 +67,9 @@ namespace BizHawk.Client.EmuHawk
//TODO for real
}
class MyBlendState : IBlendState { }
static readonly MyBlendState _rsBlendNoneVerbatim = new MyBlendState(), _rsBlendNoneOpaque = new MyBlendState(), _rsBlendNormal = new MyBlendState();
private class MyBlendState : IBlendState { }
private static readonly MyBlendState _rsBlendNoneVerbatim = new MyBlendState(), _rsBlendNoneOpaque = new MyBlendState(), _rsBlendNormal = new MyBlendState();
public IBlendState BlendNoneCopy => _rsBlendNoneVerbatim;
public IBlendState BlendNoneOpaque => _rsBlendNoneOpaque;
@ -268,7 +269,7 @@ namespace BizHawk.Client.EmuHawk
{
}
IGL_GdiPlus Gdi;
private IGL_GdiPlus Gdi;
/// <summary>
/// the control associated with this render target (if any)
@ -388,7 +389,7 @@ namespace BizHawk.Client.EmuHawk
}
}
Graphics _CurrentOffscreenGraphics;
private Graphics _CurrentOffscreenGraphics;
public Graphics GetCurrentGraphics()
{

View File

@ -17,8 +17,8 @@ namespace BizHawk.Client.EmuHawk
{
public class IGL_SlimDX9 : IGL
{
const int D3DERR_DEVICELOST = -2005530520;
const int D3DERR_DEVICENOTRESET = -2005530519;
private const int D3DERR_DEVICELOST = -2005530520;
private const int D3DERR_DEVICENOTRESET = -2005530519;
private static Direct3D _d3d;
internal Device Dev;

View File

@ -635,13 +635,13 @@ namespace BizHawk.Client.EmuHawk
//------------------
INativeWindow OffscreenNativeWindow;
IGraphicsContext GraphicsContext;
private INativeWindow OffscreenNativeWindow;
private IGraphicsContext GraphicsContext;
//---------------
//my utility methods
GLControl CastControl(swf.Control swfControl)
private GLControl CastControl(swf.Control swfControl)
{
GLControl glc = swfControl as GLControl;
if (glc == null)
@ -649,7 +649,7 @@ namespace BizHawk.Client.EmuHawk
return glc;
}
Shader CreateShader(ShaderType type, string source, string entry, bool required)
private Shader CreateShader(ShaderType type, string source, string entry, bool required)
{
var sw = new ShaderWrapper();
string info = "";
@ -670,7 +670,7 @@ namespace BizHawk.Client.EmuHawk
return ret;
}
bool CompileShaderSimple(int sid, string source, bool required)
private bool CompileShaderSimple(int sid, string source, bool required)
{
bool success = true;
ErrorCode errcode;
@ -716,7 +716,7 @@ namespace BizHawk.Client.EmuHawk
return success;
}
void UnbindVertexAttributes()
private void UnbindVertexAttributes()
{
//HAMNUTS:
//its not clear how many bindings we'll have to disable before we can enable the ones we need..
@ -727,7 +727,7 @@ namespace BizHawk.Client.EmuHawk
currBindings.Clear();
}
unsafe void MyBindArrayData(VertexLayout layout, void* pData)
private unsafe void MyBindArrayData(VertexLayout layout, void* pData)
{
UnbindVertexAttributes();
@ -798,7 +798,7 @@ namespace BizHawk.Client.EmuHawk
PurgeStateCache();
}
void CreateRenderStates()
private void CreateRenderStates()
{
_rsBlendNoneVerbatim = new CacheBlendState(
false,
@ -816,14 +816,15 @@ namespace BizHawk.Client.EmuHawk
BlendingFactorSrc.One, BlendEquationMode.FuncAdd, BlendingFactorDest.Zero);
}
CacheBlendState _rsBlendNoneVerbatim, _rsBlendNoneOpaque, _rsBlendNormal;
private CacheBlendState _rsBlendNoneVerbatim, _rsBlendNoneOpaque, _rsBlendNormal;
//state caches
int sActiveTexture;
VertexLayout sStateCurrentVertexLayout;
VertexLayout sStatePendingVertexLayout;
HashSet<int> sVertexAttribEnables = new HashSet<int>();
void PurgeStateCache()
private int sActiveTexture;
private VertexLayout sStateCurrentVertexLayout;
private VertexLayout sStatePendingVertexLayout;
private HashSet<int> sVertexAttribEnables = new HashSet<int>();
private void PurgeStateCache()
{
sStateCurrentVertexLayout = null;
sStatePendingVertexLayout = null;

View File

@ -92,7 +92,7 @@ namespace BizHawk.Client.EmuHawk
private readonly Joystick _joystick;
private JoystickState _state = new JoystickState();
GamePad(Joystick joystick, int index)
private GamePad(Joystick joystick, int index)
{
_joystick = joystick;
PlayerNumber = index + 1;

View File

@ -15,7 +15,7 @@ namespace BizHawk.Client.EmuHawk
private static readonly List<GamePad360> Devices = new List<GamePad360>();
private static readonly bool IsAvailable;
delegate uint XInputGetStateExProcDelegate(uint dwUserIndex, out XINPUT_STATE state);
private delegate uint XInputGetStateExProcDelegate(uint dwUserIndex, out XINPUT_STATE state);
private static readonly XInputGetStateExProcDelegate XInputGetStateExProc;
@ -123,7 +123,7 @@ namespace BizHawk.Client.EmuHawk
public int PlayerNumber => (int)_index0 + 1;
GamePad360(uint index0, Controller c)
private GamePad360(uint index0, Controller c)
{
this._index0 = index0;
_controller = c;

View File

@ -19,7 +19,7 @@ namespace BizHawk.Client.EmuHawk
private static readonly List<KeyEvent> PendingEventList = new List<KeyEvent>();
private static readonly List<KeyEvent> EventList = new List<KeyEvent>();
static void IPCThread()
private static void IPCThread()
{
string pipeName = $"bizhawk-pid-{System.Diagnostics.Process.GetCurrentProcess().Id}-IPCKeyInput";

View File

@ -11,9 +11,9 @@ namespace BizHawk.Client.EmuHawk
{
public class Throttle
{
int lastSkipRate;
int framesToSkip;
int framesSkipped;
private int lastSkipRate;
private int framesToSkip;
private int framesSkipped;
public bool skipNextFrame;
//if the emulator is paused then we don't need to behave as if unthrottled
@ -129,7 +129,7 @@ namespace BizHawk.Client.EmuHawk
}
}
static ulong GetCurTime()
private static ulong GetCurTime()
{
if (tmethod == 1)
return (ulong)Stopwatch.GetTimestamp();
@ -137,13 +137,13 @@ namespace BizHawk.Client.EmuHawk
return (ulong)Environment.TickCount;
}
static readonly Func<uint, uint> TimeBeginPeriod = OSTailoredCode.IsUnixHost
private static readonly Func<uint, uint> TimeBeginPeriod = OSTailoredCode.IsUnixHost
? u => u
: (Func<uint, uint>) Win32Imports.timeBeginPeriod;
static readonly int tmethod;
static readonly ulong afsfreq;
static readonly ulong tfreq;
private static readonly int tmethod;
private static readonly ulong afsfreq;
private static readonly ulong tfreq;
static Throttle()
{
@ -170,7 +170,7 @@ namespace BizHawk.Client.EmuHawk
SetSpeedPercent(target_pct);
}
int pct = -1;
private int pct = -1;
public void SetSpeedPercent(int percent)
{
//Console.WriteLine($"throttle set percent {percent}");
@ -183,17 +183,17 @@ namespace BizHawk.Client.EmuHawk
AutoFrameSkip_IgnorePreviousDelay();
}
ulong core_desiredfps;
ulong desiredfps;
float desiredspf;
private ulong core_desiredfps;
private ulong desiredfps;
private float desiredspf;
ulong ltime;
ulong beginticks, endticks, preThrottleEndticks;
float fSkipFrames;
float fSkipFramesError;
int lastSkip;
float lastError;
float integral;
private ulong ltime;
private ulong beginticks, endticks, preThrottleEndticks;
private float fSkipFrames;
private float fSkipFramesError;
private int lastSkip;
private float lastError;
private float integral;
public void AutoFrameSkip_IgnorePreviousDelay()
{
@ -205,12 +205,12 @@ namespace BizHawk.Client.EmuHawk
fSkipFrames *= 0.5f;
}
void AutoFrameSkip_BeforeThrottle()
private void AutoFrameSkip_BeforeThrottle()
{
preThrottleEndticks = GetCurTime();
}
void AutoFrameSkip_NextFrame()
private void AutoFrameSkip_NextFrame()
{
endticks = GetCurTime();
@ -264,7 +264,7 @@ namespace BizHawk.Client.EmuHawk
beginticks = GetCurTime();
}
int AutoFrameSkip_GetSkipAmount(int min, int max)
private int AutoFrameSkip_GetSkipAmount(int min, int max)
{
int rv = (int)fSkipFrames;
fSkipFramesError += fSkipFrames - rv;
@ -306,7 +306,7 @@ namespace BizHawk.Client.EmuHawk
return rv;
}
void SpeedThrottle(Sound sound, bool paused)
private void SpeedThrottle(Sound sound, bool paused)
{
AutoFrameSkip_BeforeThrottle();

View File

@ -100,7 +100,7 @@ namespace BizHawk.Client.EmuHawk
this.Invoke(() => _thread = null);
}
void br_OnProgress(object sender, BatchRunner.ProgressEventArgs e)
private void br_OnProgress(object sender, BatchRunner.ProgressEventArgs e)
{
this.Invoke(() => ProgressUpdate(e.Completed, e.Total));
e.ShouldCancel = false;

View File

@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
[RequiredService]
private IMemoryDomains MemoryDomains { get; set; }
ICodeDataLogger _icdlogger;
private ICodeDataLogger _icdlogger;
[RequiredService]
private ICodeDataLogger CodeDataLogger
@ -306,7 +306,7 @@ namespace BizHawk.Client.EmuHawk
RecentSubMenu.DropDownItems.AddRange(_recent.RecentMenu(LoadFile, "Session"));
}
void NewFileLogic()
private void NewFileLogic()
{
_cdl = new CodeDataLog();
CodeDataLogger.NewCDL(_cdl);
@ -355,7 +355,7 @@ namespace BizHawk.Client.EmuHawk
LoadFile(file.FullName);
}
void RunSave()
private void RunSave()
{
_recent.Add(_currentFilename);
using var fs = new FileStream(_currentFilename, FileMode.Create, FileAccess.Write);
@ -382,7 +382,7 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// returns false if the operation was canceled
/// </summary>
bool RunSaveAs()
private bool RunSaveAs()
{
var file = SaveFileDialog(
_currentFilename,
@ -467,7 +467,7 @@ namespace BizHawk.Client.EmuHawk
}
}
void ShutdownCDL()
private void ShutdownCDL()
{
_cdl = null;
CodeDataLogger?.SetCDL(null);

View File

@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk
/// <param name="dest">top left origin on 32bit bitmap</param>
/// <param name="pitch">pitch of bitmap in 4 byte units</param>
/// <param name="pal">4 palette colors</param>
static unsafe void DrawTile(byte* tile, int* dest, int pitch, int* pal)
private static unsafe void DrawTile(byte* tile, int* dest, int pitch, int* pal)
{
for (int y = 0; y < 8; y++)
{
@ -139,7 +139,7 @@ namespace BizHawk.Client.EmuHawk
/// <param name="pal">4 palette colors</param>
/// <param name="hFlip">true to flip horizontally</param>
/// <param name="vFlip">true to flip vertically</param>
static unsafe void DrawTileHv(byte* tile, int* dest, int pitch, int* pal, bool hFlip, bool vFlip)
private static unsafe void DrawTileHv(byte* tile, int* dest, int pitch, int* pal, bool hFlip, bool vFlip)
{
if (vFlip)
dest += pitch * 7;
@ -180,7 +180,7 @@ namespace BizHawk.Client.EmuHawk
/// <param name="tiles">base tiledata location. second bank tiledata assumed to be @+8k</param>
/// <param name="wrap">true if tileindexes are s8 (not u8)</param>
/// <param name="_pal">8 palettes (4 colors each)</param>
static unsafe void DrawBgCgb(Bitmap b, IntPtr _map, IntPtr tiles, bool wrap, IntPtr _pal)
private static unsafe void DrawBgCgb(Bitmap b, IntPtr _map, IntPtr tiles, bool wrap, IntPtr _pal)
{
var lockData = b.LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
byte* map = (byte*)_map;
@ -335,7 +335,7 @@ namespace BizHawk.Client.EmuHawk
/// <param name="b">bitmap to draw to. should be numpals x 4</param>
/// <param name="_pal">start of palettes</param>
/// <param name="numpals">number of palettes (not colors)</param>
static unsafe void DrawPal(Bitmap b, IntPtr _pal, int numpals)
private static unsafe void DrawPal(Bitmap b, IntPtr _pal, int numpals)
{
var lockData = b.LockBits(new Rectangle(0, 0, numpals, 4), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int* dest = (int*)lockData.Scan0;
@ -355,7 +355,7 @@ namespace BizHawk.Client.EmuHawk
b.UnlockBits(lockData);
}
void ScanlineCallback(byte lcdc)
private void ScanlineCallback(byte lcdc)
{
using (_memory.EnterExit())
{
@ -486,7 +486,7 @@ namespace BizHawk.Client.EmuHawk
private void radioButtonRefreshScanline_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
private void radioButtonRefreshManual_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
void ComputeRefreshValues()
private void ComputeRefreshValues()
{
if (radioButtonRefreshFrame.Checked)
{
@ -642,7 +642,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void TileMouseover(int x, int y, bool secondBank)
private unsafe void TileMouseover(int x, int y, bool secondBank)
{
using (_memory.EnterExit())
{
@ -669,7 +669,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void TileMapMouseover(int x, int y, bool win)
private unsafe void TileMapMouseover(int x, int y, bool win)
{
using (_memory.EnterExit())
{
@ -714,7 +714,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void SpriteMouseover(int x, int y)
private unsafe void SpriteMouseover(int x, int y)
{
using (_memory.EnterExit())
{

View File

@ -121,7 +121,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void DrawTextNameTable16(int* dest, int pitch, ushort* nametable, byte* tiles)
private unsafe void DrawTextNameTable16(int* dest, int pitch, ushort* nametable, byte* tiles)
{
for (int ty = 0; ty < 32; ty++)
{
@ -136,7 +136,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void DrawTextNameTable256(int* dest, int pitch, ushort* nametable, byte* tiles)
private unsafe void DrawTextNameTable256(int* dest, int pitch, ushort* nametable, byte* tiles)
{
for (int ty = 0; ty < 32; ty++)
{
@ -151,7 +151,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void DrawTextNameTable(int* dest, int pitch, ushort* nametable, byte* tiles, bool eightbit)
private unsafe void DrawTextNameTable(int* dest, int pitch, ushort* nametable, byte* tiles, bool eightbit)
{
if (eightbit)
DrawTextNameTable256(dest, pitch, nametable, tiles);
@ -159,7 +159,7 @@ namespace BizHawk.Client.EmuHawk
DrawTextNameTable16(dest, pitch, nametable, tiles);
}
unsafe void DrawTextBG(int n, MobileBmpView mbv)
private unsafe void DrawTextBG(int n, MobileBmpView mbv)
{
ushort bgcnt = ((ushort*)_mmio)[4 + n];
int ssize = bgcnt >> 14;
@ -218,7 +218,7 @@ namespace BizHawk.Client.EmuHawk
mbv.BmpView.Refresh();
}
unsafe void DrawAffineBG(int n, MobileBmpView mbv)
private unsafe void DrawAffineBG(int n, MobileBmpView mbv)
{
ushort bgcnt = ((ushort*)_mmio)[4 + n];
int ssize = bgcnt >> 14;
@ -254,7 +254,7 @@ namespace BizHawk.Client.EmuHawk
mbv.BmpView.Refresh();
}
unsafe void DrawM3BG(MobileBmpView mbv)
private unsafe void DrawM3BG(MobileBmpView mbv)
{
mbv.ChangeAllSizes(240, 160);
Bitmap bmp = mbv.BmpView.Bmp;
@ -280,7 +280,7 @@ namespace BizHawk.Client.EmuHawk
mbv.BmpView.Refresh();
}
unsafe void DrawM4BG(MobileBmpView mbv, bool secondFrame)
private unsafe void DrawM4BG(MobileBmpView mbv, bool secondFrame)
{
mbv.ChangeAllSizes(240, 160);
Bitmap bmp = mbv.BmpView.Bmp;
@ -307,7 +307,7 @@ namespace BizHawk.Client.EmuHawk
mbv.BmpView.Refresh();
}
unsafe void DrawM5BG(MobileBmpView mbv, bool secondFrame)
private unsafe void DrawM5BG(MobileBmpView mbv, bool secondFrame)
{
mbv.ChangeAllSizes(160, 128);
Bitmap bmp = mbv.BmpView.Bmp;
@ -332,7 +332,7 @@ namespace BizHawk.Client.EmuHawk
private static readonly int[, ,] SpriteSizes = { { { 1, 1 }, { 2, 2 }, { 4, 4 }, { 8, 8 } }, { { 2, 1 }, { 4, 1 }, { 4, 2 }, { 8, 4 } }, { { 1, 2 }, { 1, 4 }, { 2, 4 }, { 4, 8 } } };
unsafe void DrawSprite(int* dest, int pitch, ushort* sprite, byte* tiles, bool twodee)
private unsafe void DrawSprite(int* dest, int pitch, ushort* sprite, byte* tiles, bool twodee)
{
ushort attr0 = sprite[0];
ushort attr1 = sprite[1];
@ -409,7 +409,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void DrawSprites(MobileBmpView mbv)
private unsafe void DrawSprites(MobileBmpView mbv)
{
mbv.BmpView.ChangeBitmapSize(1024, 512);
Bitmap bmp = mbv.BmpView.Bmp;
@ -442,7 +442,7 @@ namespace BizHawk.Client.EmuHawk
mbv.BmpView.Refresh();
}
unsafe void DrawPalette(MobileBmpView mbv, bool sprite)
private unsafe void DrawPalette(MobileBmpView mbv, bool sprite)
{
mbv.BmpView.ChangeBitmapSize(16, 16);
Bitmap bmp = mbv.BmpView.Bmp;
@ -465,7 +465,7 @@ namespace BizHawk.Client.EmuHawk
mbv.BmpView.Refresh();
}
unsafe void DrawTileRange(int* dest, int pitch, byte* tiles, ushort* palette, int tw, int th, bool eightbit)
private unsafe void DrawTileRange(int* dest, int pitch, byte* tiles, ushort* palette, int tw, int th, bool eightbit)
{
for (int ty = 0; ty < th; ty++)
{
@ -489,7 +489,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void DrawSpriteTiles(MobileBmpView mbv, bool tophalfonly, bool eightbit)
private unsafe void DrawSpriteTiles(MobileBmpView mbv, bool tophalfonly, bool eightbit)
{
int tw = eightbit ? 16 : 32;
int th = tophalfonly ? 16 : 32;
@ -516,7 +516,7 @@ namespace BizHawk.Client.EmuHawk
mbv.BmpView.Refresh();
}
unsafe void DrawBGTiles(MobileBmpView mbv, bool eightbit)
private unsafe void DrawBGTiles(MobileBmpView mbv, bool eightbit)
{
int tw = eightbit ? 32 : 64;
int th = 32;

View File

@ -82,7 +82,7 @@ namespace BizHawk.Client.EmuHawk
bv.Refresh();
}
unsafe void DrawPalettes(int* pal)
private unsafe void DrawPalettes(int* pal)
{
var lockData = bmpViewPal.Bmp.LockBits(new Rectangle(0, 0, 16, 4), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int pitch = lockData.Stride / sizeof(int);
@ -98,7 +98,7 @@ namespace BizHawk.Client.EmuHawk
bmpViewPal.Refresh();
}
unsafe void DrawTiles()
private unsafe void DrawTiles()
{
var lockData = bmpViewTiles.Bmp.LockBits(new Rectangle(0, 0, 512, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int pitch = lockData.Stride / sizeof(int);

View File

@ -1386,7 +1386,7 @@ namespace BizHawk.Client.EmuHawk
FindNextMenuItem.Enabled = !string.IsNullOrWhiteSpace(_findStr);
}
string MakeCopyExportString(bool export)
private string MakeCopyExportString(bool export)
{
// make room for an array with _secondaryHighlightedAddresses and optionally HighlightedAddress
long[] addresses = new long[_secondaryHighlightedAddresses.Count + (_highlightedAddress.HasValue ? 1 : 0)];

View File

@ -44,7 +44,7 @@ namespace BizHawk.Client.EmuHawk
bmpViewSPPal.Refresh();
}
static unsafe void Draw16x16(byte* src, int* dest, int pitch, int* pal)
private static unsafe void Draw16x16(byte* src, int* dest, int pitch, int* pal)
{
int inc = pitch - 16;
dest -= inc;
@ -56,7 +56,7 @@ namespace BizHawk.Client.EmuHawk
}
}
static unsafe void Draw8x8(byte* src, int* dest, int pitch, int* pal)
private static unsafe void Draw8x8(byte* src, int* dest, int pitch, int* pal)
{
int inc = pitch - 8;
dest -= inc;
@ -68,7 +68,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void DrawSprites()
private unsafe void DrawSprites()
{
Viewer.GetGpuData(checkBoxVDC2.Checked ? 1 : 0, view =>
{
@ -90,7 +90,7 @@ namespace BizHawk.Client.EmuHawk
});
}
unsafe void DrawBacks()
private unsafe void DrawBacks()
{
Viewer.GetGpuData(checkBoxVDC2.Checked ? 1 : 0, view =>
{
@ -112,7 +112,7 @@ namespace BizHawk.Client.EmuHawk
});
}
unsafe void DrawPalettes()
private unsafe void DrawPalettes()
{
Viewer.GetGpuData(checkBoxVDC2.Checked ? 1 : 0, view =>
{
@ -122,7 +122,7 @@ namespace BizHawk.Client.EmuHawk
});
}
static unsafe void DrawPalette(Bitmap bmp, int* pal)
private static unsafe void DrawPalette(Bitmap bmp, int* pal)
{
var lockData = bmp.LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);

View File

@ -31,7 +31,7 @@ namespace BizHawk.Client.EmuHawk
protected override void GeneralUpdate() => UpdateBefore();
static unsafe void Draw8x8(byte* src, int* dest, int pitch, int* pal)
private static unsafe void Draw8x8(byte* src, int* dest, int pitch, int* pal)
{
int inc = pitch - 8;
dest -= inc;
@ -43,7 +43,7 @@ namespace BizHawk.Client.EmuHawk
}
}
static unsafe void Draw8x8hv(byte* src, int* dest, int pitch, int* pal, bool hflip, bool vflip)
private static unsafe void Draw8x8hv(byte* src, int* dest, int pitch, int* pal, bool hflip, bool vflip)
{
int incX = hflip ? -1 : 1;
int incY = vflip ? -pitch : pitch;
@ -63,7 +63,7 @@ namespace BizHawk.Client.EmuHawk
}
}
unsafe void DrawTiles(int *pal)
private unsafe void DrawTiles(int *pal)
{
var lockData = bmpViewTiles.Bmp.LockBits(new Rectangle(0, 0, 256, 128), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int* dest = (int*)lockData.Scan0;
@ -84,7 +84,7 @@ namespace BizHawk.Client.EmuHawk
bmpViewTiles.Refresh();
}
unsafe void DrawBG(int* pal)
private unsafe void DrawBG(int* pal)
{
int bgHeight = Vdp.FrameHeight == 192 ? 224 : 256;
int maxTile = bgHeight * 4;
@ -120,7 +120,7 @@ namespace BizHawk.Client.EmuHawk
bmpViewBG.Refresh();
}
unsafe void DrawPal(int* pal)
private unsafe void DrawPal(int* pal)
{
var lockData = bmpViewPalette.Bmp.LockBits(new Rectangle(0, 0, 16, 2), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
int* dest = (int*)lockData.Scan0;

View File

@ -38,7 +38,7 @@ namespace BizHawk.Client.EmuHawk
{
public unsafe partial class SNESGraphicsDebugger : ToolFormBase, IToolFormAutoConfig
{
readonly List<DisplayTypeItem> displayTypeItems = new List<DisplayTypeItem>();
private readonly List<DisplayTypeItem> displayTypeItems = new List<DisplayTypeItem>();
[RequiredService]
private LibsnesCore Emulator { get; set; }
@ -122,7 +122,7 @@ namespace BizHawk.Client.EmuHawk
return bpp == 0 ? "---" : bpp.ToString();
}
string FormatVramAddress(int address)
private string FormatVramAddress(int address)
{
int excess = address & 1023;
return excess != 0
@ -169,7 +169,7 @@ namespace BizHawk.Client.EmuHawk
suppression = false;
}
void SyncCore()
private void SyncCore()
{
if (currentSnesCore != Emulator)
{
@ -334,7 +334,7 @@ namespace BizHawk.Client.EmuHawk
}
}
eDisplayType CurrDisplaySelection => (comboDisplayType.SelectedValue as eDisplayType?).Value;
private eDisplayType CurrDisplaySelection => (comboDisplayType.SelectedValue as eDisplayType?).Value;
//todo - something smarter to cycle through bitmaps without repeatedly trashing them (use the dispose callback on the viewer)
private void RenderView()
@ -479,15 +479,17 @@ namespace BizHawk.Client.EmuHawk
}
}
enum eDisplayType
private enum eDisplayType
{
BG1 = 1, BG2 = 2, BG3 = 3, BG4 = 4, OBJTiles0, OBJTiles1, Tiles2bpp, Tiles4bpp, Tiles8bpp, TilesMode7, TilesMode7Ext, TilesMode7DC, Sprites, OBJ,
BG1Screen = 101, BG2Screen = 102, BG3Screen = 103, BG4Screen = 104
}
static bool IsDisplayTypeBG(eDisplayType type) { return type == eDisplayType.BG1 || type == eDisplayType.BG2 || type == eDisplayType.BG3 || type == eDisplayType.BG4; }
static bool IsDisplayTypeOBJ(eDisplayType type) { return type == eDisplayType.OBJTiles0 || type == eDisplayType.OBJTiles1; }
static int DisplayTypeBGNum(eDisplayType type) { if(IsDisplayTypeBG(type)) return (int)type; else return -1; }
static SNESGraphicsDecoder.BGMode BGModeForDisplayType(eDisplayType type)
private static bool IsDisplayTypeBG(eDisplayType type) { return type == eDisplayType.BG1 || type == eDisplayType.BG2 || type == eDisplayType.BG3 || type == eDisplayType.BG4; }
private static bool IsDisplayTypeOBJ(eDisplayType type) { return type == eDisplayType.OBJTiles0 || type == eDisplayType.OBJTiles1; }
private static int DisplayTypeBGNum(eDisplayType type) { if(IsDisplayTypeBG(type)) return (int)type; else return -1; }
private static SNESGraphicsDecoder.BGMode BGModeForDisplayType(eDisplayType type)
{
switch (type)
{
@ -548,7 +550,7 @@ namespace BizHawk.Client.EmuHawk
UpdateToolsLoadstate();
}
bool suppression = false;
private bool suppression = false;
private void rbBGX_CheckedChanged(object sender, EventArgs e)
{
if (suppression) return;
@ -599,13 +601,13 @@ namespace BizHawk.Client.EmuHawk
return ret;
}
Rectangle GetPaletteRegion(SNESGraphicsDecoder.PaletteSelection sel)
private Rectangle GetPaletteRegion(SNESGraphicsDecoder.PaletteSelection sel)
{
int start = sel.start, num = sel.size;
return GetPaletteRegion(start, num);
}
void DrawPaletteRegion(Graphics g, Color color, Rectangle region)
private void DrawPaletteRegion(Graphics g, Color color, Rectangle region)
{
int cellTotalSize = (paletteCellSize + paletteCellSpacing);
@ -827,7 +829,7 @@ namespace BizHawk.Client.EmuHawk
//cd.ShowDialog(this);
}
void SyncViewerSize()
private void SyncViewerSize()
{
viewer.Size = check2x.Checked ? new Size(1024, 1024) : new Size(512, 512);
}
@ -1011,7 +1013,7 @@ namespace BizHawk.Client.EmuHawk
}
}
void HandleTileViewMouseOver(int pxacross, int pxtall, int bpp, int tx, int ty)
private void HandleTileViewMouseOver(int pxacross, int pxtall, int bpp, int tx, int ty)
{
int tileStride = pxacross / 8;
int tilesTall = pxtall / 8;
@ -1072,7 +1074,7 @@ namespace BizHawk.Client.EmuHawk
SetTab(tpOBJ);
}
void SetTab(TabPage tpSet)
private void SetTab(TabPage tpSet)
{
//doesnt work well
//foreach (var tp in tabctrlDetails.TabPages)
@ -1084,7 +1086,7 @@ namespace BizHawk.Client.EmuHawk
}
}
void UpdateViewerMouseover(Point loc)
private void UpdateViewerMouseover(Point loc)
{
using (gd.EnterExit())
{
@ -1279,7 +1281,7 @@ namespace BizHawk.Client.EmuHawk
RenderTileView();
}
void RefreshBGENCheckStatesFromConfig()
private void RefreshBGENCheckStatesFromConfig()
{
var s = Emulator.GetSettings();
checkEN0_BG1.Checked = s.ShowBG1_0;

View File

@ -7,7 +7,7 @@ namespace BizHawk.Client.EmuHawk
{
[Schema("ZXSpectrum")]
// ReSharper disable once UnusedMember.Global
class ZxSpectrumSchema : IVirtualPadSchema
internal class ZxSpectrumSchema : IVirtualPadSchema
{
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
{

View File

@ -49,7 +49,7 @@ namespace BizHawk.Common
}
}
static MethodInfo ArrayEqualsGeneric = typeof(DeepEquality).GetMethod("ArrayEquals", BindingFlags.NonPublic | BindingFlags.Static);
private static MethodInfo ArrayEqualsGeneric = typeof(DeepEquality).GetMethod("ArrayEquals", BindingFlags.NonPublic | BindingFlags.Static);
/// <summary>test if two objects <paramref name="o1"/> and <paramref name="o2"/> are equal, field-by-field (with deep inspection of each field)</summary>
/// <exception cref="InvalidOperationException"><paramref name="o1"/> is an array with rank > 1 or is a non-zero-indexed array</exception>

View File

@ -61,7 +61,7 @@ namespace BizHawk.Common
}
}
static void ThreadProc()
private static void ThreadProc()
{
// squirrely logic, trying not to create garbage
var knownTempDirs = new HashSet<string>();
@ -120,7 +120,7 @@ namespace BizHawk.Common
{
}
static Thread thread;
private static Thread thread;
public static void HelperSetTempPath(string path)
{

View File

@ -13,12 +13,12 @@ namespace BizHawk.Emulation.Common
{
public static class Database
{
static Dictionary<string, CompactGameInfo> DB = new Dictionary<string, CompactGameInfo>();
private static Dictionary<string, CompactGameInfo> DB = new Dictionary<string, CompactGameInfo>();
/// <summary>
/// blocks until the DB is done loading
/// </summary>
static EventWaitHandle acquire = new EventWaitHandle(false, EventResetMode.ManualReset);
private static EventWaitHandle acquire = new EventWaitHandle(false, EventResetMode.ManualReset);
private static string RemoveHashType(string hash)
{
@ -89,9 +89,9 @@ namespace BizHawk.Emulation.Common
File.AppendAllText(path, sb.ToString());
}
static bool initialized = false;
private static bool initialized = false;
static void initializeWork(string path)
private static void initializeWork(string path)
{
//reminder: this COULD be done on several threads, if it takes even longer
using var reader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read));

View File

@ -2,6 +2,7 @@
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>$(NoWarn);SA1400</NoWarn>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>