Enable SA1400 and fix noncompliance (except in Cores)
"Access modifier should be declared"
This commit is contained in:
parent
4bf50e6e51
commit
5488c80f4d
|
@ -454,9 +454,6 @@
|
||||||
<!-- Statement should not use unnecessary parenthesis -->
|
<!-- Statement should not use unnecessary parenthesis -->
|
||||||
<Rule Id="SA1119" Action="Hidden" />
|
<Rule Id="SA1119" Action="Hidden" />
|
||||||
|
|
||||||
<!-- Access modifier should be declared -->
|
|
||||||
<Rule Id="SA1400" Action="Hidden" />
|
|
||||||
|
|
||||||
<!-- Fields should be private -->
|
<!-- Fields should be private -->
|
||||||
<Rule Id="SA1401" Action="Hidden" />
|
<Rule Id="SA1401" Action="Hidden" />
|
||||||
|
|
||||||
|
|
|
@ -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");
|
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)
|
public static IImportResolver GetExvoker(object o, ICallingConventionAdapter a)
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
return LoadArtInternal(new BitmapBuffer(path, new BitmapLoadOptions()));
|
return LoadArtInternal(new BitmapBuffer(path, new BitmapLoadOptions()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Art LoadArtInternal(BitmapBuffer tex)
|
private Art LoadArtInternal(BitmapBuffer tex)
|
||||||
{
|
{
|
||||||
AssertIsOpen(true);
|
AssertIsOpen(true);
|
||||||
|
|
||||||
|
@ -150,16 +150,16 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is used to remember the original bitmap sources for art files. Once the ArtManager is closed forever, this will be purged
|
/// This is used to remember the original bitmap sources for art files. Once the ArtManager is closed forever, this will be purged
|
||||||
/// </summary>
|
/// </summary>
|
||||||
readonly Dictionary<Art, BitmapBuffer> ArtLooseTextureAssociation = new Dictionary<Art, BitmapBuffer>();
|
private readonly Dictionary<Art, BitmapBuffer> ArtLooseTextureAssociation = new Dictionary<Art, BitmapBuffer>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Physical texture resources, which exist after this ArtManager has been closed
|
/// Physical texture resources, which exist after this ArtManager has been closed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
readonly List<Texture2d> ManagedTextures = new List<Texture2d>();
|
private readonly List<Texture2d> ManagedTextures = new List<Texture2d>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All the Arts managed by this instance
|
/// All the Arts managed by this instance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
readonly List<Art> ManagedArts = new List<Art>();
|
private readonly List<Art> ManagedArts = new List<Art>();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -288,7 +288,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
HasAlpha = false;
|
HasAlpha = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadInternal(Stream stream, Bitmap bitmap, BitmapLoadOptions options)
|
private void LoadInternal(Stream stream, Bitmap bitmap, BitmapLoadOptions options)
|
||||||
{
|
{
|
||||||
bool cleanup = options.CleanupAlpha0;
|
bool cleanup = options.CleanupAlpha0;
|
||||||
bool needsPad = true;
|
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];
|
Pixels = new int[width * height];
|
||||||
Width = width;
|
Width = width;
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
Owner = gl;
|
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),
|
||||||
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);
|
SetModulateColor(sd.Color.White);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageAttributes CurrentImageAttributes;
|
private ImageAttributes CurrentImageAttributes;
|
||||||
public void SetModulateColor(sd.Color color)
|
public void SetModulateColor(sd.Color color)
|
||||||
{
|
{
|
||||||
//white is really no color at all
|
//white is really no color at all
|
||||||
|
@ -86,15 +86,15 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
CurrentImageAttributes.SetColorMatrix(colorMatrix,ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
|
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)
|
public void SetBlendState(IBlendState rsBlend)
|
||||||
{
|
{
|
||||||
CurrentBlendState = rsBlend;
|
CurrentBlendState = rsBlend;
|
||||||
}
|
}
|
||||||
|
|
||||||
MatrixStack _Projection, _Modelview;
|
private MatrixStack _Projection, _Modelview;
|
||||||
public MatrixStack Projection
|
public MatrixStack Projection
|
||||||
{
|
{
|
||||||
get => _Projection;
|
get => _Projection;
|
||||||
|
@ -194,7 +194,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
DrawInternal(art, x, y, width, height);
|
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;
|
var tw = tex.Opaque as GDIPTextureWrapper;
|
||||||
//TODO - we can support bicubic for the final presentation..
|
//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);
|
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);
|
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);
|
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;
|
var g = ((dynamic) Gdi).GetCurrentGraphics() as sd.Graphics;
|
||||||
PrepDraw(g, tex);
|
PrepDraw(g, tex);
|
||||||
|
@ -273,7 +273,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
g.Transform = new sd.Drawing2D.Matrix(); //.Reset() doesn't work ? ?
|
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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
CurrPipeline = DefaultPipeline = Owner.CreatePipeline(VertexLayout, vs, ps, true, "xgui");
|
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)
|
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);
|
Owner.SetBlendState(rsBlend);
|
||||||
}
|
}
|
||||||
|
|
||||||
MatrixStack _Projection, _Modelview;
|
private MatrixStack _Projection, _Modelview;
|
||||||
public MatrixStack Projection
|
public MatrixStack Projection
|
||||||
{
|
{
|
||||||
get => _Projection;
|
get => _Projection;
|
||||||
|
@ -221,7 +221,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
DrawInternal(art, x, y, width, height);
|
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 art = new Art((ArtManager)null);
|
||||||
art.Width = w;
|
art.Width = w;
|
||||||
|
@ -232,7 +232,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
DrawInternal(art, x, y, w, h, false, tex.IsUpsideDown);
|
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?)
|
//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;
|
fy = false;
|
||||||
|
@ -261,7 +261,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void PrepDrawSubrectInternal(Texture2d tex)
|
private unsafe void PrepDrawSubrectInternal(Texture2d tex)
|
||||||
{
|
{
|
||||||
if (sTexture != 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];
|
float* pData = stackalloc float[32];
|
||||||
pData[0] = x;
|
pData[0] = x;
|
||||||
|
@ -333,7 +333,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
#endif
|
#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);
|
PrepDrawSubrectInternal(tex);
|
||||||
EmitRectangleInternal(x, y, w, h, u0, v0, u1, v1);
|
EmitRectangleInternal(x, y, w, h, u0, v0, u1, v1);
|
||||||
|
@ -342,14 +342,14 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
public bool IsActive { get; private set; }
|
public bool IsActive { get; private set; }
|
||||||
public IGL Owner { get; }
|
public IGL Owner { get; }
|
||||||
|
|
||||||
readonly VertexLayout VertexLayout;
|
private readonly VertexLayout VertexLayout;
|
||||||
Pipeline CurrPipeline;
|
private Pipeline CurrPipeline;
|
||||||
readonly Pipeline DefaultPipeline;
|
private readonly Pipeline DefaultPipeline;
|
||||||
|
|
||||||
//state cache
|
//state cache
|
||||||
Texture2d sTexture;
|
private Texture2d sTexture;
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
bool BlendStateSet;
|
private bool BlendStateSet;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//shaders are hand-coded for each platform to make sure they stay as fast as possible
|
//shaders are hand-coded for each platform to make sure they stay as fast as possible
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
|
|
||||||
public bool IsDirty;
|
public bool IsDirty;
|
||||||
|
|
||||||
readonly Stack<Matrix4> stack = new Stack<Matrix4>();
|
private readonly Stack<Matrix4> stack = new Stack<Matrix4>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is made public for performance reasons, to avoid lame copies of the matrix when necessary. Don't mess it up!
|
/// This is made public for performance reasons, to avoid lame copies of the matrix when necessary. Don't mess it up!
|
||||||
|
|
|
@ -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.
|
/// 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
|
/// Shader compilers will optimize out unused uniforms, and we wont have a record of it in the uniforms population loop
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class SpecialWorkingDictionary : Dictionary<string, PipelineUniform>
|
private class SpecialWorkingDictionary : Dictionary<string, PipelineUniform>
|
||||||
{
|
{
|
||||||
public SpecialWorkingDictionary(Pipeline owner)
|
public SpecialWorkingDictionary(Pipeline owner)
|
||||||
{
|
{
|
||||||
Owner = owner;
|
Owner = owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
Pipeline Owner;
|
private Pipeline Owner;
|
||||||
public new PipelineUniform this[string key]
|
public new PipelineUniform this[string key]
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -63,8 +63,8 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly SpecialWorkingDictionary UniformsDictionary;
|
private readonly SpecialWorkingDictionary UniformsDictionary;
|
||||||
IDictionary<string, PipelineUniform> Uniforms => UniformsDictionary;
|
private IDictionary<string, PipelineUniform> Uniforms => UniformsDictionary;
|
||||||
|
|
||||||
public IEnumerable<PipelineUniform> GetUniforms() => Uniforms.Values;
|
public IEnumerable<PipelineUniform> GetUniforms() => Uniforms.Values;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<UniformInfo> UniformInfos => _UniformInfos;
|
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>
|
/// <returns>the first and only <see cref="UniformInfo"/></returns>
|
||||||
/// <exception cref="InvalidOperationException">more than one <see cref="UniformInfo"/> exists</exception>
|
/// <exception cref="InvalidOperationException">more than one <see cref="UniformInfo"/> exists</exception>
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
|
|
||||||
public IGL Owner { get; }
|
public IGL Owner { get; }
|
||||||
|
|
||||||
readonly VertexLayout VertexLayout;
|
private readonly VertexLayout VertexLayout;
|
||||||
public Pipeline Pipeline;
|
public Pipeline Pipeline;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
public bool Available { get; private set; }
|
public bool Available { get; private set; }
|
||||||
public string Errors { get; set; }
|
public string Errors { get; set; }
|
||||||
|
|
||||||
int RefCount;
|
private int RefCount;
|
||||||
|
|
||||||
public void Release()
|
public void Release()
|
||||||
{
|
{
|
||||||
|
|
|
@ -210,7 +210,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Computes the ratio of used surface area.</summary>
|
/// <summary>Computes the ratio of used surface area.</summary>
|
||||||
float Occupancy()
|
private float Occupancy()
|
||||||
{
|
{
|
||||||
int totalSurfaceArea = binWidth * binHeight;
|
int totalSurfaceArea = binWidth * binHeight;
|
||||||
int usedSurfaceArea = UsedSurfaceArea(root);
|
int usedSurfaceArea = UsedSurfaceArea(root);
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
public object Opaque { get; }
|
public object Opaque { get; }
|
||||||
public IGL Owner { get; }
|
public IGL Owner { get; }
|
||||||
|
|
||||||
int RefCount;
|
private int RefCount;
|
||||||
|
|
||||||
public void Release()
|
public void Release()
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ namespace BizHawk.Bizware.BizwareGL
|
||||||
}
|
}
|
||||||
|
|
||||||
public MyDictionary Items { get; }
|
public MyDictionary Items { get; }
|
||||||
bool Closed = false;
|
private bool Closed = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ using BizHawk.Emulation.DiscSystem;
|
||||||
|
|
||||||
namespace BizHawk.Client.DiscoHawk
|
namespace BizHawk.Client.DiscoHawk
|
||||||
{
|
{
|
||||||
static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
static Program()
|
static Program()
|
||||||
{
|
{
|
||||||
|
@ -39,7 +39,7 @@ namespace BizHawk.Client.DiscoHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
[STAThread]
|
[STAThread]
|
||||||
static void Main(string[] args)
|
private static void Main(string[] args)
|
||||||
{
|
{
|
||||||
SubMain(args);
|
SubMain(args);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ namespace BizHawk.Client.DiscoHawk
|
||||||
public static extern bool FreeLibrary(IntPtr hModule);
|
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
|
// 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
|
// 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
|
//declared here instead of a more usual place to avoid dependencies on the more usual place
|
||||||
#if WINDOWS
|
#if WINDOWS
|
||||||
[DllImport("kernel32.dll", SetLastError = true)]
|
[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)]
|
[DllImport("kernel32.dll", EntryPoint = "DeleteFileW", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)]
|
||||||
static extern bool DeleteFileW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName);
|
private static extern bool DeleteFileW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName);
|
||||||
static void RemoveMOTW(string path)
|
|
||||||
|
private static void RemoveMOTW(string path)
|
||||||
{
|
{
|
||||||
DeleteFileW($"{path}:Zone.Identifier");
|
DeleteFileW($"{path}:Zone.Identifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WhackAllMOTW(string dllDir)
|
private static void WhackAllMOTW(string dllDir)
|
||||||
{
|
{
|
||||||
var todo = new Queue<DirectoryInfo>(new[] { new DirectoryInfo(dllDir) });
|
var todo = new Queue<DirectoryInfo>(new[] { new DirectoryInfo(dllDir) });
|
||||||
while (todo.Count > 0)
|
while (todo.Count > 0)
|
||||||
|
|
|
@ -68,8 +68,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// thread communication
|
// thread communication
|
||||||
// synchronized queue with custom messages
|
// 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
|
// 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;
|
private System.Collections.Concurrent.BlockingCollection<object> threadQ;
|
||||||
System.Threading.Thread workerT;
|
private System.Threading.Thread workerT;
|
||||||
|
|
||||||
private void threadproc()
|
private void threadproc()
|
||||||
{
|
{
|
||||||
|
@ -562,7 +562,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe class AviWriterSegment : IDisposable
|
private unsafe class AviWriterSegment : IDisposable
|
||||||
{
|
{
|
||||||
static AviWriterSegment()
|
static AviWriterSegment()
|
||||||
{
|
{
|
||||||
|
@ -627,7 +627,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private static bool FAILED(int hr) => hr < 0;
|
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)
|
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>
|
/// <exception cref="InvalidOperationException">unmanaged call failed</exception>
|
||||||
public void OpenFile(string destPath, Parameters parameters, CodecToken videoCodecToken)
|
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 = outStatus.audio_buffered_shorts;
|
||||||
int todo_realsamples = todo / 2;
|
int todo_realsamples = todo / 2;
|
||||||
|
|
|
@ -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}.)";
|
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;
|
private int pct = 0;
|
||||||
bool exiting = false;
|
private bool exiting = false;
|
||||||
bool succeeded = false;
|
private bool succeeded = false;
|
||||||
bool failed = false;
|
private bool failed = false;
|
||||||
|
|
||||||
void ThreadProc()
|
private void ThreadProc()
|
||||||
{
|
{
|
||||||
Download();
|
Download();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Download()
|
private void Download()
|
||||||
{
|
{
|
||||||
//the temp file is owned by this thread
|
//the temp file is owned by this thread
|
||||||
var fn = TempFileManager.GetTempFilename("ffmpeg_download", ".7z", false);
|
var fn = TempFileManager.GetTempFilename("ffmpeg_download", ".7z", false);
|
||||||
|
|
|
@ -141,12 +141,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// precooked gif header
|
/// precooked gif header
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// little endian frame length in 10ms units
|
/// little endian frame length in 10ms units
|
||||||
/// </summary>
|
/// </summary>
|
||||||
byte[] Delay = {100, 0};
|
private byte[] Delay = {100, 0};
|
||||||
|
|
||||||
public void AddFrame(IVideoProvider source)
|
public void AddFrame(IVideoProvider source)
|
||||||
{
|
{
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// variable length value, unsigned
|
/// variable length value, unsigned
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void WriteVarU(int v, Stream stream)
|
private static void WriteVarU(int v, Stream stream)
|
||||||
{
|
{
|
||||||
if (v < 0)
|
if (v < 0)
|
||||||
{
|
{
|
||||||
|
@ -141,7 +141,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// arbitrary sequence of bytes with length prepended
|
/// arbitrary sequence of bytes with length prepended
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void WriteBytes(byte[] b, Stream stream)
|
private static void WriteBytes(byte[] b, Stream stream)
|
||||||
{
|
{
|
||||||
WriteVarU(b.Length, stream);
|
WriteVarU(b.Length, stream);
|
||||||
stream.Write(b, 0, b.Length);
|
stream.Write(b, 0, b.Length);
|
||||||
|
@ -338,7 +338,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// audio packets waiting to be written
|
// audio packets waiting to be written
|
||||||
private readonly Queue<NutFrame> _audioQueue;
|
private readonly Queue<NutFrame> _audioQueue;
|
||||||
|
|
||||||
readonly ReusableBufferPool<byte> _bufferPool = new ReusableBufferPool<byte>(12);
|
private readonly ReusableBufferPool<byte> _bufferPool = new ReusableBufferPool<byte>(12);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// write out the main header
|
/// write out the main header
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
// ReSharper disable once UnusedAutoPropertyAccessor.Local
|
// ReSharper disable once UnusedAutoPropertyAccessor.Local
|
||||||
[RequiredService]
|
[RequiredService]
|
||||||
IEmulator Emulator { get; set; }
|
private IEmulator Emulator { get; set; }
|
||||||
|
|
||||||
protected override string WindowTitleStatic => "Core Features";
|
protected override string WindowTitleStatic => "Core Features";
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
DoCopy();
|
DoCopy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoCopy()
|
private void DoCopy()
|
||||||
{
|
{
|
||||||
string txt = txtException.Text;
|
string txt = txtException.Text;
|
||||||
Clipboard.SetText(txt);
|
Clipboard.SetText(txt);
|
||||||
|
@ -67,7 +67,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
//http://stackoverflow.com/questions/2636065/alpha-in-forecolor
|
//http://stackoverflow.com/questions/2636065/alpha-in-forecolor
|
||||||
class MyLabel : Label
|
private class MyLabel : Label
|
||||||
{
|
{
|
||||||
protected override void OnPaint(PaintEventArgs e)
|
protected override void OnPaint(PaintEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,14 +18,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public class CustomCheckBox : CheckBox
|
public class CustomCheckBox : CheckBox
|
||||||
{
|
{
|
||||||
Color _checkBackColor = SystemColors.Control;
|
private Color _checkBackColor = SystemColors.Control;
|
||||||
public Color CheckBackColor
|
public Color CheckBackColor
|
||||||
{
|
{
|
||||||
get => _checkBackColor;
|
get => _checkBackColor;
|
||||||
set { _checkBackColor = value; Refresh(); }
|
set { _checkBackColor = value; Refresh(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
bool? _forceChecked;
|
private bool? _forceChecked;
|
||||||
public bool? ForceChecked
|
public bool? ForceChecked
|
||||||
{
|
{
|
||||||
get => _forceChecked;
|
get => _forceChecked;
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace BizHawk.Client.EmuHawk.CustomControls
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A customizable Dialog box with 3 buttons, custom icon, and checkbox.
|
/// A customizable Dialog box with 3 buttons, custom icon, and checkbox.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
partial class MsgBox : Form
|
internal partial class MsgBox : Form
|
||||||
{
|
{
|
||||||
private readonly Icon _msgIcon;
|
private readonly Icon _msgIcon;
|
||||||
private static readonly int FormYMargin = UIHelper.ScaleY(10);
|
private static readonly int FormYMargin = UIHelper.ScaleY(10);
|
||||||
|
|
|
@ -12,9 +12,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RetainedViewportPanel : Control
|
public class RetainedViewportPanel : Control
|
||||||
{
|
{
|
||||||
Thread threadPaint;
|
private Thread threadPaint;
|
||||||
EventWaitHandle ewh;
|
private EventWaitHandle ewh;
|
||||||
volatile bool killSignal;
|
private volatile bool killSignal;
|
||||||
|
|
||||||
public Func<Bitmap,bool> ReleaseCallback;
|
public Func<Bitmap,bool> ReleaseCallback;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public bool ScaleImage = true;
|
public bool ScaleImage = true;
|
||||||
|
|
||||||
void DoPaint()
|
private void DoPaint()
|
||||||
{
|
{
|
||||||
if (bmp != null)
|
if (bmp != null)
|
||||||
{
|
{
|
||||||
|
@ -86,7 +86,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
CleanupDisposeQueue();
|
CleanupDisposeQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaintProc()
|
private void PaintProc()
|
||||||
{
|
{
|
||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CleanupDisposeQueue()
|
private void CleanupDisposeQueue()
|
||||||
{
|
{
|
||||||
lock (this)
|
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)
|
if (threadPaint == null)
|
||||||
DoPaint();
|
DoPaint();
|
||||||
|
@ -139,7 +139,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
SignalPaint();
|
SignalPaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
Bitmap bmp;
|
private Bitmap bmp;
|
||||||
|
|
||||||
/// <summary>bit of a hack; use at your own risk</summary>
|
/// <summary>bit of a hack; use at your own risk</summary>
|
||||||
/// <returns>you probably shouldn't modify this?</returns>
|
/// <returns>you probably shouldn't modify this?</returns>
|
||||||
|
|
|
@ -460,7 +460,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
UpdateSourceInternal(job);
|
UpdateSourceInternal(job);
|
||||||
}
|
}
|
||||||
|
|
||||||
Filters.BaseFilter CreateCoreScreenControl()
|
private Filters.BaseFilter CreateCoreScreenControl()
|
||||||
{
|
{
|
||||||
if (GlobalWin.Emulator is MelonDS nds)
|
if (GlobalWin.Emulator is MelonDS nds)
|
||||||
{
|
{
|
||||||
|
@ -529,7 +529,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public int VsyncDenominator => throw new InvalidOperationException();
|
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;
|
float ratio = x / y;
|
||||||
if (ratio <= 1)
|
if (ratio <= 1)
|
||||||
|
|
|
@ -177,22 +177,22 @@ namespace BizHawk.Client.EmuHawk.Filters
|
||||||
public IGL GL;
|
public IGL GL;
|
||||||
public IGuiRenderer GuiRenderer;
|
public IGuiRenderer GuiRenderer;
|
||||||
|
|
||||||
MelonDS nds;
|
private MelonDS nds;
|
||||||
|
|
||||||
//TODO: actually use this
|
//TODO: actually use this
|
||||||
bool nop = false;
|
private bool nop = false;
|
||||||
|
|
||||||
//matrices used for transforming screens
|
//matrices used for transforming screens
|
||||||
Matrix4 matTop, matBot;
|
private Matrix4 matTop, matBot;
|
||||||
Matrix4 matTopInvert, matBotInvert;
|
private Matrix4 matTopInvert, matBotInvert;
|
||||||
|
|
||||||
//final output area size
|
//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
|
//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;
|
var r = new Vector4(v.X,v.Y,0,1) * m;
|
||||||
return new Vector2(r.X, r.Y);
|
return new Vector2(r.X, r.Y);
|
||||||
|
@ -210,7 +210,7 @@ namespace BizHawk.Client.EmuHawk.Filters
|
||||||
DeclareInput(SurfaceDisposition.Texture);
|
DeclareInput(SurfaceDisposition.Texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrunchNumbers()
|
private void CrunchNumbers()
|
||||||
{
|
{
|
||||||
MatrixStack top = new MatrixStack(), bot = new MatrixStack();
|
MatrixStack top = new MatrixStack(), bot = new MatrixStack();
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@ namespace BizHawk.Client.EmuHawk.Filters
|
||||||
public class RetroShaderChain : IDisposable
|
public class RetroShaderChain : IDisposable
|
||||||
{
|
{
|
||||||
private static readonly Regex RxInclude = new Regex(@"^(\s)?\#include(\s)+(""|<)(.*)?(""|>)", RegexOptions.Multiline | RegexOptions.IgnoreCase);
|
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 (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public bool Vsync;
|
public bool Vsync;
|
||||||
|
|
||||||
void GLControlWrapper_SlimDX_Resize(object sender, EventArgs e)
|
private void GLControlWrapper_SlimDX_Resize(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_sdx.RefreshControlSwapChain(this);
|
_sdx.RefreshControlSwapChain(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool MainWindow;
|
public bool MainWindow;
|
||||||
|
|
||||||
void GraphicsControl_Paint(object sender, PaintEventArgs e)
|
private void GraphicsControl_Paint(object sender, PaintEventArgs e)
|
||||||
{
|
{
|
||||||
OnPaint(e);
|
OnPaint(e);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
public readonly IGL IGL;
|
public readonly IGL IGL;
|
||||||
|
|
||||||
private readonly IGraphicsControl _igc;
|
private readonly IGraphicsControl _igc;
|
||||||
readonly Control _managed;
|
private readonly Control _managed;
|
||||||
|
|
||||||
public virtual void SetVsync(bool state) { _igc.SetVsync(state); }
|
public virtual void SetVsync(bool state) { _igc.SetVsync(state); }
|
||||||
public virtual void SwapBuffers() { _igc.SwapBuffers(); }
|
public virtual void SwapBuffers() { _igc.SwapBuffers(); }
|
||||||
|
|
|
@ -67,8 +67,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
//TODO for real
|
//TODO for real
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyBlendState : IBlendState { }
|
private class MyBlendState : IBlendState { }
|
||||||
static readonly MyBlendState _rsBlendNoneVerbatim = new MyBlendState(), _rsBlendNoneOpaque = new MyBlendState(), _rsBlendNormal = new MyBlendState();
|
|
||||||
|
private static readonly MyBlendState _rsBlendNoneVerbatim = new MyBlendState(), _rsBlendNoneOpaque = new MyBlendState(), _rsBlendNormal = new MyBlendState();
|
||||||
|
|
||||||
public IBlendState BlendNoneCopy => _rsBlendNoneVerbatim;
|
public IBlendState BlendNoneCopy => _rsBlendNoneVerbatim;
|
||||||
public IBlendState BlendNoneOpaque => _rsBlendNoneOpaque;
|
public IBlendState BlendNoneOpaque => _rsBlendNoneOpaque;
|
||||||
|
@ -268,7 +269,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
IGL_GdiPlus Gdi;
|
private IGL_GdiPlus Gdi;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// the control associated with this render target (if any)
|
/// 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()
|
public Graphics GetCurrentGraphics()
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,8 +17,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public class IGL_SlimDX9 : IGL
|
public class IGL_SlimDX9 : IGL
|
||||||
{
|
{
|
||||||
const int D3DERR_DEVICELOST = -2005530520;
|
private const int D3DERR_DEVICELOST = -2005530520;
|
||||||
const int D3DERR_DEVICENOTRESET = -2005530519;
|
private const int D3DERR_DEVICENOTRESET = -2005530519;
|
||||||
|
|
||||||
private static Direct3D _d3d;
|
private static Direct3D _d3d;
|
||||||
internal Device Dev;
|
internal Device Dev;
|
||||||
|
|
|
@ -635,13 +635,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
|
|
||||||
INativeWindow OffscreenNativeWindow;
|
private INativeWindow OffscreenNativeWindow;
|
||||||
IGraphicsContext GraphicsContext;
|
private IGraphicsContext GraphicsContext;
|
||||||
|
|
||||||
//---------------
|
//---------------
|
||||||
//my utility methods
|
//my utility methods
|
||||||
|
|
||||||
GLControl CastControl(swf.Control swfControl)
|
private GLControl CastControl(swf.Control swfControl)
|
||||||
{
|
{
|
||||||
GLControl glc = swfControl as GLControl;
|
GLControl glc = swfControl as GLControl;
|
||||||
if (glc == null)
|
if (glc == null)
|
||||||
|
@ -649,7 +649,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return glc;
|
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();
|
var sw = new ShaderWrapper();
|
||||||
string info = "";
|
string info = "";
|
||||||
|
@ -670,7 +670,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CompileShaderSimple(int sid, string source, bool required)
|
private bool CompileShaderSimple(int sid, string source, bool required)
|
||||||
{
|
{
|
||||||
bool success = true;
|
bool success = true;
|
||||||
ErrorCode errcode;
|
ErrorCode errcode;
|
||||||
|
@ -716,7 +716,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnbindVertexAttributes()
|
private void UnbindVertexAttributes()
|
||||||
{
|
{
|
||||||
//HAMNUTS:
|
//HAMNUTS:
|
||||||
//its not clear how many bindings we'll have to disable before we can enable the ones we need..
|
//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();
|
currBindings.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void MyBindArrayData(VertexLayout layout, void* pData)
|
private unsafe void MyBindArrayData(VertexLayout layout, void* pData)
|
||||||
{
|
{
|
||||||
UnbindVertexAttributes();
|
UnbindVertexAttributes();
|
||||||
|
|
||||||
|
@ -798,7 +798,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
PurgeStateCache();
|
PurgeStateCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateRenderStates()
|
private void CreateRenderStates()
|
||||||
{
|
{
|
||||||
_rsBlendNoneVerbatim = new CacheBlendState(
|
_rsBlendNoneVerbatim = new CacheBlendState(
|
||||||
false,
|
false,
|
||||||
|
@ -816,14 +816,15 @@ namespace BizHawk.Client.EmuHawk
|
||||||
BlendingFactorSrc.One, BlendEquationMode.FuncAdd, BlendingFactorDest.Zero);
|
BlendingFactorSrc.One, BlendEquationMode.FuncAdd, BlendingFactorDest.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
CacheBlendState _rsBlendNoneVerbatim, _rsBlendNoneOpaque, _rsBlendNormal;
|
private CacheBlendState _rsBlendNoneVerbatim, _rsBlendNoneOpaque, _rsBlendNormal;
|
||||||
|
|
||||||
//state caches
|
//state caches
|
||||||
int sActiveTexture;
|
private int sActiveTexture;
|
||||||
VertexLayout sStateCurrentVertexLayout;
|
private VertexLayout sStateCurrentVertexLayout;
|
||||||
VertexLayout sStatePendingVertexLayout;
|
private VertexLayout sStatePendingVertexLayout;
|
||||||
HashSet<int> sVertexAttribEnables = new HashSet<int>();
|
private HashSet<int> sVertexAttribEnables = new HashSet<int>();
|
||||||
void PurgeStateCache()
|
|
||||||
|
private void PurgeStateCache()
|
||||||
{
|
{
|
||||||
sStateCurrentVertexLayout = null;
|
sStateCurrentVertexLayout = null;
|
||||||
sStatePendingVertexLayout = null;
|
sStatePendingVertexLayout = null;
|
||||||
|
|
|
@ -92,7 +92,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private readonly Joystick _joystick;
|
private readonly Joystick _joystick;
|
||||||
private JoystickState _state = new JoystickState();
|
private JoystickState _state = new JoystickState();
|
||||||
|
|
||||||
GamePad(Joystick joystick, int index)
|
private GamePad(Joystick joystick, int index)
|
||||||
{
|
{
|
||||||
_joystick = joystick;
|
_joystick = joystick;
|
||||||
PlayerNumber = index + 1;
|
PlayerNumber = index + 1;
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private static readonly List<GamePad360> Devices = new List<GamePad360>();
|
private static readonly List<GamePad360> Devices = new List<GamePad360>();
|
||||||
private static readonly bool IsAvailable;
|
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;
|
private static readonly XInputGetStateExProcDelegate XInputGetStateExProc;
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public int PlayerNumber => (int)_index0 + 1;
|
public int PlayerNumber => (int)_index0 + 1;
|
||||||
|
|
||||||
GamePad360(uint index0, Controller c)
|
private GamePad360(uint index0, Controller c)
|
||||||
{
|
{
|
||||||
this._index0 = index0;
|
this._index0 = index0;
|
||||||
_controller = c;
|
_controller = c;
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private static readonly List<KeyEvent> PendingEventList = new List<KeyEvent>();
|
private static readonly List<KeyEvent> PendingEventList = new List<KeyEvent>();
|
||||||
private static readonly List<KeyEvent> EventList = 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";
|
string pipeName = $"bizhawk-pid-{System.Diagnostics.Process.GetCurrentProcess().Id}-IPCKeyInput";
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public class Throttle
|
public class Throttle
|
||||||
{
|
{
|
||||||
int lastSkipRate;
|
private int lastSkipRate;
|
||||||
int framesToSkip;
|
private int framesToSkip;
|
||||||
int framesSkipped;
|
private int framesSkipped;
|
||||||
public bool skipNextFrame;
|
public bool skipNextFrame;
|
||||||
|
|
||||||
//if the emulator is paused then we don't need to behave as if unthrottled
|
//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)
|
if (tmethod == 1)
|
||||||
return (ulong)Stopwatch.GetTimestamp();
|
return (ulong)Stopwatch.GetTimestamp();
|
||||||
|
@ -137,13 +137,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return (ulong)Environment.TickCount;
|
return (ulong)Environment.TickCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly Func<uint, uint> TimeBeginPeriod = OSTailoredCode.IsUnixHost
|
private static readonly Func<uint, uint> TimeBeginPeriod = OSTailoredCode.IsUnixHost
|
||||||
? u => u
|
? u => u
|
||||||
: (Func<uint, uint>) Win32Imports.timeBeginPeriod;
|
: (Func<uint, uint>) Win32Imports.timeBeginPeriod;
|
||||||
|
|
||||||
static readonly int tmethod;
|
private static readonly int tmethod;
|
||||||
static readonly ulong afsfreq;
|
private static readonly ulong afsfreq;
|
||||||
static readonly ulong tfreq;
|
private static readonly ulong tfreq;
|
||||||
|
|
||||||
static Throttle()
|
static Throttle()
|
||||||
{
|
{
|
||||||
|
@ -170,7 +170,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
SetSpeedPercent(target_pct);
|
SetSpeedPercent(target_pct);
|
||||||
}
|
}
|
||||||
|
|
||||||
int pct = -1;
|
private int pct = -1;
|
||||||
public void SetSpeedPercent(int percent)
|
public void SetSpeedPercent(int percent)
|
||||||
{
|
{
|
||||||
//Console.WriteLine($"throttle set percent {percent}");
|
//Console.WriteLine($"throttle set percent {percent}");
|
||||||
|
@ -183,17 +183,17 @@ namespace BizHawk.Client.EmuHawk
|
||||||
AutoFrameSkip_IgnorePreviousDelay();
|
AutoFrameSkip_IgnorePreviousDelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong core_desiredfps;
|
private ulong core_desiredfps;
|
||||||
ulong desiredfps;
|
private ulong desiredfps;
|
||||||
float desiredspf;
|
private float desiredspf;
|
||||||
|
|
||||||
ulong ltime;
|
private ulong ltime;
|
||||||
ulong beginticks, endticks, preThrottleEndticks;
|
private ulong beginticks, endticks, preThrottleEndticks;
|
||||||
float fSkipFrames;
|
private float fSkipFrames;
|
||||||
float fSkipFramesError;
|
private float fSkipFramesError;
|
||||||
int lastSkip;
|
private int lastSkip;
|
||||||
float lastError;
|
private float lastError;
|
||||||
float integral;
|
private float integral;
|
||||||
|
|
||||||
public void AutoFrameSkip_IgnorePreviousDelay()
|
public void AutoFrameSkip_IgnorePreviousDelay()
|
||||||
{
|
{
|
||||||
|
@ -205,12 +205,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
fSkipFrames *= 0.5f;
|
fSkipFrames *= 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoFrameSkip_BeforeThrottle()
|
private void AutoFrameSkip_BeforeThrottle()
|
||||||
{
|
{
|
||||||
preThrottleEndticks = GetCurTime();
|
preThrottleEndticks = GetCurTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoFrameSkip_NextFrame()
|
private void AutoFrameSkip_NextFrame()
|
||||||
{
|
{
|
||||||
endticks = GetCurTime();
|
endticks = GetCurTime();
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
beginticks = GetCurTime();
|
beginticks = GetCurTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
int AutoFrameSkip_GetSkipAmount(int min, int max)
|
private int AutoFrameSkip_GetSkipAmount(int min, int max)
|
||||||
{
|
{
|
||||||
int rv = (int)fSkipFrames;
|
int rv = (int)fSkipFrames;
|
||||||
fSkipFramesError += fSkipFrames - rv;
|
fSkipFramesError += fSkipFrames - rv;
|
||||||
|
@ -306,7 +306,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpeedThrottle(Sound sound, bool paused)
|
private void SpeedThrottle(Sound sound, bool paused)
|
||||||
{
|
{
|
||||||
AutoFrameSkip_BeforeThrottle();
|
AutoFrameSkip_BeforeThrottle();
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
this.Invoke(() => _thread = null);
|
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));
|
this.Invoke(() => ProgressUpdate(e.Completed, e.Total));
|
||||||
e.ShouldCancel = false;
|
e.ShouldCancel = false;
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
[RequiredService]
|
[RequiredService]
|
||||||
private IMemoryDomains MemoryDomains { get; set; }
|
private IMemoryDomains MemoryDomains { get; set; }
|
||||||
|
|
||||||
ICodeDataLogger _icdlogger;
|
private ICodeDataLogger _icdlogger;
|
||||||
|
|
||||||
[RequiredService]
|
[RequiredService]
|
||||||
private ICodeDataLogger CodeDataLogger
|
private ICodeDataLogger CodeDataLogger
|
||||||
|
@ -306,7 +306,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RecentSubMenu.DropDownItems.AddRange(_recent.RecentMenu(LoadFile, "Session"));
|
RecentSubMenu.DropDownItems.AddRange(_recent.RecentMenu(LoadFile, "Session"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewFileLogic()
|
private void NewFileLogic()
|
||||||
{
|
{
|
||||||
_cdl = new CodeDataLog();
|
_cdl = new CodeDataLog();
|
||||||
CodeDataLogger.NewCDL(_cdl);
|
CodeDataLogger.NewCDL(_cdl);
|
||||||
|
@ -355,7 +355,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LoadFile(file.FullName);
|
LoadFile(file.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunSave()
|
private void RunSave()
|
||||||
{
|
{
|
||||||
_recent.Add(_currentFilename);
|
_recent.Add(_currentFilename);
|
||||||
using var fs = new FileStream(_currentFilename, FileMode.Create, FileAccess.Write);
|
using var fs = new FileStream(_currentFilename, FileMode.Create, FileAccess.Write);
|
||||||
|
@ -382,7 +382,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// returns false if the operation was canceled
|
/// returns false if the operation was canceled
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool RunSaveAs()
|
private bool RunSaveAs()
|
||||||
{
|
{
|
||||||
var file = SaveFileDialog(
|
var file = SaveFileDialog(
|
||||||
_currentFilename,
|
_currentFilename,
|
||||||
|
@ -467,7 +467,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShutdownCDL()
|
private void ShutdownCDL()
|
||||||
{
|
{
|
||||||
_cdl = null;
|
_cdl = null;
|
||||||
CodeDataLogger?.SetCDL(null);
|
CodeDataLogger?.SetCDL(null);
|
||||||
|
|
|
@ -110,7 +110,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <param name="dest">top left origin on 32bit bitmap</param>
|
/// <param name="dest">top left origin on 32bit bitmap</param>
|
||||||
/// <param name="pitch">pitch of bitmap in 4 byte units</param>
|
/// <param name="pitch">pitch of bitmap in 4 byte units</param>
|
||||||
/// <param name="pal">4 palette colors</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++)
|
for (int y = 0; y < 8; y++)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +139,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <param name="pal">4 palette colors</param>
|
/// <param name="pal">4 palette colors</param>
|
||||||
/// <param name="hFlip">true to flip horizontally</param>
|
/// <param name="hFlip">true to flip horizontally</param>
|
||||||
/// <param name="vFlip">true to flip vertically</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)
|
if (vFlip)
|
||||||
dest += pitch * 7;
|
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="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="wrap">true if tileindexes are s8 (not u8)</param>
|
||||||
/// <param name="_pal">8 palettes (4 colors each)</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);
|
var lockData = b.LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||||
byte* map = (byte*)_map;
|
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="b">bitmap to draw to. should be numpals x 4</param>
|
||||||
/// <param name="_pal">start of palettes</param>
|
/// <param name="_pal">start of palettes</param>
|
||||||
/// <param name="numpals">number of palettes (not colors)</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);
|
var lockData = b.LockBits(new Rectangle(0, 0, numpals, 4), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||||
int* dest = (int*)lockData.Scan0;
|
int* dest = (int*)lockData.Scan0;
|
||||||
|
@ -355,7 +355,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
b.UnlockBits(lockData);
|
b.UnlockBits(lockData);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScanlineCallback(byte lcdc)
|
private void ScanlineCallback(byte lcdc)
|
||||||
{
|
{
|
||||||
using (_memory.EnterExit())
|
using (_memory.EnterExit())
|
||||||
{
|
{
|
||||||
|
@ -486,7 +486,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private void radioButtonRefreshScanline_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
|
private void radioButtonRefreshScanline_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
|
||||||
private void radioButtonRefreshManual_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
|
private void radioButtonRefreshManual_CheckedChanged(object sender, EventArgs e) { ComputeRefreshValues(); }
|
||||||
|
|
||||||
void ComputeRefreshValues()
|
private void ComputeRefreshValues()
|
||||||
{
|
{
|
||||||
if (radioButtonRefreshFrame.Checked)
|
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())
|
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())
|
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())
|
using (_memory.EnterExit())
|
||||||
{
|
{
|
||||||
|
|
|
@ -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++)
|
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++)
|
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)
|
if (eightbit)
|
||||||
DrawTextNameTable256(dest, pitch, nametable, tiles);
|
DrawTextNameTable256(dest, pitch, nametable, tiles);
|
||||||
|
@ -159,7 +159,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
DrawTextNameTable16(dest, pitch, nametable, tiles);
|
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];
|
ushort bgcnt = ((ushort*)_mmio)[4 + n];
|
||||||
int ssize = bgcnt >> 14;
|
int ssize = bgcnt >> 14;
|
||||||
|
@ -218,7 +218,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
mbv.BmpView.Refresh();
|
mbv.BmpView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawAffineBG(int n, MobileBmpView mbv)
|
private unsafe void DrawAffineBG(int n, MobileBmpView mbv)
|
||||||
{
|
{
|
||||||
ushort bgcnt = ((ushort*)_mmio)[4 + n];
|
ushort bgcnt = ((ushort*)_mmio)[4 + n];
|
||||||
int ssize = bgcnt >> 14;
|
int ssize = bgcnt >> 14;
|
||||||
|
@ -254,7 +254,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
mbv.BmpView.Refresh();
|
mbv.BmpView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawM3BG(MobileBmpView mbv)
|
private unsafe void DrawM3BG(MobileBmpView mbv)
|
||||||
{
|
{
|
||||||
mbv.ChangeAllSizes(240, 160);
|
mbv.ChangeAllSizes(240, 160);
|
||||||
Bitmap bmp = mbv.BmpView.Bmp;
|
Bitmap bmp = mbv.BmpView.Bmp;
|
||||||
|
@ -280,7 +280,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
mbv.BmpView.Refresh();
|
mbv.BmpView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawM4BG(MobileBmpView mbv, bool secondFrame)
|
private unsafe void DrawM4BG(MobileBmpView mbv, bool secondFrame)
|
||||||
{
|
{
|
||||||
mbv.ChangeAllSizes(240, 160);
|
mbv.ChangeAllSizes(240, 160);
|
||||||
Bitmap bmp = mbv.BmpView.Bmp;
|
Bitmap bmp = mbv.BmpView.Bmp;
|
||||||
|
@ -307,7 +307,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
mbv.BmpView.Refresh();
|
mbv.BmpView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawM5BG(MobileBmpView mbv, bool secondFrame)
|
private unsafe void DrawM5BG(MobileBmpView mbv, bool secondFrame)
|
||||||
{
|
{
|
||||||
mbv.ChangeAllSizes(160, 128);
|
mbv.ChangeAllSizes(160, 128);
|
||||||
Bitmap bmp = mbv.BmpView.Bmp;
|
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 } } };
|
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 attr0 = sprite[0];
|
||||||
ushort attr1 = sprite[1];
|
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);
|
mbv.BmpView.ChangeBitmapSize(1024, 512);
|
||||||
Bitmap bmp = mbv.BmpView.Bmp;
|
Bitmap bmp = mbv.BmpView.Bmp;
|
||||||
|
@ -442,7 +442,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
mbv.BmpView.Refresh();
|
mbv.BmpView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawPalette(MobileBmpView mbv, bool sprite)
|
private unsafe void DrawPalette(MobileBmpView mbv, bool sprite)
|
||||||
{
|
{
|
||||||
mbv.BmpView.ChangeBitmapSize(16, 16);
|
mbv.BmpView.ChangeBitmapSize(16, 16);
|
||||||
Bitmap bmp = mbv.BmpView.Bmp;
|
Bitmap bmp = mbv.BmpView.Bmp;
|
||||||
|
@ -465,7 +465,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
mbv.BmpView.Refresh();
|
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++)
|
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 tw = eightbit ? 16 : 32;
|
||||||
int th = tophalfonly ? 16 : 32;
|
int th = tophalfonly ? 16 : 32;
|
||||||
|
@ -516,7 +516,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
mbv.BmpView.Refresh();
|
mbv.BmpView.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawBGTiles(MobileBmpView mbv, bool eightbit)
|
private unsafe void DrawBGTiles(MobileBmpView mbv, bool eightbit)
|
||||||
{
|
{
|
||||||
int tw = eightbit ? 32 : 64;
|
int tw = eightbit ? 32 : 64;
|
||||||
int th = 32;
|
int th = 32;
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
bv.Refresh();
|
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);
|
var lockData = bmpViewPal.Bmp.LockBits(new Rectangle(0, 0, 16, 4), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||||
int pitch = lockData.Stride / sizeof(int);
|
int pitch = lockData.Stride / sizeof(int);
|
||||||
|
@ -98,7 +98,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
bmpViewPal.Refresh();
|
bmpViewPal.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawTiles()
|
private unsafe void DrawTiles()
|
||||||
{
|
{
|
||||||
var lockData = bmpViewTiles.Bmp.LockBits(new Rectangle(0, 0, 512, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
var lockData = bmpViewTiles.Bmp.LockBits(new Rectangle(0, 0, 512, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||||
int pitch = lockData.Stride / sizeof(int);
|
int pitch = lockData.Stride / sizeof(int);
|
||||||
|
|
|
@ -1386,7 +1386,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
FindNextMenuItem.Enabled = !string.IsNullOrWhiteSpace(_findStr);
|
FindNextMenuItem.Enabled = !string.IsNullOrWhiteSpace(_findStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
string MakeCopyExportString(bool export)
|
private string MakeCopyExportString(bool export)
|
||||||
{
|
{
|
||||||
// make room for an array with _secondaryHighlightedAddresses and optionally HighlightedAddress
|
// make room for an array with _secondaryHighlightedAddresses and optionally HighlightedAddress
|
||||||
long[] addresses = new long[_secondaryHighlightedAddresses.Count + (_highlightedAddress.HasValue ? 1 : 0)];
|
long[] addresses = new long[_secondaryHighlightedAddresses.Count + (_highlightedAddress.HasValue ? 1 : 0)];
|
||||||
|
|
|
@ -44,7 +44,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
bmpViewSPPal.Refresh();
|
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;
|
int inc = pitch - 16;
|
||||||
dest -= inc;
|
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;
|
int inc = pitch - 8;
|
||||||
dest -= inc;
|
dest -= inc;
|
||||||
|
@ -68,7 +68,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawSprites()
|
private unsafe void DrawSprites()
|
||||||
{
|
{
|
||||||
Viewer.GetGpuData(checkBoxVDC2.Checked ? 1 : 0, view =>
|
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 =>
|
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 =>
|
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);
|
var lockData = bmp.LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
protected override void GeneralUpdate() => UpdateBefore();
|
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;
|
int inc = pitch - 8;
|
||||||
dest -= inc;
|
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 incX = hflip ? -1 : 1;
|
||||||
int incY = vflip ? -pitch : pitch;
|
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);
|
var lockData = bmpViewTiles.Bmp.LockBits(new Rectangle(0, 0, 256, 128), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||||
int* dest = (int*)lockData.Scan0;
|
int* dest = (int*)lockData.Scan0;
|
||||||
|
@ -84,7 +84,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
bmpViewTiles.Refresh();
|
bmpViewTiles.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe void DrawBG(int* pal)
|
private unsafe void DrawBG(int* pal)
|
||||||
{
|
{
|
||||||
int bgHeight = Vdp.FrameHeight == 192 ? 224 : 256;
|
int bgHeight = Vdp.FrameHeight == 192 ? 224 : 256;
|
||||||
int maxTile = bgHeight * 4;
|
int maxTile = bgHeight * 4;
|
||||||
|
@ -120,7 +120,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
bmpViewBG.Refresh();
|
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);
|
var lockData = bmpViewPalette.Bmp.LockBits(new Rectangle(0, 0, 16, 2), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
|
||||||
int* dest = (int*)lockData.Scan0;
|
int* dest = (int*)lockData.Scan0;
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
public unsafe partial class SNESGraphicsDebugger : ToolFormBase, IToolFormAutoConfig
|
public unsafe partial class SNESGraphicsDebugger : ToolFormBase, IToolFormAutoConfig
|
||||||
{
|
{
|
||||||
readonly List<DisplayTypeItem> displayTypeItems = new List<DisplayTypeItem>();
|
private readonly List<DisplayTypeItem> displayTypeItems = new List<DisplayTypeItem>();
|
||||||
|
|
||||||
[RequiredService]
|
[RequiredService]
|
||||||
private LibsnesCore Emulator { get; set; }
|
private LibsnesCore Emulator { get; set; }
|
||||||
|
@ -122,7 +122,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return bpp == 0 ? "---" : bpp.ToString();
|
return bpp == 0 ? "---" : bpp.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
string FormatVramAddress(int address)
|
private string FormatVramAddress(int address)
|
||||||
{
|
{
|
||||||
int excess = address & 1023;
|
int excess = address & 1023;
|
||||||
return excess != 0
|
return excess != 0
|
||||||
|
@ -169,7 +169,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
suppression = false;
|
suppression = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncCore()
|
private void SyncCore()
|
||||||
{
|
{
|
||||||
if (currentSnesCore != Emulator)
|
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)
|
//todo - something smarter to cycle through bitmaps without repeatedly trashing them (use the dispose callback on the viewer)
|
||||||
private void RenderView()
|
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,
|
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
|
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; }
|
private static bool IsDisplayTypeBG(eDisplayType type) { return type == eDisplayType.BG1 || type == eDisplayType.BG2 || type == eDisplayType.BG3 || type == eDisplayType.BG4; }
|
||||||
static int DisplayTypeBGNum(eDisplayType type) { if(IsDisplayTypeBG(type)) return (int)type; else return -1; }
|
private static bool IsDisplayTypeOBJ(eDisplayType type) { return type == eDisplayType.OBJTiles0 || type == eDisplayType.OBJTiles1; }
|
||||||
static SNESGraphicsDecoder.BGMode BGModeForDisplayType(eDisplayType type)
|
private static int DisplayTypeBGNum(eDisplayType type) { if(IsDisplayTypeBG(type)) return (int)type; else return -1; }
|
||||||
|
|
||||||
|
private static SNESGraphicsDecoder.BGMode BGModeForDisplayType(eDisplayType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
@ -548,7 +550,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
UpdateToolsLoadstate();
|
UpdateToolsLoadstate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool suppression = false;
|
private bool suppression = false;
|
||||||
private void rbBGX_CheckedChanged(object sender, EventArgs e)
|
private void rbBGX_CheckedChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (suppression) return;
|
if (suppression) return;
|
||||||
|
@ -599,13 +601,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle GetPaletteRegion(SNESGraphicsDecoder.PaletteSelection sel)
|
private Rectangle GetPaletteRegion(SNESGraphicsDecoder.PaletteSelection sel)
|
||||||
{
|
{
|
||||||
int start = sel.start, num = sel.size;
|
int start = sel.start, num = sel.size;
|
||||||
return GetPaletteRegion(start, num);
|
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);
|
int cellTotalSize = (paletteCellSize + paletteCellSpacing);
|
||||||
|
|
||||||
|
@ -827,7 +829,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
//cd.ShowDialog(this);
|
//cd.ShowDialog(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyncViewerSize()
|
private void SyncViewerSize()
|
||||||
{
|
{
|
||||||
viewer.Size = check2x.Checked ? new Size(1024, 1024) : new Size(512, 512);
|
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 tileStride = pxacross / 8;
|
||||||
int tilesTall = pxtall / 8;
|
int tilesTall = pxtall / 8;
|
||||||
|
@ -1072,7 +1074,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
SetTab(tpOBJ);
|
SetTab(tpOBJ);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetTab(TabPage tpSet)
|
private void SetTab(TabPage tpSet)
|
||||||
{
|
{
|
||||||
//doesnt work well
|
//doesnt work well
|
||||||
//foreach (var tp in tabctrlDetails.TabPages)
|
//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())
|
using (gd.EnterExit())
|
||||||
{
|
{
|
||||||
|
@ -1279,7 +1281,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
RenderTileView();
|
RenderTileView();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshBGENCheckStatesFromConfig()
|
private void RefreshBGENCheckStatesFromConfig()
|
||||||
{
|
{
|
||||||
var s = Emulator.GetSettings();
|
var s = Emulator.GetSettings();
|
||||||
checkEN0_BG1.Checked = s.ShowBG1_0;
|
checkEN0_BG1.Checked = s.ShowBG1_0;
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
[Schema("ZXSpectrum")]
|
[Schema("ZXSpectrum")]
|
||||||
// ReSharper disable once UnusedMember.Global
|
// ReSharper disable once UnusedMember.Global
|
||||||
class ZxSpectrumSchema : IVirtualPadSchema
|
internal class ZxSpectrumSchema : IVirtualPadSchema
|
||||||
{
|
{
|
||||||
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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>
|
/// <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>
|
/// <exception cref="InvalidOperationException"><paramref name="o1"/> is an array with rank > 1 or is a non-zero-indexed array</exception>
|
||||||
|
|
|
@ -61,7 +61,7 @@ namespace BizHawk.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ThreadProc()
|
private static void ThreadProc()
|
||||||
{
|
{
|
||||||
// squirrely logic, trying not to create garbage
|
// squirrely logic, trying not to create garbage
|
||||||
var knownTempDirs = new HashSet<string>();
|
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)
|
public static void HelperSetTempPath(string path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,12 +13,12 @@ namespace BizHawk.Emulation.Common
|
||||||
{
|
{
|
||||||
public static class Database
|
public static class Database
|
||||||
{
|
{
|
||||||
static Dictionary<string, CompactGameInfo> DB = new Dictionary<string, CompactGameInfo>();
|
private static Dictionary<string, CompactGameInfo> DB = new Dictionary<string, CompactGameInfo>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// blocks until the DB is done loading
|
/// blocks until the DB is done loading
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static EventWaitHandle acquire = new EventWaitHandle(false, EventResetMode.ManualReset);
|
private static EventWaitHandle acquire = new EventWaitHandle(false, EventResetMode.ManualReset);
|
||||||
|
|
||||||
private static string RemoveHashType(string hash)
|
private static string RemoveHashType(string hash)
|
||||||
{
|
{
|
||||||
|
@ -89,9 +89,9 @@ namespace BizHawk.Emulation.Common
|
||||||
File.AppendAllText(path, sb.ToString());
|
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
|
//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));
|
using var reader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read));
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<Import Project="../MainSlnCommon.props" />
|
<Import Project="../MainSlnCommon.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<NoWarn>$(NoWarn);SA1400</NoWarn>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Reference in New Issue