work on opengl display manager: optimized codepaths, user retroshader selection, support for importing a textureID from another core; add erase button to lua console;

This commit is contained in:
zeromus 2014-04-15 21:46:18 +00:00
parent 54949127ee
commit 7adc15d97e
36 changed files with 1692 additions and 987 deletions

View File

@ -60,6 +60,8 @@ namespace BizHawk.Client.Common
public int TargetZoomFactor = 2;
public int TargetScanlineFilterIntensity = 128; // choose between 0 and 256
public int TargetDisplayFilter = 0;
public int DispFinalFilter = 0;
public string DispUserFilterPath;
public RecentFiles RecentRoms = new RecentFiles(8);
public bool PauseWhenMenuActivated = true;
public bool SaveWindowPosition = true;
@ -161,7 +163,10 @@ namespace BizHawk.Client.Common
public int DispAutoholdx = 0;
public int DispAutoholdy = 0;
public int DispAutoholdanchor = 1;
public bool DispBlurry = false; // make display look ugly
public bool DispFixAspectRatio = true;
public bool DispFixScaleInteger = false;
// Sound options
public bool SoundEnabled = true;

View File

@ -407,6 +407,10 @@
<Compile Include="DisplayManager\DisplayManager.cs" />
<Compile Include="DisplayManager\DisplaySurface.cs" />
<Compile Include="DisplayManager\FilterManager.cs" />
<Compile Include="DisplayManager\Filters\BaseFilter.cs" />
<Compile Include="DisplayManager\Filters\Gui.cs" />
<Compile Include="DisplayManager\Filters\Utils.cs" />
<Compile Include="DisplayManager\Filters\Retro.cs" />
<Compile Include="DisplayManager\OSDManager.cs" />
<Compile Include="DisplayManager\RenderTargetFrugalizer.cs" />
<Compile Include="DisplayManager\SwappableDisplaySurfaceSet.cs" />
@ -1353,8 +1357,6 @@
<None Include="images\sms-icon.png" />
<None Include="images\pcb.png" />
<None Include="images\tvIcon.png" />
<None Include="Resources\pcb.png" />
<None Include="Resources\tvIcon.png" />
<EmbeddedResource Include="Resources\courier16px_0.png" />
<None Include="images\pcejin1.bmp" />
<None Include="images\watch.ico" />
@ -1454,6 +1456,7 @@
<None Include="images\alt_about_image.gif" />
<None Include="images\gba-icon.png" />
<None Include="images\checkbox.png" />
<None Include="images\Erase.png" />
<Content Include="images\logo.ico" />
<None Include="images\Paste.png" />
<None Include="images\reboot.png" />

View File

@ -1,4 +1,7 @@
using System;
//TODO
//we could flag textures as 'actually' render targets (keep a reference to the render target?) which could allow us to convert between them more quickly in some cases
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
@ -6,6 +9,7 @@ using System.Text;
using System.Threading;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
@ -13,6 +17,8 @@ using System.Drawing.Imaging;
using BizHawk.Common;
using BizHawk.Emulation.Common;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.FilterManager;
using BizHawk.Client.EmuHawk;
using BizHawk.Bizware.BizwareGL;
@ -28,6 +34,15 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
public class DisplayManager : IDisposable
{
class DisplayManagerRenderTargetProvider : FilterManager.IRenderTargetProvider
{
DisplayManagerRenderTargetProvider(Func<Size, RenderTarget> callback) { Callback = callback; }
Func<Size, RenderTarget> Callback;
RenderTarget FilterManager.IRenderTargetProvider.Get(Size size)
{
return Callback(size);
}
}
public DisplayManager(PresentationPanel presentationPanel)
{
@ -40,7 +55,6 @@ namespace BizHawk.Client.EmuHawk
Renderer = new GuiRenderer(GL);
Video2xFrugalizer = new RenderTargetFrugalizer(GL);
VideoTextureFrugalizer = new TextureFrugalizer(GL);
ShaderChainFrugalizers = new RenderTargetFrugalizer[16]; //hacky hardcoded limit.. need some other way to manage these
@ -56,16 +70,22 @@ namespace BizHawk.Client.EmuHawk
var fiHq2x = new FileInfo(System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(),"Shaders/BizHawk/hq2x.cgp"));
if(fiHq2x.Exists)
using(var stream = fiHq2x.OpenRead())
ShaderChain_hq2x = new RetroShaderChain(GL,new RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(),"Shaders/BizHawk"));
ShaderChain_hq2x = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk"));
var fiScanlines = new FileInfo(System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk/BizScanlines.cgp"));
if (fiScanlines.Exists)
using (var stream = fiScanlines.OpenRead())
ShaderChain_scanlines = new RetroShaderChain(GL,new RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(),"Shaders/BizHawk"));
ShaderChain_scanlines = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk"));
var fiBicubic = new FileInfo(System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk/bicubic-fast.cgp"));
if (fiBicubic.Exists)
using (var stream = fiBicubic.OpenRead())
ShaderChain_bicubic = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), System.IO.Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk"));
LuaSurfaceSets["emu"] = new SwappableDisplaySurfaceSet();
LuaSurfaceSets["native"] = new SwappableDisplaySurfaceSet();
LuaSurfaceFrugalizers["emu"] = new TextureFrugalizer(GL);
LuaSurfaceFrugalizers["native"] = new TextureFrugalizer(GL);
RefreshUserShader();
}
public bool Disposed { get; private set; }
@ -93,7 +113,7 @@ namespace BizHawk.Client.EmuHawk
//layer resources
PresentationPanel presentationPanel; //well, its the final layer's target, at least
GraphicsControl GraphicsControl; //well, its the final layer's target, at least
FilterManager.FilterProgram CurrentFilterProgram;
/// <summary>
/// these variables will track the dimensions of the last frame's (or the next frame? this is confusing) emulator native output size
@ -102,135 +122,249 @@ namespace BizHawk.Client.EmuHawk
TextureFrugalizer VideoTextureFrugalizer;
Dictionary<string, TextureFrugalizer> LuaSurfaceFrugalizers = new Dictionary<string, TextureFrugalizer>();
RenderTargetFrugalizer Video2xFrugalizer;
RenderTargetFrugalizer[] ShaderChainFrugalizers;
RetroShaderChain ShaderChain_hq2x, ShaderChain_scanlines;
Filters.RetroShaderChain ShaderChain_hq2x, ShaderChain_scanlines, ShaderChain_bicubic;
Filters.RetroShaderChain ShaderChain_user;
/// <summary>
/// This will receive an emulated output frame from an IVideoProvider and run it through the complete frame processing pipeline
/// Then it will stuff it into the bound PresentationPanel
/// </summary>
public void UpdateSource(IVideoProvider videoProvider)
public void RefreshUserShader()
{
//wrap the videoprovider data in a BitmapBuffer (no point to refactoring that many IVidepProviders)
BitmapBuffer bb = new BitmapBuffer(videoProvider.BufferWidth, videoProvider.BufferHeight, videoProvider.GetVideoBuffer());
if (ShaderChain_user != null)
ShaderChain_user.Dispose();
var fi = new FileInfo(Global.Config.DispUserFilterPath);
if (fi.Exists)
using (var stream = fi.OpenRead())
ShaderChain_user = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), Path.GetDirectoryName(Global.Config.DispUserFilterPath));
}
//record the size of what we received, since lua and stuff is gonna want to draw onto it
currEmuWidth = bb.Width;
currEmuHeight = bb.Height;
//now, acquire the data sent from the videoProvider into a texture
var videoTexture = VideoTextureFrugalizer.Get(bb);
//acquire the lua surfaces as textures
Texture2d luaEmuTexture = null;
var luaEmuSurface = LuaSurfaceSets["emu"].GetCurrent();
if (luaEmuSurface != null)
luaEmuTexture = LuaSurfaceFrugalizers["emu"].Get(luaEmuSurface);
Texture2d luaNativeTexture = null;
var luaNativeSurface = LuaSurfaceSets["native"].GetCurrent();
if (luaNativeSurface != null)
luaNativeTexture = LuaSurfaceFrugalizers["native"].Get(luaNativeSurface);
//select shader chain
RetroShaderChain selectedChain = null;
FilterManager.FilterProgram BuildDefaultChain(Size chain_insize, Size chain_outsize)
{
//select user special FX shader chain
Dictionary<string, object> selectedChainProperties = new Dictionary<string, object>();
Filters.RetroShaderChain selectedChain = null;
if (Global.Config.TargetDisplayFilter == 1 && ShaderChain_hq2x != null && ShaderChain_hq2x.Available)
selectedChain = ShaderChain_hq2x;
if (Global.Config.TargetDisplayFilter == 2 && ShaderChain_scanlines != null && ShaderChain_scanlines.Available)
selectedChain = ShaderChain_scanlines;
//run shader chain
Texture2d currentTexture = videoTexture;
if (selectedChain != null)
{
foreach (var pass in selectedChain.Passes)
{
//calculate size of input and output (note, we dont have a distinction between logical size and POW2 buffer size yet, like we should)
Size insize = currentTexture.Size;
Size outsize = insize;
//shader.Pipeline["uIntensity"].Set(1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f);
selectedChain = ShaderChain_scanlines;
selectedChainProperties["uIntensity"] = 1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f;
}
if (Global.Config.TargetDisplayFilter == 3 && ShaderChain_user != null && ShaderChain_user.Available)
selectedChain = ShaderChain_user;
//calculate letterboxing scale factors for the current configuration, so that ScaleType.Viewport can do something intelligent
var LLpass = new LetterboxingLogic(GraphicsControl.Width, GraphicsControl.Height, insize.Width, insize.Height);
Filters.FinalPresentation fPresent = new Filters.FinalPresentation(chain_outsize);
Filters.SourceImage fInput = new Filters.SourceImage(chain_insize);
Filters.OSD fOSD = new Filters.OSD();
fOSD.RenderCallback = () =>
{
var size = fOSD.FindInput().SurfaceFormat.Size;
Renderer.Begin(size.Width, size.Height);
MyBlitter myBlitter = new MyBlitter(this);
myBlitter.ClipBounds = new Rectangle(0, 0, size.Width, size.Height);
Renderer.SetBlendState(GL.BlendNormal);
GlobalWin.OSD.Begin(myBlitter);
GlobalWin.OSD.DrawScreenInfo(myBlitter);
GlobalWin.OSD.DrawMessages(myBlitter);
Renderer.End();
};
if (pass.ScaleTypeX == RetroShaderPreset.ScaleType.Absolute) { throw new NotImplementedException("ScaleType Absolute"); }
if (pass.ScaleTypeX == RetroShaderPreset.ScaleType.Viewport) outsize.Width = LLpass.Rectangle.Width;
if (pass.ScaleTypeX == RetroShaderPreset.ScaleType.Source) outsize.Width = (int)(insize.Width * pass.Scale.X);
if (pass.ScaleTypeY == RetroShaderPreset.ScaleType.Absolute) { throw new NotImplementedException("ScaleType Absolute"); }
if (pass.ScaleTypeY == RetroShaderPreset.ScaleType.Viewport) outsize.Height = LLpass.Rectangle.Height;
if (pass.ScaleTypeY == RetroShaderPreset.ScaleType.Source) outsize.Height = (int)(insize.Height * pass.Scale.Y);
FilterManager.FilterProgram chain = new FilterManager.FilterProgram();
if (pass.InputFilterLinear)
videoTexture.SetFilterLinear();
else
videoTexture.SetFilterNearest();
//add the first filter, encompassing output from the emulator core
chain.AddFilter(fInput, "input");
var rt = ShaderChainFrugalizers[pass.Index].Get(outsize.Width, outsize.Height);
rt.Bind();
//add lua layer 'emu'
AppendLuaLayer(chain, "emu");
var shader = selectedChain.Shaders[pass.Index];
shader.Bind();
if(selectedChain == ShaderChain_scanlines)
shader.Pipeline["uIntensity"].Set(1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f);
shader.Run(currentTexture, insize, outsize, true);
currentTexture = rt.Texture2d;
}
//add user-selected retro shader
if (selectedChain != null)
AppendRetroShaderChain(chain, "retroShader", selectedChain, selectedChainProperties);
//choose final filter
Filters.FinalPresentation.eFilterOption finalFilter = Filters.FinalPresentation.eFilterOption.None;
if (Global.Config.DispFinalFilter == 1) finalFilter = Filters.FinalPresentation.eFilterOption.Bilinear;
if (Global.Config.DispFinalFilter == 2) finalFilter = Filters.FinalPresentation.eFilterOption.Bicubic;
//if bicubic is selected and unavailable, dont use it
if (!ShaderChain_bicubic.Available && fPresent.FilterOption == Filters.FinalPresentation.eFilterOption.Bicubic)
{
finalFilter = Filters.FinalPresentation.eFilterOption.None;
}
fPresent.FilterOption = finalFilter;
//now if bicubic is chosen, insert it
if (finalFilter == Filters.FinalPresentation.eFilterOption.Bicubic)
AppendRetroShaderChain(chain, "bicubic", ShaderChain_bicubic, null);
//add final presentation
chain.AddFilter(fPresent, "presentation");
//add lua layer 'native'
AppendLuaLayer(chain, "native");
//and OSD goes on top of that
chain.AddFilter(fOSD, "osd");
return chain;
}
void AppendRetroShaderChain(FilterManager.FilterProgram program, string name, Filters.RetroShaderChain retroChain, Dictionary<string, object> properties)
{
for (int i = 0; i < retroChain.Passes.Length; i++)
{
var pass = retroChain.Passes[i];
var rsp = new Filters.RetroShaderPass(retroChain, i);
string fname = string.Format("{0}[{1}]", name, i);
program.AddFilter(rsp, fname);
rsp.Parameters = properties;
}
}
void AppendLuaLayer(FilterManager.FilterProgram chain, string name)
{
Texture2d luaNativeTexture = null;
var luaNativeSurface = LuaSurfaceSets[name].GetCurrent();
if (luaNativeSurface == null)
return;
luaNativeTexture = LuaSurfaceFrugalizers[name].Get(luaNativeSurface);
var fLuaLayer = new Filters.LuaLayer();
fLuaLayer.SetTexture(luaNativeTexture);
chain.AddFilter(fLuaLayer, name);
}
/// <summary>
/// Using the current filter program, turn a mouse coordinate from window space to the original emulator screen space.
/// </summary>
public Point UntransformPoint(Point p)
{
//first, turn it into a window coordinate
p = presentationPanel.Control.PointToClient(p);
//now, if theres no filter program active, just give up
if (CurrentFilterProgram == null) return p;
//otherwise, have the filter program untransform it
Vector2 v = new Vector2(p.X, p.Y);
v = CurrentFilterProgram.UntransformPoint("default",v);
return new Point((int)v.X, (int)v.Y);
}
/// <summary>
/// This will receive an emulated output frame from an IVideoProvider and run it through the complete frame processing pipeline
/// Then it will stuff it into the bound PresentationPanel.
/// ---
/// If the int[] is size=1, then it contains an openGL texture ID (and the size should be as specified from videoProvider)
/// Don't worry about the case where the frontend isnt using opengl; it isnt supported yet, and it will be my responsibility to deal with anyway
/// </summary>
public void UpdateSource(IVideoProvider videoProvider)
{
int[] videoBuffer = videoProvider.GetVideoBuffer();
TESTEROO:
int bufferWidth = videoProvider.BufferWidth;
int bufferHeight = videoProvider.BufferHeight;
bool isGlTextureId = videoBuffer.Length == 1;
BitmapBuffer bb = null;
Texture2d videoTexture;
if (isGlTextureId)
{
videoTexture = GL.WrapGLTexture2d(new IntPtr(videoBuffer[0]), bufferWidth, bufferHeight);
}
else
{
//wrap the videoprovider data in a BitmapBuffer (no point to refactoring that many IVideoProviders)
bb = new BitmapBuffer(bufferWidth, bufferHeight, videoBuffer);
//now, acquire the data sent from the videoProvider into a texture
videoTexture = VideoTextureFrugalizer.Get(bb);
}
//begin drawing to the PresentationPanel:
GraphicsControl.Begin();
//TEST (to be removed once we have an actual example of bring in a texture ID from opengl emu core):
if (!isGlTextureId)
{
videoBuffer = new int[1] { videoTexture.Id.ToInt32() };
goto TESTEROO;
}
//1. clear it with the background color that the emulator specified (could we please only clear the necessary letterbox area, to save some time?)
GL.SetClearColor(Color.FromArgb(videoProvider.BackgroundColor));
GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit);
//record the size of what we received, since lua and stuff is gonna want to draw onto it
currEmuWidth = bufferWidth;
currEmuHeight = bufferHeight;
//2. begin 2d rendering
Renderer.Begin(GraphicsControl.Width, GraphicsControl.Height);
//build the default filter chain and set it up with services filters will need
Size chain_insize = new Size(bufferWidth, bufferHeight);
Size chain_outsize = GraphicsControl.Size;
CurrentFilterProgram = BuildDefaultChain(chain_insize, chain_outsize);
CurrentFilterProgram.GuiRenderer = Renderer;
CurrentFilterProgram.GL = GL;
//chain.RenderTargetProvider = new DisplayManagerRenderTargetProvider((size) => ShaderChainFrugalizers);
//3. figure out how to draw the emulator output content
var LL = new LetterboxingLogic(GraphicsControl.Width, GraphicsControl.Height, currentTexture.IntWidth, currentTexture.IntHeight);
//setup the source image filter
Filters.SourceImage fInput = CurrentFilterProgram["input"] as Filters.SourceImage;
fInput.Texture = videoTexture;
//setup the final presentation filter
Filters.FinalPresentation fPresent = CurrentFilterProgram["presentation"] as Filters.FinalPresentation;
fPresent.BackgroundColor = videoProvider.BackgroundColor;
fPresent.GuiRenderer = Renderer;
fPresent.GL = GL;
CurrentFilterProgram.Compile("default", chain_insize, chain_outsize);
//4. draw the emulator content
Renderer.SetBlendState(GL.BlendNone);
Renderer.Modelview.Push();
Renderer.Modelview.Translate(LL.dx, LL.dy);
Renderer.Modelview.Scale(LL.finalScale);
if (Global.Config.DispBlurry)
videoTexture.SetFilterLinear();
else
videoTexture.SetFilterNearest();
Renderer.Draw(currentTexture);
//4.b draw the "lua emu surface" which is designed for art matching up exactly with the emulator output
Renderer.SetBlendState(GL.BlendNormal);
if(luaEmuTexture != null) Renderer.Draw(luaEmuTexture);
Renderer.Modelview.Pop();
//run filter chain
Texture2d texCurr = null;
RenderTarget rtCurr = null;
int rtCounter = 0;
bool inFinalTarget = false;
foreach (var step in CurrentFilterProgram.Program)
{
switch (step.Type)
{
case FilterManager.FilterProgram.ProgramStepType.Run:
{
int fi = (int)step.Args;
var f = CurrentFilterProgram.Filters[fi];
f.SetInput(texCurr);
f.Run();
var orec = f.FindOutput();
if (orec != null)
{
if (orec.SurfaceDisposition == FilterManager.SurfaceDisposition.Texture)
{
texCurr = f.GetOutput();
rtCurr = null;
}
}
break;
}
case FilterManager.FilterProgram.ProgramStepType.NewTarget:
{
var size = (Size)step.Args;
rtCurr = ShaderChainFrugalizers[rtCounter++].Get(size);
rtCurr.Bind();
CurrentFilterProgram.CurrRenderTarget = rtCurr;
break;
}
case FilterManager.FilterProgram.ProgramStepType.FinalTarget:
inFinalTarget = true;
rtCurr = null;
CurrentFilterProgram.CurrRenderTarget = null;
GraphicsControl.Begin();
break;
}
}
Debug.Assert(inFinalTarget);
//5a. draw the native layer content
//4.b draw the "lua emu surface" which is designed for art matching up exactly with the emulator output
if (luaNativeTexture != null) Renderer.Draw(luaNativeTexture);
//5b. draw the native layer OSD
MyBlitter myBlitter = new MyBlitter(this);
myBlitter.ClipBounds = new Rectangle(0, 0, GraphicsControl.Width, GraphicsControl.Height);
GlobalWin.OSD.Begin(myBlitter);
GlobalWin.OSD.DrawScreenInfo(myBlitter);
GlobalWin.OSD.DrawMessages(myBlitter);
//6. finished drawing
Renderer.End();
//7. apply the vsync setting (should probably try to avoid repeating this)
//apply the vsync setting (should probably try to avoid repeating this)
bool vsync = Global.Config.VSyncThrottle || Global.Config.VSync;
presentationPanel.GraphicsControl.SetVsync(vsync);
//7. present and conclude drawing
//present and conclude drawing
presentationPanel.GraphicsControl.SwapBuffers();
presentationPanel.GraphicsControl.End();
//cleanup:
bb.Dispose();
if(bb != null) bb.Dispose();
NeedsToPaint = false; //??
}
@ -270,6 +404,16 @@ namespace BizHawk.Client.EmuHawk
return ret;
}
public void ClearLuaSurfaces()
{
foreach (var kvp in LuaSurfaceSets)
{
var surf = LockLuaSurface(kvp.Key);
surf.Clear();
UnlockLuaSurface(surf);
}
}
/// <summary>
/// Unlocks this DisplaySurface which had better have been locked as a lua surface
/// </summary>
@ -320,40 +464,7 @@ namespace BizHawk.Client.EmuHawk
public Rectangle ClipBounds { get; set; }
}
/// <summary>
/// applies letterboxing logic to figure out how to fit the source dimensions into the target dimensions.
/// In the future this could also apply rules like integer-only scaling, etc.
/// TODO - make this work with a output rect instead of float and dx/dy
/// </summary>
class LetterboxingLogic
{
public LetterboxingLogic(int targetWidth, int targetHeight, int sourceWidth, int sourceHeight)
{
float vw = (float)targetWidth;
float vh = (float)targetHeight;
float widthScale = vw / sourceWidth;
float heightScale = vh / sourceHeight;
finalScale = Math.Min(widthScale, heightScale);
dx = (int)((vw - finalScale * sourceWidth) / 2);
dy = (int)((vh - finalScale * sourceHeight) / 2);
Rectangle = new Rectangle((int)dx, (int)dy, (int)(finalScale * sourceWidth), (int)(finalScale * sourceHeight));
}
/// <summary>
/// scale to be applied to both x and y
/// </summary>
public float finalScale;
/// <summary>
/// offset
/// </summary>
public float dx, dy;
/// <summary>
/// The destination rectangle
/// </summary>
public Rectangle Rectangle;
}
}
}

View File

@ -1,14 +1,13 @@
//https://github.com/Themaister/RetroArch/wiki/GLSL-shaders
//https://github.com/Themaister/Emulator-Shader-Pack/blob/master/Cg/README
//https://github.com/libretro/common-shaders/
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Drawing;
using BizHawk.Common;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.Filters;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Bizware.BizwareGL.Drivers.OpenTK;
@ -16,248 +15,226 @@ using BizHawk.Bizware.BizwareGL.Drivers.OpenTK;
using OpenTK;
using OpenTK.Graphics;
namespace BizHawk.Client.EmuHawk
namespace BizHawk.Client.EmuHawk.FilterManager
{
/// <summary>
///
/// </summary>
class RetroShaderChain : IDisposable
public enum SurfaceDisposition
{
public RetroShaderChain(IGL owner, RetroShaderPreset preset, string baseDirectory, bool debug = false)
{
Owner = owner;
this.Preset = preset;
Passes = preset.Passes.ToArray();
bool ok = true;
//load up the shaders
Shaders = new RetroShader[preset.Passes.Count];
for(int i=0;i<preset.Passes.Count;i++)
{
RetroShaderPreset.ShaderPass pass = preset.Passes[i];
//acquire content
string path = Path.Combine(baseDirectory, pass.ShaderPath);
string content = File.ReadAllText(path);
var shader = new RetroShader(Owner, content, debug);
Shaders[i] = shader;
if (!shader.Pipeline.Available)
ok = false;
}
Available = ok;
}
public void Dispose()
{
//todo
}
/// <summary>
/// Whether this shader chain is available (it wont be available if some resources failed to load or compile)
/// </summary>
public bool Available { get; private set; }
public readonly IGL Owner;
public readonly RetroShaderPreset Preset;
public readonly RetroShader[] Shaders;
public readonly RetroShaderPreset.ShaderPass[] Passes;
Unspecified, Texture, RenderTarget
}
class RetroShaderPreset
public class SurfaceFormat
{
/// <summary>
/// Parses an instance from a stream to a CGP file
/// </summary>
public RetroShaderPreset(Stream stream)
{
var content = new StreamReader(stream).ReadToEnd();
Dictionary<string,string> dict = new Dictionary<string,string>();
public SurfaceFormat(Size size) { this.Size = size; }
public Size Size { get; private set; }
}
//parse the key-value-pair format of the file
content = content.Replace("\r", "");
foreach (var _line in content.Split('\n'))
public class SurfaceState
{
public SurfaceState() { }
public SurfaceState(SurfaceFormat surfaceFormat, SurfaceDisposition surfaceDisposition = SurfaceDisposition.Unspecified)
{
this.SurfaceFormat = surfaceFormat;
this.SurfaceDisposition = surfaceDisposition;
}
public SurfaceFormat SurfaceFormat;
public SurfaceDisposition SurfaceDisposition;
}
public interface IRenderTargetProvider
{
RenderTarget Get(Size size);
}
public class FilterProgram
{
public List<BaseFilter> Filters = new List<BaseFilter>();
Dictionary<string, BaseFilter> FilterNameIndex = new Dictionary<string, BaseFilter>();
public List<ProgramStep> Program = new List<ProgramStep>();
public BaseFilter this[string name]
{
get
{
var line = _line.Trim();
if(line.StartsWith("#")) continue; //lines that are solely comments
if (line == "") continue; //empty line
int eq = line.IndexOf('=');
var key = line.Substring(0,eq).Trim();
var value = line.Substring(eq + 1).Trim();
int quote = value.IndexOf('\"');
if (quote != -1)
value = value.Substring(quote + 1, value.IndexOf('\"', quote + 1) - (quote + 1));
else
BaseFilter ret;
FilterNameIndex.TryGetValue(name, out ret);
return ret;
}
}
public enum ProgramStepType
{
Run,
NewTarget,
FinalTarget
}
//services to filters:
public GuiRenderer GuiRenderer;
public IGL GL;
public IRenderTargetProvider RenderTargetProvider;
public RenderTarget GetRenderTarget(string channel = "default") { return CurrRenderTarget; }
public RenderTarget CurrRenderTarget;
public void AddFilter(BaseFilter filter, string name = "")
{
Filters.Add(filter);
FilterNameIndex[name] = filter;
}
/// <summary>
/// Receives a point in the coordinate space of the output of the filter program and untransforms it back to input points
/// </summary>
public Vector2 UntransformPoint(string channel, Vector2 point)
{
for (int i = Filters.Count - 1; i >= 0; i--)
{
var filter = Filters[i];
point = filter.UntransformPoint(channel, point);
}
return point;
}
public class ProgramStep
{
public ProgramStep(ProgramStepType type, object args, string comment = null)
{
this.Type = type;
this.Args = args;
this.Comment = comment;
}
public ProgramStepType Type;
public object Args;
public string Comment;
public override string ToString()
{
if (Type == ProgramStepType.Run)
return string.Format("Run {0} ({1})", (int)Args, Comment);
if (Type == ProgramStepType.NewTarget)
return string.Format("NewTarget {0}", (Size)Args);
if (Type == ProgramStepType.FinalTarget)
return string.Format("FinalTarget");
return null;
}
}
public void Compile(string channel, Size insize, Size outsize)
{
RETRY:
Program.Clear();
//prep filters for initialization
foreach (var f in Filters)
{
f.BeginInitialization(this);
f.Initialize();
}
//propagate input size forwards through filter chain to allow a 'flex' filter to determine what its input will be
Size presize = insize;
for (int i = 0; i < Filters.Count; i++)
{
var filter = Filters[i];
presize = filter.PresizeInput(channel, presize);
}
//propagate output size backwards through filter chain to allow a 'flex' filter to determine its output based on the desired output needs
presize = outsize;
for (int i = Filters.Count - 1; i >= 0; i--)
{
var filter = Filters[i];
presize = filter.PresizeOutput(channel, presize);
}
SurfaceState currState = null;
List<SurfaceFormat> RenderTargets = new List<SurfaceFormat>();
for (int i = 0; i < Filters.Count; i++)
{
BaseFilter f = Filters[i];
//check whether this filter needs input. if so, notify it of the current pipeline state
var iosi = f.FindInput(channel);
if (iosi != null)
{
//remove comments from end of value. exclusive from above condition, since comments after quoted strings would be snipped by the quoted string extraction
int hash = value.IndexOf('#');
if (hash != -1)
value = value.Substring(0, hash);
value = value.Trim();
iosi.SurfaceFormat = currState.SurfaceFormat;
f.SetInputFormat(channel, currState);
//check if the desired disposition needs to change from texture to render target
//(if so, insert a render filter)
if (iosi.SurfaceDisposition == SurfaceDisposition.RenderTarget && currState.SurfaceDisposition == SurfaceDisposition.Texture)
{
var renderer = new Render();
Filters.Insert(i, renderer);
goto RETRY;
}
//check if the desired disposition needs to change from a render target to a texture
//(if so, the current render target gets resolved, and made no longer current
else if (iosi.SurfaceDisposition == SurfaceDisposition.Texture && currState.SurfaceDisposition == SurfaceDisposition.RenderTarget)
{
var resolver = new Resolve();
Filters.Insert(i, resolver);
goto RETRY;
}
}
dict[key.ToLower()] = value;
}
//process the keys
int nShaders = FetchInt(dict, "shaders", 0);
for (int i = 0; i < nShaders; i++)
//now, the filter will have set its output state depending on its input state. check if it outputs:
iosi = f.FindOutput(channel);
if (iosi != null)
{
if (currState == null)
{
currState = new SurfaceState();
currState.SurfaceFormat = iosi.SurfaceFormat;
currState.SurfaceDisposition = iosi.SurfaceDisposition;
}
else
{
//if output disposition is unspecified, change it to whatever we've got right now
if (iosi.SurfaceDisposition == SurfaceDisposition.Unspecified)
{
iosi.SurfaceDisposition = currState.SurfaceDisposition;
}
bool newTarget = false;
if (iosi.SurfaceFormat.Size != currState.SurfaceFormat.Size)
newTarget = true;
else if (currState.SurfaceDisposition == SurfaceDisposition.Texture && iosi.SurfaceDisposition == SurfaceDisposition.RenderTarget)
newTarget = true;
if (newTarget)
{
currState = new SurfaceState();
iosi.SurfaceFormat = currState.SurfaceFormat = iosi.SurfaceFormat;
iosi.SurfaceDisposition = currState.SurfaceDisposition = iosi.SurfaceDisposition;
Program.Add(new ProgramStep(ProgramStepType.NewTarget, currState.SurfaceFormat.Size));
}
else
{
currState.SurfaceDisposition = iosi.SurfaceDisposition;
}
}
}
Program.Add(new ProgramStep(ProgramStepType.Run, i, f.GetType().Name));
} //filter loop
//patch the program so that the final rendertarget set operation is the framebuffer instead
for (int i = Program.Count - 1; i >= 0; i--)
{
ShaderPass sp = new ShaderPass();
sp.Index = i;
Passes.Add(sp);
sp.InputFilterLinear = FetchBool(dict, "filter_linear" + i, false); //Should this value not be defined, the filtering option is implementation defined.
sp.OuputFloat = FetchBool(dict, "float_framebuffer" + i, false);
sp.FrameCountMod = FetchInt(dict, "frame_count_mod" + i, 1);
sp.ShaderPath = FetchString(dict, "shader" + i, "?"); //todo - change extension to .cg for better compatibility? just change .cg to .glsl transparently at last second?
//If no scale type is assumed, it is assumed that it is set to "source" with scaleN set to 1.0.
//It is possible to set scale_type_xN and scale_type_yN to specialize the scaling type in either direction. scale_typeN however overrides both of these.
sp.ScaleTypeX = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type_x" + i, "Source"), true);
sp.ScaleTypeY = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type_y" + i, "Source"), true);
ScaleType st = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type" + i, "NotSet"), true);
if (st != ScaleType.NotSet)
sp.ScaleTypeX = sp.ScaleTypeY = st;
//scaleN controls both scaling type in horizontal and vertical directions. If scaleN is defined, scale_xN and scale_yN have no effect.
sp.Scale.X = FetchFloat(dict, "scale_x" + i, 1);
sp.Scale.Y = FetchFloat(dict, "scale_y" + i, 1);
float scale = FetchFloat(dict, "scale" + i, -999);
if(scale != -999)
sp.Scale.X = sp.Scale.Y = FetchFloat(dict,"scale" + i, 1);
//TODO - LUTs
var ps = Program[i];
if (ps.Type == ProgramStepType.NewTarget)
{
var size = (Size)ps.Args;
Debug.Assert(size == outsize);
ps.Type = ProgramStepType.FinalTarget;
ps.Args = null;
break;
}
}
}
public List<ShaderPass> Passes = new List<ShaderPass>();
public enum ScaleType
{
NotSet, Source, Viewport, Absolute
}
public class ShaderPass
{
public int Index;
public string ShaderPath;
public bool InputFilterLinear;
public bool OuputFloat;
public int FrameCountMod;
public ScaleType ScaleTypeX;
public ScaleType ScaleTypeY;
public Vector2 Scale;
}
string FetchString(Dictionary<string, string> dict, string key, string @default)
{
string str;
if (dict.TryGetValue(key, out str))
return str;
else return @default;
}
int FetchInt(Dictionary<string, string> dict, string key, int @default)
{
string str;
if (dict.TryGetValue(key, out str))
return int.Parse(str);
else return @default;
}
float FetchFloat(Dictionary<string, string> dict, string key, float @default)
{
string str;
if (dict.TryGetValue(key, out str))
return float.Parse(str);
else return @default;
}
bool FetchBool(Dictionary<string, string> dict, string key, bool @default)
{
string str;
if (dict.TryGetValue(key, out str))
return ParseBool(str);
else return @default;
}
bool ParseBool(string value)
{
if (value == "1") return true;
if (value == "0") return false;
value = value.ToLower();
if (value == "true") return true;
if (value == "false") return false;
throw new InvalidOperationException("Unparseable bool in CGP file content");
}
}
}
//Here, I started making code to support GUI editing of filter chains.
//I decided to go for broke and implement retroarch's system first, and then the GUI editing should be able to internally produce a metashader
//namespace BizHawk.Client.EmuHawk
//{
// class FilterManager
// {
// class PipelineState
// {
// public PipelineState(PipelineState other)
// {
// Size = other.Size;
// Format = other.Format;
// }
// public Size Size;
// public string Format;
// }
// abstract class BaseFilter
// {
// bool Connect(FilterChain chain, BaseFilter parent)
// {
// Chain = chain;
// Parent = parent;
// return OnConnect();
// }
// public PipelineState OutputState;
// public FilterChain Chain;
// public BaseFilter Parent;
// public abstract bool OnConnect();
// }
// class FilterChain
// {
// public void AddFilter(BaseFilter filter)
// {
// }
// }
// class Filter_Grayscale : BaseFilter
// {
// public override bool OnConnect()
// {
// if(Parent.OutputState.Format != "rgb") return false;
// OutputState = new PipelineState { Parent.OutputState; }
// }
// }
// class Filter_EmuOutput_RGBA : BaseFilter
// {
// public Filter_EmuOutput_RGBA(int width, int height)
// {
// OutputState = new PipelineState() { Size = new Size(width, height), Format = "rgb" };
// }
// public override bool OnConnect()
// {
// return true;
// }
// }
// }
//}
}

View File

@ -0,0 +1,120 @@
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Drawing;
using BizHawk.Common;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.FilterManager;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Bizware.BizwareGL.Drivers.OpenTK;
using OpenTK;
using OpenTK.Graphics;
//Here's how to make a filter:
//1. Reset your state entirely in Initialize().
// The filter will be re-initialized several times while the chain is getting worked out, but not re-instantiated.
// This is sort of annoying, but there's pretty good reasons for it (some external process has created the filters and set parameters needed to govern their chaining and surface properties)
//2. In Initialize(), be sure to use DeclareInput
//(something about PresizeInput())
//3. PresizeOutput() will be called next
//4. In SetInputFormat(), use DeclareOutput to set the output based on your desires, or the provided input format.
//5. In Run(), the render target is already set. If using a texture, use InputTexture
//6. In Run(), if supplying an output texture, use YieldOutput
namespace BizHawk.Client.EmuHawk.Filters
{
public class BaseFilter
{
//initialization stuff
public void BeginInitialization(FilterProgram program) { IOSurfaceInfos.Clear(); FilterProgram = program; }
public virtual void Initialize() { }
public virtual Size PresizeInput(string channel, Size size) { return size; }
public virtual Size PresizeOutput(string channel, Size size) { return size; }
public virtual void SetInputFormat(string channel, SurfaceState state) { }
public Dictionary<string, object> Parameters = new Dictionary<string, object>();
//runtime signals
public virtual Vector2 UntransformPoint(string channel, Vector2 point)
{
//base class behaviour here just uses the input and output sizes, if appropriate. few filters will have to do anything more complex
var input = FindInput(channel);
var output = FindInput(channel);
if (input != null && output != null)
{
point.X *= ((float)output.SurfaceFormat.Size.Width) / (float)input.SurfaceFormat.Size.Width;
point.Y *= ((float)output.SurfaceFormat.Size.Height) / (float)input.SurfaceFormat.Size.Height;
}
return point;
}
public void SetInput(Texture2d tex)
{
InputTexture = tex;
}
public virtual void Run() { }
public Texture2d GetOutput() { return OutputTexture; }
//filter actions
protected void YieldOutput(Texture2d tex)
{
OutputTexture = tex;
}
protected FilterProgram FilterProgram;
protected Texture2d InputTexture;
private Texture2d OutputTexture;
//setup utilities
protected IOSurfaceInfo DeclareInput(SurfaceDisposition disposition = SurfaceDisposition.Unspecified, string channel = "default") { return DeclareIO(SurfaceDirection.Input, channel, disposition); }
protected IOSurfaceInfo DeclareOutput(SurfaceDisposition disposition = SurfaceDisposition.Unspecified, string channel = "default") { return DeclareIO(SurfaceDirection.Output, channel, disposition); }
protected IOSurfaceInfo DeclareOutput(SurfaceState state, string channel = "default")
{
var iosi = DeclareIO(SurfaceDirection.Output, channel, state.SurfaceDisposition);
iosi.SurfaceFormat = state.SurfaceFormat;
return iosi;
}
public IOSurfaceInfo FindInput(string channel = "default") { return FindIOSurfaceInfo(channel, SurfaceDirection.Input); }
public IOSurfaceInfo FindOutput(string channel = "default") { return FindIOSurfaceInfo(channel, SurfaceDirection.Output); }
private IOSurfaceInfo DeclareIO(SurfaceDirection direction, string channel, SurfaceDisposition disposition)
{
var iosi = new IOSurfaceInfo();
iosi.SurfaceDirection = direction;
iosi.Channel = channel;
iosi.SurfaceDisposition = disposition;
IOSurfaceInfos.Add(iosi);
return iosi;
}
List<IOSurfaceInfo> IOSurfaceInfos = new List<IOSurfaceInfo>();
IOSurfaceInfo FindIOSurfaceInfo(string channel, SurfaceDirection direction)
{
foreach (var iosi in IOSurfaceInfos)
if (iosi.Channel == channel && iosi.SurfaceDirection == direction)
return iosi;
return null;
}
public class IOSurfaceInfo
{
public SurfaceFormat SurfaceFormat;
public SurfaceDirection SurfaceDirection;
public SurfaceDisposition SurfaceDisposition;
public string Channel;
}
public enum SurfaceDirection
{
Input, Output
}
}
}

View File

@ -0,0 +1,226 @@
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Drawing;
using BizHawk.Common;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk;
using BizHawk.Client.EmuHawk.FilterManager;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Bizware.BizwareGL.Drivers.OpenTK;
using OpenTK;
using OpenTK.Graphics;
namespace BizHawk.Client.EmuHawk.Filters
{
/// <summary>
/// applies letterboxing logic to figure out how to fit the source dimensions into the target dimensions.
/// In the future this could also apply rules like integer-only scaling, etc.
/// </summary>
class LetterboxingLogic
{
/// <summary>
/// the location within the destination region of the output content (scaled and translated)
/// </summary>
public int vx, vy, vw, vh;
/// <summary>
/// the scale factor eventually used
/// </summary>
public float WidthScale, HeightScale;
public LetterboxingLogic(bool maintainAspect, bool maintainInteger, int targetWidth, int targetHeight, int sourceWidth, int sourceHeight)
{
//do maths on the viewport and the native resolution and the user settings to get a display rectangle
Size sz = new Size(targetWidth, targetHeight);
float widthScale = (float)sz.Width / sourceWidth;
float heightScale = (float)sz.Height / sourceHeight;
if (maintainAspect)
{
if (widthScale > heightScale) widthScale = heightScale;
if (heightScale > widthScale) heightScale = widthScale;
}
if (maintainInteger)
{
widthScale = (float)Math.Floor(widthScale);
heightScale = (float)Math.Floor(heightScale);
}
vw = (int)(widthScale * sourceWidth);
vh = (int)(heightScale * sourceHeight);
vx = (sz.Width - vw) / 2;
vy = (sz.Height - vh) / 2;
WidthScale = widthScale;
HeightScale = heightScale;
}
}
public class FinalPresentation : BaseFilter
{
public enum eFilterOption
{
None, Bilinear, Bicubic
}
public eFilterOption FilterOption = eFilterOption.None;
public RetroShaderChain BicubicFilter;
public FinalPresentation(Size size)
{
this.OutputSize = size;
}
Size OutputSize, InputSize;
public int BackgroundColor;
public GuiRenderer GuiRenderer;
public IGL GL;
bool nop;
LetterboxingLogic LL;
public override void Initialize()
{
DeclareInput();
nop = false;
}
public override Size PresizeOutput(string channel, Size size)
{
if (FilterOption == eFilterOption.Bicubic)
{
size.Width = LL.vw;
size.Height = LL.vh;
return size;
}
return base.PresizeOutput(channel, size);
}
public override Size PresizeInput(string channel, Size size)
{
if (FilterOption != eFilterOption.Bicubic)
return size;
LL = new LetterboxingLogic(Global.Config.DispFixAspectRatio, Global.Config.DispFixScaleInteger, OutputSize.Width, OutputSize.Height, size.Width, size.Height);
return size;
}
public override void SetInputFormat(string channel, SurfaceState state)
{
bool need = false;
if (state.SurfaceFormat.Size != OutputSize)
need = true;
if (FilterOption != eFilterOption.None)
need = true;
if (!need)
{
nop = true;
return;
}
FindInput().SurfaceDisposition = SurfaceDisposition.Texture;
DeclareOutput(new SurfaceState(new SurfaceFormat(OutputSize), SurfaceDisposition.RenderTarget));
InputSize = state.SurfaceFormat.Size;
LL = new LetterboxingLogic(Global.Config.DispFixAspectRatio, Global.Config.DispFixScaleInteger, OutputSize.Width, OutputSize.Height, InputSize.Width, InputSize.Height);
}
public override Vector2 UntransformPoint(string channel, Vector2 point)
{
if (nop)
return point;
point.X -= LL.vx;
point.Y -= LL.vy;
point.X /= LL.WidthScale;
point.Y /= LL.HeightScale;
return point;
}
public override void Run()
{
if (nop)
return;
GL.SetClearColor(Color.FromArgb(BackgroundColor));
GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit);
GuiRenderer.Begin(OutputSize.Width, OutputSize.Height);
GuiRenderer.SetBlendState(GL.BlendNone);
GuiRenderer.Modelview.Push();
GuiRenderer.Modelview.Translate(LL.vx, LL.vy);
GuiRenderer.Modelview.Scale(LL.WidthScale, LL.HeightScale);
if(FilterOption != eFilterOption.None)
InputTexture.SetFilterLinear();
else
InputTexture.SetFilterNearest();
if (FilterOption == eFilterOption.Bicubic)
{
}
GuiRenderer.Draw(InputTexture);
GuiRenderer.End();
}
}
public class LuaLayer : BaseFilter
{
public override void Initialize()
{
DeclareInput(SurfaceDisposition.RenderTarget);
}
public override void SetInputFormat(string channel, SurfaceState state)
{
DeclareOutput(state);
}
Bizware.BizwareGL.Texture2d Texture;
public void SetTexture(Bizware.BizwareGL.Texture2d tex)
{
Texture = tex;
}
public override void Run()
{
var outSize = FindOutput().SurfaceFormat.Size;
FilterProgram.GuiRenderer.Begin(outSize);
FilterProgram.GuiRenderer.SetBlendState(FilterProgram.GL.BlendNormal);
FilterProgram.GuiRenderer.Draw(Texture);
FilterProgram.GuiRenderer.End();
}
}
public class OSD : BaseFilter
{
//this class has the ability to disable its operations for higher performance when the callback is removed,
//without having to take it out of the chain. although, its presence in the chain may slow down performance due to added resolves/renders
//so, we should probably rebuild the chain.
public override void Initialize()
{
if (RenderCallback == null) return;
DeclareInput(SurfaceDisposition.RenderTarget);
}
public override void SetInputFormat(string channel, SurfaceState state)
{
if (RenderCallback == null) return;
DeclareOutput(state);
}
public Action RenderCallback;
public override void Run()
{
if (RenderCallback == null) return;
RenderCallback();
}
}
}

View File

@ -0,0 +1,274 @@
//https://github.com/Themaister/RetroArch/wiki/GLSL-shaders
//https://github.com/Themaister/Emulator-Shader-Pack/blob/master/Cg/README
//https://github.com/libretro/common-shaders/
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Drawing;
using BizHawk.Common;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk;
using BizHawk.Client.EmuHawk.FilterManager;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Bizware.BizwareGL.Drivers.OpenTK;
using OpenTK;
using OpenTK.Graphics;
namespace BizHawk.Client.EmuHawk.Filters
{
public class RetroShaderChain : IDisposable
{
public RetroShaderChain(IGL owner, RetroShaderPreset preset, string baseDirectory, bool debug = false)
{
Owner = owner;
this.Preset = preset;
Passes = preset.Passes.ToArray();
bool ok = true;
//load up the shaders
Shaders = new RetroShader[preset.Passes.Count];
for (int i = 0; i < preset.Passes.Count; i++)
{
RetroShaderPreset.ShaderPass pass = preset.Passes[i];
//acquire content
string path = Path.Combine(baseDirectory, pass.ShaderPath);
string content = File.ReadAllText(path);
var shader = new RetroShader(Owner, content, debug);
Shaders[i] = shader;
if (!shader.Pipeline.Available)
ok = false;
}
Available = ok;
}
public void Dispose()
{
//todo
}
/// <summary>
/// Whether this shader chain is available (it wont be available if some resources failed to load or compile)
/// </summary>
public bool Available { get; private set; }
public readonly IGL Owner;
public readonly RetroShaderPreset Preset;
public readonly RetroShader[] Shaders;
public readonly RetroShaderPreset.ShaderPass[] Passes;
}
public class RetroShaderPreset
{
/// <summary>
/// Parses an instance from a stream to a CGP file
/// </summary>
public RetroShaderPreset(Stream stream)
{
var content = new StreamReader(stream).ReadToEnd();
Dictionary<string, string> dict = new Dictionary<string, string>();
//parse the key-value-pair format of the file
content = content.Replace("\r", "");
foreach (var _line in content.Split('\n'))
{
var line = _line.Trim();
if (line.StartsWith("#")) continue; //lines that are solely comments
if (line == "") continue; //empty line
int eq = line.IndexOf('=');
var key = line.Substring(0, eq).Trim();
var value = line.Substring(eq + 1).Trim();
int quote = value.IndexOf('\"');
if (quote != -1)
value = value.Substring(quote + 1, value.IndexOf('\"', quote + 1) - (quote + 1));
else
{
//remove comments from end of value. exclusive from above condition, since comments after quoted strings would be snipped by the quoted string extraction
int hash = value.IndexOf('#');
if (hash != -1)
value = value.Substring(0, hash);
value = value.Trim();
}
dict[key.ToLower()] = value;
}
//process the keys
int nShaders = FetchInt(dict, "shaders", 0);
for (int i = 0; i < nShaders; i++)
{
ShaderPass sp = new ShaderPass();
sp.Index = i;
Passes.Add(sp);
sp.InputFilterLinear = FetchBool(dict, "filter_linear" + i, false); //Should this value not be defined, the filtering option is implementation defined.
sp.OuputFloat = FetchBool(dict, "float_framebuffer" + i, false);
sp.FrameCountMod = FetchInt(dict, "frame_count_mod" + i, 1);
sp.ShaderPath = FetchString(dict, "shader" + i, "?"); //todo - change extension to .cg for better compatibility? just change .cg to .glsl transparently at last second?
//If no scale type is assumed, it is assumed that it is set to "source" with scaleN set to 1.0.
//It is possible to set scale_type_xN and scale_type_yN to specialize the scaling type in either direction. scale_typeN however overrides both of these.
sp.ScaleTypeX = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type_x" + i, "Source"), true);
sp.ScaleTypeY = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type_y" + i, "Source"), true);
ScaleType st = (ScaleType)Enum.Parse(typeof(ScaleType), FetchString(dict, "scale_type" + i, "NotSet"), true);
if (st != ScaleType.NotSet)
sp.ScaleTypeX = sp.ScaleTypeY = st;
//scaleN controls both scaling type in horizontal and vertical directions. If scaleN is defined, scale_xN and scale_yN have no effect.
sp.Scale.X = FetchFloat(dict, "scale_x" + i, 1);
sp.Scale.Y = FetchFloat(dict, "scale_y" + i, 1);
float scale = FetchFloat(dict, "scale" + i, -999);
if (scale != -999)
sp.Scale.X = sp.Scale.Y = FetchFloat(dict, "scale" + i, 1);
//TODO - LUTs
}
}
public List<ShaderPass> Passes = new List<ShaderPass>();
public enum ScaleType
{
NotSet, Source, Viewport, Absolute
}
public class ShaderPass
{
public int Index;
public string ShaderPath;
public bool InputFilterLinear;
public bool OuputFloat;
public int FrameCountMod;
public ScaleType ScaleTypeX;
public ScaleType ScaleTypeY;
public Vector2 Scale;
}
string FetchString(Dictionary<string, string> dict, string key, string @default)
{
string str;
if (dict.TryGetValue(key, out str))
return str;
else return @default;
}
int FetchInt(Dictionary<string, string> dict, string key, int @default)
{
string str;
if (dict.TryGetValue(key, out str))
return int.Parse(str);
else return @default;
}
float FetchFloat(Dictionary<string, string> dict, string key, float @default)
{
string str;
if (dict.TryGetValue(key, out str))
return float.Parse(str);
else return @default;
}
bool FetchBool(Dictionary<string, string> dict, string key, bool @default)
{
string str;
if (dict.TryGetValue(key, out str))
return ParseBool(str);
else return @default;
}
bool ParseBool(string value)
{
if (value == "1") return true;
if (value == "0") return false;
value = value.ToLower();
if (value == "true") return true;
if (value == "false") return false;
throw new InvalidOperationException("Unparseable bool in CGP file content");
}
}
public class RetroShaderPass : BaseFilter
{
RetroShaderChain RSC;
RetroShaderPreset.ShaderPass SP;
int RSI;
Size OutputSize;
public override string ToString()
{
return string.Format("RetroShaderPass[#{0}]", RSI);
}
public RetroShaderPass(RetroShaderChain RSC, int index)
{
this.RSC = RSC;
this.RSI = index;
this.SP = RSC.Passes[index];
}
public override void Initialize()
{
DeclareInput(SurfaceDisposition.Texture);
}
public override void SetInputFormat(string channel, SurfaceState state)
{
Size insize = state.SurfaceFormat.Size;
if (SP.ScaleTypeX == RetroShaderPreset.ScaleType.Absolute) OutputSize.Width = (int)SP.Scale.X;
if (SP.ScaleTypeY == RetroShaderPreset.ScaleType.Absolute) OutputSize.Width = (int)SP.Scale.Y;
if (SP.ScaleTypeX == RetroShaderPreset.ScaleType.Source) OutputSize.Width = (int)(insize.Width * SP.Scale.X);
if (SP.ScaleTypeY == RetroShaderPreset.ScaleType.Source) OutputSize.Height = (int)(insize.Height * SP.Scale.Y);
var outState = new SurfaceState();
outState.SurfaceFormat = new SurfaceFormat(OutputSize);
outState.SurfaceDisposition = SurfaceDisposition.RenderTarget;
DeclareOutput(outState);
}
public override Size PresizeOutput(string channel, Size size)
{
OutputSize = size;
return size;
}
public override Size PresizeInput(string channel, Size insize)
{
Size outsize = insize;
if (SP.ScaleTypeX == RetroShaderPreset.ScaleType.Absolute) outsize.Width = (int)SP.Scale.X;
if (SP.ScaleTypeY == RetroShaderPreset.ScaleType.Absolute) outsize.Width = (int)SP.Scale.Y;
if (SP.ScaleTypeX == RetroShaderPreset.ScaleType.Source) outsize.Width = (int)(insize.Width * SP.Scale.X);
if (SP.ScaleTypeY == RetroShaderPreset.ScaleType.Source) outsize.Height = (int)(insize.Height * SP.Scale.Y);
return outsize;
}
public override void Run()
{
var shader = RSC.Shaders[RSI];
shader.Bind();
//apply all parameters to this shader.. even if it was meant for other shaders. kind of lame.
if(Parameters != null)
foreach (var kvp in Parameters)
{
if (kvp.Value is float)
shader.Pipeline[kvp.Key].Set((float)kvp.Value);
}
var outDisposition = FindOutput().SurfaceDisposition;
var input = InputTexture;
RSC.Shaders[RSI].Run(input, input.Size, OutputSize, InputTexture.IsUpsideDown);
}
}
}

View File

@ -0,0 +1,90 @@
using System;
using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Drawing;
using BizHawk.Common;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk;
using BizHawk.Client.EmuHawk.FilterManager;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Bizware.BizwareGL.Drivers.OpenTK;
using OpenTK;
using OpenTK.Graphics;
namespace BizHawk.Client.EmuHawk.Filters
{
public class SourceImage : BaseFilter
{
public SourceImage(Size size)
{
this.Size = size;
}
Size Size;
public Texture2d Texture;
public override void Run()
{
YieldOutput(Texture);
}
public override void Initialize()
{
DeclareOutput(new SurfaceState(new SurfaceFormat(Size), SurfaceDisposition.Texture));
}
public override void SetInputFormat(string channel, SurfaceState format)
{
DeclareOutput(SurfaceDisposition.Texture);
}
}
/// <summary>
/// transforms an input texture to an output render target (by rendering it)
/// </summary>
class Render : BaseFilter
{
public override void Initialize()
{
DeclareInput(SurfaceDisposition.Texture);
}
public override void SetInputFormat(string channel, SurfaceState state)
{
DeclareOutput(new SurfaceState(state.SurfaceFormat, SurfaceDisposition.RenderTarget));
}
public override void Run()
{
GuiRenderer renderer = FilterProgram.GuiRenderer;
renderer.Begin(FindOutput().SurfaceFormat.Size);
renderer.SetBlendState(FilterProgram.GL.BlendNone);
renderer.Draw(InputTexture);
renderer.End();
}
}
class Resolve : BaseFilter
{
public override void Initialize()
{
DeclareInput(SurfaceDisposition.RenderTarget);
}
public override void SetInputFormat(string channel, SurfaceState state)
{
DeclareOutput(new SurfaceState(state.SurfaceFormat, SurfaceDisposition.Texture));
}
public override void Run()
{
YieldOutput(FilterProgram.GetRenderTarget().Texture2d);
}
}
}

View File

@ -39,6 +39,7 @@ namespace BizHawk.Client.EmuHawk
IGL GL;
List<RenderTarget> CurrentRenderTargets;
public RenderTarget Get(System.Drawing.Size dimensions) { return Get(dimensions.Width, dimensions.Height); }
public RenderTarget Get(int width, int height)
{
//get the current entry
@ -59,7 +60,7 @@ namespace BizHawk.Client.EmuHawk
}
//now shuffle the buffers
CurrentRenderTargets.Insert(0, CurrentRenderTargets[1]);
CurrentRenderTargets[0] = CurrentRenderTargets[1];
CurrentRenderTargets[1] = CurrentRenderTarget;
return CurrentRenderTarget;

View File

@ -67,7 +67,7 @@ namespace BizHawk.Client.EmuHawk
}
//now shuffle the buffers
CurrentTextures.Insert(0,CurrentTextures[1]);
CurrentTextures[0] = CurrentTextures[1];
CurrentTextures[1] = CurrentTexture;
return CurrentTexture;

View File

@ -57,20 +57,7 @@ namespace BizHawk.Client.EmuHawk
public bool Resized { get; set; }
public sd.Point ScreenToScreen(sd.Point p)
{
//TODO GL - yeah, this is broken for now, sorry.
//This logic now has more to do with DisplayManager
//p = GraphicsControl.Control.PointToClient(p);
//sd.Point ret = new sd.Point(p.X * sw / GraphicsControl.Control.Width,
// p.Y * sh / GraphicsControl.Control.Height);
//return ret;
throw new InvalidOperationException("Not supported right now, sorry");
}
public Size NativeSize { get { return GraphicsControl.ClientSize; } }
}

File diff suppressed because it is too large Load Diff

View File

@ -118,6 +118,12 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="C64Keyboard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\C64Keyboard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="checkbox" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\checkbox.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AudioHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\AudioHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -139,6 +145,9 @@
<data name="SaveAs" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\SaveAs.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="tvIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\tvIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Save.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -148,9 +157,6 @@
<data name="SMSController" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\SMSController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="redo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\redo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MoveRight" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\MoveRight.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -160,8 +166,11 @@
<data name="poke" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\poke.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GBA_Controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\GBA_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="A78Joystick" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\A78Joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Paste" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Paste.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NewFile" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\NewFile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -181,62 +190,68 @@
<data name="Bug" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Bug.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="calculator" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\calculator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LoadConfig" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\LoadConfig.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="corphawk" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\corphawk.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="PrintPreviewHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\PrintPreviewHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AVI" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\AVI.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SNESControllerIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\SNESControllerIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Play" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Play.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="TruncateFromRW" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\TruncateFromRW.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CutHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\CutHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LightOn" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\LightOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Hack" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Hack.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Lightning" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Lightning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="HotKeys" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\HotKeys.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Refresh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Refresh.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="InsertSeparator" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\InsertSeparator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LightOn" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\LightOn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MessageConfig" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\MessageConfig.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CopyFolderHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\CopyFolderHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Recent" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Recent.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="N64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\N64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="colecovisioncontroller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\colecovisioncontroller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IntVController" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\IntVController.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Unfreeze" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Unfreeze.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TruncateFromRW" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\TruncateFromRW.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="BackMore" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\BackMore.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Blank" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Blank.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\logo.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pcb" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\pcb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SNES_Controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\SNES_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LightOff" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\LightOff.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -247,39 +262,42 @@
<data name="addWatch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\addWatch.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Refresh1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Refresh.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="calculator" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\calculator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OpenFile" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\OpenFile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ToolBox" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\ToolBox.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GenesisControllerIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\GenesisControllerIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Debugger" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Debugger.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FindHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\FindHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Import" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Scan" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Scan.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GameController" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\GameController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="gba_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\gba-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Blank" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Blank.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cheat" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\cheat.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Refresh" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Refresh.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="whiteTriDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\whiteTriDown.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="undo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\undo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="alt_about_image" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\alt_about_image.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -289,8 +307,8 @@
<data name="Help" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Help.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="watch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\watch.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="MoveUp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\MoveUp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ExclamationRed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\ExclamationRed.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -310,11 +328,11 @@
<data name="Freeze" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Freeze.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Paste" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Paste.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="WarningHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\WarningHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TI83_Controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\TI83_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="search" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\search.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NESControllerIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\NESControllerIcon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -325,8 +343,8 @@
<data name="SaveConfig" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\SaveConfig.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="undo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\undo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Refresh1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Refresh.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="nothawk" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
@ -768,44 +786,38 @@
<data name="GBController" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\GBController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TI83Calculator" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\TI83Calculator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OpenFile" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\OpenFile.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SNES_Controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\SNES_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="C64Keyboard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\C64Keyboard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Previous" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Previous.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="HomeBrew" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\HomeBrew.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\logo.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Back" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Back.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Hack" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Hack.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RecordHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\RecordHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Back" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Back.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="gba_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\gba-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GreenCheck" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\GreenCheck.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="BackMore" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\BackMore.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Cheats" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Cheats.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AutoSearch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\AutoSearch.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Lightning" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Lightning.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Play" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Play.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Cheats" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Cheats.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="redo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\redo.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Pause" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Pause.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -819,62 +831,59 @@
<data name="MoveLeft" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\MoveLeft.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TAStudio" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\TAStudio.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="atari_controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\atari_controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CorpHawkSmall" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\CorpHawkSmall.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="PrintPreviewHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\PrintPreviewHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="A78Joystick" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\A78Joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="C64Joystick" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\C64Joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ForwardMore" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\ForwardMore.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WarningHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\WarningHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Forward" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Forward.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Duplicate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Duplicate.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="C64Symbol" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\C64Symbol.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Previous" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Previous.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Translation" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Translation.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="restart" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\restart.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CorpHawkSmall" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\CorpHawkSmall.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Duplicate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Duplicate.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="C64Joystick" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\C64Joystick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GBA_Controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\GBA_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Import" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Forward" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Forward.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="IntVController" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\IntVController.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="C64Symbol" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\C64Symbol.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TI83Calculator" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\TI83Calculator.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TAStudio" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\TAStudio.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GENController" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\GENController.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="N64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\N64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="atari_controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\atari_controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Translation" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Translation.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="ForwardMore" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\ForwardMore.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ReadOnly" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\ReadOnly.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="search" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\search.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="TI83_Controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\TI83_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NES_Controller" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\config\ControllerImages\NES_Controller.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -882,20 +891,14 @@
<data name="Lua" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Lua.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CopyFolderHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\CopyFolderHS.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="GenesisControllerIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\GenesisControllerIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MoveUp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\MoveUp.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="watch" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\watch.ico;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="pcb" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\pcb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="tvIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\tvIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="checkbox" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\checkbox.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="Erase" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\Erase.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sms_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\images\sms-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

View File

@ -30,7 +30,6 @@
{
this.btnCancel = new System.Windows.Forms.Button();
this.btnOk = new System.Windows.Forms.Button();
this.checkBilinearFilter = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.tbScanlineIntensity = new System.Windows.Forms.TrackBar();
@ -38,15 +37,24 @@
this.rbScanlines = new System.Windows.Forms.RadioButton();
this.rbHq2x = new System.Windows.Forms.RadioButton();
this.checkLetterbox = new System.Windows.Forms.CheckBox();
this.checkPadInteger = new System.Windows.Forms.CheckBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.rbFinalFilterBicubic = new System.Windows.Forms.RadioButton();
this.rbFinalFilterNone = new System.Windows.Forms.RadioButton();
this.rbFinalFilterBilinear = new System.Windows.Forms.RadioButton();
this.rbUser = new System.Windows.Forms.RadioButton();
this.btnSelectUserFilter = new System.Windows.Forms.Button();
this.lblUserFilterName = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(205, 201);
this.btnCancel.Location = new System.Drawing.Point(289, 190);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 5;
@ -56,7 +64,7 @@
// btnOk
//
this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOk.Location = new System.Drawing.Point(124, 201);
this.btnOk.Location = new System.Drawing.Point(208, 190);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(75, 23);
this.btnOk.TabIndex = 4;
@ -64,16 +72,6 @@
this.btnOk.UseVisualStyleBackColor = true;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// checkBilinearFilter
//
this.checkBilinearFilter.AutoSize = true;
this.checkBilinearFilter.Location = new System.Drawing.Point(12, 145);
this.checkBilinearFilter.Name = "checkBilinearFilter";
this.checkBilinearFilter.Size = new System.Drawing.Size(85, 17);
this.checkBilinearFilter.TabIndex = 0;
this.checkBilinearFilter.Text = "Bilinear Filter";
this.checkBilinearFilter.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.AutoSize = true;
@ -85,16 +83,19 @@
//
// groupBox1
//
this.groupBox1.Controls.Add(this.lblUserFilterName);
this.groupBox1.Controls.Add(this.btnSelectUserFilter);
this.groupBox1.Controls.Add(this.rbUser);
this.groupBox1.Controls.Add(this.tbScanlineIntensity);
this.groupBox1.Controls.Add(this.rbNone);
this.groupBox1.Controls.Add(this.rbScanlines);
this.groupBox1.Controls.Add(this.rbHq2x);
this.groupBox1.Location = new System.Drawing.Point(12, 34);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(200, 105);
this.groupBox1.Size = new System.Drawing.Size(173, 132);
this.groupBox1.TabIndex = 7;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Filter";
this.groupBox1.Text = "Scaling Filter";
//
// tbScanlineIntensity
//
@ -143,24 +144,109 @@
// checkLetterbox
//
this.checkLetterbox.AutoSize = true;
this.checkLetterbox.Location = new System.Drawing.Point(12, 168);
this.checkLetterbox.Location = new System.Drawing.Point(12, 172);
this.checkLetterbox.Name = "checkLetterbox";
this.checkLetterbox.Size = new System.Drawing.Size(188, 17);
this.checkLetterbox.Size = new System.Drawing.Size(173, 17);
this.checkLetterbox.TabIndex = 8;
this.checkLetterbox.Text = "Letterbox (to maintain aspect ratio)";
this.checkLetterbox.Text = "Maintain aspect ratio (letterbox)";
this.checkLetterbox.UseVisualStyleBackColor = true;
//
// checkPadInteger
//
this.checkPadInteger.AutoSize = true;
this.checkPadInteger.Location = new System.Drawing.Point(12, 195);
this.checkPadInteger.Name = "checkPadInteger";
this.checkPadInteger.Size = new System.Drawing.Size(120, 17);
this.checkPadInteger.TabIndex = 9;
this.checkPadInteger.Text = "Pad to integer scale";
this.checkPadInteger.UseVisualStyleBackColor = true;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.rbFinalFilterBicubic);
this.groupBox2.Controls.Add(this.rbFinalFilterNone);
this.groupBox2.Controls.Add(this.rbFinalFilterBilinear);
this.groupBox2.Location = new System.Drawing.Point(191, 34);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(173, 132);
this.groupBox2.TabIndex = 8;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Final Filter";
//
// rbFinalFilterBicubic
//
this.rbFinalFilterBicubic.AutoSize = true;
this.rbFinalFilterBicubic.Location = new System.Drawing.Point(7, 65);
this.rbFinalFilterBicubic.Name = "rbFinalFilterBicubic";
this.rbFinalFilterBicubic.Size = new System.Drawing.Size(142, 17);
this.rbFinalFilterBicubic.TabIndex = 3;
this.rbFinalFilterBicubic.TabStop = true;
this.rbFinalFilterBicubic.Text = "Bicubic (shader. buggy?)";
this.rbFinalFilterBicubic.UseVisualStyleBackColor = true;
//
// rbFinalFilterNone
//
this.rbFinalFilterNone.AutoSize = true;
this.rbFinalFilterNone.Location = new System.Drawing.Point(6, 19);
this.rbFinalFilterNone.Name = "rbFinalFilterNone";
this.rbFinalFilterNone.Size = new System.Drawing.Size(51, 17);
this.rbFinalFilterNone.TabIndex = 2;
this.rbFinalFilterNone.TabStop = true;
this.rbFinalFilterNone.Text = "None";
this.rbFinalFilterNone.UseVisualStyleBackColor = true;
//
// rbFinalFilterBilinear
//
this.rbFinalFilterBilinear.AutoSize = true;
this.rbFinalFilterBilinear.Location = new System.Drawing.Point(6, 42);
this.rbFinalFilterBilinear.Name = "rbFinalFilterBilinear";
this.rbFinalFilterBilinear.Size = new System.Drawing.Size(59, 17);
this.rbFinalFilterBilinear.TabIndex = 0;
this.rbFinalFilterBilinear.TabStop = true;
this.rbFinalFilterBilinear.Text = "Bilinear";
this.rbFinalFilterBilinear.UseVisualStyleBackColor = true;
//
// rbUser
//
this.rbUser.AutoSize = true;
this.rbUser.Location = new System.Drawing.Point(6, 88);
this.rbUser.Name = "rbUser";
this.rbUser.Size = new System.Drawing.Size(47, 17);
this.rbUser.TabIndex = 4;
this.rbUser.TabStop = true;
this.rbUser.Text = "User";
this.rbUser.UseVisualStyleBackColor = true;
//
// btnSelectUserFilter
//
this.btnSelectUserFilter.Location = new System.Drawing.Point(83, 88);
this.btnSelectUserFilter.Name = "btnSelectUserFilter";
this.btnSelectUserFilter.Size = new System.Drawing.Size(75, 23);
this.btnSelectUserFilter.TabIndex = 5;
this.btnSelectUserFilter.Text = "Select";
this.btnSelectUserFilter.UseVisualStyleBackColor = true;
this.btnSelectUserFilter.Click += new System.EventHandler(this.btnSelectUserFilter_Click);
//
// lblUserFilterName
//
this.lblUserFilterName.Location = new System.Drawing.Point(6, 114);
this.lblUserFilterName.Name = "lblUserFilterName";
this.lblUserFilterName.Size = new System.Drawing.Size(161, 15);
this.lblUserFilterName.TabIndex = 10;
this.lblUserFilterName.Text = "Will contain user filter name";
//
// DisplayConfigLite
//
this.AcceptButton = this.btnOk;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(292, 236);
this.ClientSize = new System.Drawing.Size(376, 225);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.checkPadInteger);
this.Controls.Add(this.checkLetterbox);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.checkBilinearFilter);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOk);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
@ -169,6 +255,8 @@
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).EndInit();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -178,7 +266,6 @@
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.CheckBox checkBilinearFilter;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RadioButton rbNone;
@ -186,5 +273,13 @@
private System.Windows.Forms.RadioButton rbHq2x;
private System.Windows.Forms.TrackBar tbScanlineIntensity;
private System.Windows.Forms.CheckBox checkLetterbox;
private System.Windows.Forms.CheckBox checkPadInteger;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.RadioButton rbFinalFilterBicubic;
private System.Windows.Forms.RadioButton rbFinalFilterNone;
private System.Windows.Forms.RadioButton rbFinalFilterBilinear;
private System.Windows.Forms.Button btnSelectUserFilter;
private System.Windows.Forms.RadioButton rbUser;
private System.Windows.Forms.Label lblUserFilterName;
}
}

View File

@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@ -14,6 +15,7 @@ namespace BizHawk.Client.EmuHawk.config
{
public partial class DisplayConfigLite : Form
{
string PathSelection;
public DisplayConfigLite()
{
InitializeComponent();
@ -21,8 +23,18 @@ namespace BizHawk.Client.EmuHawk.config
rbNone.Checked = Global.Config.TargetDisplayFilter == 0;
rbHq2x.Checked = Global.Config.TargetDisplayFilter == 1;
rbScanlines.Checked = Global.Config.TargetDisplayFilter == 2;
checkBilinearFilter.Checked = Global.Config.DispBlurry;
rbUser.Checked = Global.Config.TargetDisplayFilter == 3;
PathSelection = Global.Config.DispUserFilterPath ?? "";
RefreshState();
rbFinalFilterNone.Checked = Global.Config.DispFinalFilter == 0;
rbFinalFilterBilinear.Checked = Global.Config.DispFinalFilter == 1;
rbFinalFilterBicubic.Checked = Global.Config.DispFinalFilter == 2;
tbScanlineIntensity.Value = Global.Config.TargetScanlineFilterIntensity;
checkLetterbox.Checked = Global.Config.DispFixAspectRatio;
checkPadInteger.Checked = Global.Config.DispFixScaleInteger;
}
private void btnOk_Click(object sender, EventArgs e)
@ -33,12 +45,42 @@ namespace BizHawk.Client.EmuHawk.config
Global.Config.TargetDisplayFilter = 1;
if (rbScanlines.Checked)
Global.Config.TargetDisplayFilter = 2;
if (rbUser.Checked)
Global.Config.TargetDisplayFilter = 3;
if(rbFinalFilterNone.Checked)
Global.Config.DispFinalFilter = 0;
if(rbFinalFilterBilinear.Checked)
Global.Config.DispFinalFilter = 1;
if(rbFinalFilterBicubic.Checked)
Global.Config.DispFinalFilter = 2;
Global.Config.DispBlurry = checkBilinearFilter.Checked;
Global.Config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value;
Global.Config.DispUserFilterPath = PathSelection;
GlobalWin.DisplayManager.RefreshUserShader();
DialogResult = System.Windows.Forms.DialogResult.OK;
Close();
}
void RefreshState()
{
lblUserFilterName.Text = Path.GetFileNameWithoutExtension(PathSelection);
}
private void btnSelectUserFilter_Click(object sender, EventArgs e)
{
var ofd = new OpenFileDialog();
ofd.Filter = ".CGP (*.cgp)|*.cgp";
ofd.FileName = PathSelection;
if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
rbUser.Checked = true;
PathSelection = Path.GetFullPath(ofd.FileName);
RefreshState();
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

View File

@ -39,8 +39,8 @@ namespace BizHawk.Client.EmuHawk
public LuaTable GetMouse()
{
var buttons = _lua.NewTable();
//TODO - ZEROMUS - this could use a more sophisticated system, it's just a stopgap
var p = GlobalWin.PresentationPanel.ScreenToScreen(Control.MousePosition);
//TODO - need to specify whether in "emu" or "native" coordinate space.
var p = GlobalWin.DisplayManager.UntransformPoint(Control.MousePosition);
buttons["X"] = p.X;
buttons["Y"] = p.Y;
buttons[MouseButtons.Left.ToString()] = (Control.MouseButtons & MouseButtons.Left) != 0;

View File

@ -99,6 +99,8 @@
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.MoveUpToolbarItem = new System.Windows.Forms.ToolStripButton();
this.toolStripButtonMoveDown = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.EraseToolbarItem = new System.Windows.Forms.ToolStripButton();
this.LuaListView = new BizHawk.Client.EmuHawk.VirtualListView();
this.Script = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.PathName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
@ -120,14 +122,14 @@
this.ScriptContextSeparator,
this.StopAllScriptsContextItem});
this.ScriptListContextMenu.Name = "contextMenuStrip1";
this.ScriptListContextMenu.Size = new System.Drawing.Size(165, 142);
this.ScriptListContextMenu.Size = new System.Drawing.Size(169, 142);
this.ScriptListContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ScriptListContextMenu_Opening);
//
// ToggleScriptContextItem
//
this.ToggleScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1;
this.ToggleScriptContextItem.Name = "ToggleScriptContextItem";
this.ToggleScriptContextItem.Size = new System.Drawing.Size(164, 22);
this.ToggleScriptContextItem.Size = new System.Drawing.Size(168, 22);
this.ToggleScriptContextItem.Text = "&Toggle";
this.ToggleScriptContextItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click);
//
@ -135,7 +137,7 @@
//
this.PauseScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause;
this.PauseScriptContextItem.Name = "PauseScriptContextItem";
this.PauseScriptContextItem.Size = new System.Drawing.Size(164, 22);
this.PauseScriptContextItem.Size = new System.Drawing.Size(168, 22);
this.PauseScriptContextItem.Text = "Pause or Resume";
this.PauseScriptContextItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click);
//
@ -143,7 +145,7 @@
//
this.EditScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS;
this.EditScriptContextItem.Name = "EditScriptContextItem";
this.EditScriptContextItem.Size = new System.Drawing.Size(164, 22);
this.EditScriptContextItem.Size = new System.Drawing.Size(168, 22);
this.EditScriptContextItem.Text = "&Edit";
this.EditScriptContextItem.Click += new System.EventHandler(this.EditScriptMenuItem_Click);
//
@ -151,7 +153,7 @@
//
this.RemoveScriptContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Close;
this.RemoveScriptContextItem.Name = "RemoveScriptContextItem";
this.RemoveScriptContextItem.Size = new System.Drawing.Size(164, 22);
this.RemoveScriptContextItem.Size = new System.Drawing.Size(168, 22);
this.RemoveScriptContextItem.Text = "&Remove";
this.RemoveScriptContextItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click);
//
@ -159,20 +161,20 @@
//
this.InsertSeperatorContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator;
this.InsertSeperatorContextItem.Name = "InsertSeperatorContextItem";
this.InsertSeperatorContextItem.Size = new System.Drawing.Size(164, 22);
this.InsertSeperatorContextItem.Size = new System.Drawing.Size(168, 22);
this.InsertSeperatorContextItem.Text = "Insert Seperator";
this.InsertSeperatorContextItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click);
//
// ScriptContextSeparator
//
this.ScriptContextSeparator.Name = "ScriptContextSeparator";
this.ScriptContextSeparator.Size = new System.Drawing.Size(161, 6);
this.ScriptContextSeparator.Size = new System.Drawing.Size(165, 6);
//
// StopAllScriptsContextItem
//
this.StopAllScriptsContextItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop;
this.StopAllScriptsContextItem.Name = "StopAllScriptsContextItem";
this.StopAllScriptsContextItem.Size = new System.Drawing.Size(164, 22);
this.StopAllScriptsContextItem.Size = new System.Drawing.Size(168, 22);
this.StopAllScriptsContextItem.Text = "Stop All Scripts";
this.StopAllScriptsContextItem.Click += new System.EventHandler(this.StopAllScriptsMenuItem_Click);
//
@ -203,7 +205,7 @@
this.toolStripSeparator1,
this.ExitMenuItem});
this.FileSubMenu.Name = "FileSubMenu";
this.FileSubMenu.Size = new System.Drawing.Size(37, 20);
this.FileSubMenu.Size = new System.Drawing.Size(35, 20);
this.FileSubMenu.Text = "&File";
this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened);
//
@ -213,7 +215,7 @@
this.NewSessionMenuItem.Name = "NewSessionMenuItem";
this.NewSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.N)));
this.NewSessionMenuItem.Size = new System.Drawing.Size(237, 22);
this.NewSessionMenuItem.Size = new System.Drawing.Size(243, 22);
this.NewSessionMenuItem.Text = "&New Session";
this.NewSessionMenuItem.Click += new System.EventHandler(this.NewSessionMenuItem_Click);
//
@ -223,7 +225,7 @@
this.OpenSessionMenuItem.Name = "OpenSessionMenuItem";
this.OpenSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.O)));
this.OpenSessionMenuItem.Size = new System.Drawing.Size(237, 22);
this.OpenSessionMenuItem.Size = new System.Drawing.Size(243, 22);
this.OpenSessionMenuItem.Text = "&Open Session...";
this.OpenSessionMenuItem.Click += new System.EventHandler(this.OpenSessionMenuItem_Click);
//
@ -232,7 +234,7 @@
this.SaveSessionMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs;
this.SaveSessionMenuItem.Name = "SaveSessionMenuItem";
this.SaveSessionMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.SaveSessionMenuItem.Size = new System.Drawing.Size(237, 22);
this.SaveSessionMenuItem.Size = new System.Drawing.Size(243, 22);
this.SaveSessionMenuItem.Text = "&Save Session";
this.SaveSessionMenuItem.Click += new System.EventHandler(this.SaveSessionMenuItem_Click);
//
@ -241,21 +243,21 @@
this.SaveSessionAsMenuItem.Name = "SaveSessionAsMenuItem";
this.SaveSessionAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S)));
this.SaveSessionAsMenuItem.Size = new System.Drawing.Size(237, 22);
this.SaveSessionAsMenuItem.Size = new System.Drawing.Size(243, 22);
this.SaveSessionAsMenuItem.Text = "Save Session &As...";
this.SaveSessionAsMenuItem.Click += new System.EventHandler(this.SaveSessionAsMenuItem_Click);
//
// toolStripSeparator9
//
this.toolStripSeparator9.Name = "toolStripSeparator9";
this.toolStripSeparator9.Size = new System.Drawing.Size(234, 6);
this.toolStripSeparator9.Size = new System.Drawing.Size(240, 6);
//
// RecentSessionsSubMenu
//
this.RecentSessionsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripSeparator8});
this.RecentSessionsSubMenu.Name = "RecentSessionsSubMenu";
this.RecentSessionsSubMenu.Size = new System.Drawing.Size(237, 22);
this.RecentSessionsSubMenu.Size = new System.Drawing.Size(243, 22);
this.RecentSessionsSubMenu.Text = "Recent Sessions";
this.RecentSessionsSubMenu.DropDownOpened += new System.EventHandler(this.RecentSessionsSubMenu_DropDownOpened);
//
@ -270,7 +272,7 @@
this.toolStripSeparator3});
this.RecentScriptsSubMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent;
this.RecentScriptsSubMenu.Name = "RecentScriptsSubMenu";
this.RecentScriptsSubMenu.Size = new System.Drawing.Size(237, 22);
this.RecentScriptsSubMenu.Size = new System.Drawing.Size(243, 22);
this.RecentScriptsSubMenu.Text = "Recent Scripts";
this.RecentScriptsSubMenu.DropDownOpened += new System.EventHandler(this.RecentScriptsSubMenu_DropDownOpened);
//
@ -282,13 +284,13 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(234, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(240, 6);
//
// ExitMenuItem
//
this.ExitMenuItem.Name = "ExitMenuItem";
this.ExitMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this.ExitMenuItem.Size = new System.Drawing.Size(237, 22);
this.ExitMenuItem.Size = new System.Drawing.Size(243, 22);
this.ExitMenuItem.Text = "E&xit";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
@ -311,7 +313,7 @@
this.StopAllScriptsMenuItem,
this.RegisteredFunctionsMenuItem});
this.ScriptSubMenu.Name = "ScriptSubMenu";
this.ScriptSubMenu.Size = new System.Drawing.Size(49, 20);
this.ScriptSubMenu.Size = new System.Drawing.Size(46, 20);
this.ScriptSubMenu.Text = "&Script";
this.ScriptSubMenu.DropDownOpened += new System.EventHandler(this.ScriptSubMenu_DropDownOpened);
//
@ -320,7 +322,7 @@
this.NewScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile;
this.NewScriptMenuItem.Name = "NewScriptMenuItem";
this.NewScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.NewScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.NewScriptMenuItem.Size = new System.Drawing.Size(223, 22);
this.NewScriptMenuItem.Text = "New Script";
this.NewScriptMenuItem.Click += new System.EventHandler(this.NewScriptMenuItem_Click);
//
@ -329,7 +331,7 @@
this.OpenScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile;
this.OpenScriptMenuItem.Name = "OpenScriptMenuItem";
this.OpenScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.OpenScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.OpenScriptMenuItem.Size = new System.Drawing.Size(223, 22);
this.OpenScriptMenuItem.Text = "&Open Script...";
this.OpenScriptMenuItem.Click += new System.EventHandler(this.OpenScriptMenuItem_Click);
//
@ -338,7 +340,7 @@
this.RefreshScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1;
this.RefreshScriptMenuItem.Name = "RefreshScriptMenuItem";
this.RefreshScriptMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.RefreshScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.RefreshScriptMenuItem.Size = new System.Drawing.Size(223, 22);
this.RefreshScriptMenuItem.Text = "&Re&fresh";
this.RefreshScriptMenuItem.Click += new System.EventHandler(this.RefreshScriptMenuItem_Click);
//
@ -347,7 +349,7 @@
this.ToggleScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.checkbox;
this.ToggleScriptMenuItem.Name = "ToggleScriptMenuItem";
this.ToggleScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
this.ToggleScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.ToggleScriptMenuItem.Size = new System.Drawing.Size(223, 22);
this.ToggleScriptMenuItem.Text = "&Toggle";
this.ToggleScriptMenuItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click);
//
@ -355,7 +357,7 @@
//
this.PauseScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Pause;
this.PauseScriptMenuItem.Name = "PauseScriptMenuItem";
this.PauseScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.PauseScriptMenuItem.Size = new System.Drawing.Size(223, 22);
this.PauseScriptMenuItem.Text = "Pause or Resume";
this.PauseScriptMenuItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click);
//
@ -364,7 +366,7 @@
this.EditScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS;
this.EditScriptMenuItem.Name = "EditScriptMenuItem";
this.EditScriptMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.EditScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.EditScriptMenuItem.Size = new System.Drawing.Size(223, 22);
this.EditScriptMenuItem.Text = "&Edit Script";
this.EditScriptMenuItem.Click += new System.EventHandler(this.EditScriptMenuItem_Click);
//
@ -373,7 +375,7 @@
this.RemoveScriptMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
this.RemoveScriptMenuItem.Name = "RemoveScriptMenuItem";
this.RemoveScriptMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this.RemoveScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.RemoveScriptMenuItem.Size = new System.Drawing.Size(223, 22);
this.RemoveScriptMenuItem.Text = "&Remove Script";
this.RemoveScriptMenuItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click);
//
@ -382,21 +384,21 @@
this.InsertSeparatorMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.InsertSeparator;
this.InsertSeparatorMenuItem.Name = "InsertSeparatorMenuItem";
this.InsertSeparatorMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(218, 22);
this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(223, 22);
this.InsertSeparatorMenuItem.Text = "Insert Separator";
this.InsertSeparatorMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(215, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(220, 6);
//
// MoveUpMenuItem
//
this.MoveUpMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveUp;
this.MoveUpMenuItem.Name = "MoveUpMenuItem";
this.MoveUpMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.U)));
this.MoveUpMenuItem.Size = new System.Drawing.Size(218, 22);
this.MoveUpMenuItem.Size = new System.Drawing.Size(223, 22);
this.MoveUpMenuItem.Text = "Move &Up";
this.MoveUpMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click);
//
@ -405,7 +407,7 @@
this.MoveDownMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.MoveDown;
this.MoveDownMenuItem.Name = "MoveDownMenuItem";
this.MoveDownMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D)));
this.MoveDownMenuItem.Size = new System.Drawing.Size(218, 22);
this.MoveDownMenuItem.Size = new System.Drawing.Size(223, 22);
this.MoveDownMenuItem.Text = "Move &Down";
this.MoveDownMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click);
//
@ -413,20 +415,20 @@
//
this.SelectAllMenuItem.Name = "SelectAllMenuItem";
this.SelectAllMenuItem.ShortcutKeyDisplayString = "Ctrl+A";
this.SelectAllMenuItem.Size = new System.Drawing.Size(218, 22);
this.SelectAllMenuItem.Size = new System.Drawing.Size(223, 22);
this.SelectAllMenuItem.Text = "Select &All";
this.SelectAllMenuItem.Click += new System.EventHandler(this.SelectAllMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(215, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(220, 6);
//
// StopAllScriptsMenuItem
//
this.StopAllScriptsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop;
this.StopAllScriptsMenuItem.Name = "StopAllScriptsMenuItem";
this.StopAllScriptsMenuItem.Size = new System.Drawing.Size(218, 22);
this.StopAllScriptsMenuItem.Size = new System.Drawing.Size(223, 22);
this.StopAllScriptsMenuItem.Text = "Stop All Scripts";
this.StopAllScriptsMenuItem.Click += new System.EventHandler(this.StopAllScriptsMenuItem_Click);
//
@ -434,7 +436,7 @@
//
this.RegisteredFunctionsMenuItem.Name = "RegisteredFunctionsMenuItem";
this.RegisteredFunctionsMenuItem.ShortcutKeyDisplayString = "F12";
this.RegisteredFunctionsMenuItem.Size = new System.Drawing.Size(218, 22);
this.RegisteredFunctionsMenuItem.Size = new System.Drawing.Size(223, 22);
this.RegisteredFunctionsMenuItem.Text = "&Registered Functions...";
this.RegisteredFunctionsMenuItem.Click += new System.EventHandler(this.RegisteredFunctionsMenuItem_Click);
//
@ -451,66 +453,66 @@
this.toolStripSeparator5,
this.RestoreDefaultSettingsMenuItem});
this.OptionsSubMenu.Name = "OptionsSubMenu";
this.OptionsSubMenu.Size = new System.Drawing.Size(61, 20);
this.OptionsSubMenu.Size = new System.Drawing.Size(56, 20);
this.OptionsSubMenu.Text = "&Options";
this.OptionsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened);
//
// AutoloadConsoleMenuItem
//
this.AutoloadConsoleMenuItem.Name = "AutoloadConsoleMenuItem";
this.AutoloadConsoleMenuItem.Size = new System.Drawing.Size(199, 22);
this.AutoloadConsoleMenuItem.Size = new System.Drawing.Size(203, 22);
this.AutoloadConsoleMenuItem.Text = "Autoload Console";
this.AutoloadConsoleMenuItem.Click += new System.EventHandler(this.AutoloadConsoleMenuItem_Click);
//
// AutoloadSessionMenuItem
//
this.AutoloadSessionMenuItem.Name = "AutoloadSessionMenuItem";
this.AutoloadSessionMenuItem.Size = new System.Drawing.Size(199, 22);
this.AutoloadSessionMenuItem.Size = new System.Drawing.Size(203, 22);
this.AutoloadSessionMenuItem.Text = "Autoload Session";
this.AutoloadSessionMenuItem.Click += new System.EventHandler(this.AutoloadSessionMenuItem_Click);
//
// DisableScriptsOnLoadMenuItem
//
this.DisableScriptsOnLoadMenuItem.Name = "DisableScriptsOnLoadMenuItem";
this.DisableScriptsOnLoadMenuItem.Size = new System.Drawing.Size(199, 22);
this.DisableScriptsOnLoadMenuItem.Size = new System.Drawing.Size(203, 22);
this.DisableScriptsOnLoadMenuItem.Text = "Disable Scripts on Load";
this.DisableScriptsOnLoadMenuItem.Click += new System.EventHandler(this.DisableScriptsOnLoadMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(196, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(200, 6);
//
// SaveWindowPositionMenuItem
//
this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem";
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(199, 22);
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(203, 22);
this.SaveWindowPositionMenuItem.Text = "Save Window Position";
this.SaveWindowPositionMenuItem.Click += new System.EventHandler(this.SaveWindowPositionMenuItem_Click);
//
// AlwaysOnTopMenuItem
//
this.AlwaysOnTopMenuItem.Name = "AlwaysOnTopMenuItem";
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(199, 22);
this.AlwaysOnTopMenuItem.Size = new System.Drawing.Size(203, 22);
this.AlwaysOnTopMenuItem.Text = "Always On Top";
this.AlwaysOnTopMenuItem.Click += new System.EventHandler(this.AlwaysOnTopMenuItem_Click);
//
// FloatingWindowMenuItem
//
this.FloatingWindowMenuItem.Name = "FloatingWindowMenuItem";
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(199, 22);
this.FloatingWindowMenuItem.Size = new System.Drawing.Size(203, 22);
this.FloatingWindowMenuItem.Text = "Floating Window";
this.FloatingWindowMenuItem.Click += new System.EventHandler(this.FloatingWindowMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(196, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(200, 6);
//
// RestoreDefaultSettingsMenuItem
//
this.RestoreDefaultSettingsMenuItem.Name = "RestoreDefaultSettingsMenuItem";
this.RestoreDefaultSettingsMenuItem.Size = new System.Drawing.Size(199, 22);
this.RestoreDefaultSettingsMenuItem.Size = new System.Drawing.Size(203, 22);
this.RestoreDefaultSettingsMenuItem.Text = "Restore Default Settings";
this.RestoreDefaultSettingsMenuItem.Click += new System.EventHandler(this.RestoreDefaultSettingsMenuItem_Click);
//
@ -520,20 +522,20 @@
this.FunctionsListMenuItem,
this.OnlineDocsMenuItem});
this.HelpSubMenu.Name = "HelpSubMenu";
this.HelpSubMenu.Size = new System.Drawing.Size(44, 20);
this.HelpSubMenu.Size = new System.Drawing.Size(40, 20);
this.HelpSubMenu.Text = "&Help";
//
// FunctionsListMenuItem
//
this.FunctionsListMenuItem.Name = "FunctionsListMenuItem";
this.FunctionsListMenuItem.Size = new System.Drawing.Size(202, 22);
this.FunctionsListMenuItem.Size = new System.Drawing.Size(200, 22);
this.FunctionsListMenuItem.Text = "&Lua Functions List";
this.FunctionsListMenuItem.Click += new System.EventHandler(this.FunctionsListMenuItem_Click);
//
// OnlineDocsMenuItem
//
this.OnlineDocsMenuItem.Name = "OnlineDocsMenuItem";
this.OnlineDocsMenuItem.Size = new System.Drawing.Size(202, 22);
this.OnlineDocsMenuItem.Size = new System.Drawing.Size(200, 22);
this.OnlineDocsMenuItem.Text = "Documentation online...";
this.OnlineDocsMenuItem.Click += new System.EventHandler(this.OnlineDocsMenuItem_Click);
//
@ -557,20 +559,20 @@
this.ClearConsoleContextItem,
this.RegisteredFunctionsContextItem});
this.ConsoleContextMenu.Name = "contextMenuStrip2";
this.ConsoleContextMenu.Size = new System.Drawing.Size(185, 48);
this.ConsoleContextMenu.Size = new System.Drawing.Size(187, 48);
this.ConsoleContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ConsoleContextMenu_Opening);
//
// ClearConsoleContextItem
//
this.ClearConsoleContextItem.Name = "ClearConsoleContextItem";
this.ClearConsoleContextItem.Size = new System.Drawing.Size(184, 22);
this.ClearConsoleContextItem.Size = new System.Drawing.Size(186, 22);
this.ClearConsoleContextItem.Text = "&Clear";
this.ClearConsoleContextItem.Click += new System.EventHandler(this.ClearConsoleContextItem_Click);
//
// RegisteredFunctionsContextItem
//
this.RegisteredFunctionsContextItem.Name = "RegisteredFunctionsContextItem";
this.RegisteredFunctionsContextItem.Size = new System.Drawing.Size(184, 22);
this.RegisteredFunctionsContextItem.Size = new System.Drawing.Size(186, 22);
this.RegisteredFunctionsContextItem.Text = "&Registered Functions";
this.RegisteredFunctionsContextItem.Click += new System.EventHandler(this.RegisteredFunctionsMenuItem_Click);
//
@ -616,10 +618,12 @@
this.PauseToolbarItem,
this.EditToolbarItem,
this.RemoveScriptToolbarItem,
this.InsertSeparatorToolbarItem,
this.toolStripSeparator2,
this.MoveUpToolbarItem,
this.toolStripButtonMoveDown});
this.toolStripButtonMoveDown,
this.InsertSeparatorToolbarItem,
this.toolStripSeparator10,
this.EraseToolbarItem});
this.toolStrip1.Location = new System.Drawing.Point(0, 24);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(584, 25);
@ -731,6 +735,21 @@
this.toolStripButtonMoveDown.Text = "Move Down";
this.toolStripButtonMoveDown.Click += new System.EventHandler(this.MoveDownMenuItem_Click);
//
// toolStripSeparator10
//
this.toolStripSeparator10.Name = "toolStripSeparator10";
this.toolStripSeparator10.Size = new System.Drawing.Size(6, 25);
//
// EraseToolbarItem
//
this.EraseToolbarItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.EraseToolbarItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Erase;
this.EraseToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.EraseToolbarItem.Name = "EraseToolbarItem";
this.EraseToolbarItem.Size = new System.Drawing.Size(23, 22);
this.EraseToolbarItem.Text = "toolStripButton1";
this.EraseToolbarItem.Click += new System.EventHandler(this.EraseToolbarItem_Click);
//
// LuaListView
//
this.LuaListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -748,6 +767,7 @@
this.LuaListView.ItemCount = 0;
this.LuaListView.Location = new System.Drawing.Point(13, 71);
this.LuaListView.Name = "LuaListView";
this.LuaListView.SelectAllInProgress = false;
this.LuaListView.selectedItem = -1;
this.LuaListView.Size = new System.Drawing.Size(291, 255);
this.LuaListView.TabIndex = 0;
@ -874,5 +894,7 @@
private System.Windows.Forms.ToolStripMenuItem FloatingWindowMenuItem;
private System.Windows.Forms.ToolStripButton RefreshScriptToolbarItem;
private System.Windows.Forms.ToolStripMenuItem RefreshScriptMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
private System.Windows.Forms.ToolStripButton EraseToolbarItem;
}
}

View File

@ -1115,6 +1115,12 @@ namespace BizHawk.Client.EmuHawk
#endregion
private void EraseToolbarItem_Click(object sender, EventArgs e)
{
GlobalWin.DisplayManager.ClearLuaSurfaces();
}
#endregion
}
}

View File

@ -133,17 +133,18 @@
<data name="OpenScriptToolbarItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJHSURBVDhPxZBdSNNhFMb/F110ZZEVhVBgeeHNICiiuggp
olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdNKMwr7kApFItTUkWZqVhSVYmao5Nevvy7UoYR3HXh4
4XCe33nOKyy3lAY7l9RWMo0O/raWXxEyo5spVYTNvOGyfIRPfW+ptOkXqaPl6T83hcRmExSdgzAz3NVm
YWyoYla/B+1M9JtxWLPpaH22JORIjI6gKAMB0jyEimIdo4OlbuaprwVMOOMovammpDADc34qppwUrmnl
5Kni3aFlFg2j3y1z5mnRTJccnNIltQhwq0jFry+mOXNtpWZWDx1Z1NhV3C3JwGFOw25SYjVe5oYhiUKd
HKMmwQUrMWUw/CF3NnZvvYKqUh1TvUroS3fXe7HXkwidMngTS2t5KLbregSzMY2f3Wr4qKW6LJvGR1rX
0MLor8OhKYTJBn/GHvvxrliCTBrsOqXIoOBHh5K+hmSq7FqmexTQHuUytkaKxuNMNgYyVneA4Qd7GKjc
hjLaRzxH7gIU6JIZaEvgtk1D8wsxSWecCDgNzWFMvwxm/PkhRmr3Mli1nW9lvjRdWc0Jf+/5jzRmyWmv
S+GOLQu6U6BFjPvqKOP1AYw88WOoZif9DgmfLVtxaj1RSLdwNvrkPCA3M54KqxrnvRia9MKcGrUrqFOt
5H7qKsqT1mGO9+Lqhc2ELdw+U/r0i+gVZ8hMiCDx3DHORwZyKnQ/hw/uYt9uCTskPvh6e7Fp41rWr/Fg
g6eHO+A/lyD8ARfG3mk9fv1YAAAAAElFTkSuQmCC
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
AAAAAElFTkSuQmCC
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -18,6 +18,16 @@ namespace BizHawk.Common
return Path.GetDirectoryName(path);
}
public static IEnumerable<LinkedListNode<T>> EnumerateNodes<T>(this LinkedList<T> list)
{
var node = list.First;
while (node != null)
{
yield return node;
node = node.Next;
}
}
public static int LowerBoundBinarySearch<T, TKey>(this IList<T> list, Func<T, TKey> keySelector, TKey key) where TKey : IComparable<TKey>
{
int min = 0;

View File

@ -36,6 +36,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
private delegate void ReadScreen2Res(IntPtr dummy, ref int width, ref int height, int buffer);
ReadScreen2Res GFXReadScreen2Res;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate Int32 GetScreenTextureID();
GetScreenTextureID GFXGetScreenTextureID;
public mupen64plusVideoApi(mupen64plusApi core, VideoPluginSettings settings)
{
@ -58,6 +63,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
videoplugin);
GFXReadScreen2 = (ReadScreen2)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2));
GFXReadScreen2Res = (ReadScreen2Res)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "ReadScreen2"), typeof(ReadScreen2Res));
if(GetProcAddress(GfxDll, "GetScreenTextureID") != IntPtr.Zero)
GFXGetScreenTextureID = (GetScreenTextureID)Marshal.GetDelegateForFunctionPointer(GetProcAddress(GfxDll, "GetScreenTextureID"), typeof(GetScreenTextureID));
}
public void GetScreenDimensions(ref int width, ref int height)

View File

@ -53,6 +53,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\BizHawk.Common\BizHawk.Common.csproj">
<Project>{866F8D13-0678-4FF9-80A4-A3993FD4D8A3}</Project>
<Name>BizHawk.Common</Name>
</ProjectReference>
<ProjectReference Include="..\BizHawk.Bizware.BizwareGL\BizHawk.Bizware.BizwareGL.csproj">
<Project>{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}</Project>
<Name>BizHawk.Bizware.BizwareGL</Name>

View File

@ -261,6 +261,20 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
GL.BindTexture(TextureTarget.Texture2D, tex.Id.ToInt32());
}
public void SetTextureWrapMode(Texture2d tex, bool clamp)
{
BindTexture2d(tex);
int mode;
if (clamp)
{
mode = (int)global::OpenTK.Graphics.OpenGL.TextureWrapMode.ClampToEdge;
}
else
mode = (int)global::OpenTK.Graphics.OpenGL.TextureWrapMode.Repeat;
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, mode);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, mode);
}
public unsafe void BindArrayData(void* pData)
{
MyBindArrayData(sStatePendingVertexLayout, pData);
@ -351,6 +365,11 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
return new Texture2d(this, id, width, height);
}
public Texture2d WrapGLTexture2d(IntPtr glTexId, int width, int height)
{
return new Texture2d(this as IGL,glTexId, width, height);
}
public void LoadTextureData(Texture2d tex, BitmapBuffer bmp)
{
sdi.BitmapData bmp_data = bmp.LockBits();

View File

@ -57,6 +57,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
var Modelview = Owner.CreateGuiViewMatrix(OutputSize);
Pipeline["MVPMatrix"].Set(Modelview * Projection, false);
Owner.SetTextureWrapMode(tex, true);
Pipeline["Texture"].Set(tex);
Owner.SetViewport(OutputSize);
@ -81,6 +82,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
pData[i++] = 0; pData[i++] = 0; pData[i++] = 0; pData[i++] = 0; //junk
pData[i++] = 1; pData[i++] = v1; //texcoord
Owner.SetBlendState(Owner.BlendNone);
Owner.BindArrayData(pData);
Owner.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
}

View File

@ -29,6 +29,8 @@ namespace BizHawk.Bizware.BizwareGL
public int Width, Height;
public int[] Pixels;
public Size Size { get { return new Size(Width, Height); } }
sd.Bitmap WrappedBitmap;
GCHandle CurrLockHandle;
BitmapData CurrLock;

View File

@ -82,6 +82,12 @@
<Compile Include="UniformInfo.cs" />
<Compile Include="VertexLayout.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\BizHawk.Common\BizHawk.Common.csproj">
<Project>{866F8D13-0678-4FF9-80A4-A3993FD4D8A3}</Project>
<Name>BizHawk.Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -1,6 +1,7 @@
//http://stackoverflow.com/questions/6893302/decode-rgb-value-to-single-float-without-bit-shift-in-glsl
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using sd=System.Drawing;
@ -106,6 +107,9 @@ namespace BizHawk.Bizware.BizwareGL
public void SetBlendState(IBlendState rsBlend)
{
#if DEBUG
BlendStateSet = true;
#endif
Flush();
Owner.SetBlendState(rsBlend);
}
@ -130,6 +134,7 @@ namespace BizHawk.Bizware.BizwareGL
}
}
public void Begin(sd.Size size) { Begin(size.Width, size.Height); }
/// <summary>
/// begin rendering, initializing viewport and projections to the given dimensions
@ -170,6 +175,10 @@ namespace BizHawk.Bizware.BizwareGL
Modelview.Clear();
Projection.Clear();
SetModulateColorWhite();
#if DEBUG
BlendStateSet = false;
#endif
}
/// <summary>
@ -248,7 +257,7 @@ namespace BizHawk.Bizware.BizwareGL
art.u0 = art.v0 = 0;
art.u1 = art.v1 = 1;
art.BaseTexture = tex;
DrawInternal(art,x,y,w,h,false,false);
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)
@ -343,6 +352,10 @@ namespace BizHawk.Bizware.BizwareGL
Owner.BindArrayData(pData);
Owner.DrawArrays(PrimitiveType.TriangleStrip, 0, 4);
#if DEBUG
Debug.Assert(BlendStateSet);
#endif
}
unsafe void DrawSubrectInternal(Texture2d tex, float x, float y, float w, float h, float u0, float v0, float u1, float v1)
@ -359,6 +372,9 @@ namespace BizHawk.Bizware.BizwareGL
//state cache
Texture2d sTexture;
#if DEBUG
bool BlendStateSet;
#endif
public readonly string DefaultVertexShader = @"
#version 110 //opengl 2.0 ~ 2004

View File

@ -179,6 +179,17 @@ namespace BizHawk.Bizware.BizwareGL
/// </summary>
Texture2d CreateTexture(int width, int height);
/// <summary>
/// In case you already have the texture ID (from an opengl emulator gpu core) you can get a Texture2d with it this way.
/// Otherwise, if this isn't an OpenGL frontend implementation, I guess... try reading the texturedata out of it and making a new texture?
/// </summary>
Texture2d WrapGLTexture2d(IntPtr glTexId, int width, int height);
/// <summary>
/// Sets the clamp mode (for both uv) for the Texture2d
/// </summary>
void SetTextureWrapMode(Texture2d tex, bool clamp);
/// <summary>
/// Loads the texture with new data. This isnt supposed to be especially versatile, it just blasts a bitmap buffer into the texture
/// </summary>

View File

@ -10,6 +10,12 @@ namespace BizHawk.Bizware.BizwareGL
Owner = owner;
Id = handle;
Texture2d = tex;
tex.IsUpsideDown = true;
}
public override string ToString()
{
return string.Format("GL RT: {0}x{1}", Texture2d.Width, Texture2d.Height);
}
public IntPtr Id { get; private set; }

View File

@ -35,6 +35,11 @@ namespace BizHawk.Bizware.BizwareGL
Height = height;
}
public override string ToString()
{
return string.Format("GL Tex: {0}x{1}", Width, Height);
}
public void LoadFrom(BitmapBuffer buffer)
{
}
@ -73,5 +78,10 @@ namespace BizHawk.Bizware.BizwareGL
public int IntWidth { get { return (int)Width; } }
public int IntHeight { get { return (int)Height; } }
public Size Size { get { return new Size(IntWidth, IntHeight); } }
/// <summary>
/// opengl sucks, man. seriously, screw this (textures from render targets are upside down)
/// </summary>
public bool IsUpsideDown;
}
}

View File

@ -1,36 +1,12 @@
using System;
using System.Collections.Generic;
using BizHawk.Common;
using OpenTK.Graphics.OpenGL;
namespace BizHawk.Bizware.BizwareGL
{
//TEMP until its in bizhawk main
public class WorkingDictionary<K, V> : Dictionary<K, V> where V : new()
{
public new V this[K key]
{
get
{
V temp;
if (!TryGetValue(key, out temp))
{
temp = this[key] = new V();
}
return temp;
}
set
{
base[key] = value;
}
}
public WorkingDictionary() { }
}
public class VertexLayout : IDisposable
{
//TODO - could refactor to use vertex array objects? check opengl profile requirements (answer: 3.0. dont want to do this.)

View File

@ -98,7 +98,8 @@
<OutputFile>.\Debug/n64Glide.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>xcopy /y "$(OutDir)$(TargetName)$(TargetExt)" "$(TargetDir)..\..\..\..\..\BizHawk.MultiClient\output\dll\"</Command>
<Command>xcopy /y "$(OutDir)$(TargetName)$(TargetExt)" "$(TargetDir)..\..\..\..\..\output\dll\"</Command>
<Message>Copying shared data and libraries to build directory...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

View File

@ -1315,6 +1315,21 @@ void ReleaseGfx ()
extern "C" {
#endif
EXPORT void* CALL GetScreenTextureID()
{
//__asm int 3;
// GrLfbInfo_t info;
// info.size = sizeof(GrLfbInfo_t);
// if (grLfbLock (GR_LFB_READ_ONLY,
// GR_BUFFER_BACKBUFFER,
// GR_LFBWRITEMODE_888,
// GR_ORIGIN_UPPER_LEFT,
// FXFALSE,
// &info))
return NULL;
}
EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front)
{
VLOG("CALL ReadScreen2 ()\n");

View File

@ -32,7 +32,7 @@ uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
gl_Position = MVPMatrix * VertexCoord;
vTexCoord0 = TexCoord;
vTexCoord0 = TexCoord.xy;
}
#elif defined(FRAGMENT)
@ -70,7 +70,7 @@ uniform float uIntensity;
void main()
{
vec4 temp = texture2D(Texture,vTexCoord0);
if((int(gl_FragCoord.y))%2==1) temp.rgb *= uIntensity;
if(floor(gl_FragCoord.y/2) != floor(gl_FragCoord.y)/2) temp.rgb *= uIntensity;
FragColor = temp;
}
#endif

View File

@ -0,0 +1,4 @@
shaders = 1
shader0 = bicubic-fast.glsl
scale_type0 = viewport