Merge from TASVideo

This commit is contained in:
Hathor86 2015-11-01 22:01:19 +01:00
commit f70a2c8c6c
154 changed files with 8102 additions and 24250 deletions

2
.gitignore vendored
View File

@ -257,3 +257,5 @@
.hgignore
.hgtags
/output/*.manifest
/output/dll/*.iobj
/output/dll/*.ipdb

View File

@ -47,9 +47,10 @@ namespace BizHawk.Client.Common
public static BinaryStateLump ClientSettings { get; private set; }
[Name("VerificationLog", "txt")]
public static BinaryStateLump VerificationLog { get; private set; }
[Name("UserData", "txt")]
public static BinaryStateLump UserData { get; private set; }
[Name("Session", "txt")]
public static BinaryStateLump Session { get; private set; }
// branchstuff
[Name("Branches\\CoreData", "bin")]
@ -64,6 +65,8 @@ namespace BizHawk.Client.Common
public static BinaryStateLump BranchHeader { get; private set; }
[Name("Branches\\Markers", "txt")]
public static BinaryStateLump BranchMarkers { get; private set; }
[Name("Branches\\GreenZone")]
public static BinaryStateLump BranchStateHistory { get; private set; }
[AttributeUsage(AttributeTargets.Property)]
private class NameAttribute : Attribute

View File

@ -52,7 +52,6 @@
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@ -113,9 +112,6 @@
<Compile Include="CoreFileProvider.cs" />
<Compile Include="ExceptionClasses.cs" />
<Compile Include="FirmwareManager.cs" />
<Compile Include="GLManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Global.cs" />
<Compile Include="inputAdapters\AutoPattern.cs" />
<Compile Include="inputAdapters\BitwiseAdapters.cs" />
@ -158,6 +154,7 @@
<Compile Include="movie\bk2\Bk2Movie.HeaderApi.cs">
<DependentUpon>Bk2Movie.cs</DependentUpon>
</Compile>
<Compile Include="movie\import\PXMImport.cs" />
<Compile Include="movie\tasproj\StateManagerState.cs" />
<Compile Include="movie\tasproj\TasBranch.cs" />
<Compile Include="movie\tasproj\TasMovie.History.cs" />
@ -212,6 +209,7 @@
</Compile>
<Compile Include="movie\tasproj\TasMovie.cs" />
<Compile Include="movie\tasproj\TasMovieMarker.cs" />
<Compile Include="movie\tasproj\TasSession.cs" />
<Compile Include="movie\tasproj\TasStateManager.cs" />
<Compile Include="movie\tasproj\TasMovieRecord.cs" />
<Compile Include="movie\tasproj\TasStateManagerSettings.cs" />
@ -231,12 +229,12 @@
<Compile Include="SevenZipWriter.cs" />
<Compile Include="SharpZipWriter.cs" />
<Compile Include="SystemInfo.cs" />
<Compile Include="TempFileCleaner.cs" />
<Compile Include="tools\Cheat.cs" />
<Compile Include="tools\CheatList.cs" />
<Compile Include="tools\RamSearchEngine.cs" />
<Compile Include="tools\Watch.cs" />
<Compile Include="tools\WatchList.cs" />
<Compile Include="UIHelper.cs" />
<Compile Include="XmlGame.cs" />
</ItemGroup>
<ItemGroup>

View File

@ -31,7 +31,7 @@ namespace BizHawk.Client.Common
{
public class RomLoader
{
public enum LoadErrorType { Unknown, MissingFirmware, XML }
public enum LoadErrorType { Unknown, MissingFirmware, XML, DiscError }
// helper methods for the settings events
private object GetCoreSettings<T>()
@ -265,7 +265,7 @@ namespace BizHawk.Client.Common
if (discMountJob.OUT_SlowLoadAborted)
{
System.Windows.Forms.MessageBox.Show("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk");
DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", "", LoadErrorType.DiscError);
return false;
}
@ -324,7 +324,7 @@ namespace BizHawk.Client.Common
if (discMountJob.OUT_SlowLoadAborted)
{
System.Windows.Forms.MessageBox.Show("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk");
DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", "", LoadErrorType.DiscError);
return false;
}
@ -460,7 +460,7 @@ namespace BizHawk.Client.Common
if (discMountJob.OUT_SlowLoadAborted)
{
System.Windows.Forms.MessageBox.Show("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk");
DoLoadErrorCallback("This disc would take too long to load. Run it through discohawk first, or find a new rip because this one is probably junk", "PSX", LoadErrorType.DiscError);
return false;
}
@ -515,7 +515,7 @@ namespace BizHawk.Client.Common
{
// need to get rid of this hack at some point
rom = new RomGame(file);
((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", String.Empty)); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename
((CoreFileProvider)nextComm.CoreFileProvider).SubfileDirectory = Path.GetDirectoryName(path.Replace("|", string.Empty)); // Dirty hack to get around archive filenames (since we are just getting the directory path, it is safe to mangle the filename
byte[] romData = null;
byte[] xmlData = rom.FileData;

View File

@ -0,0 +1,61 @@
using System;
using System.IO;
namespace BizHawk.Client.Common
{
/// <summary>
/// Starts a thread which cleans any filenames in %temp% beginning with bizhawk.bizdelete.
/// Files shouldn't be named that unless they're safe to delete, but notably, they may stil be in use. That won't hurt this component.
/// When they're no longer in use, this component will then be able to delete them.
/// </summary>
public static class TempFileCleaner
{
//todo - manage paths other than %temp%, make not static, or allow adding multiple paths to static instance
public static void Start()
{
lock (typeof(TempFileCleaner))
{
if (thread != null)
return;
thread = new System.Threading.Thread(ThreadProc);
thread.IsBackground = true;
thread.Priority = System.Threading.ThreadPriority.Lowest;
thread.Start();
}
}
static void ThreadProc()
{
var di = new DirectoryInfo(Path.GetTempPath());
for (; ; )
{
var fis = di.GetFiles("bizhawk.bizdelete*");
foreach (var fi in fis)
{
try
{
fi.Delete();
}
catch
{
}
//try not to do more than one thing per frame
System.Threading.Thread.Sleep(100);
}
//try not to slam the filesystem too hard, we dont want this to cause any hiccups
System.Threading.Thread.Sleep(5000);
}
}
public static void Stop()
{
}
static System.Threading.Thread thread;
}
}

View File

@ -116,7 +116,11 @@ namespace BizHawk.Client.Common
public enum ESoundOutputMethod { DirectSound, XAudio2, OpenAL, Dummy };
public enum EDispManagerAR { None, System, Custom };
public enum EDispManagerAR { None, System,
//actually, custom SIZE (fixme on major release)
Custom,
CustomRatio
};
public enum SaveStateTypeE { Default, Binary, Text };
@ -273,9 +277,14 @@ namespace BizHawk.Client.Common
public bool DispChrome_Fullscreen_AutohideMouse = true;
public bool DispChrome_AllowDoubleClickFullscreen = true;
public EDispManagerAR DispManagerAR = EDispManagerAR.System;
public int DispCustomUserARWidth = 1;
public int DispCustomUserARHeight = 1;
public EDispManagerAR DispManagerAR = EDispManagerAR.System;
//these are misnomers. they're actually a fixed size (fixme on major release)
public int DispCustomUserARWidth = -1;
public int DispCustomUserARHeight = -1;
//these are more like the actual AR ratio (i.e. 4:3) (fixme on major release)
public float DispCustomUserARX = -1;
public float DispCustomUserARY = -1;
// Sound options
#if WINDOWS

View File

@ -9,8 +9,7 @@ namespace BizHawk.Client.Common
{
Name = string.Empty;
Path = path;
Enabled = true;
Paused = false;
State = RunState.Running;
FrameWaiting = false;
}
@ -29,28 +28,34 @@ namespace BizHawk.Client.Common
IsSeparator = isSeparator;
Name = string.Empty;
Path = string.Empty;
Enabled = false;
State = RunState.Disabled;
}
public LuaFile(LuaFile file)
{
Name = file.Name;
Path = file.Path;
Enabled = file.Enabled;
Paused = file.Paused;
State = file.State;
IsSeparator = file.IsSeparator;
CurrentDirectory = file.CurrentDirectory;
}
public string Name { get; set; }
public string Path { get; set; }
public bool Enabled { get; set; }
public bool Paused { get; set; }
public bool Enabled { get { return State != RunState.Disabled; } }
public bool Paused { get { return State == RunState.Paused; } }
public bool IsSeparator { get; set; }
public LuaInterface.Lua Thread { get; set; }
public bool FrameWaiting { get; set; }
public string CurrentDirectory { get; set; }
public enum RunState
{
Disabled, Running, Paused
}
public RunState State { get; set; }
public static LuaFile SeparatorInstance
{
get { return new LuaFile(true); }
@ -58,22 +63,25 @@ namespace BizHawk.Client.Common
public void Stop()
{
Enabled = false;
State = RunState.Disabled;
Thread = null;
}
public void Toggle()
{
Enabled ^= true;
if (Enabled)
{
Paused = false;
}
if (State == RunState.Paused)
State = RunState.Running;
else if (State == RunState.Disabled)
State = RunState.Running;
else State = RunState.Disabled;
}
public void TogglePause()
{
Paused ^= true;
if (State == RunState.Paused)
State = RunState.Running;
else if(State == RunState.Running)
State = RunState.Paused;
}
}
}

View File

@ -45,7 +45,7 @@ namespace BizHawk.Client.Common
public void StopAllScripts()
{
ForEach(x => x.Enabled = false);
ForEach(x => x.State = LuaFile.RunState.Disabled);
}
public new void Clear()
@ -105,8 +105,10 @@ namespace BizHawk.Client.Common
Add(new LuaFile(scriptPath)
{
Enabled = !Global.Config.DisableLuaScriptsOnLoad &&
line.Substring(0, 1) == "1",
State = (
!Global.Config.DisableLuaScriptsOnLoad
&& line.Substring(0, 1) == "1"
) ? LuaFile.RunState.Running : LuaFile.RunState.Disabled
});
}
}

View File

@ -18,12 +18,12 @@ namespace BizHawk.Client.Common
public new bool Remove(NamedLuaFunction function)
{
if (Global.Emulator.CanPollInput())
if (Global.Emulator.InputCallbacksAvailable())
{
Global.Emulator.AsInputPollable().InputCallbacks.Remove(function.Callback);
}
if (Global.Emulator.CanDebug() && Global.Emulator.MemoryCallbacksAvailable())
if (Global.Emulator.MemoryCallbacksAvailable())
{
Global.Emulator.AsDebuggable().MemoryCallbacks.Remove(function.Callback);
}
@ -33,22 +33,15 @@ namespace BizHawk.Client.Common
public void ClearAll()
{
if (Global.Emulator.CanPollInput())
if (Global.Emulator.InputCallbacksAvailable())
{
Global.Emulator.AsInputPollable().InputCallbacks.RemoveAll(this.Select(x => x.Callback));
}
if (Global.Emulator.CanDebug())
if (Global.Emulator.MemoryCallbacksAvailable())
{
try
{
var cbSys = Global.Emulator.AsDebuggable().MemoryCallbacks;
cbSys.RemoveAll(this.Select(x => x.Callback));
}
catch
{
//swallow exceptions here. many cores havent implemented memorycallbacks, we ought to have more granular feature querying
}
var cbSys = Global.Emulator.AsDebuggable().MemoryCallbacks;
cbSys.RemoveAll(this.Select(x => x.Callback));
}
Clear();

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using BizHawk.Common;
using BizHawk.Common.BufferExtensions;
@ -53,7 +54,7 @@ namespace BizHawk.Client.Common
if (!string.IsNullOrWhiteSpace(warningMsg))
{
messageCallback(warningMsg);
}
else
{
@ -73,23 +74,72 @@ namespace BizHawk.Client.Common
warningMsg = string.Empty;
string ext = path != null ? Path.GetExtension(path).ToUpper() : string.Empty;
// TODO: reflect off the assembly and find an IMovieImporter with the appropriate ImportExtension metadata
//if (ext == ".FM2")
//{
// var result = new Fm2Import().Import(path);
// errorMsg = result.Errors.First();
// warningMsg = result.Errors.First();
// return result.Movie;
//}
if (ext == ".PJM")
if (UsesLegacyImporter(ext))
{
var result = new PJMImport().Import(path);
errorMsg = result.Errors.First();
warningMsg = result.Errors.First();
return result.Movie;
return LegacyImportFile(ext, path, out errorMsg, out warningMsg).ToBk2();
}
var importers = ImportersForExtension(ext);
var importerType = importers.FirstOrDefault();
if (importerType == default(Type))
{
errorMsg = "No importer found for file type " + ext;
return null;
}
// Create a new instance of the importer class using the no-argument constructor
IMovieImport importer = importerType.GetConstructor(new Type[] { })
.Invoke(new object[] { }) as IMovieImport;
Bk2Movie movie = null;
try
{
var result = importer.Import(path);
if (result.Errors.Count() > 0) errorMsg = result.Errors.First();
if (result.Warnings.Count() > 0) warningMsg = result.Warnings.First();
movie = result.Movie;
}
catch (Exception ex)
{
errorMsg = ex.ToString();
}
return movie;
}
private static IEnumerable<Type> ImportersForExtension(string ext)
{
var info = typeof(MovieImport).Module;
var importers = from t in info.GetTypes()
where typeof(IMovieImport).IsAssignableFrom(t)
&& TypeImportsExtension(t, ext)
select t;
return importers;
}
private static bool TypeImportsExtension(Type t, string ext)
{
var attrs = (ImportExtension[])t.GetCustomAttributes(typeof(ImportExtension), inherit: false);
if (attrs.Any(a => a.Extension.ToUpper() == ext.ToUpper()))
{
return true;
}
else
{
return false;
}
}
private static BkmMovie LegacyImportFile(string ext, string path, out string errorMsg, out string warningMsg)
{
errorMsg = string.Empty;
warningMsg = string.Empty;
BkmMovie m = new BkmMovie();
try
@ -149,16 +199,23 @@ namespace BizHawk.Client.Common
errorMsg = except.ToString();
}
// Hack
return m.ToBk2();
return m;
}
// Return whether or not the type of file provided can currently be imported.
public static bool IsValidMovieExtension(string extension)
{
// TODO: Other movie formats that don't use a legacy importer (PJM/PXM, etc),
// when those are implemented
return UsesLegacyImporter(extension);
}
// Return whether or not the type of file provided is currently imported by a legacy (i.e. to BKM not BK2) importer
public static bool UsesLegacyImporter(string extension)
{
string[] extensions =
{
"FCM", "FM2", "FMV", "GMV", "MCM", "MC2", "MMV", "NMV", "LSMV", "SMV", "VBM", "VMV", "YMV", "ZMV"
"BKM", "FCM", "FM2", "FMV", "GMV", "MCM", "MC2", "MMV", "NMV", "LSMV", "SMV", "VBM", "VMV", "YMV", "ZMV"
};
return extensions.Any(ext => extension.ToUpper() == "." + ext);
}
@ -213,7 +270,7 @@ namespace BizHawk.Client.Common
controller = "Saturn Controller";
break;
}
var controllers = new SimpleController {Type = new ControllerDefinition {Name = controller}};
var controllers = new SimpleController { Type = new ControllerDefinition { Name = controller } };
// Split up the sections of the frame.
string[] sections = line.Split('|');
if (ext == ".FM2" && sections.Length >= 2 && sections[1].Length != 0)
@ -643,7 +700,7 @@ namespace BizHawk.Client.Common
m.Header[HeaderKeys.AUTHOR] = author;
// Advance to first byte of input data.
r.BaseStream.Position = firstFrameOffset;
SimpleController controllers = new SimpleController {Type = new ControllerDefinition {Name = "NES Controller"}};
SimpleController controllers = new SimpleController { Type = new ControllerDefinition { Name = "NES Controller" } };
string[] buttons = { "A", "B", "Select", "Start", "Up", "Down", "Left", "Right" };
bool fds = false;
bool fourscore = false;
@ -832,7 +889,7 @@ namespace BizHawk.Client.Common
else
{
FDS = false;
}
m.Header[HeaderKeys.PLATFORM] = "NES";
@ -874,7 +931,7 @@ namespace BizHawk.Client.Common
*/
m.Header[HeaderKeys.PAL] = "False";
// 090 frame data begins here
SimpleController controllers = new SimpleController {Type = new ControllerDefinition {Name = "NES Controller"}};
SimpleController controllers = new SimpleController { Type = new ControllerDefinition { Name = "NES Controller" } };
/*
* 01 Right
* 02 Left
@ -1378,7 +1435,7 @@ namespace BizHawk.Client.Common
r.ReadBytes(103);
// TODO: Verify if NTSC/"PAL" mode used for the movie can be detected or not.
// 100 variable Input data
SimpleController controllers = new SimpleController {Type = new ControllerDefinition {Name = name + " Controller"}};
SimpleController controllers = new SimpleController { Type = new ControllerDefinition { Name = name + " Controller" } };
int bytes = 256;
// The input stream consists of 1 byte for power-on and reset, and then X bytes per each input port per frame.
if (platform == "nes")
@ -1499,7 +1556,7 @@ namespace BizHawk.Client.Common
// 00e4-00f3: binary: rom MD5 digest
byte[] md5 = r.ReadBytes(16);
m.Header[MD5] = string.Format("{0:x8}", md5.BytesToHexString().ToLower());
var controllers = new SimpleController { Type = new ControllerDefinition { Name = "SMS Controller" }};
var controllers = new SimpleController { Type = new ControllerDefinition { Name = "SMS Controller" } };
/*
76543210
* bit 0 (0x01): up
@ -1724,7 +1781,7 @@ namespace BizHawk.Client.Common
// ... 4-byte little-endian unsigned int: length of controller data in bytes
uint length = r.ReadUInt32();
// ... (variable) controller data
SimpleController controllers = new SimpleController {Type = new ControllerDefinition {Name = "NES Controller"}};
SimpleController controllers = new SimpleController { Type = new ControllerDefinition { Name = "NES Controller" } };
/*
Standard controllers store data in the following format:
* 01: A
@ -1827,7 +1884,7 @@ namespace BizHawk.Client.Common
* bit 4: controller 5 in use
* other: reserved, set to 0
*/
SimpleController controllers = new SimpleController {Type = new ControllerDefinition {Name = "SNES Controller"}};
SimpleController controllers = new SimpleController { Type = new ControllerDefinition { Name = "SNES Controller" } };
bool[] controllersUsed = new bool[5];
for (int controller = 1; controller <= controllersUsed.Length; controller++)
{
@ -1944,7 +2001,7 @@ namespace BizHawk.Client.Common
{
"Right", "Left", "Down", "Up", "Start", "Select", "Y", "B", "R", "L", "X", "A"
};
for (int frame = 0; frame <= frameCount; frame++)
{
controllers["Reset"] = true;
@ -2139,16 +2196,16 @@ namespace BizHawk.Client.Common
// bit 2: if "1", movie is for the SGB system
bool is_sgb = (((flags >> 2) & 0x1) != 0);
// other: reserved, set to 0
// (At most one of bits 0, 1, 2 can be "1")
//if (!(is_gba ^ is_gbc ^ is_sgb) && (is_gba || is_gbc || is_sgb)) //TODO: adelikat: this doesn't do what the comment above suggests it is trying to check for, it is always false!
//{
//errorMsg = "This is not a valid .VBM file.";
//r.Close();
//fs.Close();
//return null;
//errorMsg = "This is not a valid .VBM file.";
//r.Close();
//fs.Close();
//return null;
//}
// (If all 3 of these bits are "0", it is for regular GB.)
string platform = "GB";
if (is_gba)
@ -2238,7 +2295,7 @@ namespace BizHawk.Client.Common
string movieDescription = NullTerminated(r.ReadStringFixedAscii(128));
m.Comments.Add(COMMENT + " " + movieDescription);
r.BaseStream.Position = firstFrameOffset;
SimpleController controllers = new SimpleController {Type = new ControllerDefinition()};
SimpleController controllers = new SimpleController { Type = new ControllerDefinition() };
if (platform != "GBA")
{
controllers.Type.Name = "Gameboy Controller";
@ -2268,7 +2325,7 @@ namespace BizHawk.Client.Common
* 00 40 Down motion sensor
* 00 80 Up motion sensor
*/
string[] other =
string[] other =
{
"Reset (old timing)" , "Reset (new timing since version 1.1)", "Left motion sensor",
"Right motion sensor", "Down motion sensor", "Up motion sensor"
@ -2416,7 +2473,7 @@ namespace BizHawk.Client.Common
return m;
}
r.BaseStream.Position = firstFrameOffset;
SimpleController controllers = new SimpleController {Type = new ControllerDefinition {Name = "NES Controller"}};
SimpleController controllers = new SimpleController { Type = new ControllerDefinition { Name = "NES Controller" } };
/*
* 01 A
* 02 B
@ -2653,7 +2710,7 @@ namespace BizHawk.Client.Common
uint savestateSize = (uint)((r.ReadByte() | (r.ReadByte() << 8) | (r.ReadByte() << 16)) & 0x7FFFFF);
// Next follows a ZST format savestate.
r.ReadBytes((int)savestateSize);
SimpleController controllers = new SimpleController {Type = new ControllerDefinition {Name = "SNES Controller"}};
SimpleController controllers = new SimpleController { Type = new ControllerDefinition { Name = "SNES Controller" } };
/*
* bit 11: A
* bit 10: X

View File

@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using BizHawk.Emulation.Cores.Sony.PSX;
using Newtonsoft.Json;
using System;
using System.IO;
using System.Linq;
using System.Text;
namespace BizHawk.Client.Common
{
@ -11,7 +10,418 @@ namespace BizHawk.Client.Common
{
protected override void RunImport()
{
// TODO
Bk2Movie movie = Result.Movie;
MiscHeaderInfo info;
movie.HeaderEntries[HeaderKeys.PLATFORM] = "PSX";
using (var fs = SourceFile.OpenRead())
{
using (var br = new BinaryReader(fs))
{
info = parseHeader(movie, "PJM ", br);
fs.Seek(info.controllerDataOffset, SeekOrigin.Begin);
if (info.binaryFormat)
{
parseBinaryInputLog(br, movie, info);
}
else
{
parseTextInputLog(br, movie, info);
}
}
}
movie.Save();
}
protected MiscHeaderInfo parseHeader(Bk2Movie movie, string expectedMagic, BinaryReader br)
{
var info = new MiscHeaderInfo();
string magic = new string(br.ReadChars(4));
if (magic != expectedMagic)
{
Result.Errors.Add("Not a " + expectedMagic + "file: invalid magic number in file header.");
return info;
}
UInt32 movieVersionNumber = br.ReadUInt32();
if (movieVersionNumber != 2)
{
Result.Warnings.Add(String.Format("Unexpected movie version: got {0}, expecting 2", movieVersionNumber));
}
// 008: UInt32 emulator version.
br.ReadUInt32();
byte flags = br.ReadByte();
byte flags2 = br.ReadByte();
if ((flags & 0x02) != 0)
{
Result.Errors.Add("Movie starts from savestate; this is currently unsupported.");
}
if ((flags & 0x04) != 0)
{
movie.HeaderEntries[HeaderKeys.PAL] = "1";
}
if ((flags & 0x08) != 0)
{
Result.Errors.Add("Movie contains embedded memory cards; this is currently unsupported.");
}
if ((flags & 0x10) != 0)
{
Result.Errors.Add("Movie contains embedded cheat list; this is currently unsupported.");
}
if ((flags & 0x20) != 0 || (flags2 & 0x06) != 0)
{
Result.Errors.Add("Movie relies on emulator hacks; this is currently unsupported.");
}
if ((flags & 0x40) != 0)
{
info.binaryFormat = false;
}
if ((flags & 0x80) != 0 || (flags2 & 0x01) != 0)
{
Result.Errors.Add("Movie uses multitap; this is currently unsupported.");
return info;
}
// Player 1 controller type
switch (br.ReadByte())
{
// It seems to be inconsistent in the files I looked at which of these is used
// to mean no controller present.
case 0:
case 8:
info.player1Type = OctoshockDll.ePeripheralType.None;
break;
case 4:
info.player1Type = OctoshockDll.ePeripheralType.Pad;
break;
case 7:
info.player1Type = OctoshockDll.ePeripheralType.DualShock;
break;
default:
Result.Errors.Add("Movie has unrecognised controller type for Player 1.");
return info;
}
// Player 2 controller type
switch (br.ReadByte())
{
case 0:
case 8:
info.player1Type = OctoshockDll.ePeripheralType.None;
break;
case 4:
info.player1Type = OctoshockDll.ePeripheralType.Pad;
break;
case 7:
info.player1Type = OctoshockDll.ePeripheralType.DualShock;
break;
default:
Result.Errors.Add("Movie has unrecognised controller type for Player 2.");
return info;
}
Octoshock.SyncSettings syncsettings = new Octoshock.SyncSettings();
syncsettings.FIOConfig.Devices8 =
new[] {
info.player1Type,
OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,
info.player2Type,
OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None
};
// Annoying kludge to force the json serializer to serialize the type name for "o" object.
// For just the "o" object to have type information, it must be cast to a superclass such
// that the TypeNameHandling.Auto decides to serialize the type as well as the object
// contents. As such, the object cast is NOT redundant
var jsonSettings = new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.Auto
};
movie.SyncSettingsJson = JsonConvert.SerializeObject(new { o = (object)syncsettings }, jsonSettings);
info.frameCount = br.ReadUInt32();
UInt32 rerecordCount = br.ReadUInt32();
movie.HeaderEntries[HeaderKeys.RERECORDS] = rerecordCount.ToString();
// 018: UInt32 savestateOffset
// 01C: UInt32 memoryCard1Offset
// 020: UInt32 memoryCard2Offset
// 024: UInt32 cheatListOffset
// 028: UInt32 cdRomIdOffset
// Source format is just the first up-to-8 alphanumeric characters of the CD label,
// so not so useful.
br.ReadBytes(20);
info.controllerDataOffset = br.ReadUInt32();
UInt32 authorNameLength = br.ReadUInt32();
char[] authorName = br.ReadChars((int)authorNameLength);
movie.HeaderEntries[HeaderKeys.AUTHOR] = new string(authorName);
info.parseSuccessful = true;
return info;
}
protected void parseBinaryInputLog(BinaryReader br, Bk2Movie movie, MiscHeaderInfo info)
{
Octoshock.SyncSettings settings = new Octoshock.SyncSettings();
SimpleController controllers = new SimpleController();
settings.FIOConfig.Devices8 =
new[] {
info.player1Type,
OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,
info.player2Type,
OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None
};
controllers.Type = Octoshock.CreateControllerDefinition(settings);
string[] buttons = { "Select", "L3", "R3", "Start", "Up", "Right", "Down", "Left",
"L2", "R2", "L1", "R1", "Triangle", "Circle", "Cross", "Square"};
bool isCdTrayOpen = false;
int cdNumber = 1;
for (int frame = 0; frame < info.frameCount; ++frame)
{
if (info.player1Type != OctoshockDll.ePeripheralType.None)
{
UInt16 controllerState = br.ReadUInt16();
// As L3 and R3 don't exist on a standard gamepad, handle them separately later. Unfortunately
// due to the layout, we handle select separately too first.
controllers["P1 Select"] = (controllerState & 0x1) != 0;
for (int button = 3; button < buttons.Length; button++)
{
controllers["P1 " + buttons[button]] = (((controllerState >> button) & 0x1) != 0);
if (((controllerState >> button) & 0x1) != 0 && button > 15)
{
continue;
}
}
if (info.player1Type == OctoshockDll.ePeripheralType.DualShock)
{
controllers["P1 L3"] = (controllerState & 0x2) != 0;
controllers["P1 R3"] = (controllerState & 0x4) != 0;
Tuple<string, float> leftX = new Tuple<string, float>("P1 LStick X", (float)br.ReadByte());
Tuple<string, float> leftY = new Tuple<string, float>("P1 LStick Y", (float)br.ReadByte());
Tuple<string, float> rightX = new Tuple<string, float>("P1 RStick X", (float)br.ReadByte());
Tuple<string, float> rightY = new Tuple<string, float>("P1 RStick Y", (float)br.ReadByte());
controllers.AcceptNewFloats(new[] { leftX, leftY, rightX, rightY });
}
}
if (info.player2Type != OctoshockDll.ePeripheralType.None)
{
UInt16 controllerState = br.ReadUInt16();
for (int button = 0; button < buttons.Length; button++)
{
controllers["P2 " + buttons[button]] = (((controllerState >> button) & 0x1) != 0);
if (((controllerState >> button) & 0x1) != 0 && button > 15)
{
continue;
}
}
if (info.player2Type == OctoshockDll.ePeripheralType.DualShock)
{
Tuple<string, float> leftX = new Tuple<string, float>("P2 LStick X", (float)br.ReadByte());
Tuple<string, float> leftY = new Tuple<string, float>("P2 LStick Y", (float)br.ReadByte());
Tuple<string, float> rightX = new Tuple<string, float>("P2 RStick X", (float)br.ReadByte());
Tuple<string, float> rightY = new Tuple<string, float>("P2 RStick Y", (float)br.ReadByte());
controllers.AcceptNewFloats(new[] { leftX, leftY, rightX, rightY });
}
}
byte controlState = br.ReadByte();
controllers["Reset"] = (controlState & 0x02) != 0;
if ((controlState & 0x04) != 0)
{
if (isCdTrayOpen)
{
controllers["Close"] = true;
cdNumber++;
}
else
{
controllers["Open"] = true;
}
isCdTrayOpen = !isCdTrayOpen;
}
else
{
controllers["Close"] = false;
controllers["Open"] = false;
}
Tuple<string, float> discSelect = new Tuple<string, float>("Disc Select", cdNumber);
controllers.AcceptNewFloats(new[] { discSelect });
if ((controlState & 0xFC) != 0)
{
Result.Warnings.Add("Ignored toggle hack flag on frame " + frame.ToString());
}
movie.AppendFrame(controllers);
}
}
protected void parseTextInputLog(BinaryReader br, Bk2Movie movie, MiscHeaderInfo info)
{
Octoshock.SyncSettings settings = new Octoshock.SyncSettings();
SimpleController controllers = new SimpleController();
settings.FIOConfig.Devices8 =
new[] {
info.player1Type,
OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,
info.player2Type,
OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None,OctoshockDll.ePeripheralType.None
};
controllers.Type = Octoshock.CreateControllerDefinition(settings);
string[] buttons = { "Select", "L3", "R3", "Start", "Up", "Right", "Down", "Left",
"L2", "R2", "L1", "R1", "Triangle", "Circle", "Cross", "Square"};
bool isCdTrayOpen = false;
int cdNumber = 1;
for (int frame = 0; frame < info.frameCount; ++frame)
{
if (info.player1Type != OctoshockDll.ePeripheralType.None)
{
// As L3 and R3 don't exist on a standard gamepad, handle them separately later. Unfortunately
// due to the layout, we handle select separately too first.
controllers["P1 Select"] = br.ReadChar() != '.';
if (info.player1Type == OctoshockDll.ePeripheralType.DualShock)
{
controllers["P1 L3"] = br.ReadChar() != '.';
controllers["P1 R3"] = br.ReadChar() != '.';
}
for (int button = 3; button < buttons.Length; button++)
{
controllers["P1 " + buttons[button]] = br.ReadChar() != '.';
}
if (info.player1Type == OctoshockDll.ePeripheralType.DualShock)
{
// The analog controls are encoded as four space-separated numbers with a leading space
string leftXRaw = new string(br.ReadChars(4)).Trim();
string leftYRaw = new string(br.ReadChars(4)).Trim();
string rightXRaw = new string(br.ReadChars(4)).Trim();
string rightYRaw = new string(br.ReadChars(4)).Trim();
Tuple<string, float> leftX = new Tuple<string, float>("P1 LStick X", float.Parse(leftXRaw));
Tuple<string, float> leftY = new Tuple<string, float>("P1 LStick Y", float.Parse(leftYRaw));
Tuple<string, float> rightX = new Tuple<string, float>("P1 RStick X", float.Parse(rightXRaw));
Tuple<string, float> rightY = new Tuple<string, float>("P1 RStick Y", float.Parse(rightYRaw));
controllers.AcceptNewFloats(new[] { leftX, leftY, rightX, rightY });
}
}
// Each controller is terminated with a pipeline.
br.ReadChar();
if (info.player2Type != OctoshockDll.ePeripheralType.None)
{
// As L3 and R3 don't exist on a standard gamepad, handle them separately later. Unfortunately
// due to the layout, we handle select separately too first.
controllers["P2 Select"] = br.ReadChar() != '.';
if (info.player2Type == OctoshockDll.ePeripheralType.DualShock)
{
controllers["P2 L3"] = br.ReadChar() != '.';
controllers["P2 R3"] = br.ReadChar() != '.';
}
for (int button = 3; button < buttons.Length; button++)
{
controllers["P2 " + buttons[button]] = br.ReadChar() != '.';
}
if (info.player2Type == OctoshockDll.ePeripheralType.DualShock)
{
// The analog controls are encoded as four space-separated numbers with a leading space
string leftXRaw = new string(br.ReadChars(4)).Trim();
string leftYRaw = new string(br.ReadChars(4)).Trim();
string rightXRaw = new string(br.ReadChars(4)).Trim();
string rightYRaw = new string(br.ReadChars(4)).Trim();
Tuple<string, float> leftX = new Tuple<string, float>("P2 LStick X", float.Parse(leftXRaw));
Tuple<string, float> leftY = new Tuple<string, float>("P2 LStick Y", float.Parse(leftYRaw));
Tuple<string, float> rightX = new Tuple<string, float>("P2 RStick X", float.Parse(rightXRaw));
Tuple<string, float> rightY = new Tuple<string, float>("P2 RStick Y", float.Parse(rightYRaw));
controllers.AcceptNewFloats(new[] { leftX, leftY, rightX, rightY });
}
}
// Each controller is terminated with a pipeline.
br.ReadChar();
byte controlState = br.ReadByte();
controllers["Reset"] = (controlState & 0x02) != 0;
if ((controlState & 0x04) != 0)
{
if (isCdTrayOpen)
{
controllers["Close"] = true;
cdNumber++;
}
else
{
controllers["Open"] = true;
}
isCdTrayOpen = !isCdTrayOpen;
}
else
{
controllers["Close"] = false;
controllers["Open"] = false;
}
Tuple<string, float> discSelect = new Tuple<string, float>("Disc Select", cdNumber);
controllers.AcceptNewFloats(new[] { discSelect });
if ((controlState & 0xFC) != 0)
{
Result.Warnings.Add("Ignored toggle hack flag on frame " + frame.ToString());
}
// Each controller is terminated with a pipeline.
br.ReadChar();
movie.AppendFrame(controllers);
}
}
protected class MiscHeaderInfo
{
public bool binaryFormat = true;
public UInt32 controllerDataOffset;
public UInt32 frameCount;
public OctoshockDll.ePeripheralType player1Type;
public OctoshockDll.ePeripheralType player2Type;
public bool parseSuccessful = false;
}
}
}

View File

@ -0,0 +1,44 @@
using System.IO;
namespace BizHawk.Client.Common.movie.import
{
// PXM files are directly compatible with binary-format PJM files, with the only
// difference being fewer flags implemented in the header, hence just calling the
// base class methods via a subclass.
//
// However, the magic number/file signature is slightly different, requiring some
// refactoring to avoid PXM-specific code in the PJMImport class.
[ImportExtension(".pxm")]
class PXMImport : PJMImport
{
protected override void RunImport()
{
Bk2Movie movie = Result.Movie;
MiscHeaderInfo info;
movie.HeaderEntries[HeaderKeys.PLATFORM] = "PSX";
using (var fs = SourceFile.OpenRead())
{
using (var br = new BinaryReader(fs))
{
info = parseHeader(movie, "PXM ", br);
fs.Seek(info.controllerDataOffset, SeekOrigin.Begin);
if (info.binaryFormat)
{
parseBinaryInputLog(br, movie, info);
}
else
{
parseTextInputLog(br, movie, info);
}
}
}
movie.Save();
}
}
}

View File

@ -82,8 +82,8 @@ namespace BizHawk.Client.Common
{
bs.PutLump(BinaryStateLump.MovieSaveRam, (BinaryWriter bw) => bw.Write(SaveRam));
}
ReportProgress(PROGRESS_STEP);
if (ClientSettingsForSave != null)
{
var clientSettingsJson = ClientSettingsForSave();
@ -99,9 +99,14 @@ namespace BizHawk.Client.Common
if (Branches.Any())
{
Branches.Save(bs);
if (StateManager.Settings.BranchStatesInTasproj)
{
bs.PutLump(BinaryStateLump.BranchStateHistory, (BinaryWriter bw) => StateManager.SaveBranchStates(bw));
}
}
ReportProgress(PROGRESS_STEP);
bs.PutLump(BinaryStateLump.Session, tw => tw.WriteLine(Session.ToString()));
}
Changes = false;
@ -288,6 +293,18 @@ namespace BizHawk.Client.Common
}
Branches.Load(bl, this);
if (StateManager.Settings.BranchStatesInTasproj)
{
bl.GetLump(BinaryStateLump.BranchStateHistory, false, delegate(BinaryReader br, long length)
{
StateManager.LoadBranchStates(br);
});
}
bl.GetLump(BinaryStateLump.Session, false, delegate(TextReader tr)
{
Session.PopulateFromString(tr.ReadToEnd());
});
}
Changes = false;

View File

@ -18,10 +18,10 @@ namespace BizHawk.Client.Common
private readonly Bk2MnemonicConstants Mnemonics = new Bk2MnemonicConstants();
private readonly TasStateManager StateManager;
public readonly TasSession Session;
private readonly TasLagLog LagLog = new TasLagLog();
private readonly Dictionary<int, IController> InputStateCache = new Dictionary<int, IController>();
public readonly List<string> VerificationLog = new List<string>(); // For movies that do not begin with power-on, this is the input required to get into the initial state
public readonly TasBranchCollection Branches = new TasBranchCollection();
private BackgroundWorker _progressReportWorker = null;
@ -48,12 +48,14 @@ namespace BizHawk.Client.Common
ChangeLog = new TasMovieChangeLog(this);
StateManager = new TasStateManager(this);
Session = new TasSession(this);
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
Markers = new TasMovieMarkerList(this);
Markers.CollectionChanged += Markers_CollectionChanged;
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
BindMarkersToInput = true;
CurrentBranch = -1;
}
public TasMovie(bool startsFromSavestate = false, BackgroundWorker progressReportWorker = null)
@ -68,12 +70,14 @@ namespace BizHawk.Client.Common
ChangeLog = new TasMovieChangeLog(this);
StateManager = new TasStateManager(this);
Session = new TasSession(this);
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0 Tasproj v1.0";
Markers = new TasMovieMarkerList(this);
Markers.CollectionChanged += Markers_CollectionChanged;
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
BindMarkersToInput = true;
CurrentBranch = -1;
}
public TasLagLog TasLagLog { get { return LagLog; } }
@ -81,6 +85,7 @@ namespace BizHawk.Client.Common
public TasMovieMarkerList Markers { get; set; }
public bool BindMarkersToInput { get; set; }
public bool UseInputCache { get; set; }
public int CurrentBranch { get; set; }
public int BranchCount { get { return Branches.Count; } }
public TasBranch GetBranch(int index)
{
@ -497,12 +502,14 @@ namespace BizHawk.Client.Common
_log = branch.InputLog.ToList();
//_changes = true;
LagLog.FromLagLog(branch.LagLog);
// if there are branch states, they will be loaded anyway
// but if there's none, or only *after* divergent point, don't invalidate the entire movie anymore
if (divergentPoint.HasValue)
StateManager.Invalidate(divergentPoint.Value);
{
StateManager.Invalidate(divergentPoint.Value);
LagLog.FromLagLog(branch.LagLog); // don't truncate LagLog if the branch's one is shorter, but input is the same
}
else
StateManager.Invalidate(branch.InputLog.Count);

View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Client.Common
{
public class TasSession
{
private TasMovie _movie;
public int CurrentFrame { get; set; }
public int CurrentBranch { get; set; }
public TasSession(TasMovie movie)
{
_movie = movie;
CurrentFrame = 0;
CurrentBranch = -1;
}
public void UpdateValues()
{
CurrentFrame = Global.Emulator.Frame;
CurrentBranch = _movie.CurrentBranch;
}
public override string ToString()
{
StringBuilder sb = new StringBuilder();
UpdateValues();
sb.AppendLine(CurrentFrame.ToString());
sb.AppendLine(CurrentBranch.ToString());
return sb.ToString();
}
public void PopulateFromString(string session)
{
if (!string.IsNullOrWhiteSpace(session))
{
string[] lines = session.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
if (lines.Length > 0)
CurrentFrame = int.Parse(lines[0]);
else
CurrentFrame = 0;
if (lines.Length > 1)
CurrentBranch = int.Parse(lines[1]);
else
CurrentBranch = -1;
}
}
}
}

View File

@ -562,23 +562,6 @@ namespace BizHawk.Client.Common
bw.Write(kvp.Value.Length);
bw.Write(kvp.Value.State);
}
bw.Write(currentBranch);
if (Settings.BranchStatesInTasproj)
{
bw.Write(BranchStates.Count);
foreach (var s in BranchStates)
{
bw.Write(s.Key);
bw.Write(s.Value.Count);
foreach (var t in s.Value)
{
bw.Write(t.Key);
t.Value.Write(bw);
}
}
}
}
public void Load(BinaryReader br)
@ -599,34 +582,49 @@ namespace BizHawk.Client.Common
//Used += len;
}
//}
}
public void SaveBranchStates(BinaryWriter bw)
{
bw.Write(BranchStates.Count);
foreach (var s in BranchStates)
{
bw.Write(s.Key);
bw.Write(s.Value.Count);
foreach (var t in s.Value)
{
bw.Write(t.Key);
t.Value.Write(bw);
}
}
}
public void LoadBranchStates(BinaryReader br)
{
try
{
currentBranch = br.ReadInt32();
if (Settings.BranchStatesInTasproj)
int c = br.ReadInt32();
BranchStates = new SortedList<int, SortedList<int, StateManagerState>>(c);
while (c > 0)
{
int c = br.ReadInt32();
BranchStates = new SortedList<int, SortedList<int, StateManagerState>>(c);
while (c > 0)
int key = br.ReadInt32();
int c2 = br.ReadInt32();
var list = new SortedList<int, StateManagerState>(c2);
while (c2 > 0)
{
int key = br.ReadInt32();
int c2 = br.ReadInt32();
var list = new SortedList<int, StateManagerState>(c2);
while (c2 > 0)
{
int key2 = br.ReadInt32();
var state = StateManagerState.Read(br, this);
list.Add(key2, state);
c2--;
}
BranchStates.Add(key, list);
c--;
int key2 = br.ReadInt32();
var state = StateManagerState.Read(br, this);
list.Add(key2, state);
c2--;
}
BranchStates.Add(key, list);
c--;
}
}
catch (EndOfStreamException) { }
}
public KeyValuePair<int, byte[]> GetStateClosestToFrame(int frame)
{
var s = States.LastOrDefault(state => state.Key < frame);
@ -699,7 +697,6 @@ namespace BizHawk.Client.Common
#region "Branches"
private SortedList<int, SortedList<int, StateManagerState>> BranchStates = new SortedList<int, SortedList<int, StateManagerState>>();
private int currentBranch = -1;
/// <summary>
/// Checks if the state at frame in the given branch (-1 for current) has any duplicates.
@ -776,7 +773,6 @@ namespace BizHawk.Client.Common
stateList.Add(branchHash, kvp.Value);
Used += (ulong)stateList[branchHash].Length;
}
currentBranch = _movie.BranchCount;
}
public void RemoveBranch(int index)
@ -804,10 +800,6 @@ namespace BizHawk.Client.Common
if (stateList.Count == 0)
BranchStates.Remove(kvp.Key);
}
if (currentBranch > index)
currentBranch--;
else if (currentBranch == index)
currentBranch = -1;
}
public void UpdateBranch(int index)
@ -853,7 +845,6 @@ namespace BizHawk.Client.Common
stateList.Add(branchHash, kvp.Value);
Used += (ulong)stateList[branchHash].Length;
}
currentBranch = index;
}
public void LoadBranch(int index)
@ -870,8 +861,6 @@ namespace BizHawk.Client.Common
if (kvp.Value.ContainsKey(branchHash))
SetState(kvp.Key, kvp.Value[branchHash].State);
}
currentBranch = index;
}
#endregion

File diff suppressed because it is too large Load Diff

View File

@ -466,6 +466,12 @@
<Compile Include="CoreFeatureAnalysis.Designer.cs">
<DependentUpon>CoreFeatureAnalysis.cs</DependentUpon>
</Compile>
<Compile Include="CustomControls\ExceptionBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CustomControls\ExceptionBox.designer.cs">
<DependentUpon>ExceptionBox.cs</DependentUpon>
</Compile>
<Compile Include="CustomControls\FolderBrowserDialogEx.cs">
<SubType>Component</SubType>
</Compile>
@ -525,9 +531,7 @@
<Compile Include="CustomControls\ViewportPanel.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\VirtualListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\VirtualListView.cs" />
<Compile Include="CustomControls\Win32.cs" />
<Compile Include="DisplayManager\DisplayManager.cs" />
<Compile Include="DisplayManager\DisplaySurface.cs" />
@ -543,6 +547,7 @@
<Compile Include="Extensions\ControlExtensions.cs" />
<Compile Include="Extensions\CoreExtensions.cs" />
<Compile Include="Extensions\ToolExtensions.cs" />
<Compile Include="GLManager.cs" />
<Compile Include="GlobalWin.cs" />
<Compile Include="Input\GamePad.cs" Condition=" '$(OS)' == 'Windows_NT' " />
<Compile Include="Input\GamePad360.cs" />
@ -666,6 +671,12 @@
<DependentUpon>BatchRun.cs</DependentUpon>
</Compile>
<Compile Include="tools\BatchRunner.cs" />
<Compile Include="tools\CDL.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\CDL.designer.cs">
<DependentUpon>CDL.cs</DependentUpon>
</Compile>
<Compile Include="tools\Cheats\CheatEdit.cs">
<SubType>UserControl</SubType>
</Compile>
@ -911,12 +922,6 @@
<Compile Include="tools\PCE\PCEBGViewer.Designer.cs">
<DependentUpon>PCEBGViewer.cs</DependentUpon>
</Compile>
<Compile Include="tools\PCE\PCECDL.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\PCE\PCECDL.Designer.cs">
<DependentUpon>PCECDL.cs</DependentUpon>
</Compile>
<Compile Include="tools\PCE\PCESoundDebugger.cs">
<SubType>Form</SubType>
</Compile>
@ -1146,6 +1151,7 @@
<Compile Include="tools\Watch\WatchValueBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="UIHelper.cs" />
<Compile Include="UpdateChecker.cs">
<SubType>Code</SubType>
</Compile>
@ -1290,6 +1296,9 @@
<EmbeddedResource Include="CoreFeatureAnalysis.resx">
<DependentUpon>CoreFeatureAnalysis.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CustomControls\ExceptionBox.resx">
<DependentUpon>ExceptionBox.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CustomControls\InputConfigBase.resx">
<DependentUpon>InputConfigBase.cs</DependentUpon>
</EmbeddedResource>
@ -1339,6 +1348,9 @@
<EmbeddedResource Include="tools\BatchRun.resx">
<DependentUpon>BatchRun.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\CDL.resx">
<DependentUpon>CDL.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\Cheats\CheatEdit.resx">
<DependentUpon>CheatEdit.cs</DependentUpon>
</EmbeddedResource>
@ -1436,9 +1448,6 @@
<EmbeddedResource Include="tools\PCE\PCEBGViewer.resx">
<DependentUpon>PCEBGViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\PCE\PCECDL.resx">
<DependentUpon>PCECDL.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\PCE\PCESoundDebugger.resx">
<DependentUpon>PCESoundDebugger.cs</DependentUpon>
</EmbeddedResource>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,148 @@
namespace BizHawk.Client.EmuHawk
{
partial class ExceptionBox
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.btnOK = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.txtException = new System.Windows.Forms.TextBox();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.btnCopy = new System.Windows.Forms.Button();
this.lblDone = new ExceptionBox.MyLabel();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.tableLayoutPanel1.SuspendLayout();
this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
// btnOK
//
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnOK.Location = new System.Drawing.Point(625, 304);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 0;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.Controls.Add(this.btnOK, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.txtException, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(703, 330);
this.tableLayoutPanel1.TabIndex = 1;
//
// txtException
//
this.tableLayoutPanel1.SetColumnSpan(this.txtException, 2);
this.txtException.Dock = System.Windows.Forms.DockStyle.Fill;
this.txtException.Location = new System.Drawing.Point(3, 3);
this.txtException.Multiline = true;
this.txtException.Name = "txtException";
this.txtException.ReadOnly = true;
this.txtException.Size = new System.Drawing.Size(697, 295);
this.txtException.TabIndex = 1;
//
// flowLayoutPanel1
//
this.flowLayoutPanel1.AutoSize = true;
this.flowLayoutPanel1.Controls.Add(this.btnCopy);
this.flowLayoutPanel1.Controls.Add(this.lblDone);
this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 301);
this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0);
this.flowLayoutPanel1.Name = "flowLayoutPanel1";
this.flowLayoutPanel1.Size = new System.Drawing.Size(87, 29);
this.flowLayoutPanel1.TabIndex = 2;
//
// btnCopy
//
this.btnCopy.Location = new System.Drawing.Point(3, 3);
this.btnCopy.Name = "btnCopy";
this.btnCopy.Size = new System.Drawing.Size(75, 23);
this.btnCopy.TabIndex = 3;
this.btnCopy.Text = "Copy";
this.btnCopy.UseVisualStyleBackColor = true;
this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
//
// lblDone
//
this.lblDone.AutoSize = true;
this.lblDone.Location = new System.Drawing.Point(84, 10);
this.lblDone.Margin = new System.Windows.Forms.Padding(3, 10, 3, 0);
this.lblDone.Name = "lblDone";
this.lblDone.Size = new System.Drawing.Size(0, 13);
this.lblDone.TabIndex = 4;
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// ExceptionBox
//
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnOK;
this.ClientSize = new System.Drawing.Size(703, 330);
this.Controls.Add(this.tableLayoutPanel1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ExceptionBox";
this.Text = "Exception";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.flowLayoutPanel1.ResumeLayout(false);
this.flowLayoutPanel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.TextBox txtException;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Button btnCopy;
private ExceptionBox.MyLabel lblDone;
}
}

View File

@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace BizHawk.Client.EmuHawk
{
public partial class ExceptionBox : Form
{
public ExceptionBox(Exception ex)
{
InitializeComponent();
txtException.Text = ex.ToString();
timer1.Start();
}
private void btnCopy_Click(object sender, EventArgs e)
{
DoCopy();
}
void DoCopy()
{
string txt = txtException.Text;
Clipboard.SetText(txt);
try
{
if (Clipboard.GetText() == txt)
{
lblDone.Text = "Done!";
lblDone.ForeColor = SystemColors.ControlText;
return;
}
}
catch
{
}
lblDone.Text = "ERROR!";
lblDone.ForeColor = SystemColors.ControlText;
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.C | Keys.Control))
{
DoCopy();
return true;
}
return false;
}
private void btnOK_Click(object sender, EventArgs e)
{
Close();
}
private void timer1_Tick(object sender, EventArgs e)
{
int a = lblDone.ForeColor.A - 16;
if (a < 0) a = 0;
lblDone.ForeColor = Color.FromArgb(a, lblDone.ForeColor);
}
//http://stackoverflow.com/questions/2636065/alpha-in-forecolor
class MyLabel : Label
{
protected override void OnPaint(PaintEventArgs e)
{
Rectangle rc = this.ClientRectangle;
StringFormat fmt = new StringFormat(StringFormat.GenericTypographic);
using (var br = new SolidBrush(this.ForeColor))
{
e.Graphics.DrawString(this.Text, this.Font, br, rc, fmt);
}
}
}
}
}

View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -30,11 +30,27 @@ namespace BizHawk.Client.EmuHawk
public void SetHexProperties(long domainSize)
{
bool wasMaxSizeSet = _maxSize.HasValue;
int currMaxLength = MaxLength;
_maxSize = domainSize - 1;
MaxLength = _maxSize.Value.NumHexDigits();
_addressFormatStr = "{0:X" + MaxLength + "}";
ResetText();
//try to preserve the old value, as best we can
if(!wasMaxSizeSet)
ResetText();
else if(_nullable)
Text = "";
else if (MaxLength != currMaxLength)
{
long? value = ToLong();
if (value.HasValue)
value = value.Value & ((1L << (MaxLength * 4)) - 1);
else value = 0;
Text = string.Format(_addressFormatStr, value.Value);
}
}
public long GetMax()

View File

@ -743,7 +743,9 @@ namespace BizHawk.Client.EmuHawk
return (index >= FirstVisibleRow) && (index <= LastFullyVisibleRow);
}
public bool IsPartiallyVisible(int index)
{ return (index >= FirstVisibleRow) && (index <= LastVisibleRow); }
{
return (index >= FirstVisibleRow) && (index <= LastVisibleRow);
}
/// <summary>
/// Gets the number of rows currently visible including partially visible rows.

View File

@ -65,14 +65,14 @@ namespace BizHawk.Client.EmuHawk
if (GL is BizHawk.Bizware.BizwareGL.Drivers.OpenTK.IGL_TK || GL is BizHawk.Bizware.BizwareGL.Drivers.SlimDX.IGL_SlimDX9)
{
//var fiHq2x = new FileInfo(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk/hq2x.cgp"));
//if (fiHq2x.Exists)
// using (var stream = fiHq2x.OpenRead())
// ShaderChain_hq2x = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk"));
//var fiScanlines = new FileInfo(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk/BizScanlines.cgp"));
//if (fiScanlines.Exists)
// using (var stream = fiScanlines.OpenRead())
// ShaderChain_scanlines = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk"));
var fiHq2x = new FileInfo(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk/hq2x.cgp"));
if (fiHq2x.Exists)
using (var stream = fiHq2x.OpenRead())
ShaderChain_hq2x = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk"));
var fiScanlines = new FileInfo(Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk/BizScanlines.cgp"));
if (fiScanlines.Exists)
using (var stream = fiScanlines.OpenRead())
ShaderChain_scanlines = new Filters.RetroShaderChain(GL, new Filters.RetroShaderPreset(stream), Path.Combine(PathManager.GetExeDirectoryAbsolute(), "Shaders/BizHawk"));
string bicubic_path = "Shaders/BizHawk/bicubic-fast.cgp";
if(GL is BizHawk.Bizware.BizwareGL.Drivers.SlimDX.IGL_SlimDX9)
bicubic_path = "Shaders/BizHawk/bicubic-normal.cgp";
@ -128,6 +128,11 @@ namespace BizHawk.Client.EmuHawk
/// </summary>
public System.Windows.Forms.Padding GameExtraPadding;
/// <summary>
/// additional pixels added at the native level for the use of lua drawing. essentially just gets tacked onto the final calculated window sizes.
/// </summary>
public System.Windows.Forms.Padding ClientExtraPadding;
TextureFrugalizer VideoTextureFrugalizer;
Dictionary<string, TextureFrugalizer> LuaSurfaceFrugalizers = new Dictionary<string, TextureFrugalizer>();
RenderTargetFrugalizer[] ShaderChainFrugalizers;
@ -177,7 +182,6 @@ namespace BizHawk.Client.EmuHawk
selectedChain = ShaderChain_hq2x;
if (Global.Config.TargetDisplayFilter == 2 && ShaderChain_scanlines != null && ShaderChain_scanlines.Available)
{
//shader.Pipeline["uIntensity"].Set(1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f);
selectedChain = ShaderChain_scanlines;
selectedChainProperties["uIntensity"] = 1.0f - Global.Config.TargetScanlineFilterIntensity / 256.0f;
}
@ -375,6 +379,24 @@ namespace BizHawk.Client.EmuHawk
public int BackgroundColor { get; set; }
}
void FixRatio(float x, float y, int inw, int inh, out int outw, out int outh)
{
float ratio = x / y;
if (ratio <= 1)
{
//taller. weird. expand height.
outw = inw;
outh = (int)((float)inw / ratio);
}
else
{
//wider. normal. expand width.
outw = (int)((float)inh * ratio);
outh = inh;
}
}
/// <summary>
/// Attempts to calculate a good client size with the given zoom factor, considering the user's DisplayManager preferences
/// TODO - this needs to be redone with a concept different from zoom factor.
@ -385,7 +407,8 @@ namespace BizHawk.Client.EmuHawk
bool ar_active = Global.Config.DispFixAspectRatio;
bool ar_system = Global.Config.DispManagerAR == Config.EDispManagerAR.System;
bool ar_custom = Global.Config.DispManagerAR == Config.EDispManagerAR.Custom;
bool ar_correct = ar_system || ar_custom;
bool ar_customRatio = Global.Config.DispManagerAR == Config.EDispManagerAR.CustomRatio;
bool ar_correct = ar_system || ar_custom || ar_customRatio;
bool ar_unity = !ar_correct;
bool ar_integer = Global.Config.DispFixScaleInteger;
@ -399,6 +422,11 @@ namespace BizHawk.Client.EmuHawk
virtualWidth = Global.Config.DispCustomUserARWidth;
virtualHeight = Global.Config.DispCustomUserARHeight;
}
if (ar_customRatio)
{
FixRatio(Global.Config.DispCustomUserARX, Global.Config.DispCustomUserARY, videoProvider.BufferWidth, videoProvider.BufferHeight, out virtualWidth, out virtualHeight);
}
var padding = CalculateCompleteContentPadding(true, false);
virtualWidth += padding.Horizontal;
@ -498,6 +526,9 @@ namespace BizHawk.Client.EmuHawk
chain_outsize = new Size(bufferWidth * zoom, bufferHeight * zoom);
}
chain_outsize.Width += ClientExtraPadding.Horizontal;
chain_outsize.Height += ClientExtraPadding.Vertical;
var job = new JobInfo
{
videoProvider = fvp,
@ -550,6 +581,10 @@ namespace BizHawk.Client.EmuHawk
vw = Global.Config.DispCustomUserARWidth;
vh = Global.Config.DispCustomUserARHeight;
}
if (Global.Config.DispManagerAR == Config.EDispManagerAR.CustomRatio)
{
FixRatio(Global.Config.DispCustomUserARX, Global.Config.DispCustomUserARY, videoProvider.BufferWidth, videoProvider.BufferHeight, out vw, out vh);
}
}
var padding = CalculateCompleteContentPadding(true,false);
@ -609,6 +644,7 @@ namespace BizHawk.Client.EmuHawk
fPresent.GuiRenderer = Renderer;
fPresent.Config_FixAspectRatio = Global.Config.DispFixAspectRatio;
fPresent.Config_FixScaleInteger = Global.Config.DispFixScaleInteger;
fPresent.Padding = ClientExtraPadding;
fPresent.GL = GL;

View File

@ -133,8 +133,8 @@ namespace BizHawk.Client.EmuHawk.Filters
PS = trials[bestIndex];
}
vw = (int)(PS.X * textureWidth);
vh = (int)(PS.Y * textureHeight);
vw = (int)(PS.X * oldSourceWidth);
vh = (int)(PS.Y * oldSourceHeight);
widthScale = PS.X;
heightScale = PS.Y;
}
@ -222,7 +222,11 @@ namespace BizHawk.Client.EmuHawk.Filters
LL.vh = size.Height;
}
else
{
LL = new LetterboxingLogic(Config_FixAspectRatio, Config_FixScaleInteger, OutputSize.Width, OutputSize.Height, size.Width, size.Height, TextureSize, VirtualTextureSize);
LL.vx += Padding.Left;
LL.vy += Padding.Top;
}
return size;
}
@ -253,9 +257,19 @@ namespace BizHawk.Client.EmuHawk.Filters
LL.vy += Padding.Top;
LL.vw = InputSize.Width;
LL.vh = InputSize.Height;
LL.WidthScale = 1;
LL.HeightScale = 1;
}
else
{
int ow = OutputSize.Width;
int oh = OutputSize.Height;
ow -= Padding.Horizontal;
oh -= Padding.Vertical;
LL = new LetterboxingLogic(Config_FixAspectRatio, Config_FixScaleInteger, ow, oh, InputSize.Width, InputSize.Height, TextureSize, VirtualTextureSize);
LL.vx += Padding.Left;
LL.vy += Padding.Top;
}
else
LL = new LetterboxingLogic(Config_FixAspectRatio, Config_FixScaleInteger, OutputSize.Width, OutputSize.Height, InputSize.Width, InputSize.Height, TextureSize, VirtualTextureSize);
ContentSize = new Size(LL.vw,LL.vh);
}

View File

@ -7,6 +7,7 @@ using System.Linq;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Drawing;
using BizHawk.Common;
@ -24,6 +25,21 @@ namespace BizHawk.Client.EmuHawk.Filters
{
public class RetroShaderChain : IDisposable
{
static System.Text.RegularExpressions.Regex rxInclude = new Regex(@"^(\s)?\#include(\s)+(""|<)(.*)?(""|>)", RegexOptions.Multiline | RegexOptions.IgnoreCase);
static string ResolveIncludes(string content, string baseDirectory)
{
for (; ; )
{
var match = rxInclude.Match(content);
if(match.Value == "") break;
string fname = match.Groups[4].Value;
fname = Path.Combine(baseDirectory,fname);
string includedContent = ResolveIncludes(File.ReadAllText(fname),Path.GetDirectoryName(fname));
content = content.Substring(0, match.Index) + includedContent + content.Substring(match.Index + match.Length);
}
return content;
}
public RetroShaderChain(IGL owner, RetroShaderPreset preset, string baseDirectory, bool debug = false)
{
Owner = owner;
@ -45,12 +61,15 @@ namespace BizHawk.Client.EmuHawk.Filters
ok = false;
break;
}
string content = File.ReadAllText(path);
string content = ResolveIncludes(File.ReadAllText(path), Path.GetDirectoryName(path));
var shader = new RetroShader(Owner, content, debug);
Shaders[i] = shader;
if (!shader.Pipeline.Available)
ok = false;
if (!shader.Available)
ok = false;
}
Available = ok;
@ -140,6 +159,20 @@ namespace BizHawk.Client.EmuHawk.Filters
public List<ShaderPass> Passes = new List<ShaderPass>();
/// <summary>
/// Indicates whether any of the passes contain GLSL filenames (these are invalid now)
/// </summary>
public bool ContainsGLSL
{
get
{
foreach (var pass in Passes)
if (Path.GetExtension(pass.ShaderPath).ToLowerInvariant() == ".glsl")
return true;
return false;
}
}
public enum ScaleType
{
NotSet, Source, Viewport, Absolute

View File

@ -1,100 +1,104 @@
using System;
using BizHawk.Bizware.BizwareGL;
namespace BizHawk.Client.Common
{
/// <summary>
/// This singleton class manages OpenGL contexts, in an effort to minimize context changes.
/// </summary>
public class GLManager
{
private GLManager()
{
}
public static GLManager Instance { get; private set; }
public static void CreateInstance()
{
if (Instance != null) throw new InvalidOperationException("Attempt to create more than one GLManager");
Instance = new GLManager();
}
public ContextRef CreateGLContext()
{
var ret = new ContextRef
{
gl = new Bizware.BizwareGL.Drivers.OpenTK.IGL_TK()
};
return ret;
}
public ContextRef GetContextForGraphicsControl(GraphicsControl gc)
{
return new ContextRef
{
gc = gc,
gl = gc.IGL
};
}
/// <summary>
/// This might not be a GL implementation. If it isnt GL, then setting it as active context is just NOP
/// </summary>
public ContextRef GetContextForIGL(IGL gl)
{
return new ContextRef
{
gl = gl
};
}
ContextRef ActiveContext;
public void Invalidate()
{
ActiveContext = null;
}
public void Activate(ContextRef cr)
{
bool begun = false;
//this needs a begin signal to set the swap chain to the next backbuffer
if (cr.gl is BizHawk.Bizware.BizwareGL.Drivers.SlimDX.IGL_SlimDX9)
{
cr.gc.Begin();
begun = true;
}
if (cr == ActiveContext)
return;
ActiveContext = cr;
if (cr.gc != null)
{
//TODO - this is checking the current context inside to avoid an extra NOP context change. make this optional or remove it, since we're tracking it here
if(!begun)
cr.gc.Begin();
}
if (cr.gl != null)
{
if(cr.gl is BizHawk.Bizware.BizwareGL.Drivers.OpenTK.IGL_TK)
((BizHawk.Bizware.BizwareGL.Drivers.OpenTK.IGL_TK)cr.gl).MakeDefaultCurrent();
}
}
public void Deactivate()
{
//this is here for future use and tracking purposes.. however.. instead of relying on this, we should just make sure we always activate what we need before we use it
}
public class ContextRef
{
public IGL gl;
public GraphicsControl gc;
}
}
using System;
using BizHawk.Bizware.BizwareGL;
namespace BizHawk.Client.EmuHawk
{
/// <summary>
/// This singleton class manages OpenGL contexts, in an effort to minimize context changes.
/// </summary>
public class GLManager : IDisposable
{
private GLManager()
{
}
public void Dispose()
{
}
public static GLManager Instance { get; private set; }
public static void CreateInstance()
{
if (Instance != null) throw new InvalidOperationException("Attempt to create more than one GLManager");
Instance = new GLManager();
}
public ContextRef CreateGLContext()
{
var ret = new ContextRef
{
gl = new Bizware.BizwareGL.Drivers.OpenTK.IGL_TK()
};
return ret;
}
public ContextRef GetContextForGraphicsControl(GraphicsControl gc)
{
return new ContextRef
{
gc = gc,
gl = gc.IGL
};
}
/// <summary>
/// This might not be a GL implementation. If it isnt GL, then setting it as active context is just NOP
/// </summary>
public ContextRef GetContextForIGL(IGL gl)
{
return new ContextRef
{
gl = gl
};
}
ContextRef ActiveContext;
public void Invalidate()
{
ActiveContext = null;
}
public void Activate(ContextRef cr)
{
bool begun = false;
//this needs a begin signal to set the swap chain to the next backbuffer
if (cr.gl is BizHawk.Bizware.BizwareGL.Drivers.SlimDX.IGL_SlimDX9)
{
cr.gc.Begin();
begun = true;
}
if (cr == ActiveContext)
return;
ActiveContext = cr;
if (cr.gc != null)
{
//TODO - this is checking the current context inside to avoid an extra NOP context change. make this optional or remove it, since we're tracking it here
if(!begun)
cr.gc.Begin();
}
if (cr.gl != null)
{
if(cr.gl is BizHawk.Bizware.BizwareGL.Drivers.OpenTK.IGL_TK)
((BizHawk.Bizware.BizwareGL.Drivers.OpenTK.IGL_TK)cr.gl).MakeDefaultCurrent();
}
}
public void Deactivate()
{
//this is here for future use and tracking purposes.. however.. instead of relying on this, we should just make sure we always activate what we need before we use it
}
public class ContextRef
{
public IGL gl;
public GraphicsControl gc;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -455,7 +455,7 @@ namespace BizHawk.Client.EmuHawk
InitialDirectory = PathManager.GetRomsPath(Global.Emulator.SystemId),
Multiselect = true,
Filter = FormatFilter(
"Movie Files", "*.fm2;*.mc2;*.mcm;*.mmv;*.gmv;*.vbm;*.lsmv;*.fcm;*.fmv;*.vmv;*.nmv;*.smv;*.ymv;*.zmv;*.bkm",
"Movie Files", "*.fm2;*.mc2;*.mcm;*.mmv;*.gmv;*.vbm;*.lsmv;*.fcm;*.fmv;*.vmv;*.nmv;*.smv;*.ymv;*.zmv;*.bkm;*.pjm;*.pxm",
"FCEUX", "*.fm2",
"PCEjin/Mednafen", "*.mc2;*.mcm",
"Dega", "*.mmv",
@ -469,6 +469,8 @@ namespace BizHawk.Client.EmuHawk
"Snes9x", "*.smv",
"Yabause", "*.ymv",
"ZSNES", "*.zmv",
"PSXjin", "*.pjm",
"PCSX", "*.pxm",
"BizHawk Bkm", "*.bkm",
"All Files", "*.*"),
RestoreDirectory = false
@ -1144,6 +1146,7 @@ namespace BizHawk.Client.EmuHawk
VirtualPadMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Virtual Pad"].Bindings;
TraceLoggerMenuItem.ShortcutKeyDisplayString = Global.Config.HotkeyBindings["Trace Logger"].Bindings;
TraceLoggerMenuItem.Enabled = GlobalWin.Tools.IsAvailable<TraceLogger>();
CodeDataLoggerMenuItem.Enabled = GlobalWin.Tools.IsAvailable<CDL>();
TAStudioMenuItem.Enabled = GlobalWin.Tools.IsAvailable<TAStudio>();
@ -1393,7 +1396,7 @@ namespace BizHawk.Client.EmuHawk
private void CodeDataLoggerMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.Tools.Load<PCECDL>();
GlobalWin.Tools.Load<CDL>();
}
private void PCEAlwaysPerformSpriteLimitMenuItem_Click(object sender, EventArgs e)
@ -2616,8 +2619,8 @@ namespace BizHawk.Client.EmuHawk
else if (ext.ToUpper() == ".CDL" && Global.Emulator is PCEngine)
{
GlobalWin.Tools.Load<PCECDL>();
(GlobalWin.Tools.Get<PCECDL>() as PCECDL).LoadFile(filePaths[0]);
GlobalWin.Tools.Load<CDL>();
(GlobalWin.Tools.Get<CDL>() as CDL).LoadFile(filePaths[0]);
}
else if (MovieImport.IsValidMovieExtension(Path.GetExtension(filePaths[0])))

View File

@ -144,6 +144,7 @@ namespace BizHawk.Client.EmuHawk
// TODO - replace this with some kind of standard dictionary-yielding parser in a separate component
string cmdRom = null;
string cmdLoadState = null;
string cmdLoadSlot = null;
string cmdMovie = null;
string cmdDumpType = null;
string cmdDumpName = null;
@ -161,6 +162,10 @@ namespace BizHawk.Client.EmuHawk
var arg = args[i].ToLower();
if (arg.StartsWith("--load-slot="))
{
cmdLoadSlot = arg.Substring(arg.IndexOf('=') + 1);
}
if (arg.StartsWith("--load-state="))
{
cmdLoadState = arg.Substring(arg.IndexOf('=') + 1);
}
@ -401,13 +406,20 @@ namespace BizHawk.Client.EmuHawk
ToggleFullscreen();
}
if (cmdLoadState != null && !Global.Game.IsNullInstance)
if(!Global.Game.IsNullInstance)
{
LoadQuickSave("QuickSave" + cmdLoadState);
}
else if (Global.Config.AutoLoadLastSaveSlot && !Global.Game.IsNullInstance)
{
LoadQuickSave("QuickSave" + Global.Config.SaveSlot);
if(cmdLoadState != null)
{
LoadState(cmdLoadState,Path.GetFileName(cmdLoadState));
}
else if (cmdLoadSlot != null)
{
LoadQuickSave("QuickSave" + cmdLoadSlot);
}
else if (Global.Config.AutoLoadLastSaveSlot)
{
LoadQuickSave("QuickSave" + Global.Config.SaveSlot);
}
}
GlobalWin.Tools.AutoLoad();
@ -600,8 +612,9 @@ namespace BizHawk.Client.EmuHawk
if (value == null) // TODO: make an Event handler instead, but the logic here is that after turbo seeking, tools will want to do a real update when the emulator finally pauses
{
GlobalWin.Tools.UpdateToolsBefore();
GlobalWin.Tools.UpdateToolsAfter();
bool skipScripts = !(Global.Config.TurboSeek && !Global.Config.RunLuaDuringTurbo);
GlobalWin.Tools.UpdateToolsBefore(skipScripts);
GlobalWin.Tools.UpdateToolsAfter(skipScripts);
}
}
}
@ -878,12 +891,13 @@ namespace BizHawk.Client.EmuHawk
string fname_bare = string.Format(fmt, prefix, ts, "");
string fname = string.Format(fmt, prefix, ts, " (0)");
//if this file already exists,
//1. move the original file to a numbered one (to keep a good filesystem sort ordering)
if (File.Exists(fname_bare))
//if the (0) filename exists, do nothing. we'll bump up the number later
//if the bare filename exists, move it to (0)
//otherwise, no related filename exists, and we can proceed with the bare filename
if (File.Exists(fname)) { }
else if (File.Exists(fname_bare))
File.Move(fname_bare, fname);
else fname = fname_bare;
//2. create next one sequentially named
int seq = 0;
while (File.Exists(fname))
{
@ -1344,7 +1358,8 @@ namespace BizHawk.Client.EmuHawk
if (_inResizeLoop)
{
var size = PresentationPanel.NativeSize;
str = str + string.Format("({0}x{1}) - ", size.Width, size.Height);
float AR = (float)size.Width / size.Height;
str = str + string.Format("({0}x{1})={2} - ", size.Width, size.Height, AR);
}
//we need to display FPS somewhere, in this case
@ -3248,6 +3263,7 @@ namespace BizHawk.Client.EmuHawk
bbin = new BitmapBuffer(Global.Emulator.VideoProvider().BufferWidth, Global.Emulator.VideoProvider().BufferHeight, Global.Emulator.VideoProvider().GetVideoBuffer());
}
bbin.DiscardAlpha();
bmpout = new Bitmap(_avwriterResizew, _avwriterResizeh, PixelFormat.Format32bppArgb);
bmpin = bbin.ToSysdrawingBitmap();
@ -3894,6 +3910,5 @@ namespace BizHawk.Client.EmuHawk
}
}
}

View File

@ -59,6 +59,7 @@ namespace BizHawk.Client.EmuHawk
}
}
BizHawk.Client.Common.TempFileCleaner.Start();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
string iniPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.ini");
@ -198,14 +199,7 @@ namespace BizHawk.Client.EmuHawk
}
catch (Exception e)
{
string message = e.ToString();
if (e.InnerException != null)
{
message += "\n\nInner Exception:\n\n" + e.InnerException;
}
message += "\n\nStackTrace:\n" + e.StackTrace;
MessageBox.Show(message);
new ExceptionBox(e).ShowDialog();
}
#if WINDOWS
finally
@ -220,7 +214,17 @@ namespace BizHawk.Client.EmuHawk
}
#endif
}
}
//cleanup:
//cleanup IGL stuff so we can get better refcounts when exiting process, for debugging
//DOESNT WORK FOR SOME REASON
//GlobalWin.IGL_GL = new Bizware.BizwareGL.Drivers.OpenTK.IGL_TK();
//GLManager.Instance.Dispose();
//if (GlobalWin.IGL_GL != GlobalWin.GL)
// GlobalWin.GL.Dispose();
//((IDisposable)GlobalWin.IGL_GL).Dispose();
} //SubMain
//declared here instead of a more usual place to avoid dependencies on the more usual place
#if WINDOWS

View File

@ -1,62 +1,62 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.Client.Common
{
public static class UIHelper
{
private static readonly AutoScaleMode _autoScaleMode = AutoScaleMode.Font;
private static readonly SizeF _autoScaleBaseSize = new SizeF(6F, 13F);
private static readonly SizeF _autoScaleCurrentSize = GetCurrentAutoScaleSize(_autoScaleMode);
private static SizeF GetCurrentAutoScaleSize(AutoScaleMode autoScaleMode)
{
using (Form form = new Form())
{
form.AutoScaleMode = autoScaleMode;
return form.CurrentAutoScaleDimensions;
}
}
public static AutoScaleMode AutoScaleMode
{
get { return _autoScaleMode; }
}
public static SizeF AutoScaleBaseSize
{
get { return _autoScaleBaseSize; }
}
public static float AutoScaleFactorX
{
get { return _autoScaleCurrentSize.Width / _autoScaleBaseSize.Width; }
}
public static float AutoScaleFactorY
{
get { return _autoScaleCurrentSize.Height / _autoScaleBaseSize.Height; }
}
public static int ScaleX(int size)
{
return (int)Math.Round(size * AutoScaleFactorX);
}
public static int ScaleY(int size)
{
return (int)Math.Round(size * AutoScaleFactorY);
}
public static Point Scale(Point p)
{
return new Point(ScaleX(p.X), ScaleY(p.Y));
}
public static Size Scale(Size s)
{
return new Size(ScaleX(s.Width), ScaleY(s.Height));
}
}
}
using System;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.Client.Common
{
public static class UIHelper
{
private static readonly AutoScaleMode _autoScaleMode = AutoScaleMode.Font;
private static readonly SizeF _autoScaleBaseSize = new SizeF(6F, 13F);
private static readonly SizeF _autoScaleCurrentSize = GetCurrentAutoScaleSize(_autoScaleMode);
private static SizeF GetCurrentAutoScaleSize(AutoScaleMode autoScaleMode)
{
using (Form form = new Form())
{
form.AutoScaleMode = autoScaleMode;
return form.CurrentAutoScaleDimensions;
}
}
public static AutoScaleMode AutoScaleMode
{
get { return _autoScaleMode; }
}
public static SizeF AutoScaleBaseSize
{
get { return _autoScaleBaseSize; }
}
public static float AutoScaleFactorX
{
get { return _autoScaleCurrentSize.Width / _autoScaleBaseSize.Width; }
}
public static float AutoScaleFactorY
{
get { return _autoScaleCurrentSize.Height / _autoScaleBaseSize.Height; }
}
public static int ScaleX(int size)
{
return (int)Math.Round(size * AutoScaleFactorX);
}
public static int ScaleY(int size)
{
return (int)Math.Round(size * AutoScaleFactorY);
}
public static Point Scale(Point p)
{
return new Point(ScaleX(p.X), ScaleY(p.Y));
}
public static Size Scale(Size s)
{
return new Size(ScaleX(s.Width), ScaleY(s.Height));
}
}
}

View File

@ -28,153 +28,153 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AutofireConfig));
this.Ok = new System.Windows.Forms.Button();
this.Cancel = new System.Windows.Forms.Button();
this.OnNumeric = new System.Windows.Forms.NumericUpDown();
this.OffNumeric = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.LagFrameCheck = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.OnNumeric)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.OffNumeric)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// Ok
//
this.Ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Ok.Location = new System.Drawing.Point(108, 140);
this.Ok.Name = "Ok";
this.Ok.Size = new System.Drawing.Size(75, 23);
this.Ok.TabIndex = 5;
this.Ok.Text = "&Ok";
this.Ok.UseVisualStyleBackColor = true;
this.Ok.Click += new System.EventHandler(this.Ok_Click);
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(189, 140);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.TabIndex = 7;
this.Cancel.Text = "&Cancel";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// OnNumeric
//
this.OnNumeric.Location = new System.Drawing.Point(10, 32);
this.OnNumeric.Maximum = new decimal(new int[] {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AutofireConfig));
this.Ok = new System.Windows.Forms.Button();
this.Cancel = new System.Windows.Forms.Button();
this.OnNumeric = new System.Windows.Forms.NumericUpDown();
this.OffNumeric = new System.Windows.Forms.NumericUpDown();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.LagFrameCheck = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.OnNumeric)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.OffNumeric)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// Ok
//
this.Ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Ok.Location = new System.Drawing.Point(108, 140);
this.Ok.Name = "Ok";
this.Ok.Size = new System.Drawing.Size(75, 23);
this.Ok.TabIndex = 5;
this.Ok.Text = "&Ok";
this.Ok.UseVisualStyleBackColor = true;
this.Ok.Click += new System.EventHandler(this.Ok_Click);
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(189, 140);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.TabIndex = 7;
this.Cancel.Text = "&Cancel";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// OnNumeric
//
this.OnNumeric.Location = new System.Drawing.Point(10, 32);
this.OnNumeric.Maximum = new decimal(new int[] {
512,
0,
0,
0});
this.OnNumeric.Minimum = new decimal(new int[] {
this.OnNumeric.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.OnNumeric.Name = "OnNumeric";
this.OnNumeric.Size = new System.Drawing.Size(74, 20);
this.OnNumeric.TabIndex = 2;
this.OnNumeric.Value = new decimal(new int[] {
this.OnNumeric.Name = "OnNumeric";
this.OnNumeric.Size = new System.Drawing.Size(74, 20);
this.OnNumeric.TabIndex = 2;
this.OnNumeric.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// OffNumeric
//
this.OffNumeric.Location = new System.Drawing.Point(101, 32);
this.OffNumeric.Maximum = new decimal(new int[] {
//
// OffNumeric
//
this.OffNumeric.Location = new System.Drawing.Point(101, 32);
this.OffNumeric.Maximum = new decimal(new int[] {
512,
0,
0,
0});
this.OffNumeric.Minimum = new decimal(new int[] {
this.OffNumeric.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.OffNumeric.Name = "OffNumeric";
this.OffNumeric.Size = new System.Drawing.Size(74, 20);
this.OffNumeric.TabIndex = 3;
this.OffNumeric.Value = new decimal(new int[] {
this.OffNumeric.Name = "OffNumeric";
this.OffNumeric.Size = new System.Drawing.Size(74, 20);
this.OffNumeric.TabIndex = 3;
this.OffNumeric.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(21, 13);
this.label1.TabIndex = 4;
this.label1.Text = "On";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(101, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(21, 13);
this.label2.TabIndex = 5;
this.label2.Text = "Off";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.OnNumeric);
this.groupBox1.Controls.Add(this.OffNumeric);
this.groupBox1.Location = new System.Drawing.Point(13, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(184, 70);
this.groupBox1.TabIndex = 6;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Autofire Pattern";
//
// LagFrameCheck
//
this.LagFrameCheck.AutoSize = true;
this.LagFrameCheck.Location = new System.Drawing.Point(13, 100);
this.LagFrameCheck.Name = "LagFrameCheck";
this.LagFrameCheck.Size = new System.Drawing.Size(164, 17);
this.LagFrameCheck.TabIndex = 8;
this.LagFrameCheck.Text = "Take lag frames into account";
this.LagFrameCheck.UseVisualStyleBackColor = true;
//
// AutofireConfig
//
this.AcceptButton = this.Ok;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(276, 175);
this.Controls.Add(this.LagFrameCheck);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.Ok);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(512, 512);
this.MinimumSize = new System.Drawing.Size(218, 179);
this.Name = "AutofireConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Autofire Configuration";
this.Load += new System.EventHandler(this.AutofireConfig_Load);
((System.ComponentModel.ISupportInitialize)(this.OnNumeric)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.OffNumeric)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(10, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(21, 13);
this.label1.TabIndex = 4;
this.label1.Text = "On";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(101, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(21, 13);
this.label2.TabIndex = 5;
this.label2.Text = "Off";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.OnNumeric);
this.groupBox1.Controls.Add(this.OffNumeric);
this.groupBox1.Location = new System.Drawing.Point(13, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(184, 70);
this.groupBox1.TabIndex = 6;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Autofire Pattern";
//
// LagFrameCheck
//
this.LagFrameCheck.AutoSize = true;
this.LagFrameCheck.Location = new System.Drawing.Point(13, 100);
this.LagFrameCheck.Name = "LagFrameCheck";
this.LagFrameCheck.Size = new System.Drawing.Size(164, 17);
this.LagFrameCheck.TabIndex = 8;
this.LagFrameCheck.Text = "Take lag frames into account";
this.LagFrameCheck.UseVisualStyleBackColor = true;
//
// AutofireConfig
//
this.AcceptButton = this.Ok;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(276, 175);
this.Controls.Add(this.LagFrameCheck);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.Ok);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(512, 512);
this.MinimumSize = new System.Drawing.Size(218, 179);
this.Name = "AutofireConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Autofire Configuration";
this.Load += new System.EventHandler(this.AutofireConfig_Load);
((System.ComponentModel.ISupportInitialize)(this.OnNumeric)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.OffNumeric)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}

File diff suppressed because it is too large Load Diff

View File

@ -91,6 +91,10 @@
this.trackbarFrameSizeWindowed = new BizHawk.Client.EmuHawk.TransparentTrackBar();
this.cbCaptionWindowed = new System.Windows.Forms.CheckBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.rbUseCustomRatio = new System.Windows.Forms.RadioButton();
this.txtCustomARY = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.txtCustomARX = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.tbScanlineIntensity)).BeginInit();
this.grpFinalFilter.SuspendLayout();
@ -246,7 +250,7 @@
// checkPadInteger
//
this.checkPadInteger.AutoSize = true;
this.checkPadInteger.Location = new System.Drawing.Point(15, 284);
this.checkPadInteger.Location = new System.Drawing.Point(15, 307);
this.checkPadInteger.Name = "checkPadInteger";
this.checkPadInteger.Size = new System.Drawing.Size(248, 17);
this.checkPadInteger.TabIndex = 9;
@ -325,6 +329,10 @@
//
// grpARSelection
//
this.grpARSelection.Controls.Add(this.txtCustomARY);
this.grpARSelection.Controls.Add(this.label12);
this.grpARSelection.Controls.Add(this.txtCustomARX);
this.grpARSelection.Controls.Add(this.rbUseCustomRatio);
this.grpARSelection.Controls.Add(this.label4);
this.grpARSelection.Controls.Add(this.txtCustomARHeight);
this.grpARSelection.Controls.Add(this.label3);
@ -334,7 +342,7 @@
this.grpARSelection.Controls.Add(this.rbUseSystem);
this.grpARSelection.Location = new System.Drawing.Point(15, 171);
this.grpARSelection.Name = "grpARSelection";
this.grpARSelection.Size = new System.Drawing.Size(377, 107);
this.grpARSelection.Size = new System.Drawing.Size(377, 130);
this.grpARSelection.TabIndex = 13;
this.grpARSelection.TabStop = false;
this.grpARSelection.Text = "Aspect Ratio Selection";
@ -376,10 +384,10 @@
this.rbUseCustom.AutoSize = true;
this.rbUseCustom.Location = new System.Drawing.Point(26, 80);
this.rbUseCustom.Name = "rbUseCustom";
this.rbUseCustom.Size = new System.Drawing.Size(107, 17);
this.rbUseCustom.Size = new System.Drawing.Size(105, 17);
this.rbUseCustom.TabIndex = 13;
this.rbUseCustom.TabStop = true;
this.rbUseCustom.Text = "Use custom Size:";
this.rbUseCustom.Text = "Use custom size:";
this.rbUseCustom.UseVisualStyleBackColor = true;
//
// label2
@ -798,6 +806,40 @@
this.linkLabel1.Text = "Documentation";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// rbUseCustomRatio
//
this.rbUseCustomRatio.AutoSize = true;
this.rbUseCustomRatio.Location = new System.Drawing.Point(26, 103);
this.rbUseCustomRatio.Name = "rbUseCustomRatio";
this.rbUseCustomRatio.Size = new System.Drawing.Size(102, 17);
this.rbUseCustomRatio.TabIndex = 16;
this.rbUseCustomRatio.TabStop = true;
this.rbUseCustomRatio.Text = "Use custom AR:";
this.rbUseCustomRatio.UseVisualStyleBackColor = true;
//
// txtCustomARY
//
this.txtCustomARY.Location = new System.Drawing.Point(230, 102);
this.txtCustomARY.Name = "txtCustomARY";
this.txtCustomARY.Size = new System.Drawing.Size(72, 20);
this.txtCustomARY.TabIndex = 19;
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(212, 107);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(10, 13);
this.label12.TabIndex = 17;
this.label12.Text = ":";
//
// txtCustomARX
//
this.txtCustomARX.Location = new System.Drawing.Point(134, 102);
this.txtCustomARX.Name = "txtCustomARX";
this.txtCustomARX.Size = new System.Drawing.Size(72, 20);
this.txtCustomARX.TabIndex = 18;
//
// DisplayConfigLite
//
this.AcceptButton = this.btnOk;
@ -907,5 +949,9 @@
private System.Windows.Forms.RadioButton rbDisplayFull;
private System.Windows.Forms.CheckBox cbAllowDoubleclickFullscreen;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.RadioButton rbUseCustomRatio;
private System.Windows.Forms.TextBox txtCustomARY;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox txtCustomARX;
}
}

View File

@ -76,9 +76,17 @@ namespace BizHawk.Client.EmuHawk.config
rbUseSystem.Checked = true;
else if (Global.Config.DispManagerAR == Config.EDispManagerAR.Custom)
rbUseCustom.Checked = true;
else if (Global.Config.DispManagerAR == Config.EDispManagerAR.CustomRatio)
rbUseCustomRatio.Checked = true;
txtCustomARWidth.Text = Global.Config.DispCustomUserARWidth.ToString();
txtCustomARHeight.Text = Global.Config.DispCustomUserARHeight.ToString();
if(Global.Config.DispCustomUserARWidth != -1)
txtCustomARWidth.Text = Global.Config.DispCustomUserARWidth.ToString();
if (Global.Config.DispCustomUserARHeight != -1)
txtCustomARHeight.Text = Global.Config.DispCustomUserARHeight.ToString();
if (Global.Config.DispCustomUserARX != -1)
txtCustomARX.Text = Global.Config.DispCustomUserARX.ToString();
if (Global.Config.DispCustomUserARY != -1)
txtCustomARY.Text = Global.Config.DispCustomUserARY.ToString();
RefreshAspectRatioOptions();
}
@ -141,9 +149,21 @@ namespace BizHawk.Client.EmuHawk.config
Global.Config.DispManagerAR = Config.EDispManagerAR.System;
else if (rbUseCustom.Checked)
Global.Config.DispManagerAR = Config.EDispManagerAR.Custom;
else if (rbUseCustomRatio.Checked)
Global.Config.DispManagerAR = Config.EDispManagerAR.CustomRatio;
int.TryParse(txtCustomARWidth.Text, out Global.Config.DispCustomUserARWidth);
int.TryParse(txtCustomARHeight.Text, out Global.Config.DispCustomUserARHeight);
if (txtCustomARWidth.Text != "")
int.TryParse(txtCustomARWidth.Text, out Global.Config.DispCustomUserARWidth);
else Global.Config.DispCustomUserARWidth = -1;
if (txtCustomARHeight.Text != "")
int.TryParse(txtCustomARHeight.Text, out Global.Config.DispCustomUserARHeight);
else Global.Config.DispCustomUserARHeight = -1;
if (txtCustomARX.Text != "")
float.TryParse(txtCustomARX.Text, out Global.Config.DispCustomUserARX);
else Global.Config.DispCustomUserARX = -1;
if (txtCustomARY.Text != "")
float.TryParse(txtCustomARY.Text, out Global.Config.DispCustomUserARY);
else Global.Config.DispCustomUserARY = -1;
var oldDisplayMethod = Global.Config.DispMethod;
if(rbOpenGL.Checked)
@ -176,7 +196,34 @@ namespace BizHawk.Client.EmuHawk.config
if (ofd.ShowDialog() == DialogResult.OK)
{
rbUser.Checked = true;
PathSelection = Path.GetFullPath(ofd.FileName);
var choice = Path.GetFullPath(ofd.FileName);
//test the preset
using (var stream = File.OpenRead(choice))
{
var cgp = new BizHawk.Client.EmuHawk.Filters.RetroShaderPreset(stream);
if (cgp.ContainsGLSL)
{
MessageBox.Show("Specified CGP contains references to .glsl files. This is illegal. Use .cg");
return;
}
//try compiling it
bool ok = false;
try
{
var filter = new BizHawk.Client.EmuHawk.Filters.RetroShaderChain(GlobalWin.GL, cgp, Path.GetDirectoryName(choice));
ok = filter.Available;
}
catch {}
if (!ok)
{
MessageBox.Show("Selected filter could not be compiled.");
return;
}
}
PathSelection = choice;
RefreshState();
}
}
@ -210,8 +257,7 @@ namespace BizHawk.Client.EmuHawk.config
{
Global.Config.TargetScanlineFilterIntensity = tbScanlineIntensity.Value;
int scanlines = Global.Config.TargetScanlineFilterIntensity;
float percentage = (float) scanlines / 255 * 100;
if (percentage > 100) percentage = 100;
float percentage = (float) scanlines / 256 * 100;
lblScanlines.Text = String.Format("{0:F2}", percentage) + "%";
}

View File

@ -559,6 +559,16 @@ namespace BizHawk.Client.EmuHawk
if (didSomething) DoScan();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Escape)
{
this.Close();
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
private void lvFirmwares_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))

View File

@ -32,7 +32,9 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(N64VideoPluginconfig));
this.N64plugintabcontrol = new System.Windows.Forms.TabControl();
this.N64vpluginglobaltab = new System.Windows.Forms.TabPage();
this.VideoResolutionYTextBox = new System.Windows.Forms.TextBox();
this.LabelVideoResolutionY = new System.Windows.Forms.Label();
this.VideoResolutionXTextBox = new System.Windows.Forms.TextBox();
this.LabelVideoResolutionX = new System.Windows.Forms.Label();
this.label49 = new System.Windows.Forms.Label();
this.RspTypeDropdown = new System.Windows.Forms.ComboBox();
@ -275,6 +277,8 @@
this.Glide64mk2_UseDefaultHacks2 = new System.Windows.Forms.CheckBox();
this.JaboTab = new System.Windows.Forms.TabPage();
this.JaboPerGameHacksGroupBox = new System.Windows.Forms.GroupBox();
this.JaboResolutionHeightBox = new BizHawk.Client.EmuHawk.WatchValueBox();
this.JaboResolutionWidthBox = new BizHawk.Client.EmuHawk.WatchValueBox();
this.label71 = new System.Windows.Forms.Label();
this.label70 = new System.Windows.Forms.Label();
this.JaboClearModeDropDown = new System.Windows.Forms.ComboBox();
@ -306,10 +310,6 @@
this.SaveButton = new System.Windows.Forms.Button();
this.CancelBT = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.VideoResolutionYTextBox = new System.Windows.Forms.TextBox();
this.VideoResolutionXTextBox = new System.Windows.Forms.TextBox();
this.JaboResolutionHeightBox = new BizHawk.Client.EmuHawk.WatchValueBox();
this.JaboResolutionWidthBox = new BizHawk.Client.EmuHawk.WatchValueBox();
this.N64plugintabcontrol.SuspendLayout();
this.N64vpluginglobaltab.SuspendLayout();
this.RiceTabPage.SuspendLayout();
@ -374,6 +374,16 @@
this.N64vpluginglobaltab.Text = "Global";
this.N64vpluginglobaltab.UseVisualStyleBackColor = true;
//
// VideoResolutionYTextBox
//
this.VideoResolutionYTextBox.Location = new System.Drawing.Point(66, 270);
this.VideoResolutionYTextBox.MaxLength = 5;
this.VideoResolutionYTextBox.Name = "VideoResolutionYTextBox";
this.VideoResolutionYTextBox.Size = new System.Drawing.Size(35, 20);
this.VideoResolutionYTextBox.TabIndex = 22;
this.VideoResolutionYTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.VideoResolutionYTextBox.Visible = false;
//
// LabelVideoResolutionY
//
this.LabelVideoResolutionY.AutoSize = true;
@ -384,6 +394,16 @@
this.LabelVideoResolutionY.Text = "Height:";
this.LabelVideoResolutionY.Visible = false;
//
// VideoResolutionXTextBox
//
this.VideoResolutionXTextBox.Location = new System.Drawing.Point(66, 244);
this.VideoResolutionXTextBox.MaxLength = 5;
this.VideoResolutionXTextBox.Name = "VideoResolutionXTextBox";
this.VideoResolutionXTextBox.Size = new System.Drawing.Size(35, 20);
this.VideoResolutionXTextBox.TabIndex = 20;
this.VideoResolutionXTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.VideoResolutionXTextBox.Visible = false;
//
// LabelVideoResolutionX
//
this.LabelVideoResolutionX.AutoSize = true;
@ -3324,6 +3344,32 @@
this.JaboPerGameHacksGroupBox.TabStop = false;
this.JaboPerGameHacksGroupBox.Text = "Per game settings";
//
// JaboResolutionHeightBox
//
this.JaboResolutionHeightBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte;
this.JaboResolutionHeightBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.JaboResolutionHeightBox.Location = new System.Drawing.Point(127, 90);
this.JaboResolutionHeightBox.MaxLength = 4;
this.JaboResolutionHeightBox.Name = "JaboResolutionHeightBox";
this.JaboResolutionHeightBox.Nullable = false;
this.JaboResolutionHeightBox.Size = new System.Drawing.Size(52, 20);
this.JaboResolutionHeightBox.TabIndex = 34;
this.JaboResolutionHeightBox.Text = "0";
this.JaboResolutionHeightBox.Type = BizHawk.Client.Common.Watch.DisplayType.Signed;
//
// JaboResolutionWidthBox
//
this.JaboResolutionWidthBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte;
this.JaboResolutionWidthBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.JaboResolutionWidthBox.Location = new System.Drawing.Point(127, 60);
this.JaboResolutionWidthBox.MaxLength = 4;
this.JaboResolutionWidthBox.Name = "JaboResolutionWidthBox";
this.JaboResolutionWidthBox.Nullable = false;
this.JaboResolutionWidthBox.Size = new System.Drawing.Size(52, 20);
this.JaboResolutionWidthBox.TabIndex = 33;
this.JaboResolutionWidthBox.Text = "0";
this.JaboResolutionWidthBox.Type = BizHawk.Client.Common.Watch.DisplayType.Signed;
//
// label71
//
this.label71.AutoSize = true;
@ -3627,52 +3673,6 @@
this.toolTip1.ReshowDelay = 100;
this.toolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info;
//
// VideoResolutionYTextBox
//
this.VideoResolutionYTextBox.Location = new System.Drawing.Point(66, 270);
this.VideoResolutionYTextBox.MaxLength = 5;
this.VideoResolutionYTextBox.Name = "VideoResolutionYTextBox";
this.VideoResolutionYTextBox.Size = new System.Drawing.Size(35, 20);
this.VideoResolutionYTextBox.TabIndex = 22;
this.VideoResolutionYTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.VideoResolutionYTextBox.Visible = false;
//
// VideoResolutionXTextBox
//
this.VideoResolutionXTextBox.Location = new System.Drawing.Point(66, 244);
this.VideoResolutionXTextBox.MaxLength = 5;
this.VideoResolutionXTextBox.Name = "VideoResolutionXTextBox";
this.VideoResolutionXTextBox.Size = new System.Drawing.Size(35, 20);
this.VideoResolutionXTextBox.TabIndex = 20;
this.VideoResolutionXTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.VideoResolutionXTextBox.Visible = false;
//
// JaboResolutionHeightBox
//
this.JaboResolutionHeightBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte;
this.JaboResolutionHeightBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.JaboResolutionHeightBox.Location = new System.Drawing.Point(127, 90);
this.JaboResolutionHeightBox.MaxLength = 4;
this.JaboResolutionHeightBox.Name = "JaboResolutionHeightBox";
this.JaboResolutionHeightBox.Nullable = false;
this.JaboResolutionHeightBox.Size = new System.Drawing.Size(52, 20);
this.JaboResolutionHeightBox.TabIndex = 34;
this.JaboResolutionHeightBox.Text = "0";
this.JaboResolutionHeightBox.Type = BizHawk.Client.Common.Watch.DisplayType.Signed;
//
// JaboResolutionWidthBox
//
this.JaboResolutionWidthBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte;
this.JaboResolutionWidthBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.JaboResolutionWidthBox.Location = new System.Drawing.Point(127, 60);
this.JaboResolutionWidthBox.MaxLength = 4;
this.JaboResolutionWidthBox.Name = "JaboResolutionWidthBox";
this.JaboResolutionWidthBox.Nullable = false;
this.JaboResolutionWidthBox.Size = new System.Drawing.Size(52, 20);
this.JaboResolutionWidthBox.TabIndex = 33;
this.JaboResolutionWidthBox.Text = "0";
this.JaboResolutionWidthBox.Type = BizHawk.Client.Common.Watch.DisplayType.Signed;
//
// N64VideoPluginconfig
//
this.AcceptButton = this.SaveButton;

View File

@ -31,6 +31,8 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NewN64PluginSettings));
this.PluginTabs = new System.Windows.Forms.TabControl();
this.GlobalTab = new System.Windows.Forms.TabPage();
this.VideoResolutionYTextBox = new System.Windows.Forms.TextBox();
this.LabelVideoResolutionY = new System.Windows.Forms.Label();
this.VideoResolutionXTextBox = new System.Windows.Forms.TextBox();
this.LabelVideoResolutionX = new System.Windows.Forms.Label();
this.label49 = new System.Windows.Forms.Label();
@ -51,8 +53,6 @@
this.JaboPropertyGrid = new System.Windows.Forms.PropertyGrid();
this.SaveBtn = new System.Windows.Forms.Button();
this.CancelBtn = new System.Windows.Forms.Button();
this.LabelVideoResolutionY = new System.Windows.Forms.Label();
this.VideoResolutionYTextBox = new System.Windows.Forms.TextBox();
this.PluginTabs.SuspendLayout();
this.GlobalTab.SuspendLayout();
this.RiceTab.SuspendLayout();
@ -99,6 +99,26 @@
this.GlobalTab.Text = "Global";
this.GlobalTab.UseVisualStyleBackColor = true;
//
// VideoResolutionYTextBox
//
this.VideoResolutionYTextBox.Location = new System.Drawing.Point(494, 91);
this.VideoResolutionYTextBox.MaxLength = 5;
this.VideoResolutionYTextBox.Name = "VideoResolutionYTextBox";
this.VideoResolutionYTextBox.Size = new System.Drawing.Size(35, 20);
this.VideoResolutionYTextBox.TabIndex = 108;
this.VideoResolutionYTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.VideoResolutionYTextBox.Visible = false;
//
// LabelVideoResolutionY
//
this.LabelVideoResolutionY.AutoSize = true;
this.LabelVideoResolutionY.Location = new System.Drawing.Point(447, 94);
this.LabelVideoResolutionY.Name = "LabelVideoResolutionY";
this.LabelVideoResolutionY.Size = new System.Drawing.Size(41, 13);
this.LabelVideoResolutionY.TabIndex = 107;
this.LabelVideoResolutionY.Text = "Height:";
this.LabelVideoResolutionY.Visible = false;
//
// VideoResolutionXTextBox
//
this.VideoResolutionXTextBox.Location = new System.Drawing.Point(402, 91);
@ -233,6 +253,7 @@
//
// RicePropertyGrid
//
this.RicePropertyGrid.CategoryForeColor = System.Drawing.SystemColors.InactiveCaptionText;
this.RicePropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.RicePropertyGrid.Location = new System.Drawing.Point(3, 3);
this.RicePropertyGrid.Name = "RicePropertyGrid";
@ -253,6 +274,7 @@
//
// Glidemk2PropertyGrid
//
this.Glidemk2PropertyGrid.CategoryForeColor = System.Drawing.SystemColors.InactiveCaptionText;
this.Glidemk2PropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.Glidemk2PropertyGrid.Location = new System.Drawing.Point(0, 0);
this.Glidemk2PropertyGrid.Name = "Glidemk2PropertyGrid";
@ -273,6 +295,7 @@
//
// GlidePropertyGrid
//
this.GlidePropertyGrid.CategoryForeColor = System.Drawing.SystemColors.InactiveCaptionText;
this.GlidePropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.GlidePropertyGrid.Location = new System.Drawing.Point(0, 0);
this.GlidePropertyGrid.Name = "GlidePropertyGrid";
@ -293,6 +316,7 @@
//
// JaboPropertyGrid
//
this.JaboPropertyGrid.CategoryForeColor = System.Drawing.SystemColors.InactiveCaptionText;
this.JaboPropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
this.JaboPropertyGrid.Location = new System.Drawing.Point(0, 0);
this.JaboPropertyGrid.Name = "JaboPropertyGrid";
@ -324,26 +348,6 @@
this.CancelBtn.UseVisualStyleBackColor = true;
this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click);
//
// LabelVideoResolutionY
//
this.LabelVideoResolutionY.AutoSize = true;
this.LabelVideoResolutionY.Location = new System.Drawing.Point(447, 94);
this.LabelVideoResolutionY.Name = "LabelVideoResolutionY";
this.LabelVideoResolutionY.Size = new System.Drawing.Size(41, 13);
this.LabelVideoResolutionY.TabIndex = 107;
this.LabelVideoResolutionY.Text = "Height:";
this.LabelVideoResolutionY.Visible = false;
//
// VideoResolutionYTextBox
//
this.VideoResolutionYTextBox.Location = new System.Drawing.Point(494, 91);
this.VideoResolutionYTextBox.MaxLength = 5;
this.VideoResolutionYTextBox.Name = "VideoResolutionYTextBox";
this.VideoResolutionYTextBox.Size = new System.Drawing.Size(35, 20);
this.VideoResolutionYTextBox.TabIndex = 108;
this.VideoResolutionYTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.VideoResolutionYTextBox.Visible = false;
//
// NewN64PluginSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -52,8 +52,9 @@ namespace BizHawk.Client.EmuHawk
{
var combo = combos[i];
if (user.Devices8[i] == OctoshockDll.ePeripheralType.None) combo.SelectedIndex = 0;
if (user.Devices8[i] == OctoshockDll.ePeripheralType.DualAnalog) combo.SelectedIndex = 1;
if (user.Devices8[i] == OctoshockDll.ePeripheralType.Pad) combo.SelectedIndex = 1;
if (user.Devices8[i] == OctoshockDll.ePeripheralType.DualShock) combo.SelectedIndex = 2;
if (user.Devices8[i] == OctoshockDll.ePeripheralType.DualAnalog) combo.SelectedIndex = 3;
}
}
@ -72,8 +73,9 @@ namespace BizHawk.Client.EmuHawk
{
var combo = combos[i];
if (combo.SelectedIndex == 0) uc.Devices8[i] = OctoshockDll.ePeripheralType.None;
if (combo.SelectedIndex == 1) uc.Devices8[i] = OctoshockDll.ePeripheralType.DualAnalog;
if (combo.SelectedIndex == 1) uc.Devices8[i] = OctoshockDll.ePeripheralType.Pad;
if (combo.SelectedIndex == 2) uc.Devices8[i] = OctoshockDll.ePeripheralType.DualShock;
if (combo.SelectedIndex == 3) uc.Devices8[i] = OctoshockDll.ePeripheralType.DualAnalog;
}
return uc;

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

File diff suppressed because it is too large Load Diff

View File

@ -284,7 +284,59 @@ namespace BizHawk.Client.EmuHawk
}
}
public string FromSlot
public byte MainComparisonType
{
get
{
return (byte)mainOperator.SelectedIndex;
}
set
{
if (value < 5) mainOperator.SelectedIndex = value;
else mainOperator.SelectedIndex = 0;
}
}
public byte Tie1ComparisonType
{
get
{
return (byte)Tiebreak1Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak1Operator.SelectedIndex = value;
else Tiebreak1Operator.SelectedIndex = 0;
}
}
public byte Tie2ComparisonType
{
get
{
return (byte)Tiebreak2Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak2Operator.SelectedIndex = value;
else Tiebreak2Operator.SelectedIndex = 0;
}
}
public byte Tie3ComparisonType
{
get
{
return (byte)Tiebreak3Operator.SelectedIndex;
}
set
{
if (value < 5) Tiebreak3Operator.SelectedIndex = value;
else Tiebreak3Operator.SelectedIndex = 0;
}
}
public string FromSlot
{
get
{
@ -392,6 +444,10 @@ namespace BizHawk.Client.EmuHawk
TieBreaker2Address = 0;
TieBreaker3Address = 0;
StartFromSlotBox.SelectedIndex = 0;
mainOperator.SelectedIndex = 0;
Tiebreak1Operator.SelectedIndex = 0;
Tiebreak2Operator.SelectedIndex = 0;
Tiebreak3Operator.SelectedIndex = 0;
UpdateBestAttempt();
}
@ -549,6 +605,11 @@ namespace BizHawk.Client.EmuHawk
public int TieBreak1 { get; set; }
public int TieBreak2 { get; set; }
public int TieBreak3 { get; set; }
public byte ComparisonTypeMain { get; set; }
public byte ComparisonTypeTie1 { get; set; }
public byte ComparisonTypeTie2 { get; set; }
public byte ComparisonTypeTie3 { get; set; }
public List<string> Log { get; set; }
}
@ -560,7 +621,11 @@ namespace BizHawk.Client.EmuHawk
public int TieBreaker1 { get; set; }
public int TieBreaker2 { get; set; }
public int TieBreaker3 { get; set; }
public int FrameLength { get; set; }
public byte ComparisonTypeMain { get; set; }
public byte ComparisonTypeTie1 { get; set; }
public byte ComparisonTypeTie2 { get; set; }
public byte ComparisonTypeTie3 { get; set; }
public int FrameLength { get; set; }
public string FromSlot { get; set; }
public long Attempts { get; set; }
public long Frames { get; set; }
@ -611,6 +676,20 @@ namespace BizHawk.Client.EmuHawk
TieBreaker1Address = botData.TieBreaker1;
TieBreaker2Address = botData.TieBreaker2;
TieBreaker3Address = botData.TieBreaker3;
try
{
MainComparisonType = botData.ComparisonTypeMain;
Tie1ComparisonType = botData.ComparisonTypeTie1;
Tie2ComparisonType = botData.ComparisonTypeTie2;
Tie3ComparisonType = botData.ComparisonTypeTie3;
}
catch
{
MainComparisonType = 0;
Tie1ComparisonType = 0;
Tie2ComparisonType = 0;
Tie3ComparisonType = 0;
}
FrameLength = botData.FrameLength;
FromSlot = botData.FromSlot;
Attempts = botData.Attempts;
@ -639,14 +718,18 @@ namespace BizHawk.Client.EmuHawk
private void SaveBotFile(string path)
{
var data = new BotData
{
Best = _bestBotAttempt,
ControlProbabilities = ControlProbabilities,
Maximize = MaximizeAddress,
TieBreaker1 = TieBreaker1Address,
TieBreaker2 = TieBreaker2Address,
TieBreaker3 = TieBreaker3Address,
var data = new BotData
{
Best = _bestBotAttempt,
ControlProbabilities = ControlProbabilities,
Maximize = MaximizeAddress,
TieBreaker1 = TieBreaker1Address,
TieBreaker2 = TieBreaker2Address,
TieBreaker3 = TieBreaker3Address,
ComparisonTypeMain = MainComparisonType,
ComparisonTypeTie1 = Tie1ComparisonType,
ComparisonTypeTie2 = Tie2ComparisonType,
ComparisonTypeTie3 = Tie3ComparisonType,
FromSlot = FromSlot,
FrameLength = FrameLength,
Attempts = Attempts,
@ -799,35 +882,53 @@ namespace BizHawk.Client.EmuHawk
private bool IsBetter(BotAttempt best, BotAttempt current)
{
if (current.Maximize > best.Maximize)
if (!TestValue(MainComparisonType, current.Maximize, best.Maximize))
{
return true;
return false;
}
else if (current.Maximize == best.Maximize)
{
if (current.TieBreak1 > best.TieBreak1)
if (!TestValue(Tie1ComparisonType, current.TieBreak1, best.TieBreak1))
{
return true;
return false;
}
else if (current.TieBreak1 == best.TieBreak1)
{
if (current.TieBreak2 > best.TieBreak2)
if (!TestValue(Tie2ComparisonType, current.TieBreak2, best.TieBreak2))
{
return true;
return false;
}
else if (current.TieBreak2 == best.TieBreak2)
{
if (current.TieBreak3 > current.TieBreak3)
if (!TestValue(Tie3ComparisonType, current.TieBreak3, current.TieBreak3))
{
return true;
return false;
}
}
}
}
return false;
return true;
}
private bool TestValue(byte operation, int currentValue, int bestValue)
{
switch (operation)
{
case 0:
return currentValue > bestValue;
case 1:
return currentValue >= bestValue;
case 2:
return currentValue == bestValue;
case 3:
return currentValue <= bestValue;
case 4:
return currentValue < bestValue;
}
return false;
}
private void UpdateBestAttempt()
{
if (_bestBotAttempt != null)

View File

@ -1,241 +1,241 @@
namespace BizHawk.Client.EmuHawk
{
partial class PCECDL
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PCECDL));
this.LoggingActiveCheckbox = new System.Windows.Forms.CheckBox();
this.menuStrip1 = new MenuStripEx();
this.FileSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.NewMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.OpenMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SaveMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SaveAsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.AppendMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RecentSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.ClearMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DisassembleMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CdlTextbox = new System.Windows.Forms.TextBox();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// LoggingActiveCheckbox
//
this.LoggingActiveCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.LoggingActiveCheckbox.AutoSize = true;
this.LoggingActiveCheckbox.Location = new System.Drawing.Point(12, 244);
this.LoggingActiveCheckbox.Name = "LoggingActiveCheckbox";
this.LoggingActiveCheckbox.Size = new System.Drawing.Size(101, 17);
this.LoggingActiveCheckbox.TabIndex = 1;
this.LoggingActiveCheckbox.Text = "Loging is Active";
this.LoggingActiveCheckbox.UseVisualStyleBackColor = true;
this.LoggingActiveCheckbox.CheckedChanged += new System.EventHandler(this.LoggingActiveCheckbox_CheckedChanged);
//
// menuStrip1
//
this.menuStrip1.ClickThrough = true;
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.FileSubMenu});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(292, 24);
this.menuStrip1.TabIndex = 2;
this.menuStrip1.Text = "menuStrip1";
//
// FileSubMenu
//
this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.NewMenuItem,
this.OpenMenuItem,
this.SaveMenuItem,
this.SaveAsMenuItem,
this.AppendMenuItem,
this.RecentSubMenu,
this.toolStripSeparator2,
this.ClearMenuItem,
this.DisassembleMenuItem,
this.toolStripSeparator1,
this.ExitMenuItem});
this.FileSubMenu.Name = "FileSubMenu";
this.FileSubMenu.Size = new System.Drawing.Size(35, 20);
this.FileSubMenu.Text = "&File";
this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened);
//
// NewMenuItem
//
this.NewMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile;
this.NewMenuItem.Name = "NewMenuItem";
this.NewMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.NewMenuItem.Size = new System.Drawing.Size(193, 22);
this.NewMenuItem.Text = "&New";
this.NewMenuItem.Click += new System.EventHandler(this.NewMenuItem_Click);
//
// OpenMenuItem
//
this.OpenMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile;
this.OpenMenuItem.Name = "OpenMenuItem";
this.OpenMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.OpenMenuItem.Size = new System.Drawing.Size(193, 22);
this.OpenMenuItem.Text = "&Open...";
this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click);
//
// SaveMenuItem
//
this.SaveMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs;
this.SaveMenuItem.Name = "SaveMenuItem";
this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.SaveMenuItem.Size = new System.Drawing.Size(193, 22);
this.SaveMenuItem.Text = "&Save";
this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click);
//
// SaveAsMenuItem
//
this.SaveAsMenuItem.Name = "SaveAsMenuItem";
this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S)));
this.SaveAsMenuItem.Size = new System.Drawing.Size(193, 22);
this.SaveAsMenuItem.Text = "&Save As...";
this.SaveAsMenuItem.Click += new System.EventHandler(this.SaveAsMenuItem_Click);
//
// AppendMenuItem
//
this.AppendMenuItem.Name = "AppendMenuItem";
this.AppendMenuItem.Size = new System.Drawing.Size(193, 22);
this.AppendMenuItem.Text = "&Append File...";
this.AppendMenuItem.Click += new System.EventHandler(this.AppendMenuItem_Click);
//
// RecentSubMenu
//
this.RecentSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.noneToolStripMenuItem});
this.RecentSubMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent;
this.RecentSubMenu.Name = "RecentSubMenu";
this.RecentSubMenu.Size = new System.Drawing.Size(193, 22);
this.RecentSubMenu.Text = "Recent";
this.RecentSubMenu.DropDownOpened += new System.EventHandler(this.RecentSubMenu_DropDownOpened);
//
// noneToolStripMenuItem
//
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
this.noneToolStripMenuItem.Size = new System.Drawing.Size(99, 22);
this.noneToolStripMenuItem.Text = "None";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(190, 6);
//
// ClearMenuItem
//
this.ClearMenuItem.Name = "ClearMenuItem";
this.ClearMenuItem.Size = new System.Drawing.Size(193, 22);
this.ClearMenuItem.Text = "&Clear";
this.ClearMenuItem.Click += new System.EventHandler(this.ClearMenuItem_Click);
//
// DisassembleMenuItem
//
this.DisassembleMenuItem.Name = "DisassembleMenuItem";
this.DisassembleMenuItem.Size = new System.Drawing.Size(193, 22);
this.DisassembleMenuItem.Text = "&Disassemble...";
this.DisassembleMenuItem.Click += new System.EventHandler(this.DisassembleMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(190, 6);
//
// ExitMenuItem
//
this.ExitMenuItem.Name = "ExitMenuItem";
this.ExitMenuItem.ShortcutKeyDisplayString = "Alt+F4";
this.ExitMenuItem.Size = new System.Drawing.Size(193, 22);
this.ExitMenuItem.Text = "&Close";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
// CdlTextbox
//
this.CdlTextbox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CdlTextbox.Location = new System.Drawing.Point(0, 27);
this.CdlTextbox.Multiline = true;
this.CdlTextbox.Name = "CdlTextbox";
this.CdlTextbox.ReadOnly = true;
this.CdlTextbox.Size = new System.Drawing.Size(292, 211);
this.CdlTextbox.TabIndex = 3;
//
// PCECDL
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 273);
this.Controls.Add(this.CdlTextbox);
this.Controls.Add(this.LoggingActiveCheckbox);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(150, 130);
this.Name = "PCECDL";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Code Data Logger";
this.Load += new System.EventHandler(this.PCECDL_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.PCECDL_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.PCECDL_DragEnter);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox LoggingActiveCheckbox;
private MenuStripEx menuStrip1;
private System.Windows.Forms.ToolStripMenuItem FileSubMenu;
private System.Windows.Forms.ToolStripMenuItem ClearMenuItem;
private System.Windows.Forms.ToolStripMenuItem OpenMenuItem;
private System.Windows.Forms.ToolStripMenuItem SaveAsMenuItem;
private System.Windows.Forms.ToolStripMenuItem AppendMenuItem;
private System.Windows.Forms.ToolStripMenuItem NewMenuItem;
private System.Windows.Forms.TextBox CdlTextbox;
private System.Windows.Forms.ToolStripMenuItem DisassembleMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem ExitMenuItem;
private System.Windows.Forms.ToolStripMenuItem SaveMenuItem;
private System.Windows.Forms.ToolStripMenuItem RecentSubMenu;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem;
}
namespace BizHawk.Client.EmuHawk
{
partial class CDL
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CDL));
this.LoggingActiveCheckbox = new System.Windows.Forms.CheckBox();
this.menuStrip1 = new MenuStripEx();
this.FileSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.NewMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.OpenMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SaveMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.SaveAsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.AppendMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RecentSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.ClearMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DisassembleMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.CdlTextbox = new System.Windows.Forms.TextBox();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
// LoggingActiveCheckbox
//
this.LoggingActiveCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.LoggingActiveCheckbox.AutoSize = true;
this.LoggingActiveCheckbox.Location = new System.Drawing.Point(12, 240);
this.LoggingActiveCheckbox.Name = "LoggingActiveCheckbox";
this.LoggingActiveCheckbox.Size = new System.Drawing.Size(107, 17);
this.LoggingActiveCheckbox.TabIndex = 1;
this.LoggingActiveCheckbox.Text = "Logging is Active";
this.LoggingActiveCheckbox.UseVisualStyleBackColor = true;
this.LoggingActiveCheckbox.CheckedChanged += new System.EventHandler(this.LoggingActiveCheckbox_CheckedChanged);
//
// menuStrip1
//
this.menuStrip1.ClickThrough = true;
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.FileSubMenu});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(463, 24);
this.menuStrip1.TabIndex = 2;
this.menuStrip1.Text = "menuStrip1";
//
// FileSubMenu
//
this.FileSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.NewMenuItem,
this.OpenMenuItem,
this.SaveMenuItem,
this.SaveAsMenuItem,
this.AppendMenuItem,
this.RecentSubMenu,
this.toolStripSeparator2,
this.ClearMenuItem,
this.DisassembleMenuItem,
this.toolStripSeparator1,
this.ExitMenuItem});
this.FileSubMenu.Name = "FileSubMenu";
this.FileSubMenu.Size = new System.Drawing.Size(35, 20);
this.FileSubMenu.Text = "&File";
this.FileSubMenu.DropDownOpened += new System.EventHandler(this.FileSubMenu_DropDownOpened);
//
// NewMenuItem
//
this.NewMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile;
this.NewMenuItem.Name = "NewMenuItem";
this.NewMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.NewMenuItem.Size = new System.Drawing.Size(193, 22);
this.NewMenuItem.Text = "&New";
this.NewMenuItem.Click += new System.EventHandler(this.NewMenuItem_Click);
//
// OpenMenuItem
//
this.OpenMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile;
this.OpenMenuItem.Name = "OpenMenuItem";
this.OpenMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.OpenMenuItem.Size = new System.Drawing.Size(193, 22);
this.OpenMenuItem.Text = "&Open...";
this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click);
//
// SaveMenuItem
//
this.SaveMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs;
this.SaveMenuItem.Name = "SaveMenuItem";
this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.SaveMenuItem.Size = new System.Drawing.Size(193, 22);
this.SaveMenuItem.Text = "&Save";
this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click);
//
// SaveAsMenuItem
//
this.SaveAsMenuItem.Name = "SaveAsMenuItem";
this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S)));
this.SaveAsMenuItem.Size = new System.Drawing.Size(193, 22);
this.SaveAsMenuItem.Text = "&Save As...";
this.SaveAsMenuItem.Click += new System.EventHandler(this.SaveAsMenuItem_Click);
//
// AppendMenuItem
//
this.AppendMenuItem.Name = "AppendMenuItem";
this.AppendMenuItem.Size = new System.Drawing.Size(193, 22);
this.AppendMenuItem.Text = "&Append File...";
this.AppendMenuItem.Click += new System.EventHandler(this.AppendMenuItem_Click);
//
// RecentSubMenu
//
this.RecentSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.noneToolStripMenuItem});
this.RecentSubMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent;
this.RecentSubMenu.Name = "RecentSubMenu";
this.RecentSubMenu.Size = new System.Drawing.Size(193, 22);
this.RecentSubMenu.Text = "Recent";
this.RecentSubMenu.DropDownOpened += new System.EventHandler(this.RecentSubMenu_DropDownOpened);
//
// noneToolStripMenuItem
//
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
this.noneToolStripMenuItem.Size = new System.Drawing.Size(99, 22);
this.noneToolStripMenuItem.Text = "None";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(190, 6);
//
// ClearMenuItem
//
this.ClearMenuItem.Name = "ClearMenuItem";
this.ClearMenuItem.Size = new System.Drawing.Size(193, 22);
this.ClearMenuItem.Text = "&Clear";
this.ClearMenuItem.Click += new System.EventHandler(this.ClearMenuItem_Click);
//
// DisassembleMenuItem
//
this.DisassembleMenuItem.Name = "DisassembleMenuItem";
this.DisassembleMenuItem.Size = new System.Drawing.Size(193, 22);
this.DisassembleMenuItem.Text = "&Disassemble...";
this.DisassembleMenuItem.Click += new System.EventHandler(this.DisassembleMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(190, 6);
//
// ExitMenuItem
//
this.ExitMenuItem.Name = "ExitMenuItem";
this.ExitMenuItem.ShortcutKeyDisplayString = "Alt+F4";
this.ExitMenuItem.Size = new System.Drawing.Size(193, 22);
this.ExitMenuItem.Text = "&Close";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
// CdlTextbox
//
this.CdlTextbox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CdlTextbox.Location = new System.Drawing.Point(0, 27);
this.CdlTextbox.Multiline = true;
this.CdlTextbox.Name = "CdlTextbox";
this.CdlTextbox.ReadOnly = true;
this.CdlTextbox.Size = new System.Drawing.Size(463, 207);
this.CdlTextbox.TabIndex = 3;
//
// CDL
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(463, 269);
this.Controls.Add(this.CdlTextbox);
this.Controls.Add(this.LoggingActiveCheckbox);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(150, 130);
this.Name = "CDL";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Code Data Logger";
this.Load += new System.EventHandler(this.PCECDL_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.PCECDL_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.PCECDL_DragEnter);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox LoggingActiveCheckbox;
private MenuStripEx menuStrip1;
private System.Windows.Forms.ToolStripMenuItem FileSubMenu;
private System.Windows.Forms.ToolStripMenuItem ClearMenuItem;
private System.Windows.Forms.ToolStripMenuItem OpenMenuItem;
private System.Windows.Forms.ToolStripMenuItem SaveAsMenuItem;
private System.Windows.Forms.ToolStripMenuItem AppendMenuItem;
private System.Windows.Forms.ToolStripMenuItem NewMenuItem;
private System.Windows.Forms.TextBox CdlTextbox;
private System.Windows.Forms.ToolStripMenuItem DisassembleMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem ExitMenuItem;
private System.Windows.Forms.ToolStripMenuItem SaveMenuItem;
private System.Windows.Forms.ToolStripMenuItem RecentSubMenu;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem;
}
}

View File

@ -1,338 +1,390 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Common.IEmulatorExtensions;
using BizHawk.Emulation.Cores.Components.H6280;
using BizHawk.Emulation.Cores.PCEngine;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.ToolExtensions;
namespace BizHawk.Client.EmuHawk
{
public partial class PCECDL : Form, IToolFormAutoConfig
{
[RequiredService]
private PCEngine _emu { get; set; }
private CodeDataLog _cdl;
private RecentFiles _recent_fld = new RecentFiles();
[ConfigPersist]
private RecentFiles _recent
{
get
{ return _recent_fld; }
set
{
_recent_fld = value;
if (_recent_fld.AutoLoad)
{
LoadFile(_recent.MostRecent);
_currentFileName = _recent.MostRecent;
}
}
}
[RequiredService]
private IMemoryDomains MemoryDomains { get; set; }
private string _currentFileName = string.Empty;
public PCECDL()
{
InitializeComponent();
}
public void UpdateValues()
{
UpdateDisplay();
}
public void FastUpdate()
{
// Do nothing
}
public void Restart()
{
LoggingActiveCheckbox.Checked = _emu.Cpu.CDLLoggingActive;
_cdl = _emu.Cpu.CDL;
_emu.InitCDLMappings();
UpdateDisplay();
}
private void UpdateDisplay()
{
var lines = new List<string>();
if (_cdl == null)
{
lines.Add("No CDL loaded.");
}
else
{
lines.Add("CDL contains the following domains:");
foreach (var kvp in _cdl)
{
int total = 0;
unsafe
{
fixed (byte* data = kvp.Value)
{
byte* src = data;
byte* end = data + kvp.Value.Length;
while (src < end)
{
if (*src++ != 0)
{
total++;
}
}
}
}
lines.Add(string.Format("Domain {0} Size {1} Mapped {2}%", kvp.Key, kvp.Value.Length, total / (float) kvp.Value.Length * 100f));
}
}
CdlTextbox.Lines = lines.ToArray();
}
public bool AskSaveChanges()
{
return true;
}
public bool UpdateBefore
{
get { return false; }
}
public void LoadFile(string path)
{
using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read))
{
var newCDL = CodeDataLog.Load(fs);
if (!newCDL.CheckConsistency(_emu.Cpu.Mappings))
{
MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
}
else
{
_cdl = newCDL;
_emu.Cpu.CDL = _cdl;
UpdateDisplay();
}
}
}
#region Events
#region File
private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{
SaveMenuItem.Enabled = !string.IsNullOrWhiteSpace(_currentFileName);
SaveAsMenuItem.Enabled =
AppendMenuItem.Enabled =
ClearMenuItem.Enabled =
DisassembleMenuItem.Enabled =
_cdl != null;
}
private void RecentSubMenu_DropDownOpened(object sender, EventArgs e)
{
RecentSubMenu.DropDownItems.Clear();
RecentSubMenu.DropDownItems.AddRange(_recent.RecentMenu(LoadFile, true));
}
private void NewMenuItem_Click(object sender, EventArgs e)
{
var result = MessageBox.Show(this, "OK to create new CDL?", "Query", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
{
_cdl = CodeDataLog.Create(_emu.Cpu.Mappings);
_emu.Cpu.CDL = _cdl;
UpdateDisplay();
}
}
private void OpenMenuItem_Click(object sender, EventArgs e)
{
var result = MessageBox.Show(this, "OK to load new CDL?", "Query", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
{
var file = ToolHelpers.OpenFileDialog(
_currentFileName,
PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
"Code Data Logger Files",
"cdl");
if (file != null)
{
using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
{
var newCDL = CodeDataLog.Load(fs);
if (!newCDL.CheckConsistency(_emu.Cpu.Mappings))
{
MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
}
else
{
_cdl = newCDL;
_emu.Cpu.CDL = _cdl;
UpdateDisplay();
_recent.Add(file.FullName);
_currentFileName = file.FullName;
}
}
}
}
}
private void SaveMenuItem_Click(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(_currentFileName))
{
using (var fs = new FileStream(_currentFileName, FileMode.Create, FileAccess.Write))
{
_cdl.Save(fs);
}
}
}
private void SaveAsMenuItem_Click(object sender, EventArgs e)
{
if (_cdl == null)
{
MessageBox.Show(this, "Cannot save with no CDL loaded!", "Alert");
}
else
{
var file = ToolHelpers.SaveFileDialog(
_currentFileName,
PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
"Code Data Logger Files",
"cdl");
if (file != null)
{
using (var fs = new FileStream(file.FullName, FileMode.Create, FileAccess.Write))
{
_cdl.Save(fs);
_recent.Add(file.FullName);
_currentFileName = file.FullName;
}
}
}
}
private void AppendMenuItem_Click(object sender, EventArgs e)
{
if (_cdl == null)
{
MessageBox.Show(this, "Cannot append with no CDL loaded!", "Alert");
}
else
{
var file = ToolHelpers.OpenFileDialog(
_currentFileName,
PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
"Code Data Logger Files",
"cdl");
if (file != null)
{
using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
{
var newCDL = CodeDataLog.Load(fs);
_cdl.LogicalOrFrom(newCDL);
UpdateDisplay();
}
}
}
}
private void ClearMenuItem_Click(object sender, EventArgs e)
{
if (_cdl == null)
{
MessageBox.Show(this, "Cannot clear with no CDL loaded!", "Alert");
}
else
{
var result = MessageBox.Show(this, "OK to clear CDL?", "Query", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
{
_cdl.ClearData();
UpdateDisplay();
}
}
}
private void DisassembleMenuItem_Click(object sender, EventArgs e)
{
if (_cdl == null)
{
MessageBox.Show(this, "Cannot disassemble with no CDL loaded!", "Alert");
}
else
{
var sfd = new SaveFileDialog();
var result = sfd.ShowDialog(this);
if (result == DialogResult.OK)
{
using (var fs = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
{
_cdl.Disassemble(fs, MemoryDomains);
}
}
}
}
private void ExitMenuItem_Click(object sender, EventArgs e)
{
Close();
}
#endregion
#region Dialog Events
private void PCECDL_Load(object sender, EventArgs e)
{
}
private void LoggingActiveCheckbox_CheckedChanged(object sender, EventArgs e)
{
if (LoggingActiveCheckbox.Checked && _cdl == null)
{
MessageBox.Show(this, "Cannot log with no CDL loaded!", "Alert");
LoggingActiveCheckbox.Checked = false;
}
_emu.Cpu.CDLLoggingActive = LoggingActiveCheckbox.Checked;
}
private void PCECDL_DragEnter(object sender, DragEventArgs e)
{
e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None;
}
private void PCECDL_DragDrop(object sender, DragEventArgs e)
{
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
if (Path.GetExtension(filePaths[0]) == ".cdl")
{
LoadFile(filePaths[0]);
}
}
#endregion
#endregion
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Common.IEmulatorExtensions;
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
using BizHawk.Emulation.Cores.Components.H6280;
using BizHawk.Emulation.Cores.PCEngine;
using BizHawk.Emulation.Cores.Consoles.Sega;
using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk.ToolExtensions;
namespace BizHawk.Client.EmuHawk
{
public partial class CDL : Form, IToolFormAutoConfig
{
private RecentFiles _recent_fld = new RecentFiles();
[ConfigPersist]
private RecentFiles _recent
{
get
{ return _recent_fld; }
set
{
_recent_fld = value;
if (_recent_fld.AutoLoad)
{
LoadFile(_recent.MostRecent);
_currentFileName = _recent.MostRecent;
}
}
}
[RequiredService]
private IMemoryDomains MemoryDomains { get; set; }
[RequiredService]
private ICodeDataLogger CodeDataLogger { get; set; }
private string _currentFileName = string.Empty;
private CodeDataLog _cdl;
public CDL()
{
InitializeComponent();
}
public void UpdateValues()
{
UpdateDisplay();
}
public void FastUpdate()
{
// Do nothing
}
public void Restart()
{
//don't try to recover the current CDL!
//even though it seems like it might be nice, it might get mixed up between games. even if we use CheckCDL. Switching games with the same memory map will be bad.
_cdl = null;
_currentFileName = null;
LoggingActiveCheckbox.Checked = false;
UpdateDisplay();
}
private void UpdateDisplay()
{
if (_cdl == null)
{
CdlTextbox.Text = "No CDL loaded.";
return;
}
StringWriter sw = new StringWriter();
sw.WriteLine("CDL contains the following domains:");
foreach (var kvp in _cdl)
{
int total = 0;
unsafe
{
fixed (byte* data = kvp.Value)
{
byte* src = data;
byte* end = data + kvp.Value.Length;
while (src < end)
{
if (*src++ != 0)
{
total++;
}
}
}
}
sw.WriteLine("Domain {0} Size {1} Mapped {2}% ({3}/{4} bytes)", kvp.Key, kvp.Value.Length, total / (float)kvp.Value.Length * 100f, total, kvp.Value.Length);
}
sw.WriteLine();
var bm = _cdl.GetBlockMap();
foreach (var kvp in bm)
{
sw.WriteLine("{0:X8}: {1}", kvp.Value, kvp.Key);
}
CdlTextbox.Text = sw.ToString();
}
public bool AskSaveChanges()
{
return true;
}
public bool UpdateBefore
{
get { return false; }
}
public void LoadFile(string path)
{
using (var fs = new FileStream(path, FileMode.Open, FileAccess.Read))
{
var newCDL = new CodeDataLog();
newCDL.Load(fs);
//have the core create a CodeDataLog to check mapping information against
var testCDL = new CodeDataLog();
CodeDataLogger.NewCDL(testCDL);
if (!newCDL.Check(testCDL))
{
MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
return;
}
//ok, it's all good:
_cdl = newCDL;
CodeDataLogger.SetCDL(null);
if (LoggingActiveCheckbox.Checked)
CodeDataLogger.SetCDL(_cdl);
_currentFileName = path;
}
UpdateDisplay();
}
#region Events
#region File
private void FileSubMenu_DropDownOpened(object sender, EventArgs e)
{
SaveMenuItem.Enabled = !string.IsNullOrWhiteSpace(_currentFileName);
SaveAsMenuItem.Enabled =
AppendMenuItem.Enabled =
ClearMenuItem.Enabled =
DisassembleMenuItem.Enabled =
_cdl != null;
}
private void RecentSubMenu_DropDownOpened(object sender, EventArgs e)
{
RecentSubMenu.DropDownItems.Clear();
RecentSubMenu.DropDownItems.AddRange(_recent.RecentMenu(LoadFile, true));
}
void NewFileLogic()
{
_cdl = new CodeDataLog();
CodeDataLogger.NewCDL(_cdl);
if (LoggingActiveCheckbox.Checked)
CodeDataLogger.SetCDL(_cdl);
else CodeDataLogger.SetCDL(null);
_currentFileName = null;
UpdateDisplay();
}
private void NewMenuItem_Click(object sender, EventArgs e)
{
//take care not to clobber an existing CDL
if (_cdl != null)
{
var result = MessageBox.Show(this, "OK to create new CDL?", "Query", MessageBoxButtons.YesNo);
if (result != DialogResult.Yes)
return;
}
NewFileLogic();
}
private void OpenMenuItem_Click(object sender, EventArgs e)
{
var file = ToolHelpers.OpenFileDialog(
_currentFileName,
PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
"Code Data Logger Files",
"cdl");
if (file == null)
return;
//take care not to clobber an existing CDL
if (_cdl != null)
{
var result = MessageBox.Show(this, "OK to load new CDL?", "Query", MessageBoxButtons.YesNo);
if (result != DialogResult.Yes)
return;
}
LoadFile(file.FullName);
}
private void SaveMenuItem_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(_currentFileName))
{
RunSaveAs();
return;
}
using (var fs = new FileStream(_currentFileName, FileMode.Create, FileAccess.Write))
{
_cdl.Save(fs);
}
}
void RunSaveAs()
{
if (_cdl == null)
{
MessageBox.Show(this, "Cannot save with no CDL loaded!", "Alert");
}
else
{
var file = ToolHelpers.SaveFileDialog(
_currentFileName,
PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
"Code Data Logger Files",
"cdl");
if (file != null)
{
using (var fs = new FileStream(file.FullName, FileMode.Create, FileAccess.Write))
{
_cdl.Save(fs);
_recent.Add(file.FullName);
_currentFileName = file.FullName;
}
}
}
}
private void SaveAsMenuItem_Click(object sender, EventArgs e)
{
RunSaveAs();
}
private void AppendMenuItem_Click(object sender, EventArgs e)
{
if (_cdl == null)
{
MessageBox.Show(this, "Cannot append with no CDL loaded!", "Alert");
}
else
{
var file = ToolHelpers.OpenFileDialog(
_currentFileName,
PathManager.MakeAbsolutePath(Global.Config.PathEntries.LogPathFragment, null),
"Code Data Logger Files",
"cdl");
if (file != null)
{
using (var fs = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
{
var newCDL = new CodeDataLog();
newCDL.Load(fs);
if (!_cdl.Check(newCDL))
{
MessageBox.Show(this, "CDL file does not match emulator's current memory map!");
return;
}
_cdl.LogicalOrFrom(newCDL);
UpdateDisplay();
}
}
}
}
private void ClearMenuItem_Click(object sender, EventArgs e)
{
if (_cdl == null)
{
MessageBox.Show(this, "Cannot clear with no CDL loaded!", "Alert");
}
else
{
var result = MessageBox.Show(this, "OK to clear CDL?", "Query", MessageBoxButtons.YesNo);
if (result == DialogResult.Yes)
{
_cdl.ClearData();
UpdateDisplay();
}
}
}
private void DisassembleMenuItem_Click(object sender, EventArgs e)
{
if (_cdl == null)
{
MessageBox.Show(this, "Cannot disassemble with no CDL loaded!", "Alert");
return;
}
var sfd = new SaveFileDialog();
var result = sfd.ShowDialog(this);
if (result == DialogResult.OK)
{
using (var fs = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
{
CodeDataLogger.DisassembleCDL(fs, _cdl);
}
}
}
private void ExitMenuItem_Click(object sender, EventArgs e)
{
Close();
}
protected override void OnClosed(EventArgs e)
{
//deactivate logger
if (CodeDataLogger != null) //just in case...
CodeDataLogger.SetCDL(null);
}
#endregion
#region Dialog Events
private void PCECDL_Load(object sender, EventArgs e)
{
}
private void LoggingActiveCheckbox_CheckedChanged(object sender, EventArgs e)
{
if (LoggingActiveCheckbox.Checked && _cdl == null)
{
//implicitly create a new file
NewFileLogic();
}
if (_cdl != null && LoggingActiveCheckbox.Checked)
CodeDataLogger.SetCDL(_cdl);
else
CodeDataLogger.SetCDL(null);
}
private void PCECDL_DragEnter(object sender, DragEventArgs e)
{
e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None;
}
private void PCECDL_DragDrop(object sender, DragEventArgs e)
{
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
if (Path.GetExtension(filePaths[0]) == ".cdl")
{
LoadFile(filePaths[0]);
}
}
#endregion
#endregion
}
}

View File

@ -1,200 +1,200 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAAAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAABILAAASCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8AAAD/AAAA/6qqqv+qqqr/qqqq/6qqqv+qqqr/qqqq/6qqqv+qqqr/qqqq/6qqqv+qqqr/qqqq/6qq
qv+qqqr/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAAAMjIy/6qqqv+qqqr/qqqq/6qq
qv+qqqr/qqqq/6qqqv+qqqr///////////+enp7/np6e/56env+enp7/np6e/56env+enp7/np6e/56e
nv+enp7///////////+qqqr/qqqq/6qqqv+qqqr/qqqq/87Ozv/Ozs7/qqqq/zIyMv8yMjL/////////
/////////////////////////////////////////////2JiYv9iYmL/2tra/9ra2v/a2tr/2tra/9ra
2v/a2tr/YmJi/2JiYv//////////////////////////////////////////////////////MjIy/zIy
Mv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP/a2tr/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8yMjL/MjIy/5KSkv+SkpL/////////////////kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KS
kv+SkpL/bm5u/25ubv+SkpL/kpKS/wCFAf8AhQH/kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/wAA
AP8AAAD/kpKS/zIyMv8yMjL/kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KS
kv+SkpL/kpKS/5KSkv9ubm7/bm5u/+bm5v+SkpL/kpKS/5KSkv+SkpL/kpKS/+bm5v/m5ub/kpKS/5KS
kv+SkpL/kpKS/5KSkv/m5ub/MjIy/zIyMv/m5ub/5ubm/+bm5v/m5ub/5ubm/+bm5v/m5ub/5ubm/+bm
5v/m5ub/5ubm/+bm5v/m5ub/5ubm/25ubv9ubm7//////87Ozv/m5ub/5ubm/3h5ef94eXn/////////
///m5ub/5ubm/+bm5v/m5ub/5ubm//////8yMjL/MjIy/2JiYv8lJSX///////////+enp7/np6e/56e
nv+enp7/np6e/56env///////////8DAwP/AwMD/bm5u/25ubv//////zs7O////////////eHl5////
////////9vr+///////m5ub///////////+qqqr//////zIyMv8yMjL//////2JiYv//////np6e/xoa
Gv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/56env////////////////9ubm7/bm5u///////Ozs7/////////
//94eXn//////////////////////+bm5v///////////6qqqv//////MjIy/zIyMv+enp7/pKai/25u
bv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/25ubv+enp7/np6e/25ubv9ubm7//////87O
zv///////////3h5ef//////////////////////5ubm////////////qqqq//////8yMjL/MjIy////
//+enp7///////////9iYmL/Pj4+/xoaGv8lJSX/Pj4+/2JiYv///////////25ubv//////bm5u/25u
bv//////zs7O////////////JSUl/yUlJf8lJSX/JSUl/yUlJf/m5ub///////////+qqqr//////zIy
Mv8yMjL//////56env//////////////////////////////////////////////////////bm5u////
//9ubm7/bm5u///////Ozs7///////////+SkpL/kpKS/5KSkv+SkpL/kpKS/+bm5v///////////6qq
qv//////MjIy/zIyMv//////np6e/////////////////8DAwP/AwMD//////8DAwP//////////////
//9ubm7//////25ubv9ubm7//////87Ozv//////zs7O/////////////////5GO/v///////////6qq
qv//////qqqq//////8yMjL/AAAA//////+enp7/////////////////////////////////////////
/////////////25ubv//////bm5u/5KSkv//////zs7O///////Ozs7//////5GO/v+Rjv7//////5GO
/v//////qqqq//////+qqqr/kpKS/wAAAP8AAAD///////////+enp7/////////////////////////
//////////////////9ubm7///////////9ubm7/kpKS///////Ozs7////////////Ozs7/////////
/////////////6qqqv///////////6qqqv//////AAAA/wAAAP////////////////+enp7/////////
////////////////////////bm5u/////////////////25ubv+SkpL//////87Ozv//////////////
///Ozs7/zs7O/6qqqv+qqqr/////////////////qqqq//////8AAAD/AAAA////////////////////
//+enp7/np6e/56env+enp7/np6e/56env//////////////////////bm5u/5KSkv//////zs7O/87O
zv/Ozs7/zs7O/87Ozv/Ozs7/zs7O/87Ozv/Ozs7/zs7O/87Ozv/Ozs7//////wAAAP8AAAD/////////
//////////////////////////////////////////////////////////////////9ubm7/kpKS////
////////////////////////////////////////////////////////////////////////AAAA/wAA
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8AAAD/AAAA/2JiYv+SkpL/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoa
Gv8+Pj7/Pj4+/z4+Pv8+Pj7/Ghoa/z4+Pv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoa
Gv8aGhr/VlZW/wAAAP8AAAD/YmJi/5KSkv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZW
Vv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Pj4+/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW//2P
a/9WVlb//Y9r/xoaGv9WVlb/AAAA/wAAAP9iYmL/kpKS/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZW
Vv9WVlb/VlZW/xoaGv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZWVv8+Pj7/VlZW/1ZWVv9WVlb/VlZW/1ZW
Vv9WVlb/VlZW/1ZWVv9WVlb/Ghoa/1ZWVv8AAAD/AAAA/2JiYv+SkpL/VlZW/1ZWVv+Ghob/VlZW/4aG
hv+Ghob/hoaG/4aGhv9WVlb/Ghoa/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW/z4+Pv9WVlb/VlZW/1ZW
Vv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZWVv8aGhr/VlZW/wAAAP8AAAD/YmJi/2JiYv+SkpL/kpKS/5KS
kv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KSkv9iYmL/hoaG/4aGhv+Ghob/hoaG/4aGhv+Ghob/YmJi/5KS
kv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/25ubv9iYmL/AAAA/1ZWVv8AAAD/AAAA/wAA
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP9WVlb/AAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA/////////////////4AB/4AAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAD///////////////8=
</value>
</data>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAAAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAAAAAABILAAASCwAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8AAAD/AAAA/6qqqv+qqqr/qqqq/6qqqv+qqqr/qqqq/6qqqv+qqqr/qqqq/6qqqv+qqqr/qqqq/6qq
qv+qqqr/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAAAMjIy/6qqqv+qqqr/qqqq/6qq
qv+qqqr/qqqq/6qqqv+qqqr///////////+enp7/np6e/56env+enp7/np6e/56env+enp7/np6e/56e
nv+enp7///////////+qqqr/qqqq/6qqqv+qqqr/qqqq/87Ozv/Ozs7/qqqq/zIyMv8yMjL/////////
/////////////////////////////////////////////2JiYv9iYmL/2tra/9ra2v/a2tr/2tra/9ra
2v/a2tr/YmJi/2JiYv//////////////////////////////////////////////////////MjIy/zIy
Mv8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP/a2tr/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8yMjL/MjIy/5KSkv+SkpL/////////////////kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KS
kv+SkpL/bm5u/25ubv+SkpL/kpKS/wCFAf8AhQH/kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/wAA
AP8AAAD/kpKS/zIyMv8yMjL/kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KS
kv+SkpL/kpKS/5KSkv9ubm7/bm5u/+bm5v+SkpL/kpKS/5KSkv+SkpL/kpKS/+bm5v/m5ub/kpKS/5KS
kv+SkpL/kpKS/5KSkv/m5ub/MjIy/zIyMv/m5ub/5ubm/+bm5v/m5ub/5ubm/+bm5v/m5ub/5ubm/+bm
5v/m5ub/5ubm/+bm5v/m5ub/5ubm/25ubv9ubm7//////87Ozv/m5ub/5ubm/3h5ef94eXn/////////
///m5ub/5ubm/+bm5v/m5ub/5ubm//////8yMjL/MjIy/2JiYv8lJSX///////////+enp7/np6e/56e
nv+enp7/np6e/56env///////////8DAwP/AwMD/bm5u/25ubv//////zs7O////////////eHl5////
////////9vr+///////m5ub///////////+qqqr//////zIyMv8yMjL//////2JiYv//////np6e/xoa
Gv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/56env////////////////9ubm7/bm5u///////Ozs7/////////
//94eXn//////////////////////+bm5v///////////6qqqv//////MjIy/zIyMv+enp7/pKai/25u
bv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/25ubv+enp7/np6e/25ubv9ubm7//////87O
zv///////////3h5ef//////////////////////5ubm////////////qqqq//////8yMjL/MjIy////
//+enp7///////////9iYmL/Pj4+/xoaGv8lJSX/Pj4+/2JiYv///////////25ubv//////bm5u/25u
bv//////zs7O////////////JSUl/yUlJf8lJSX/JSUl/yUlJf/m5ub///////////+qqqr//////zIy
Mv8yMjL//////56env//////////////////////////////////////////////////////bm5u////
//9ubm7/bm5u///////Ozs7///////////+SkpL/kpKS/5KSkv+SkpL/kpKS/+bm5v///////////6qq
qv//////MjIy/zIyMv//////np6e/////////////////8DAwP/AwMD//////8DAwP//////////////
//9ubm7//////25ubv9ubm7//////87Ozv//////zs7O/////////////////5GO/v///////////6qq
qv//////qqqq//////8yMjL/AAAA//////+enp7/////////////////////////////////////////
/////////////25ubv//////bm5u/5KSkv//////zs7O///////Ozs7//////5GO/v+Rjv7//////5GO
/v//////qqqq//////+qqqr/kpKS/wAAAP8AAAD///////////+enp7/////////////////////////
//////////////////9ubm7///////////9ubm7/kpKS///////Ozs7////////////Ozs7/////////
/////////////6qqqv///////////6qqqv//////AAAA/wAAAP////////////////+enp7/////////
////////////////////////bm5u/////////////////25ubv+SkpL//////87Ozv//////////////
///Ozs7/zs7O/6qqqv+qqqr/////////////////qqqq//////8AAAD/AAAA////////////////////
//+enp7/np6e/56env+enp7/np6e/56env//////////////////////bm5u/5KSkv//////zs7O/87O
zv/Ozs7/zs7O/87Ozv/Ozs7/zs7O/87Ozv/Ozs7/zs7O/87Ozv/Ozs7//////wAAAP8AAAD/////////
//////////////////////////////////////////////////////////////////9ubm7/kpKS////
////////////////////////////////////////////////////////////////////////AAAA/wAA
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8AAAD/AAAA/2JiYv+SkpL/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoa
Gv8+Pj7/Pj4+/z4+Pv8+Pj7/Ghoa/z4+Pv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoa
Gv8aGhr/VlZW/wAAAP8AAAD/YmJi/5KSkv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZW
Vv8aGhr/Ghoa/xoaGv8aGhr/Ghoa/xoaGv8aGhr/Pj4+/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW//2P
a/9WVlb//Y9r/xoaGv9WVlb/AAAA/wAAAP9iYmL/kpKS/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZW
Vv9WVlb/VlZW/xoaGv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZWVv8+Pj7/VlZW/1ZWVv9WVlb/VlZW/1ZW
Vv9WVlb/VlZW/1ZWVv9WVlb/Ghoa/1ZWVv8AAAD/AAAA/2JiYv+SkpL/VlZW/1ZWVv+Ghob/VlZW/4aG
hv+Ghob/hoaG/4aGhv9WVlb/Ghoa/1ZWVv9WVlb/VlZW/1ZWVv9WVlb/VlZW/z4+Pv9WVlb/VlZW/1ZW
Vv9WVlb/VlZW/1ZWVv9WVlb/VlZW/1ZWVv8aGhr/VlZW/wAAAP8AAAD/YmJi/2JiYv+SkpL/kpKS/5KS
kv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KSkv9iYmL/hoaG/4aGhv+Ghob/hoaG/4aGhv+Ghob/YmJi/5KS
kv+SkpL/kpKS/5KSkv+SkpL/kpKS/5KSkv+SkpL/kpKS/25ubv9iYmL/AAAA/1ZWVv8AAAD/AAAA/wAA
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAA
AP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP9WVlb/AAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAA/////////////////4AB/4AAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAD///////////////8=
</value>
</data>
</root>

View File

@ -63,11 +63,6 @@ namespace BizHawk.Client.EmuHawk
AddressBox.SetHexProperties(_cheat.Domain.Size);
NameBox.Text = _cheat.Name;
AddressBox.Text = _cheat.AddressStr;
ValueBox.Text = _cheat.ValueStr;
CompareBox.Text = _cheat.Compare.HasValue ? _cheat.CompareStr : String.Empty;
ValueBox.ByteSize =
CompareBox.ByteSize =
_cheat.Size;
@ -82,6 +77,11 @@ namespace BizHawk.Client.EmuHawk
BigEndianCheckBox.Checked = _cheat.BigEndian.Value;
NameBox.Text = _cheat.Name;
AddressBox.Text = _cheat.AddressStr;
ValueBox.Text = _cheat.ValueStr;
CompareBox.Text = _cheat.Compare.HasValue ? _cheat.CompareStr : String.Empty;
CheckFormState();
if (!_cheat.Compare.HasValue)
{

View File

@ -174,7 +174,7 @@
this.DisableAllContextMenuItem,
this.ViewInHexEditorContextMenuItem});
this.CheatsContextMenu.Name = "contextMenuStrip1";
this.CheatsContextMenu.Size = new System.Drawing.Size(170, 92);
this.CheatsContextMenu.Size = new System.Drawing.Size(161, 92);
this.CheatsContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.CheatsContextMenu_Opening);
//
// ToggleContextMenuItem
@ -182,7 +182,7 @@
this.ToggleContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1;
this.ToggleContextMenuItem.Name = "ToggleContextMenuItem";
this.ToggleContextMenuItem.ShortcutKeyDisplayString = "Enter";
this.ToggleContextMenuItem.Size = new System.Drawing.Size(169, 22);
this.ToggleContextMenuItem.Size = new System.Drawing.Size(160, 22);
this.ToggleContextMenuItem.Text = "&Toggle";
this.ToggleContextMenuItem.Click += new System.EventHandler(this.ToggleMenuItem_Click);
//
@ -191,7 +191,7 @@
this.RemoveContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
this.RemoveContextMenuItem.Name = "RemoveContextMenuItem";
this.RemoveContextMenuItem.ShortcutKeyDisplayString = "Delete";
this.RemoveContextMenuItem.Size = new System.Drawing.Size(169, 22);
this.RemoveContextMenuItem.Size = new System.Drawing.Size(160, 22);
this.RemoveContextMenuItem.Text = "&Remove";
this.RemoveContextMenuItem.Click += new System.EventHandler(this.RemoveCheatMenuItem_Click);
//
@ -199,14 +199,14 @@
//
this.DisableAllContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop;
this.DisableAllContextMenuItem.Name = "DisableAllContextMenuItem";
this.DisableAllContextMenuItem.Size = new System.Drawing.Size(169, 22);
this.DisableAllContextMenuItem.Size = new System.Drawing.Size(160, 22);
this.DisableAllContextMenuItem.Text = "&Disable All";
this.DisableAllContextMenuItem.Click += new System.EventHandler(this.DisableAllCheatsMenuItem_Click);
//
// ViewInHexEditorContextMenuItem
//
this.ViewInHexEditorContextMenuItem.Name = "ViewInHexEditorContextMenuItem";
this.ViewInHexEditorContextMenuItem.Size = new System.Drawing.Size(169, 22);
this.ViewInHexEditorContextMenuItem.Size = new System.Drawing.Size(160, 22);
this.ViewInHexEditorContextMenuItem.Text = "View in Hex Editor";
this.ViewInHexEditorContextMenuItem.Click += new System.EventHandler(this.ViewInHexEditorContextMenuItem_Click);
//
@ -235,7 +235,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);
//
@ -244,7 +244,7 @@
this.NewMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.NewFile;
this.NewMenuItem.Name = "NewMenuItem";
this.NewMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.NewMenuItem.Size = new System.Drawing.Size(195, 22);
this.NewMenuItem.Size = new System.Drawing.Size(193, 22);
this.NewMenuItem.Text = "&New";
this.NewMenuItem.Click += new System.EventHandler(this.NewMenuItem_Click);
//
@ -253,7 +253,7 @@
this.OpenMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile;
this.OpenMenuItem.Name = "OpenMenuItem";
this.OpenMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.OpenMenuItem.Size = new System.Drawing.Size(195, 22);
this.OpenMenuItem.Size = new System.Drawing.Size(193, 22);
this.OpenMenuItem.Text = "&Open...";
this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click);
//
@ -262,7 +262,7 @@
this.SaveMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.SaveAs;
this.SaveMenuItem.Name = "SaveMenuItem";
this.SaveMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.SaveMenuItem.Size = new System.Drawing.Size(195, 22);
this.SaveMenuItem.Size = new System.Drawing.Size(193, 22);
this.SaveMenuItem.Text = "&Save";
this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click);
//
@ -271,14 +271,14 @@
this.SaveAsMenuItem.Name = "SaveAsMenuItem";
this.SaveAsMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S)));
this.SaveAsMenuItem.Size = new System.Drawing.Size(195, 22);
this.SaveAsMenuItem.Size = new System.Drawing.Size(193, 22);
this.SaveAsMenuItem.Text = "Save &As...";
this.SaveAsMenuItem.Click += new System.EventHandler(this.SaveAsMenuItem_Click);
//
// AppendMenuItem
//
this.AppendMenuItem.Name = "AppendMenuItem";
this.AppendMenuItem.Size = new System.Drawing.Size(195, 22);
this.AppendMenuItem.Size = new System.Drawing.Size(193, 22);
this.AppendMenuItem.Text = "Append File";
//
// RecentSubMenu
@ -287,7 +287,7 @@
this.toolStripSeparator4});
this.RecentSubMenu.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Recent;
this.RecentSubMenu.Name = "RecentSubMenu";
this.RecentSubMenu.Size = new System.Drawing.Size(195, 22);
this.RecentSubMenu.Size = new System.Drawing.Size(193, 22);
this.RecentSubMenu.Text = "Recent";
this.RecentSubMenu.DropDownOpened += new System.EventHandler(this.RecentSubMenu_DropDownOpened);
//
@ -299,13 +299,13 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(192, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(190, 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(195, 22);
this.ExitMenuItem.Size = new System.Drawing.Size(193, 22);
this.ExitMenuItem.Text = "E&xit";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
@ -324,7 +324,7 @@
this.GameGenieSeparator,
this.OpenGameGenieEncoderDecoderMenuItem});
this.CheatsSubMenu.Name = "CheatsSubMenu";
this.CheatsSubMenu.Size = new System.Drawing.Size(55, 20);
this.CheatsSubMenu.Size = new System.Drawing.Size(53, 20);
this.CheatsSubMenu.Text = "&Cheats";
this.CheatsSubMenu.DropDownOpened += new System.EventHandler(this.CheatsSubMenu_DropDownOpened);
//
@ -333,7 +333,7 @@
this.RemoveCheatMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
this.RemoveCheatMenuItem.Name = "RemoveCheatMenuItem";
this.RemoveCheatMenuItem.ShortcutKeyDisplayString = "Delete";
this.RemoveCheatMenuItem.Size = new System.Drawing.Size(233, 22);
this.RemoveCheatMenuItem.Size = new System.Drawing.Size(217, 22);
this.RemoveCheatMenuItem.Text = "&Remove Cheat";
this.RemoveCheatMenuItem.Click += new System.EventHandler(this.RemoveCheatMenuItem_Click);
//
@ -342,21 +342,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(233, 22);
this.InsertSeparatorMenuItem.Size = new System.Drawing.Size(217, 22);
this.InsertSeparatorMenuItem.Text = "Insert Separator";
this.InsertSeparatorMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(230, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(214, 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(233, 22);
this.MoveUpMenuItem.Size = new System.Drawing.Size(217, 22);
this.MoveUpMenuItem.Text = "Move &Up";
this.MoveUpMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click);
//
@ -365,7 +365,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(233, 22);
this.MoveDownMenuItem.Size = new System.Drawing.Size(217, 22);
this.MoveDownMenuItem.Text = "Move &Down";
this.MoveDownMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click);
//
@ -373,21 +373,21 @@
//
this.SelectAllMenuItem.Name = "SelectAllMenuItem";
this.SelectAllMenuItem.ShortcutKeyDisplayString = "Ctrl+A";
this.SelectAllMenuItem.Size = new System.Drawing.Size(233, 22);
this.SelectAllMenuItem.Size = new System.Drawing.Size(217, 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(230, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(214, 6);
//
// ToggleMenuItem
//
this.ToggleMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh1;
this.ToggleMenuItem.Name = "ToggleMenuItem";
this.ToggleMenuItem.ShortcutKeyDisplayString = "Enter";
this.ToggleMenuItem.Size = new System.Drawing.Size(233, 22);
this.ToggleMenuItem.Size = new System.Drawing.Size(217, 22);
this.ToggleMenuItem.Text = "&Toggle";
this.ToggleMenuItem.Click += new System.EventHandler(this.ToggleMenuItem_Click);
//
@ -395,19 +395,19 @@
//
this.DisableAllCheatsMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Stop;
this.DisableAllCheatsMenuItem.Name = "DisableAllCheatsMenuItem";
this.DisableAllCheatsMenuItem.Size = new System.Drawing.Size(233, 22);
this.DisableAllCheatsMenuItem.Size = new System.Drawing.Size(217, 22);
this.DisableAllCheatsMenuItem.Text = "Disable all";
this.DisableAllCheatsMenuItem.Click += new System.EventHandler(this.DisableAllCheatsMenuItem_Click);
//
// GameGenieSeparator
//
this.GameGenieSeparator.Name = "GameGenieSeparator";
this.GameGenieSeparator.Size = new System.Drawing.Size(230, 6);
this.GameGenieSeparator.Size = new System.Drawing.Size(214, 6);
//
// OpenGameGenieEncoderDecoderMenuItem
//
this.OpenGameGenieEncoderDecoderMenuItem.Name = "OpenGameGenieEncoderDecoderMenuItem";
this.OpenGameGenieEncoderDecoderMenuItem.Size = new System.Drawing.Size(233, 22);
this.OpenGameGenieEncoderDecoderMenuItem.Size = new System.Drawing.Size(217, 22);
this.OpenGameGenieEncoderDecoderMenuItem.Text = "Game Genie Encoder/Decoder";
this.OpenGameGenieEncoderDecoderMenuItem.Click += new System.EventHandler(this.OpenGameGenieEncoderDecoderMenuItem_Click);
//
@ -425,73 +425,73 @@
this.toolStripSeparator5,
this.RestoreWindowSizeMenuItem});
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);
//
// AlwaysLoadCheatsMenuItem
//
this.AlwaysLoadCheatsMenuItem.Name = "AlwaysLoadCheatsMenuItem";
this.AlwaysLoadCheatsMenuItem.Size = new System.Drawing.Size(199, 22);
this.AlwaysLoadCheatsMenuItem.Size = new System.Drawing.Size(192, 22);
this.AlwaysLoadCheatsMenuItem.Text = "Always load cheats";
this.AlwaysLoadCheatsMenuItem.Click += new System.EventHandler(this.AlwaysLoadCheatsMenuItem_Click);
//
// AutoSaveCheatsMenuItem
//
this.AutoSaveCheatsMenuItem.Name = "AutoSaveCheatsMenuItem";
this.AutoSaveCheatsMenuItem.Size = new System.Drawing.Size(199, 22);
this.AutoSaveCheatsMenuItem.Size = new System.Drawing.Size(192, 22);
this.AutoSaveCheatsMenuItem.Text = "Autosave cheats";
this.AutoSaveCheatsMenuItem.Click += new System.EventHandler(this.AutoSaveCheatsMenuItem_Click);
//
// DisableCheatsOnLoadMenuItem
//
this.DisableCheatsOnLoadMenuItem.Name = "DisableCheatsOnLoadMenuItem";
this.DisableCheatsOnLoadMenuItem.Size = new System.Drawing.Size(199, 22);
this.DisableCheatsOnLoadMenuItem.Size = new System.Drawing.Size(192, 22);
this.DisableCheatsOnLoadMenuItem.Text = "Disable Cheats on Load";
this.DisableCheatsOnLoadMenuItem.Click += new System.EventHandler(this.CheatsOnOffLoadMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(196, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(189, 6);
//
// AutoloadMenuItem
//
this.AutoloadMenuItem.Name = "AutoloadMenuItem";
this.AutoloadMenuItem.Size = new System.Drawing.Size(199, 22);
this.AutoloadMenuItem.Size = new System.Drawing.Size(192, 22);
this.AutoloadMenuItem.Text = "Autoload";
this.AutoloadMenuItem.Click += new System.EventHandler(this.AutoloadMenuItem_Click);
//
// SaveWindowPositionMenuItem
//
this.SaveWindowPositionMenuItem.Name = "SaveWindowPositionMenuItem";
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(199, 22);
this.SaveWindowPositionMenuItem.Size = new System.Drawing.Size(192, 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(192, 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(192, 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(189, 6);
//
// RestoreWindowSizeMenuItem
//
this.RestoreWindowSizeMenuItem.Name = "RestoreWindowSizeMenuItem";
this.RestoreWindowSizeMenuItem.Size = new System.Drawing.Size(199, 22);
this.RestoreWindowSizeMenuItem.Size = new System.Drawing.Size(192, 22);
this.RestoreWindowSizeMenuItem.Text = "Restore Default Settings";
this.RestoreWindowSizeMenuItem.Click += new System.EventHandler(this.RestoreDefaultsMenuItem_Click);
//
@ -607,7 +607,7 @@
this.LoadGameGenieToolbarItem.Image = ((System.Drawing.Image)(resources.GetObject("LoadGameGenieToolbarItem.Image")));
this.LoadGameGenieToolbarItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.LoadGameGenieToolbarItem.Name = "LoadGameGenieToolbarItem";
this.LoadGameGenieToolbarItem.Size = new System.Drawing.Size(75, 22);
this.LoadGameGenieToolbarItem.Size = new System.Drawing.Size(68, 22);
this.LoadGameGenieToolbarItem.Text = "Game Genie";
this.LoadGameGenieToolbarItem.ToolTipText = "Open the Game Genie Encoder/Decoder";
this.LoadGameGenieToolbarItem.Click += new System.EventHandler(this.OpenGameGenieEncoderDecoderMenuItem_Click);
@ -648,8 +648,8 @@
this.CheatEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.CheatEditor.MemoryDomains = null;
this.CheatEditor.Location = new System.Drawing.Point(6, 14);
this.CheatEditor.MemoryDomains = null;
this.CheatEditor.Name = "CheatEditor";
this.CheatEditor.Size = new System.Drawing.Size(190, 264);
this.CheatEditor.TabIndex = 0;

View File

@ -629,7 +629,6 @@ namespace BizHawk.Client.EmuHawk
private void CheatListView_Click(object sender, EventArgs e)
{
DoSelectedIndexChange();
}
private void CheatListView_DoubleClick(object sender, EventArgs e)

View File

@ -233,6 +233,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoScroll = true;
this.ClientSize = new System.Drawing.Size(1078, 954);
this.Controls.Add(this.label1);
this.Controls.Add(this.groupBox5);

View File

@ -21,6 +21,12 @@ namespace BizHawk.Client.EmuHawk
private LibGPGX.VDPView View = new LibGPGX.VDPView();
int palindex = 0;
protected override System.Drawing.Point ScrollToControl(System.Windows.Forms.Control activeControl)
{
// Returning the current location prevents the panel from scrolling to the active control when the panel loses and regains focus
return this.DisplayRectangle.Location;
}
public GenVDPViewer()
{
InitializeComponent();

View File

@ -220,7 +220,7 @@
this.CopyMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Duplicate;
this.CopyMenuItem.Name = "CopyMenuItem";
this.CopyMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.CopyMenuItem.Size = new System.Drawing.Size(152, 22);
this.CopyMenuItem.Size = new System.Drawing.Size(144, 22);
this.CopyMenuItem.Text = "&Copy";
this.CopyMenuItem.Click += new System.EventHandler(this.CopyMenuItem_Click);
//
@ -228,7 +228,7 @@
//
this.ExportMenuItem.Name = "ExportMenuItem";
this.ExportMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.ExportMenuItem.Size = new System.Drawing.Size(152, 22);
this.ExportMenuItem.Size = new System.Drawing.Size(144, 22);
this.ExportMenuItem.Text = "&Export";
this.ExportMenuItem.Click += new System.EventHandler(this.ExportMenuItem_Click);
//
@ -237,20 +237,20 @@
this.PasteMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Paste;
this.PasteMenuItem.Name = "PasteMenuItem";
this.PasteMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.PasteMenuItem.Size = new System.Drawing.Size(152, 22);
this.PasteMenuItem.Size = new System.Drawing.Size(144, 22);
this.PasteMenuItem.Text = "&Paste";
this.PasteMenuItem.Click += new System.EventHandler(this.PasteMenuItem_Click);
//
// toolStripSeparator6
//
this.toolStripSeparator6.Name = "toolStripSeparator6";
this.toolStripSeparator6.Size = new System.Drawing.Size(149, 6);
this.toolStripSeparator6.Size = new System.Drawing.Size(141, 6);
//
// FindMenuItem
//
this.FindMenuItem.Name = "FindMenuItem";
this.FindMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.FindMenuItem.Size = new System.Drawing.Size(152, 22);
this.FindMenuItem.Size = new System.Drawing.Size(144, 22);
this.FindMenuItem.Text = "&Find...";
this.FindMenuItem.Click += new System.EventHandler(this.FindMenuItem_Click);
//
@ -258,7 +258,7 @@
//
this.FindNextMenuItem.Name = "FindNextMenuItem";
this.FindNextMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F3;
this.FindNextMenuItem.Size = new System.Drawing.Size(152, 22);
this.FindNextMenuItem.Size = new System.Drawing.Size(144, 22);
this.FindNextMenuItem.Text = "Find Next";
this.FindNextMenuItem.Click += new System.EventHandler(this.FindNextMenuItem_Click);
//
@ -266,7 +266,7 @@
//
this.FindPrevMenuItem.Name = "FindPrevMenuItem";
this.FindPrevMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.FindPrevMenuItem.Size = new System.Drawing.Size(152, 22);
this.FindPrevMenuItem.Size = new System.Drawing.Size(144, 22);
this.FindPrevMenuItem.Text = "Find Prev";
this.FindPrevMenuItem.Click += new System.EventHandler(this.FindPrevMenuItem_Click);
//

View File

@ -1901,6 +1901,7 @@ namespace BizHawk.Client.EmuHawk
ClearNibbles();
SetHighlighted(_addressHighlighted + 1);
UpdateValues();
Refresh();
}
break;
@ -1929,6 +1930,7 @@ namespace BizHawk.Client.EmuHawk
ClearNibbles();
SetHighlighted(_addressHighlighted + 2);
UpdateValues();
Refresh();
}
break;
@ -1980,6 +1982,7 @@ namespace BizHawk.Client.EmuHawk
ClearNibbles();
SetHighlighted(_addressHighlighted + 4);
UpdateValues();
Refresh();
}
break;

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethodAttributes(
"borderheight",
"Gets the current height in pixels of the border around the emulator's drawing area"
"Gets the current height in pixels of the letter/pillarbox area (top side only) around the emu display surface, excluding the gameExtraPadding you've set. This function (the whole lot of them) should be renamed or refactored since the padding areas have got more complex."
)]
public static int BorderHeight()
{
@ -57,7 +57,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethodAttributes(
"borderwidth",
"Gets the current width in pixels of the border around the emulator's drawing area"
"Gets the current width in pixels of the letter/pillarbox area (left side only) around the emu display surface, excluding the gameExtraPadding you've set. This function (the whole lot of them) should be renamed or refactored since the padding areas have got more complex."
)]
public static int BorderWidth()
{
@ -67,7 +67,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethodAttributes(
"bufferheight",
"Gets the current height in pixels of the emulator's drawing area"
"Gets the visible height of the emu display surface, excluding the gameExtraPadding you've set. This function (the whole lot of them) should be renamed or refactored since the padding areas have got more complex."
)]
public int BufferHeight()
{
@ -79,7 +79,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethodAttributes(
"bufferwidth",
"Gets the current width in pixels of the emulator's drawing area"
"Gets the visible width of the emu display surface, excluding the gameExtraPadding you've set. This function (the whole lot of them) should be renamed or refactored since the padding areas have got more complex."
)]
public int BufferWidth()
{
@ -161,6 +161,34 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.MainForm.FrameBufferResized();
}
[LuaMethodAttributes(
"SetSoundOn",
"Sets the state of the Sound On toggle"
)]
public static void SetSoundOn(bool enable)
{
Global.Config.SoundEnabled = enable;
}
[LuaMethodAttributes(
"GetSoundOn",
"Gets the state of the Sound On toggle"
)]
public static bool GetSoundOn()
{
return Global.Config.SoundEnabled;
}
[LuaMethodAttributes(
"SetClientExtraPadding",
"Sets the extra padding added to the 'native' surface so that you can draw HUD elements in predictable placements"
)]
public static void SetClientExtraPadding(int left, int top, int right, int bottom)
{
GlobalWin.DisplayManager.ClientExtraPadding = new System.Windows.Forms.Padding(left, top, right, bottom);
GlobalWin.MainForm.FrameBufferResized();
}
[LuaMethodAttributes(
"ispaused",
"Returns true if emulator is paused, otherwise, false"
@ -280,7 +308,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethodAttributes(
"screenheight",
"Gets the current width in pixels of the emulator's drawing area"
"Gets the current height in pixels of the emulator's drawing area"
)]
public static int ScreenHeight()
{
@ -332,7 +360,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethodAttributes(
"screenwidth",
"Gets the current height in pixels of the emulator's drawing area"
"Gets the current width in pixels of the emulator's drawing area"
)]
public static int ScreenWidth()
{

View File

@ -78,11 +78,11 @@ namespace BizHawk.Client.EmuHawk
// Outputs the given object to the output box on the Lua Console dialog. Note: Can accept a LuaTable
private static void LogWithSeparator(string separator, string terminator, params object[] outputs)
{
if(outputs == null)
{
GlobalWin.Tools.LuaConsole.WriteToOutputWindow("NULL");
return;
}
if (outputs == null)
{
GlobalWin.Tools.LuaConsole.WriteToOutputWindow("(no return)" + terminator);
return;
}
for (var outIndex = 0; outIndex < outputs.Length; outIndex++)
{
var output = outputs[outIndex];
@ -94,7 +94,7 @@ namespace BizHawk.Client.EmuHawk
if (output == null)
{
GlobalWin.Tools.LuaConsole.WriteToOutputWindow("NULL");
GlobalWin.Tools.LuaConsole.WriteToOutputWindow("nil");
}
else
{

View File

@ -442,7 +442,7 @@ namespace BizHawk.Client.EmuHawk
[LuaMethodAttributes(
"drawPolygon",
"Draws a polygon using the table of coordinates specified in points. Line is the color of the polygon. Background is the optional fill color"
"Draws a polygon using the table of coordinates specified in points. This should be a table of tables(each of size 2). Line is the color of the polygon. Background is the optional fill color"
)]
public void DrawPolygon(LuaTable points, Color? line = null, Color? background = null)
{

View File

@ -143,16 +143,16 @@ namespace BizHawk.Client.EmuHawk
public Lua SpawnCoroutine(string file)
{
var lua = _lua.NewThread();
var main = lua.LoadString(File.ReadAllText(file), "main");
var main = lua.LoadString(File.ReadAllText(file), "main");
lua.Push(main); // push main function on to stack for subsequent resuming
return lua;
}
public void ExecuteString(string command)
{
_currThread = _lua.NewThread();
_currThread.DoString(command);
}
public void ExecuteString(string command)
{
_currThread = _lua.NewThread();
_currThread.DoString(command);
}
public ResumeResult ResumeScript(Lua script)
{

View File

@ -99,6 +99,7 @@
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()));
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ScriptListContextMenu.SuspendLayout();
this.menuStrip1.SuspendLayout();
@ -122,14 +123,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(158, 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(157, 22);
this.ToggleScriptContextItem.Text = "&Toggle";
this.ToggleScriptContextItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click);
//
@ -137,7 +138,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(157, 22);
this.PauseScriptContextItem.Text = "Pause or Resume";
this.PauseScriptContextItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click);
//
@ -145,7 +146,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(157, 22);
this.EditScriptContextItem.Text = "&Edit";
this.EditScriptContextItem.Click += new System.EventHandler(this.EditScriptMenuItem_Click);
//
@ -153,7 +154,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(157, 22);
this.RemoveScriptContextItem.Text = "&Remove";
this.RemoveScriptContextItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click);
//
@ -161,20 +162,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(157, 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(154, 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(157, 22);
this.StopAllScriptsContextItem.Text = "Stop All Scripts";
this.StopAllScriptsContextItem.Click += new System.EventHandler(this.StopAllScriptsMenuItem_Click);
//
@ -205,7 +206,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);
//
@ -215,7 +216,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(232, 22);
this.NewSessionMenuItem.Text = "&New Session";
this.NewSessionMenuItem.Click += new System.EventHandler(this.NewSessionMenuItem_Click);
//
@ -225,7 +226,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(232, 22);
this.OpenSessionMenuItem.Text = "&Open Session...";
this.OpenSessionMenuItem.Click += new System.EventHandler(this.OpenSessionMenuItem_Click);
//
@ -234,7 +235,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(232, 22);
this.SaveSessionMenuItem.Text = "&Save Session";
this.SaveSessionMenuItem.Click += new System.EventHandler(this.SaveSessionMenuItem_Click);
//
@ -243,21 +244,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(232, 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(229, 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(232, 22);
this.RecentSessionsSubMenu.Text = "Recent Sessions";
this.RecentSessionsSubMenu.DropDownOpened += new System.EventHandler(this.RecentSessionsSubMenu_DropDownOpened);
//
@ -272,7 +273,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(232, 22);
this.RecentScriptsSubMenu.Text = "Recent Scripts";
this.RecentScriptsSubMenu.DropDownOpened += new System.EventHandler(this.RecentScriptsSubMenu_DropDownOpened);
//
@ -284,13 +285,13 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(234, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(229, 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(232, 22);
this.ExitMenuItem.Text = "E&xit";
this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click);
//
@ -314,7 +315,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);
//
@ -323,7 +324,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(212, 22);
this.NewScriptMenuItem.Text = "New Script";
this.NewScriptMenuItem.Click += new System.EventHandler(this.NewScriptMenuItem_Click);
//
@ -332,7 +333,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(212, 22);
this.OpenScriptMenuItem.Text = "&Open Script...";
this.OpenScriptMenuItem.Click += new System.EventHandler(this.OpenScriptMenuItem_Click);
//
@ -341,7 +342,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(212, 22);
this.RefreshScriptMenuItem.Text = "&Re&fresh";
this.RefreshScriptMenuItem.Click += new System.EventHandler(this.RefreshScriptMenuItem_Click);
//
@ -350,7 +351,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(212, 22);
this.ToggleScriptMenuItem.Text = "&Toggle";
this.ToggleScriptMenuItem.Click += new System.EventHandler(this.ToggleScriptMenuItem_Click);
//
@ -358,7 +359,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(212, 22);
this.PauseScriptMenuItem.Text = "Pause or Resume";
this.PauseScriptMenuItem.Click += new System.EventHandler(this.PauseScriptMenuItem_Click);
//
@ -367,7 +368,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(212, 22);
this.EditScriptMenuItem.Text = "&Edit Script";
this.EditScriptMenuItem.Click += new System.EventHandler(this.EditScriptMenuItem_Click);
//
@ -376,28 +377,28 @@
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(212, 22);
this.RemoveScriptMenuItem.Text = "&Remove Script";
this.RemoveScriptMenuItem.Click += new System.EventHandler(this.RemoveScriptMenuItem_Click);
//
// DuplicateScriptMenuItem
//
this.DuplicateScriptMenuItem.Name = "DuplicateScriptMenuItem";
this.DuplicateScriptMenuItem.Size = new System.Drawing.Size(218, 22);
this.DuplicateScriptMenuItem.Size = new System.Drawing.Size(212, 22);
this.DuplicateScriptMenuItem.Text = "&Duplicate Script";
this.DuplicateScriptMenuItem.Click += new System.EventHandler(this.DuplicateScriptMenuItem_Click);
//
// toolStripSeparator7
//
this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(215, 6);
this.toolStripSeparator7.Size = new System.Drawing.Size(209, 6);
//
// InsertSeparatorMenuItem
//
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(212, 22);
this.InsertSeparatorMenuItem.Text = "Insert Separator";
this.InsertSeparatorMenuItem.Click += new System.EventHandler(this.InsertSeparatorMenuItem_Click);
//
@ -406,7 +407,7 @@
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(212, 22);
this.MoveUpMenuItem.Text = "Move &Up";
this.MoveUpMenuItem.Click += new System.EventHandler(this.MoveUpMenuItem_Click);
//
@ -415,7 +416,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(212, 22);
this.MoveDownMenuItem.Text = "Move &Down";
this.MoveDownMenuItem.Click += new System.EventHandler(this.MoveDownMenuItem_Click);
//
@ -423,20 +424,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(212, 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(209, 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(212, 22);
this.StopAllScriptsMenuItem.Text = "Stop All Scripts";
this.StopAllScriptsMenuItem.Click += new System.EventHandler(this.StopAllScriptsMenuItem_Click);
//
@ -444,7 +445,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(212, 22);
this.RegisteredFunctionsMenuItem.Text = "&Registered Functions...";
this.RegisteredFunctionsMenuItem.Click += new System.EventHandler(this.RegisteredFunctionsMenuItem_Click);
//
@ -453,14 +454,14 @@
this.SettingsSubMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.DisableScriptsOnLoadMenuItem});
this.SettingsSubMenu.Name = "SettingsSubMenu";
this.SettingsSubMenu.Size = new System.Drawing.Size(61, 20);
this.SettingsSubMenu.Size = new System.Drawing.Size(58, 20);
this.SettingsSubMenu.Text = "&Settings";
this.SettingsSubMenu.DropDownOpened += new System.EventHandler(this.OptionsSubMenu_DropDownOpened);
//
// DisableScriptsOnLoadMenuItem
//
this.DisableScriptsOnLoadMenuItem.Name = "DisableScriptsOnLoadMenuItem";
this.DisableScriptsOnLoadMenuItem.Size = new System.Drawing.Size(196, 22);
this.DisableScriptsOnLoadMenuItem.Size = new System.Drawing.Size(184, 22);
this.DisableScriptsOnLoadMenuItem.Text = "Disable Scripts on Load";
this.DisableScriptsOnLoadMenuItem.Click += new System.EventHandler(this.DisableScriptsOnLoadMenuItem_Click);
//
@ -470,21 +471,21 @@
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.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.FunctionsListMenuItem.Size = new System.Drawing.Size(202, 22);
this.FunctionsListMenuItem.Size = new System.Drawing.Size(189, 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(189, 22);
this.OnlineDocsMenuItem.Text = "Documentation online...";
this.OnlineDocsMenuItem.Click += new System.EventHandler(this.OnlineDocsMenuItem_Click);
//
@ -509,20 +510,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(176, 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(175, 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(175, 22);
this.RegisteredFunctionsContextItem.Text = "&Registered Functions";
this.RegisteredFunctionsContextItem.Click += new System.EventHandler(this.RegisteredFunctionsMenuItem_Click);
//
@ -730,7 +731,6 @@
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.LuaListView.BlazingFast = false;
this.LuaListView.CheckBoxes = true;
this.LuaListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.Script,
this.PathName});
@ -744,6 +744,7 @@
this.LuaListView.SelectAllInProgress = false;
this.LuaListView.selectedItem = -1;
this.LuaListView.Size = new System.Drawing.Size(273, 271);
this.LuaListView.SmallImageList = this.imageList1;
this.LuaListView.TabIndex = 0;
this.LuaListView.UseCompatibleStateImageBehavior = false;
this.LuaListView.UseCustomBackground = true;
@ -762,6 +763,14 @@
this.PathName.Text = "Path";
this.PathName.Width = 195;
//
// imageList1
//
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
this.imageList1.Images.SetKeyName(0, "StopButton.png");
this.imageList1.Images.SetKeyName(1, "PlayButton.png");
this.imageList1.Images.SetKeyName(2, "Pause.png");
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
@ -888,6 +897,7 @@
private System.Windows.Forms.ToolStripButton DuplicateToolbarButton;
private System.Windows.Forms.ToolStripMenuItem DuplicateScriptMenuItem;
private System.Windows.Forms.TextBox InputBox;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ImageList imageList1;
}
}

View File

@ -54,6 +54,8 @@ namespace BizHawk.Client.EmuHawk
LuaListView.QueryItemText += LuaListView_QueryItemText;
LuaListView.QueryItemBkColor += LuaListView_QueryItemBkColor;
LuaListView.QueryItemImage += LuaListView_QueryItemImage;
LuaListView.QueryItemIndent += LuaListView_QueryItemIndent;
LuaListView.VirtualMode = true;
LuaSandbox.SetLogger(this.ConsoleLog);
@ -137,10 +139,10 @@ namespace BizHawk.Client.EmuHawk
LuaSandbox.Sandbox(() =>
{
file.Thread = LuaImp.SpawnCoroutine(file.Path);
file.Enabled = true;
file.State = LuaFile.RunState.Running;
}, () =>
{
file.Enabled = false;
file.State = LuaFile.RunState.Disabled;
});
}
catch (Exception ex)
@ -172,10 +174,10 @@ namespace BizHawk.Client.EmuHawk
LuaSandbox.Sandbox(() =>
{
luaFile.Thread = LuaImp.SpawnCoroutine(processedPath);
luaFile.Enabled = true;
luaFile.State = LuaFile.RunState.Running;
}, () =>
{
luaFile.Enabled = false;
luaFile.State = LuaFile.RunState.Disabled;
});
}
catch (Exception e)
@ -185,10 +187,10 @@ namespace BizHawk.Client.EmuHawk
}
else
{
luaFile.Enabled = false;
luaFile.State = LuaFile.RunState.Disabled;
}
luaFile.Paused = false;
//luaFile.Paused = false;
}
else
{
@ -225,7 +227,7 @@ namespace BizHawk.Client.EmuHawk
file.Thread = LuaImp.SpawnCoroutine(file.Path);
}, () =>
{
file.Enabled = false;
file.State = LuaFile.RunState.Disabled;
});
}
catch (Exception e)
@ -247,6 +249,21 @@ namespace BizHawk.Client.EmuHawk
Path.GetFileName(_luaList.Filename);
}
private void LuaListView_QueryItemImage(int item, int subItem, out int imageIndex)
{
imageIndex = -1;
if (subItem != 0) return;
if (_luaList[item].Paused) imageIndex = 2;
else if (_luaList[item].Enabled) imageIndex = 1;
else imageIndex = 0;
}
void LuaListView_QueryItemIndent(int item, out int itemIndent)
{
itemIndent = 0;
}
private void LuaListView_QueryItemBkColor(int index, int column, ref Color color)
{
if (column == 0)
@ -261,7 +278,7 @@ namespace BizHawk.Client.EmuHawk
}
else if (_luaList[index].Enabled && _luaList[index].Paused)
{
color = Color.IndianRed;
color = Color.LightPink;
}
}
@ -271,7 +288,6 @@ namespace BizHawk.Client.EmuHawk
private void LuaListView_QueryItemText(int index, int column, out string text)
{
text = string.Empty;
if (column == 0)
{
text = Path.GetFileNameWithoutExtension(_luaList[index].Path); // TODO: how about allow the user to name scripts?
@ -439,7 +455,7 @@ namespace BizHawk.Client.EmuHawk
}
}, () =>
{
lf.Enabled = false;
lf.State = LuaFile.RunState.Disabled;
lf.Thread = null;
});
}
@ -731,7 +747,7 @@ namespace BizHawk.Client.EmuHawk
item.Thread = LuaImp.SpawnCoroutine(item.Path);
}, () =>
{
item.Enabled = false;
item.State = LuaFile.RunState.Disabled;
});
}
@ -763,6 +779,8 @@ namespace BizHawk.Client.EmuHawk
}
UpdateDialog();
UpdateNumberOfScripts();
LuaListView.Refresh();
}
private void PauseScriptMenuItem_Click(object sender, EventArgs e)

View File

@ -133,17 +133,89 @@
<data name="OpenScriptToolbarItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJQSURBVDhPlZNdSNNRGMb/F110ZZEVhVBgeeHNICiiuggp
olAUyyxI0oSaH1QYC3N+tKnp5ubm1JUua5uuqdPKMgr7kApFItTUkWZqVhSVYmao5Nev/xyoQ4k88Nyc
8z6/93nP4QjCfy6lwc4ltZVso4P/tMyXRcmMHqZ0EeY6jZQVInzuf0e1Tb9Ina3P/tkpLD6XkNg8BJe5
u93C+HDVrP4M2ZkcMOOw5tLZ9nxJyJE4HSExBoKkBQhVpTrGhso9zNPfiph0JlB+U01ZcRbmwnRMeWlc
08opUCV6QissGsZ+WOY6z4hmuuXglC6pRYBbJSp+fzXNxnaZ66o1s3rkyKHWruJuWRYOcwZ2kxKr8TI3
DCkU6+QYNUnuNGWmLEY+5uOK3degoKZcx3SfEvozPfVB3OtNhi4ZvI2nrTIc23U9gtmYwa8eNXzScq8i
l6bHWnfRwhHeREJzGFONgYw/CeB9qQSZNNR9FyUGBT87lfQ3plJj1zLTq4COGDegLVo0HmeqKZjx+gOM
PNzDYPU2lLF+4jhyN6BIl8pgexK3bRpaXopJuhJEwGloiWDmVSgTLw4xWreXoZrtfK/wp/nKak4E+s6/
hDFHTkd9GndsOdCTBq1i3NdHmWgIYvRpAMO1OxlwSPhi2YpT641CuoWzsSfnAfnZiVRZ1Tjvx9GsF+bU
pF1BvWolD9JXUZmyDnOiD1cvbCZiYXfXCPrMi+gVZ8hOiiL53DHORwdzKnw/hw/uYt9uCTskfvj7+rBp
41rWr/Fig7fX8j/Tsn/fcgx/ARfG3ml6M3rzAAAAAElFTkSuQmCC
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
</value>
</data>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>489, 17</value>
</metadata>
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
<value>
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6
DgAAAk1TRnQBSQFMAgEBAwEAASABAAEgAQABEAEAARABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAFA
AwABEAMAAQEBAAEgBgABECoAAo8BmAHlAbIBtAHSAf8BuwG+AdcB/wKQAZkB5zAAAY8BmAGQAeUBsgHS
AbYB/wG7AdcBvgH/AZABmQGRAecwAAGYAZMBjwHlAdIBvgGyAf8B1wHFAbsB/wGZAZIBkAHnaAABbwF0
AaAB9QE5AUABlwH/AQUBEAGHAf8BBgEQAYcB/wEEAQ8BhwH/AQsBFQGIAf8BDgEYAYkB/wFmAWoBoQH5
IAABbwGgAXsB9QE5AZcBRQH/AQUBhwEUAf8BBgGHARUB/wEEAYcBEgH/AQsBiAEZAf8BDgGJARwB/wFm
AaEBagH5IAABoAGFAW8B9QGXAVsBOQH/AYcBMwEFAf8BhwE0AQYB/wGHATIBBAH/AYgBNwELAf8BiQE6
AQ4B/wGhAXoBZgH5XAABNAE8AZgB/wExATkBmAH/AbABsgHLAf8B2gHbAdoB/wLRAdUB/wHLAcwB0gH/
AcQBxwHOAf8BWAFeAaUB/wFKAVEBjgH5ASkBMgGPAf8YAAEmAZIBMgH/ATEBmAE9Af8BsAHLAbMB/wHb
AtoB/wHRAdUB0gH/AcsB0gHLAf8BxQHOAcQB/wFYAaUBYQH/AUoBjgFSAfkBKQGPATQB/xgAAZIBTAEm
Af8BmAFWATEB/wHLAboBsAH/AtoB2wH/AdUB0wHRAf8B0gHNAcsB/wHOAcYBxAH/AaUBcwFYAf8BjgFo
AUoB+QGPAUwBKQH/VAABPQFAAZMB/QKMAZMB4wL+Af0B/wH+Af0B9QH/AvcB8wH/Ae8C7gH/Au0B6wH/
AdkC2wH/AeMB5AHiAf8CwAHMAf8BdwF6AY0B7QFGAUwBkAH7EAABPQGTAUAB/QGMAZMBjAHjAf8B/gL/
Af4B9QH9Af8B9wHzAfYB/wLuAe8B/wHtAesB7QH/AtsB2QH/AeQB4gHjAf8BwAHMAcIB/wF3AY0BegHt
AUYBkAFQAfsQAAGTAVMBPQH9AZMBjQGMAeMB/gP/AfUB+wH+Af8B8wH1AfcB/wHuAe8B7gH/AesB7AHt
Af8B2wHZAdoB/wLiAeQB/wHMAcUBwAH/AY0BgAF3Ae0BkAFfAUYB+0wAAXIBewGeAfMBiwGMAZ0B6wX/
Af4B/Rf/Af4B/wHwAe8B8AH/Ac8B0AHWAf8BbgFxAYkB7QF2AXsBlAHvCAABcgGeAXwB8wGLAZ0BjgHr
Bf8B/Qb/AeMB8AHjAf8BnAHNAZwK/wH+Av8B7wLwAf8BzwHWAc8B/wFuAYkBcgHtAXYBlAF7Ae8IAAGe
AYQBcgHzAZ0BkQGLAesE/wH9F/8B/gP/AuMB4AH/Ac8ByQHHAf8BiQF5AW4B7QGUAYMBdgHvSAACagGp
AfkD/iX/AfAB8gHwAf8CxgHNAf8CRwGKAfkIAAFqAakBawH5EP8B3AHtAdwB/wERAXkBEQH/AYMBwQGD
Df8B8gHxAfAB/wHHAc4ByAH/AUcBigFNAfkIAAGpAYQBagH5DP8B4QHNAb4B/wG+AZIBjQH/AfcB8QHv
Af8B+wH4AfcB/wHBAZgBjwH/AeoB2gHRBf8B5QHiAeYB/wHOAcoBxwH/AYoBYgFHAflEAAGGAYkBrQHz
Ao4BpQHtCP8C9QH7Af8BbQFpAdQB/wGhAZ8B5wH/AaMBoQHmAf8BogGhAeUB/wGUAZEB4QH/AZ4BnAHm
Bf8B+QH4AfcB/wHnAeQB3gH/AWABZgGRAfUBWgFfAZwB+wGGAa0BjAHzAY4BpgGSAe0Q/wHkAfEB5AH/
AQEBdQEBAf8BEQF7AREB/wGcAc4BnAn/AfkB9wH5Af8B5gHeAecB/wFgAZEBbAH1AVoBnAFfAfsBrQGV
AYYB8wGmAZcBjgHtDP8BrgF2AVQB/wFZAgAB/wH4AfUB8gH/AfoB9wH1Af8BWQIAAf8BswF7AVoF/wHx
AfQB9QH/Ad4B5gHnAf8BkQFxAWAB9QGcAW0BWgH7QAABggGIAcoB/wHQAdIB7Qn/AvUB+gH/ATsBOAG7
Af8BZwFkAd4B/wFkAWAB2AH/AV8BWwHTAf8BUwFOAdEB/wGiAaEB6QX/AvkB+AH/AfwB+wHqAf8BowGm
Ab4B/wFDAUoBoAH/AYIBygGKAf8B0AHtAdQR/wHiAfAB4gH/AQIBdgECAf8BAAF2AQAB/wERAYQBEQH/
AZgBzAGYBf8B+QH4AfkB/wH8AeoB+gH/AaMBvgGlAf8BQwGgAU4B/wHKAZwBggH/Ae0B2wHQDf8BugGM
AWoB/wGNASIBAAL/Av4B/wP+Af8BjQEhAQAB/wG7AYkBaAX/AfIB9AH1Af8B6gH1AfwB/wG+AawBowH/
AaABZAFDAf9AAAF0AXoBwgH/AeUB5gH0Cf8C9wH7Af8BSgFHAcMB/wF1AXMB4wH/AXABbQHdAf8BawFo
AdgB/wFfAVoB0wH/AasBqQHqBf8D+QH/Af4B+wHvAf8BtAG2AcUB/wFBAUkBnwH/AXQBwgGBAf8B5QH0
AecR/wHiAfAB4gH/AQEBeAEBAf8BAAF6AQAB/wEAAXIBAAH/AREBhAERAf8B+gH8AfoB/wP5Af8B/gHv
Af4B/wG0AcUBtgH/AUEBnwFMAf8BwgGTAXQB/wH0AesB5Q3/AbkBjAFrAf8BpwE4AQsB/wH7AfkB+AH/
AfsB+gH5Af8BpwE4AQsB/wG9AYwBawX/A/QB/wHvAfoB/gH/AcUBugG0Af8BnwFiAUEB/0AAAXABdwG9
Af8C2gHvCf8C9wH7Af8BTgFLAccB/wF7AXkB6gH/AXYBdQHjAf8BcwFxAd8B/wFmAWMB2gH/Aa0BqwHr
Bf8C+gH4Af8B/QH8Ae4B/wGdAaABuwH/AUkBUQGjAf8BcAG9AXgB/wHaAe8B3hH/AeIB8AHiAf8BAgF4
AQIB/wEAAXABAAH/ASwBjgEsAf8B4gHwAeIF/wH6AfgB+gH/Af0B7gH7Af8BnQG7AaEB/wFJAaMBUgH/
Ab0BjgFwAf8B7wHjAdoN/wG3AYgBZgH/AcQBRwEkAf8C/QH8Af8B/AH6AfkB/wHGAUoBJgH/AcIBjwFw
Bf8B8gH1AfcB/wHuAfcB/QH/AbsBqAGdAf8BowFoAUkB/0AAAYcBjAGkAe8BlAGVAbIB8Qj/AvYB+wH/
AUsBRwHFAf8BegF5AesB/wF2AXUB5AH/AXQBcQHhAf8BZAFhAdsB/wGpAacB6wX/AvsB+QH/AfsB/AHu
Af8BSAFOAZQB+wGCAYMBnwHvAYcBpAGMAe8BlAGyAZkB8RD/AeIB8AHiAf8BAAFuAQAB/wEoAYcBKAH/
AecB8wHnCf8B+wH5AfsB/wH8Ae4B+QH/AUgBlAFSAfsBggGfAYYB7wGkAZIBhwHvAbIBoAGUAfEM/wHB
AZcBegH/AaQBPgEWAf8B/QH7AfoB/wH8AfoB+QH/AZMBOQEPAf8BzAGpAZQF/wH0AfcB+QH/Ae4B9QH8
Af8BlAFfAUgB+wGfAYwBggHvRAABewGBAc8J/wLzAfkB/wFJAUYBuQH/AYcBhgHWAf8BhwGFAdUB/wGH
AYUB1QH/AWUBYgHIAf8BbQFsAcwG/wH+AfwB/wLOAdcB/wE5AUEBmAH/CAABewHPAY0R/wHTAegB0wH/
ASQBhwEkAf8B4gHwAeIN/wH+AfwC/wHOAdcB0AH/ATkBmAFDAf8IAAHPAaEBeyn/AfsD/wHXAdIBzgH/
AZgBWgE5Af9IAAGMAY0BwgH5AqABvAHxJP8B/AH7AfYB/wE3AT8BlgH/AYoBiwGbAekIAAGMAcIBkAH5
AaABvAGmAfEM/wH6AfwB+gH/Ae8B9gHvEf8B/AH2AfwB/wE3AZYBQQH/AYoBmwGKAekIAAHCAZ4BjAH5
AbwBrQGgAfEk/wH1AfoB/AH/AZYBWAE3Af8BmwGRAYoB6UwAAYMBiQHMAf0CnAGpAekc/wHyAfUB+AH/
AV4BaAGTAfUBcQF4AaMB9RAAAYMBzAGOAf0BnAGqAZ0B6Rz/AfQB+AHyAf8BXgGTAWgB9QFxAaMBfwH1
EAABzAGjAYMB/QGqAaMBnAHpHP8B+ALyAf8BkwFvAV4B9QGjAYYBcQH1VAABhgGMAcgB+wGVAZcBzgH5
AtMB9wH/AfEB8AH7Af8B9gH3Av8B9wH4Af0B/wHkAecB8wH/AYMBhgGiAe8BfwGBAaEB8wGPAZABogHr
GAABhgHIAZAB+wGVAc4BoQH5AdMB9wHaAf8B8AH7AfMB/wH2Af8B9wH/AfcB/QH4Af8B5AHzAeQB/wGD
AaIBhgHvAX8BoQGCAfMBjwGiAZAB6xgAAcgBmwGGAfsBzgGwAZUB+QH3AeMB0wH/AfsB9gHwAv8B+QH2
Af8B/QH5AfcB/wHzAegB5AH/AaIBjwGDAe8BoQGMAX8B8wGiAZcBjwHrXAACmAGrAesBjQGTAdcB/wGO
AZQB3QH/AY8BlQHgAf8BjQGUAdsB/wGaAZ8B2gH/AZIBkwGeAeckAAGYAasBmgHrAY0B1wGWAf8BjgHd
AZgB/wGPAeABmQH/AY0B2wGWAf8BmgHaAaIB/wGSAZ4BlQHnJAABqwGhAZgB6wHXAagBjQH/Ad0BrAGO
Af8B4AGtAY8B/wHbAakBjQH/AdoBsgGaAf8BngGYAZIB51QAAUIBTQE+BwABPgMAASgDAAFAAwABEAMA
AQEBAAEBBQABgBcAA/8BAAH8AT8B/AE/AfwBPwIAAfABDwHwAQ8B8AEPAgAB4AEHAeABBwHgAQcCAAHA
AQMBwAEDAcABAwIAAYABAQGAAQEBgAEBAgABgAEBAYABAQGAAQEqAAGAAQEBgAEBAYABAQIAAYABAQGA
AQEBgAEBAgABwAEDAcABAwHAAQMCAAHgAQcB4AEHAeABBwIAAfABHwHwAR8B8AEfAgAL
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

View File

@ -2143,10 +2143,9 @@
// pnDetailsPaletteColor
//
this.pnDetailsPaletteColor.BackColor = System.Drawing.Color.Red;
this.pnDetailsPaletteColor.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.pnDetailsPaletteColor.Location = new System.Drawing.Point(3, 4);
this.pnDetailsPaletteColor.Location = new System.Drawing.Point(6, 6);
this.pnDetailsPaletteColor.Name = "pnDetailsPaletteColor";
this.pnDetailsPaletteColor.Size = new System.Drawing.Size(69, 68);
this.pnDetailsPaletteColor.Size = new System.Drawing.Size(64, 64);
this.pnDetailsPaletteColor.TabIndex = 3;
this.pnDetailsPaletteColor.DoubleClick += new System.EventHandler(this.pnDetailsPaletteColor_DoubleClick);
//

View File

@ -978,10 +978,13 @@ namespace BizHawk.Client.EmuHawk
{
//view a BG tile
int paletteStart = 0;
var bmp = new Bitmap(8, 8, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
var bmpdata = bmp.LockBits(new Rectangle(0, 0, 8, 8), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
var bgs = currMapEntryState;
var oneTileEntry = new SNESGraphicsDecoder.TileEntry[] { bgs.entry };
int tileSize = si.BG[bgs.bgnum].TileSize;
int pixels = tileSize * tileSize;
var bmp = new Bitmap(tileSize, tileSize, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
var bmpdata = bmp.LockBits(new Rectangle(0, 0, tileSize, tileSize), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
if (viewBgMode == SNESGraphicsDecoder.BGMode.Mode7)
gd.RenderMode7TilesToScreen((int*)bmpdata.Scan0, bmpdata.Stride / 4, false, false, 1, currMapEntryState.entry.tilenum, 1);
@ -991,9 +994,9 @@ namespace BizHawk.Client.EmuHawk
gd.RenderMode7TilesToScreen((int*)bmpdata.Scan0, bmpdata.Stride / 4, false, true, 1, currMapEntryState.entry.tilenum, 1);
else
{
gd.DecodeBG((int*)bmpdata.Scan0, bmpdata.Stride / 4, oneTileEntry, si.BG[bgs.bgnum].TiledataAddr, SNESGraphicsDecoder.ScreenSize.Hacky_1x1, si.BG[bgs.bgnum].Bpp, 8, paletteStart);
gd.Paletteize((int*)bmpdata.Scan0, 0, 0, 64);
gd.Colorize((int*)bmpdata.Scan0, 0, 64);
gd.DecodeBG((int*)bmpdata.Scan0, bmpdata.Stride / 4, oneTileEntry, si.BG[bgs.bgnum].TiledataAddr, SNESGraphicsDecoder.ScreenSize.Hacky_1x1, si.BG[bgs.bgnum].Bpp, tileSize, paletteStart);
gd.Paletteize((int*)bmpdata.Scan0, 0, 0, pixels);
gd.Colorize((int*)bmpdata.Scan0, 0, pixels);
}
bmp.UnlockBits(bmpdata);
@ -1160,7 +1163,10 @@ namespace BizHawk.Client.EmuHawk
if (bg.TileSize == 16) { tx /= 2; ty /= 2; } //worry about this later. need to pass a different flag into `currViewingTile`
int tloc = ty * bg.ScreenSizeInTiles.Width + tx;
if (tloc > map.Length) break;
if (tx >= bg.ScreenSizeInTiles.Width) break;
if (ty >= bg.ScreenSizeInTiles.Height) break;
if (tx < 0) break;
if (ty < 0) break;
currMapEntryState = new MapEntryState();
currMapEntryState.bgnum = (int)CurrDisplaySelection;

View File

@ -71,8 +71,6 @@ namespace BizHawk.Client.EmuHawk
}
}
private int CurrentBranch = -1;
private void QueryItemText(int index, InputRoll.RollColumn column, out string text, ref int offsetX, ref int offsetY)
{
text = string.Empty;
@ -102,7 +100,7 @@ namespace BizHawk.Client.EmuHawk
if (branch != null)
{
var record = Tastudio.CurrentTasMovie[branch.Frame];
if (index == CurrentBranch)
if (index == Movie.CurrentBranch)
color = TAStudio.CurrentFrame_InputLog; // SystemColors.HotTrack;
else if (record.Lagged.HasValue)
{
@ -147,9 +145,9 @@ namespace BizHawk.Client.EmuHawk
if (SelectedBranch != null)
{
int index = BranchView.SelectedRows.First();
//if (CurrentBranch == index) // if the current branch was edited, we should allow loading it. some day there might be a proper check
//if (Movie.CurrentBranch == index) // if the current branch was edited, we should allow loading it. some day there might be a proper check
// return;
CurrentBranch = index;
Movie.CurrentBranch = index;
LoadBranch(SelectedBranch);
BranchView.Refresh();
}
@ -168,13 +166,13 @@ namespace BizHawk.Client.EmuHawk
if (SelectedBranch != null)
{
int index = BranchView.SelectedRows.First();
if (index == CurrentBranch)
if (index == Movie.CurrentBranch)
{
CurrentBranch = -1;
Movie.CurrentBranch = -1;
}
else if (index < CurrentBranch)
else if (index < Movie.CurrentBranch)
{
CurrentBranch--;
Movie.CurrentBranch--;
}
Movie.RemoveBranch(SelectedBranch);
@ -220,7 +218,7 @@ namespace BizHawk.Client.EmuHawk
TasBranch branch = CreateBranch();
Movie.AddBranch(branch);
BranchView.RowCount = Movie.BranchCount;
CurrentBranch = Movie.BranchCount - 1;
Movie.CurrentBranch = Movie.BranchCount - 1;
BranchView.Refresh();
Tastudio.RefreshDialog();
}
@ -302,7 +300,7 @@ namespace BizHawk.Client.EmuHawk
if (SelectedBranch != null)
{
UpdateBranch(SelectedBranch);
CurrentBranch = BranchView.SelectedRows.First();
Movie.CurrentBranch = BranchView.SelectedRows.First();
}
}

View File

@ -39,14 +39,15 @@ namespace BizHawk.Client.EmuHawk
if (AutoadjustInputMenuItem.Checked)
refreshNeeded = AutoAdjustInput();
if (TasView.RowCount != CurrentTasMovie.InputLogLength + 1)
TasView.RowCount = CurrentTasMovie.InputLogLength + 1;
MaybeFollowCursor();
if (TasView.IsPartiallyVisible(Global.Emulator.Frame) || TasView.IsPartiallyVisible(lastRefresh))
refreshNeeded = true;
RefreshDialog(refreshNeeded);
if (!refreshNeeded && TasView.RowCount != CurrentTasMovie.InputLogLength + 1) // Perhaps not the best place to put this.
TasView.RowCount = CurrentTasMovie.InputLogLength + 1;
}
public void FastUpdate()

View File

@ -189,7 +189,7 @@ namespace BizHawk.Client.EmuHawk
}
else if (record.Lagged.HasValue)
{
if (!CurrentTasMovie.TasStateManager.HasState(index) && TasView.denoteStatesWithBGColor)
if (!record.HasState && TasView.denoteStatesWithBGColor)
color = record.Lagged.Value ?
LagZone_InputLog :
GreenZone_InputLog;
@ -200,9 +200,14 @@ namespace BizHawk.Client.EmuHawk
}
else if (record.WasLagged.HasValue)
{
color = record.WasLagged.Value ?
LagZone_InputLog_Invalidated :
GreenZone_InputLog_Invalidated;
if (!record.HasState && TasView.denoteStatesWithBGColor)
color = record.WasLagged.Value ?
LagZone_InputLog_Invalidated :
GreenZone_InputLog_Invalidated;
else
color = record.WasLagged.Value ?
LagZone_InputLog_Stated :
GreenZone_InputLog_Stated;
}
else
{
@ -579,6 +584,8 @@ namespace BizHawk.Client.EmuHawk
if (TasView.RightButtonHeld && TasView.CurrentCell.RowIndex.HasValue)
{
_supressContextMenu = true;
int notch = e.Delta / 120;
if (GlobalWin.MainForm.IsSeeking)
{
if (e.Delta < 0)
@ -595,10 +602,7 @@ namespace BizHawk.Client.EmuHawk
}
else
{
if (e.Delta < 0)
GoToNextFrame();
else
GoToPreviousFrame();
GoToFrame(Emulator.Frame - notch);
}
}
}

View File

@ -58,7 +58,7 @@ namespace BizHawk.Client.EmuHawk
DrawInput = true;
AutoPause = true;
FollowCursor = true;
ScrollSpeed = 1;
ScrollSpeed = 3;
FollowCursorAlwaysScroll = false;
FollowCursorScrollMethod = "near";
// default to taseditor fashion
@ -237,6 +237,9 @@ namespace BizHawk.Client.EmuHawk
BranchesMarkersSplit.SplitterDistance = Settings.BranchMarkerSplitDistance;
}
GoToFrame(CurrentTasMovie.Session.CurrentFrame);
CurrentTasMovie.CurrentBranch = CurrentTasMovie.Session.CurrentBranch;
////////////////
RefreshDialog();

View File

@ -610,6 +610,11 @@ namespace BizHawk.Client.EmuHawk
tool.FastUpdate();
}
}
if (Global.Config.RunLuaDuringTurbo && Has<LuaConsole>())
{
LuaConsole.EndLuaDrawing();
}
}
public bool IsAvailable<T>()

View File

@ -28,214 +28,214 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RamPoke));
this.label1 = new System.Windows.Forms.Label();
this.OK = new System.Windows.Forms.Button();
this.Cancel = new System.Windows.Forms.Button();
this.OutputLabel = new System.Windows.Forms.Label();
this.ValeLabel = new System.Windows.Forms.Label();
this.ValueBox = new BizHawk.Client.EmuHawk.WatchValueBox();
this.ValueHexLabel = new System.Windows.Forms.Label();
this.DisplayTypeLabel = new System.Windows.Forms.Label();
this.SizeLabel = new System.Windows.Forms.Label();
this.BigEndianLabel = new System.Windows.Forms.Label();
this.AddressBox = new BizHawk.Client.EmuHawk.HexTextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.DomainLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(20, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(62, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Address: 0x";
//
// OK
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OK.Location = new System.Drawing.Point(12, 169);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(65, 23);
this.OK.TabIndex = 35;
this.OK.Text = "&Poke";
this.OK.UseVisualStyleBackColor = true;
this.OK.Click += new System.EventHandler(this.Ok_Click);
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(136, 169);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(65, 23);
this.Cancel.TabIndex = 40;
this.Cancel.Text = "&Close";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// OutputLabel
//
this.OutputLabel.AutoSize = true;
this.OutputLabel.Location = new System.Drawing.Point(12, 7);
this.OutputLabel.Name = "OutputLabel";
this.OutputLabel.Size = new System.Drawing.Size(129, 13);
this.OutputLabel.TabIndex = 9;
this.OutputLabel.Text = "Enter an address to poke:";
//
// ValeLabel
//
this.ValeLabel.AutoSize = true;
this.ValeLabel.Location = new System.Drawing.Point(31, 59);
this.ValeLabel.Name = "ValeLabel";
this.ValeLabel.Size = new System.Drawing.Size(37, 13);
this.ValeLabel.TabIndex = 10;
this.ValeLabel.Text = "Value:";
//
// ValueBox
//
this.ValueBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte;
this.ValueBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.ValueBox.Location = new System.Drawing.Point(82, 57);
this.ValueBox.MaxLength = 2;
this.ValueBox.Name = "ValueBox";
this.ValueBox.Nullable = false;
this.ValueBox.Size = new System.Drawing.Size(116, 20);
this.ValueBox.TabIndex = 10;
this.ValueBox.Text = "00";
this.ValueBox.Type = BizHawk.Client.Common.Watch.DisplayType.Hex;
//
// ValueHexLabel
//
this.ValueHexLabel.AutoSize = true;
this.ValueHexLabel.Location = new System.Drawing.Point(64, 60);
this.ValueHexLabel.Name = "ValueHexLabel";
this.ValueHexLabel.Size = new System.Drawing.Size(18, 13);
this.ValueHexLabel.TabIndex = 11;
this.ValueHexLabel.Text = "0x";
//
// DisplayTypeLabel
//
this.DisplayTypeLabel.AutoSize = true;
this.DisplayTypeLabel.Location = new System.Drawing.Point(81, 118);
this.DisplayTypeLabel.Name = "DisplayTypeLabel";
this.DisplayTypeLabel.Size = new System.Drawing.Size(52, 13);
this.DisplayTypeLabel.TabIndex = 24;
this.DisplayTypeLabel.Text = "Unsigned";
//
// SizeLabel
//
this.SizeLabel.AutoSize = true;
this.SizeLabel.Location = new System.Drawing.Point(82, 101);
this.SizeLabel.Name = "SizeLabel";
this.SizeLabel.Size = new System.Drawing.Size(28, 13);
this.SizeLabel.TabIndex = 23;
this.SizeLabel.Text = "Byte";
//
// BigEndianLabel
//
this.BigEndianLabel.AutoSize = true;
this.BigEndianLabel.Location = new System.Drawing.Point(82, 135);
this.BigEndianLabel.Name = "BigEndianLabel";
this.BigEndianLabel.Size = new System.Drawing.Size(58, 13);
this.BigEndianLabel.TabIndex = 41;
this.BigEndianLabel.Text = "Big Endian";
//
// AddressBox
//
this.AddressBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.AddressBox.Enabled = false;
this.AddressBox.Location = new System.Drawing.Point(82, 30);
this.AddressBox.MaxLength = 8;
this.AddressBox.Name = "AddressBox";
this.AddressBox.Nullable = false;
this.AddressBox.Size = new System.Drawing.Size(116, 20);
this.AddressBox.TabIndex = 5;
this.AddressBox.Text = "0000";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(39, 135);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(43, 13);
this.label2.TabIndex = 44;
this.label2.Text = "Endian:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(11, 118);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(71, 13);
this.label3.TabIndex = 43;
this.label3.Text = "Display Type:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(52, 101);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(30, 13);
this.label4.TabIndex = 42;
this.label4.Text = "Size:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(36, 84);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(46, 13);
this.label5.TabIndex = 46;
this.label5.Text = "Domain:";
//
// DomainLabel
//
this.DomainLabel.AutoSize = true;
this.DomainLabel.Location = new System.Drawing.Point(82, 84);
this.DomainLabel.Name = "DomainLabel";
this.DomainLabel.Size = new System.Drawing.Size(70, 13);
this.DomainLabel.TabIndex = 45;
this.DomainLabel.Text = "Main Memory";
//
// RamPoke
//
this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(213, 208);
this.Controls.Add(this.label5);
this.Controls.Add(this.DomainLabel);
this.Controls.Add(this.label2);
this.Controls.Add(this.label3);
this.Controls.Add(this.label4);
this.Controls.Add(this.BigEndianLabel);
this.Controls.Add(this.DisplayTypeLabel);
this.Controls.Add(this.SizeLabel);
this.Controls.Add(this.ValueHexLabel);
this.Controls.Add(this.ValueBox);
this.Controls.Add(this.ValeLabel);
this.Controls.Add(this.OutputLabel);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.OK);
this.Controls.Add(this.AddressBox);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "RamPoke";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Ram Poke";
this.Load += new System.EventHandler(this.RamPoke_Load);
this.ResumeLayout(false);
this.PerformLayout();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RamPoke));
this.label1 = new System.Windows.Forms.Label();
this.OK = new System.Windows.Forms.Button();
this.Cancel = new System.Windows.Forms.Button();
this.OutputLabel = new System.Windows.Forms.Label();
this.ValeLabel = new System.Windows.Forms.Label();
this.ValueBox = new BizHawk.Client.EmuHawk.WatchValueBox();
this.ValueHexLabel = new System.Windows.Forms.Label();
this.DisplayTypeLabel = new System.Windows.Forms.Label();
this.SizeLabel = new System.Windows.Forms.Label();
this.BigEndianLabel = new System.Windows.Forms.Label();
this.AddressBox = new BizHawk.Client.EmuHawk.HexTextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.DomainLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(20, 33);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(62, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Address: 0x";
//
// OK
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.OK.Location = new System.Drawing.Point(12, 169);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(65, 23);
this.OK.TabIndex = 35;
this.OK.Text = "&Poke";
this.OK.UseVisualStyleBackColor = true;
this.OK.Click += new System.EventHandler(this.Ok_Click);
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(136, 169);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(65, 23);
this.Cancel.TabIndex = 40;
this.Cancel.Text = "&Close";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// OutputLabel
//
this.OutputLabel.AutoSize = true;
this.OutputLabel.Location = new System.Drawing.Point(12, 7);
this.OutputLabel.Name = "OutputLabel";
this.OutputLabel.Size = new System.Drawing.Size(129, 13);
this.OutputLabel.TabIndex = 9;
this.OutputLabel.Text = "Enter an address to poke:";
//
// ValeLabel
//
this.ValeLabel.AutoSize = true;
this.ValeLabel.Location = new System.Drawing.Point(31, 59);
this.ValeLabel.Name = "ValeLabel";
this.ValeLabel.Size = new System.Drawing.Size(37, 13);
this.ValeLabel.TabIndex = 10;
this.ValeLabel.Text = "Value:";
//
// ValueBox
//
this.ValueBox.ByteSize = BizHawk.Client.Common.Watch.WatchSize.Byte;
this.ValueBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.ValueBox.Location = new System.Drawing.Point(82, 57);
this.ValueBox.MaxLength = 2;
this.ValueBox.Name = "ValueBox";
this.ValueBox.Nullable = false;
this.ValueBox.Size = new System.Drawing.Size(116, 20);
this.ValueBox.TabIndex = 10;
this.ValueBox.Text = "00";
this.ValueBox.Type = BizHawk.Client.Common.Watch.DisplayType.Hex;
//
// ValueHexLabel
//
this.ValueHexLabel.AutoSize = true;
this.ValueHexLabel.Location = new System.Drawing.Point(64, 60);
this.ValueHexLabel.Name = "ValueHexLabel";
this.ValueHexLabel.Size = new System.Drawing.Size(18, 13);
this.ValueHexLabel.TabIndex = 11;
this.ValueHexLabel.Text = "0x";
//
// DisplayTypeLabel
//
this.DisplayTypeLabel.AutoSize = true;
this.DisplayTypeLabel.Location = new System.Drawing.Point(81, 118);
this.DisplayTypeLabel.Name = "DisplayTypeLabel";
this.DisplayTypeLabel.Size = new System.Drawing.Size(52, 13);
this.DisplayTypeLabel.TabIndex = 24;
this.DisplayTypeLabel.Text = "Unsigned";
//
// SizeLabel
//
this.SizeLabel.AutoSize = true;
this.SizeLabel.Location = new System.Drawing.Point(82, 101);
this.SizeLabel.Name = "SizeLabel";
this.SizeLabel.Size = new System.Drawing.Size(28, 13);
this.SizeLabel.TabIndex = 23;
this.SizeLabel.Text = "Byte";
//
// BigEndianLabel
//
this.BigEndianLabel.AutoSize = true;
this.BigEndianLabel.Location = new System.Drawing.Point(82, 135);
this.BigEndianLabel.Name = "BigEndianLabel";
this.BigEndianLabel.Size = new System.Drawing.Size(58, 13);
this.BigEndianLabel.TabIndex = 41;
this.BigEndianLabel.Text = "Big Endian";
//
// AddressBox
//
this.AddressBox.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
this.AddressBox.Enabled = false;
this.AddressBox.Location = new System.Drawing.Point(82, 30);
this.AddressBox.MaxLength = 8;
this.AddressBox.Name = "AddressBox";
this.AddressBox.Nullable = false;
this.AddressBox.Size = new System.Drawing.Size(116, 20);
this.AddressBox.TabIndex = 5;
this.AddressBox.Text = "0000";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(39, 135);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(43, 13);
this.label2.TabIndex = 44;
this.label2.Text = "Endian:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(11, 118);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(71, 13);
this.label3.TabIndex = 43;
this.label3.Text = "Display Type:";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(52, 101);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(30, 13);
this.label4.TabIndex = 42;
this.label4.Text = "Size:";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(36, 84);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(46, 13);
this.label5.TabIndex = 46;
this.label5.Text = "Domain:";
//
// DomainLabel
//
this.DomainLabel.AutoSize = true;
this.DomainLabel.Location = new System.Drawing.Point(82, 84);
this.DomainLabel.Name = "DomainLabel";
this.DomainLabel.Size = new System.Drawing.Size(70, 13);
this.DomainLabel.TabIndex = 45;
this.DomainLabel.Text = "Main Memory";
//
// RamPoke
//
this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(213, 208);
this.Controls.Add(this.label5);
this.Controls.Add(this.DomainLabel);
this.Controls.Add(this.label2);
this.Controls.Add(this.label3);
this.Controls.Add(this.label4);
this.Controls.Add(this.BigEndianLabel);
this.Controls.Add(this.DisplayTypeLabel);
this.Controls.Add(this.SizeLabel);
this.Controls.Add(this.ValueHexLabel);
this.Controls.Add(this.ValueBox);
this.Controls.Add(this.ValeLabel);
this.Controls.Add(this.OutputLabel);
this.Controls.Add(this.Cancel);
this.Controls.Add(this.OK);
this.Controls.Add(this.AddressBox);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "RamPoke";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Ram Poke";
this.Load += new System.EventHandler(this.RamPoke_Load);
this.ResumeLayout(false);
this.PerformLayout();
}

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,7 @@
this.WatchCountLabel = new System.Windows.Forms.Label();
this.MemDomainLabel = new System.Windows.Forms.Label();
this.ListViewContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.EditContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RemoveContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.DuplicateContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -144,6 +145,7 @@
// ListViewContextMenu
//
this.ListViewContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.EditContextMenuItem,
this.RemoveContextMenuItem,
this.DuplicateContextMenuItem,
@ -159,9 +161,17 @@
this.MoveUpContextMenuItem,
this.MoveDownContextMenuItem});
this.ListViewContextMenu.Name = "contextMenuStrip1";
this.ListViewContextMenu.Size = new System.Drawing.Size(191, 280);
this.ListViewContextMenu.Size = new System.Drawing.Size(191, 324);
this.ListViewContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.ListViewContextMenu_Opening);
//
// newToolStripMenuItem
//
this.newToolStripMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.addWatch;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(190, 22);
this.newToolStripMenuItem.Text = "&New Watch";
this.newToolStripMenuItem.Click += new System.EventHandler(this.NewWatchMenuItem_Click);
//
// EditContextMenuItem
//
this.EditContextMenuItem.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.CutHS;
@ -1041,5 +1051,6 @@
private System.Windows.Forms.ToolStripSeparator Separator4;
private System.Windows.Forms.ToolStripMenuItem ReadBreakpointContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem WriteBreakpointContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
}
}

View File

@ -1086,6 +1086,8 @@ namespace BizHawk.Client.EmuHawk
UnfreezeAllContextMenuItem.Visible = Global.CheatList.ActiveCount > 0;
ViewInHexEditorContextMenuItem.Visible = SelectedWatches.Count() == 1;
newToolStripMenuItem.Visible = indexes.Count == 0;
}
private void UnfreezeAllContextMenuItem_Click(object sender, EventArgs e)
@ -1213,5 +1215,6 @@ namespace BizHawk.Client.EmuHawk
SelectedIndices.Any() &&
SelectedWatches.All(w => w.Domain.CanPoke());
}
}
}

View File

@ -9,6 +9,7 @@ using System.Drawing;
using BizHawk.Emulation.Common;
using BizHawk.Client.Common;
using BizHawk.Client.EmuHawk;
using BizHawk.Client.EmuHawk.FilterManager;
using BizHawk.Bizware.BizwareGL;

View File

@ -9,6 +9,7 @@ using System.Windows.Forms;
using BizHawk.Common;
using BizHawk.Common.BufferExtensions;
using BizHawk.Client.EmuHawk;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Client.Common;
using BizHawk.Emulation.Common;

View File

@ -13,6 +13,7 @@ using System.Windows.Forms;
using BizHawk.Common;
using BizHawk.Common.IOExtensions;
using BizHawk.Client.EmuHawk;
using BizHawk.Bizware.BizwareGL;
using BizHawk.Emulation.Common;
using BizHawk.Emulation.Common.IEmulatorExtensions;
@ -32,7 +33,7 @@ namespace BizHawk.Client.MultiHawk
public Mainform(string[] args)
{
BizHawk.Client.Common.GLManager.CreateInstance();
GLManager.CreateInstance();
InitializeComponent();
_throttle = new BizHawk.Client.EmuHawk.Throttle();
@ -319,7 +320,7 @@ namespace BizHawk.Client.MultiHawk
Emulator = loader.LoadedEmulator,
GL = new Bizware.BizwareGL.Drivers.OpenTK.IGL_TK(),
GLManager = BizHawk.Client.Common.GLManager.Instance,
GLManager = GLManager.Instance,
Game = loader.Game,
CurrentRomPath = loader.CanonicalFullPath
};

View File

@ -63,6 +63,7 @@
<Compile Include="Extensions\ReflectionExtensions.cs" />
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="HawkFile.cs" />
<Compile Include="InstanceDll.cs" />
<Compile Include="IPC\IPCRingBuffer.cs" />
<Compile Include="IPC\SharedMemoryBlock.cs" />
<Compile Include="Log.cs" />

View File

@ -25,6 +25,7 @@ namespace BizHawk.Common.IOExtensions
}
// Read bytes from a BinaryReader and translate them into the UTF-8 string they represent.
//WHAT? WHY IS THIS NAMED ASCII BUT USING UTF8
public static string ReadStringFixedAscii(this BinaryReader r, int bytes)
{
var read = new byte[bytes];

View File

@ -0,0 +1,47 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace BizHawk.Common
{
public class InstanceDll : IDisposable
{
public InstanceDll(string dllPath)
{
//copy the dll to a temp directory
var path = Path.Combine(Path.GetTempPath(), "instancedll-pid" + System.Diagnostics.Process.GetCurrentProcess().Id + "-" + Guid.NewGuid()) + "-" + Path.GetFileName(dllPath);
using (var stream = new FileStream(path, FileMode.Create, System.Security.AccessControl.FileSystemRights.FullControl, FileShare.ReadWrite | FileShare.Delete, 4 * 1024, FileOptions.None))
using (var sdll = File.OpenRead(dllPath))
sdll.CopyTo(stream);
_hModule = LoadLibrary(path);
var newfname = Path.GetFileName(path);
newfname = "bizhawk.bizdelete-" + newfname;
var newpath = Path.Combine(Path.GetDirectoryName(path), newfname);
File.Move(path, newpath);
}
[DllImport("kernel32.dll")]
static extern IntPtr LoadLibrary(string dllToLoad);
[DllImport("kernel32.dll")]
static extern IntPtr GetProcAddress(IntPtr hModule, string procedureName);
[DllImport("kernel32.dll")]
static extern bool FreeLibrary(IntPtr hModule);
public IntPtr GetProcAddress(string procName)
{
return GetProcAddress(_hModule, procName);
}
public void Dispose()
{
if (_hModule != IntPtr.Zero)
{
FreeLibrary(_hModule);
_hModule = IntPtr.Zero;
}
}
IntPtr _hModule;
}
}

View File

@ -217,6 +217,11 @@ namespace BizHawk.Emulation.Common
private MemoryDomain _mainMemory;
private MemoryDomain _systemBus;
public bool Has(string name)
{
return this.FirstOrDefault((md) => md.Name == name) != null;
}
public MemoryDomainList(IList<MemoryDomain> domains)
: base(domains)
{

View File

@ -64,6 +64,7 @@
<Compile Include="Base Implementations\NullSound.cs" />
<Compile Include="Base Implementations\TraceBuffer.cs" />
<Compile Include="BinaryQuickSerializer.cs" />
<Compile Include="CodeDataLog.cs" />
<Compile Include="CoreAttributes.cs" />
<Compile Include="CoreComms.cs" />
<Compile Include="Database\CRC32.cs" />
@ -73,6 +74,7 @@
<Compile Include="EmulationExceptions.cs" />
<Compile Include="Enums.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="Interfaces\ICodeDataLogger.cs" />
<Compile Include="Interfaces\IController.cs" />
<Compile Include="Interfaces\ICoreFileProvider.cs" />
<Compile Include="Interfaces\IDebuggable.cs" />

View File

@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Common
{
public class CodeDataLog : Dictionary<string, byte[]>
{
public CodeDataLog()
{
}
/// <summary>
/// This is just a hook, if needed, to readily suspend logging, without having to rewire the core
/// </summary>
public bool Active = true;
public string SubType;
public int SubVer;
/// <summary>
/// Tests whether the other CodeDataLog is structurally identical
/// </summary>
public bool Check(CodeDataLog other)
{
if (SubType != other.SubType)
return false;
if (SubVer != other.SubVer)
return false;
if (this.Count != other.Count)
return false;
foreach (var kvp in this)
{
if (!other.ContainsKey(kvp.Key))
return false;
var oval = other[kvp.Key];
if (oval.Length != kvp.Value.Length)
return false;
}
return true;
}
public void LogicalOrFrom(CodeDataLog other)
{
if (this.Count != other.Count)
throw new InvalidDataException("Dictionaries must have the same number of keys!");
foreach (var kvp in other)
{
byte[] fromdata = kvp.Value;
byte[] todata = this[kvp.Key];
if (fromdata.Length != todata.Length)
throw new InvalidDataException("Memory regions must be the same size!");
for (int i = 0; i < todata.Length; i++)
todata[i] |= fromdata[i];
}
}
public void ClearData()
{
foreach (byte[] data in Values)
Array.Clear(data, 0, data.Length);
}
public void Save(Stream s)
{
_Save(s, true);
}
Dictionary<string, long> _Save(Stream s, bool forReal)
{
var ret = new Dictionary<string, long>();
var w = new BinaryWriter(s);
w.Write("BIZHAWK-CDL-2");
w.Write(SubType.PadRight(15));
w.Write(Count);
w.Flush();
long addr = s.Position;
if (forReal)
{
foreach (var kvp in this)
{
w.Write(kvp.Key);
w.Write(kvp.Value.Length);
w.Write(kvp.Value);
}
}
else
{
foreach (var kvp in this)
{
addr += kvp.Key.Length + 1; //assumes shortly-encoded key names
addr += 4;
ret[kvp.Key] = addr;
addr += kvp.Value.Length;
}
}
w.Flush();
return ret;
}
public Dictionary<string, long> GetBlockMap()
{
return _Save(new MemoryStream(), false);
}
public void Load(Stream s)
{
var br = new BinaryReader(s);
string id = br.ReadString();
if (id == "BIZHAWK-CDL-1")
SubType = "PCE";
else if (id == "BIZHAWK-CDL-2")
SubType = br.ReadString().TrimEnd(' ');
else
throw new InvalidDataException("File is not a Bizhawk CDL file!");
int count = br.ReadInt32();
for (int i = 0; i < count; i++)
{
string key = br.ReadString();
int len = br.ReadInt32();
byte[] data = br.ReadBytes(len);
this[key] = data;
}
}
}
}

View File

@ -78,6 +78,31 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
return (IInputPollable)core.ServiceProvider.GetService<IInputPollable>();
}
public static bool InputCallbacksAvailable(this IEmulator core)
{
if (core == null)
{
return false;
}
// TODO: this is a pretty ugly way to handle this
var pollable = (IInputPollable)core.ServiceProvider.GetService<IInputPollable>();
if (pollable != null)
{
try
{
var callbacks = pollable.InputCallbacks;
return true;
}
catch (NotImplementedException)
{
return false;
}
}
return false;
}
public static bool HasDriveLight(this IEmulator core)
{
if (core == null)
@ -215,6 +240,21 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
return (IRegionable)core.ServiceProvider.GetService<IRegionable>();
}
public static bool CanCDLog(this IEmulator core)
{
if (core == null)
{
return false;
}
return core.ServiceProvider.HasService<ICodeDataLogger>();
}
public static ICodeDataLogger AsCodeDataLogger(this IEmulator core)
{
return core.ServiceProvider.GetService<ICodeDataLogger>();
}
// TODO: a better place for these
public static bool IsImplemented(this MethodInfo info)
{

View File

@ -0,0 +1,23 @@
using System.IO;
namespace BizHawk.Emulation.Common
{
public interface ICodeDataLogger : IEmulatorService
{
/// <summary>
/// Sets the CodeDataLog as current (and logging) on the core
/// </summary>
void SetCDL(CodeDataLog cdl);
/// <summary>
/// Fills a new CodeDataLog with memory domain information suitable for the core
/// </summary>
void NewCDL(CodeDataLog cdl);
/// <summary>
/// Disassembles the CodeDataLog to an output Stream. Can't be done without a core because there's no code to disassemble otherwise!
/// This could be extended later to produce richer multi-file disassembly
/// </summary>
void DisassembleCDL(Stream s, CodeDataLog cdl);
}
}

View File

@ -18,5 +18,7 @@ namespace BizHawk.Emulation.Common
bool HasSystemBus { get; }
MemoryDomain SystemBus { get; set; }
bool Has(string name);
}
}

View File

@ -347,6 +347,9 @@
<Compile Include="Consoles\Intellivision\PSG.cs" />
<Compile Include="Consoles\Intellivision\STIC.cs" />
<Compile Include="Consoles\Nintendo\Gameboy\Gambatte.cs" />
<Compile Include="Consoles\Nintendo\Gameboy\Gambatte.ICodeDataLog.cs">
<DependentUpon>Gambatte.cs</DependentUpon>
</Compile>
<Compile Include="Consoles\Nintendo\Gameboy\Gambatte.IDebuggable.cs">
<DependentUpon>Gambatte.cs</DependentUpon>
</Compile>
@ -787,6 +790,7 @@
<Compile Include="Consoles\Sega\Saturn\Yabause.IStatable.cs">
<DependentUpon>Yabause.cs</DependentUpon>
</Compile>
<Compile Include="Consoles\Sega\SMS\CDL_SMS.cs" />
<Compile Include="Consoles\Sega\SMS\SMS.Input.cs" />
<Compile Include="Consoles\Sega\SMS\TerebiOekaki.cs" />
<Compile Include="Consoles\Sega\SMS\MemoryMap.Korea.cs" />
@ -824,6 +828,7 @@
<Compile Include="CoreInventory.cs" />
<Compile Include="CPUs\CP1610\CP1610.Disassembler.cs" />
<Compile Include="CPUs\CP1610\CP1610.Execute.cs" />
<Compile Include="CPUs\HuC6280\HuC6280_CDL.cs" />
<Compile Include="CPUs\W65816\Disassembler.cs" />
<Compile Include="CPUs\68000\Diassembler.cs" />
<Compile Include="CPUs\68000\Instructions\BitArithemetic.cs" />
@ -837,7 +842,6 @@
<Compile Include="CPUs\68000\Tables.cs" />
<Compile Include="CPUs\ARM\Darm.cs" />
<Compile Include="CPUs\CP1610\CP1610.cs" />
<Compile Include="CPUs\HuC6280\CDL.cs" />
<Compile Include="CPUs\HuC6280\CDLOpcodes.cs" />
<Compile Include="CPUs\HuC6280\Disassembler.cs" />
<Compile Include="CPUs\HuC6280\Execute.cs" />

View File

@ -1,288 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Components.H6280
{
public class CodeDataLog : Dictionary<string, byte[]>
{
private CodeDataLog()
:base()
{
}
public void LogicalOrFrom(CodeDataLog other)
{
if (this.Count != other.Count)
throw new InvalidDataException("Dictionaries must have the same number of keys!");
foreach (var kvp in other)
{
byte[] fromdata = kvp.Value;
byte[] todata = this[kvp.Key];
if (fromdata.Length != todata.Length)
throw new InvalidDataException("Memory regions must be the same size!");
for (int i = 0; i < todata.Length; i++)
todata[i] |= fromdata[i];
}
}
public void ClearData()
{
foreach (byte[] data in Values)
Array.Clear(data, 0, data.Length);
}
public void Save(Stream s)
{
var w = new BinaryWriter(s);
w.Write("BIZHAWK-CDL-1");
w.Write(Count);
foreach (var kvp in this)
{
w.Write(kvp.Key);
w.Write(kvp.Value.Length);
w.Write(kvp.Value);
}
w.Flush();
}
public void Disassemble(Stream s, IMemoryDomains mem)
{
var w = new StreamWriter(s);
w.WriteLine("; Bizhawk CDL Disassembly");
w.WriteLine();
foreach (var kvp in this)
{
w.WriteLine(".\"{0}\" size=0x{1:x8}", kvp.Key, kvp.Value.Length);
byte[] cd = kvp.Value;
var md = mem[kvp.Key];
for (int i = 0; i < kvp.Value.Length; i++)
{
if ((kvp.Value[i] & (byte)HuC6280.CDLUsage.Code) != 0)
{
int unused;
string dis = HuC6280.DisassembleExt(
0,
out unused,
delegate(ushort addr)
{
return md.PeekByte(addr + i);
},
delegate(ushort addr)
{
return md.PeekWord(addr + i, false);
}
);
w.WriteLine("0x{0:x8}: {1}", i, dis);
}
}
w.WriteLine();
}
w.WriteLine("; EOF");
w.Flush();
}
public static CodeDataLog Load(Stream s)
{
var t = new CodeDataLog();
var r = new BinaryReader(s);
string id = r.ReadString();
if (id != "BIZHAWK-CDL-1")
throw new InvalidDataException("File is not a Bizhawk CDL file!");
int count = r.ReadInt32();
for (int i = 0; i < count; i++)
{
string key = r.ReadString();
int len = r.ReadInt32();
byte[] data = r.ReadBytes(len);
t[key] = data;
}
return t;
}
public bool CheckConsistency(IEnumerable<HuC6280.MemMapping> mm)
{
var sizes = SizesFromHuMap(mm);
if (sizes.Count != Count)
return false;
foreach (var kvp in sizes)
{
if (!ContainsKey(kvp.Key))
return false;
if (this[kvp.Key].Length != kvp.Value)
return false;
}
return true;
}
private static Dictionary<string, int> SizesFromHuMap(IEnumerable<HuC6280.MemMapping> mm)
{
Dictionary<string, int> sizes = new Dictionary<string, int>();
foreach (var m in mm)
{
if (!sizes.ContainsKey(m.Name) || m.MaxOffs >= sizes[m.Name])
sizes[m.Name] = m.MaxOffs;
}
List<string> keys = new List<string>(sizes.Keys);
foreach (var key in keys)
{
// becase we were looking at offsets, and each bank is 8192 big, we need to add that size
sizes[key] += 8192;
}
return sizes;
}
public static CodeDataLog Create(IEnumerable<HuC6280.MemMapping> mm)
{
var t = new CodeDataLog();
foreach (var kvp in SizesFromHuMap(mm))
{
t[kvp.Key] = new byte[kvp.Value];
}
return t;
}
}
public partial class HuC6280
{
public struct MemMapping
{
public string Name;
public int Offs;
public int VOffs; // if non-zero, specifies a larger potential offset
public int MaxOffs { get { return Math.Max(Offs, VOffs); } }
}
public MemMapping[] Mappings; // = new MemMapping[256];
public CodeDataLog CDL = null;
public bool CDLLoggingActive = false;
[Flags]
public enum CDLUsage : byte
{
// was fetched as an opcode first byte
Code = 0x01,
// was read or written as data
Data = 0x02,
// was read and used as a pointer to data via indirect addressing
DataPtr = 0x04,
// was read or written as stack
Stack = 0x08,
// was read or written as data via indirect addressing
IndirectData = 0x10,
// was read and used as function pointer
// NB: there is no "IndirectCode"; all code is marked simply as code regardless of how it is reached
FcnPtr = 0x20,
// was used as a source or destination (either initial or during the loop) of a block xfer
BlockXFer = 0x40,
// was fetched as an operand byte to an opcode
CodeOperand = 0x80
}
void Mark(ushort addr, CDLUsage flag)
{
var m = Mappings[MPR[addr >> 13]];
CDL[m.Name][addr & 0x1fff | m.Offs] |= (byte)flag;
}
// mark addr as having been fetched for execute
void MarkCode(int addr_, int n)
{
for (int i = 0; i < n; i++)
{
ushort addr = (ushort)(addr_ + i);
Mark(addr, i == 0 ? CDLUsage.Code : CDLUsage.CodeOperand);
}
}
// mark addr as having been seen as data
void MarkAddr(int addr_)
{
ushort addr = (ushort)addr_;
Mark(addr, CDLUsage.Data);
}
// convert address to zero-page, then mark as data
void MarkZP(int addr_)
{
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
Mark(addr, CDLUsage.Data);
}
// convert address to zero-page, then return the pointer stored there
ushort GetIndirect(int addr_)
{
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
return ReadWordPageWrap(addr);
}
// convert address to zero-page, then mark as pointer (two bytes)
void MarkZPPtr(int addr_)
{
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
ushort addr2 = (ushort)(addr & 0xff00 | (addr + 1) & 0x00ff);
Mark(addr, CDLUsage.DataPtr);
Mark(addr2, CDLUsage.DataPtr);
}
// mark address as destination data of an indirect pointer
void MarkIndirect(int addr_)
{
ushort addr = (ushort)addr_;
Mark(addr, CDLUsage.IndirectData);
}
// mark stack space
void MarkPush(int n)
{
for (int i = 0; i < n; i++)
{
ushort addr = (ushort)(S - i);
Mark(addr, CDLUsage.Stack);
}
}
void MarkPop(int n)
{
for (int i = 0; i < n; i++)
{
ushort addr = (ushort)(S + i + 1);
Mark(addr, CDLUsage.Stack);
}
}
// mark addr as function pointer (2 bytes)
void MarkFptr(int addr_)
{
ushort addr = (ushort)addr_;
ushort addr2 = (ushort)(addr & 0xff00 | (addr + 1) & 0x00ff);
Mark(addr, CDLUsage.FcnPtr);
Mark(addr2, CDLUsage.FcnPtr);
}
// block transfer "from"
void MarkBTFrom(int addr_)
{
ushort addr = (ushort)addr_;
Mark(addr, CDLUsage.BlockXFer);
}
// block transfer "to"
void MarkBTTo(int addr_)
{
ushort addr = (ushort)addr_;
Mark(addr, CDLUsage.BlockXFer);
}
}
}

View File

@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
if (Debug) Logger(State());
MemoryCallbacks.CallExecutes(PC);
if (CDLLoggingActive) CDLOpcode();
if (CDL != null && CDL.Active) CDLOpcode();
byte opcode = ReadMemory(PC++);
switch (opcode)

View File

@ -0,0 +1,200 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Components.H6280
{
public partial class HuC6280
{
public void DisassembleCDL(Stream s, CodeDataLog cdl, IMemoryDomains mem)
{
var w = new StreamWriter(s);
w.WriteLine("; Bizhawk CDL Disassembly");
w.WriteLine();
foreach (var kvp in cdl)
{
w.WriteLine(".\"{0}\" size=0x{1:x8}", kvp.Key, kvp.Value.Length);
byte[] cd = kvp.Value;
var md = mem[kvp.Key];
for (int i = 0; i < kvp.Value.Length; i++)
{
if ((kvp.Value[i] & (byte)HuC6280.CDLUsage.Code) != 0)
{
int unused;
string dis = HuC6280.DisassembleExt(
0,
out unused,
delegate(ushort addr)
{
return md.PeekByte(addr + i);
},
delegate(ushort addr)
{
return md.PeekWord(addr + i, false);
}
);
w.WriteLine("0x{0:x8}: {1}", i, dis);
}
}
w.WriteLine();
}
w.WriteLine("; EOF");
w.Flush();
}
private static Dictionary<string, int> SizesFromHuMap(IEnumerable<HuC6280.MemMapping> mm)
{
Dictionary<string, int> sizes = new Dictionary<string, int>();
foreach (var m in mm)
{
if (!sizes.ContainsKey(m.Name) || m.MaxOffs >= sizes[m.Name])
sizes[m.Name] = m.MaxOffs;
}
List<string> keys = new List<string>(sizes.Keys);
foreach (var key in keys)
{
// becase we were looking at offsets, and each bank is 8192 big, we need to add that size
sizes[key] += 8192;
}
return sizes;
}
}
public partial class HuC6280
{
public struct MemMapping
{
public string Name;
public int Offs;
public int VOffs; // if non-zero, specifies a larger potential offset
public int MaxOffs { get { return Math.Max(Offs, VOffs); } }
}
public MemMapping[] Mappings; // = new MemMapping[256];
public CodeDataLog CDL = null;
[Flags]
public enum CDLUsage : byte
{
// was fetched as an opcode first byte
Code = 0x01,
// was read or written as data
Data = 0x02,
// was read and used as a pointer to data via indirect addressing
DataPtr = 0x04,
// was read or written as stack
Stack = 0x08,
// was read or written as data via indirect addressing
IndirectData = 0x10,
// was read and used as function pointer
// NB: there is no "IndirectCode"; all code is marked simply as code regardless of how it is reached
FcnPtr = 0x20,
// was used as a source or destination (either initial or during the loop) of a block xfer
BlockXFer = 0x40,
// was fetched as an operand byte to an opcode
CodeOperand = 0x80
}
void Mark(ushort addr, CDLUsage flag)
{
var m = Mappings[MPR[addr >> 13]];
CDL[m.Name][addr & 0x1fff | m.Offs] |= (byte)flag;
}
// mark addr as having been fetched for execute
void MarkCode(int addr_, int n)
{
for (int i = 0; i < n; i++)
{
ushort addr = (ushort)(addr_ + i);
Mark(addr, i == 0 ? CDLUsage.Code : CDLUsage.CodeOperand);
}
}
// mark addr as having been seen as data
void MarkAddr(int addr_)
{
ushort addr = (ushort)addr_;
Mark(addr, CDLUsage.Data);
}
// convert address to zero-page, then mark as data
void MarkZP(int addr_)
{
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
Mark(addr, CDLUsage.Data);
}
// convert address to zero-page, then return the pointer stored there
ushort GetIndirect(int addr_)
{
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
return ReadWordPageWrap(addr);
}
// convert address to zero-page, then mark as pointer (two bytes)
void MarkZPPtr(int addr_)
{
ushort addr = (ushort)(addr_ & 0xff | 0x2000);
ushort addr2 = (ushort)(addr & 0xff00 | (addr + 1) & 0x00ff);
Mark(addr, CDLUsage.DataPtr);
Mark(addr2, CDLUsage.DataPtr);
}
// mark address as destination data of an indirect pointer
void MarkIndirect(int addr_)
{
ushort addr = (ushort)addr_;
Mark(addr, CDLUsage.IndirectData);
}
// mark stack space
void MarkPush(int n)
{
for (int i = 0; i < n; i++)
{
ushort addr = (ushort)(S - i);
Mark(addr, CDLUsage.Stack);
}
}
void MarkPop(int n)
{
for (int i = 0; i < n; i++)
{
ushort addr = (ushort)(S + i + 1);
Mark(addr, CDLUsage.Stack);
}
}
// mark addr as function pointer (2 bytes)
void MarkFptr(int addr_)
{
ushort addr = (ushort)addr_;
ushort addr2 = (ushort)(addr & 0xff00 | (addr + 1) & 0x00ff);
Mark(addr, CDLUsage.FcnPtr);
Mark(addr2, CDLUsage.FcnPtr);
}
// block transfer "from"
void MarkBTFrom(int addr_)
{
ushort addr = (ushort)addr_;
Mark(addr, CDLUsage.BlockXFer);
}
// block transfer "to"
void MarkBTTo(int addr_)
{
ushort addr = (ushort)addr_;
Mark(addr, CDLUsage.BlockXFer);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,7 @@ namespace BizHawk.Emulation.Cores.Components.Z80
// Memory Access
public Func<ushort, bool, byte> FetchMemory;
public Func<ushort, byte> ReadMemory;
public Action<ushort, byte> WriteMemory;
@ -48,6 +49,26 @@ namespace BizHawk.Emulation.Cores.Components.Z80
return ReadMemory(addr);
}
public byte FetchFirstMemoryWrapper(ushort addr)
{
if (MemoryCallbacks != null)
{
MemoryCallbacks.CallReads(addr);
}
return FetchMemory(addr, true);
}
public byte FetchMemoryWrapper(ushort addr)
{
if (MemoryCallbacks != null)
{
MemoryCallbacks.CallReads(addr);
}
return FetchMemory(addr, false);
}
public void WriteMemoryWrapper(ushort addr, byte value)
{
if (MemoryCallbacks != null)

View File

@ -0,0 +1,56 @@
using System;
using System.IO;
using System.Collections.Generic;
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
{
partial class Gameboy
{
void ICodeDataLogger.SetCDL(CodeDataLog cdl)
{
CDL = cdl;
if(cdl == null)
LibGambatte.gambatte_setcdcallback(GambatteState, null);
else
LibGambatte.gambatte_setcdcallback(GambatteState, CDCallback);
}
void ICodeDataLogger.NewCDL(CodeDataLog cdl)
{
cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];
//cdl["HRAM"] = new byte[_memoryDomains["HRAM"].Size]; //this is probably useless, but it's here if someone needs it
cdl["WRAM"] = new byte[MemoryDomains["WRAM"].Size];
if (MemoryDomains.Has("CartRAM"))
cdl["CartRAM"] = new byte[MemoryDomains["WRAM"].Size];
cdl.SubType = "GB";
cdl.SubVer = 0;
}
//not supported
void ICodeDataLogger.DisassembleCDL(Stream s, CodeDataLog cdl) { }
CodeDataLog CDL;
LibGambatte.CDCallback CDCallback;
void CDCallbackProc(int addr, LibGambatte.CDLog_AddrType addrtype, LibGambatte.CDLog_Flags flags)
{
if (CDL == null) return;
if (!CDL.Active) return;
string key;
switch (addrtype)
{
case LibGambatte.CDLog_AddrType.ROM: key = "ROM"; break;
case LibGambatte.CDLog_AddrType.HRAM: key = "HRAM"; break;
case LibGambatte.CDLog_AddrType.WRAM: key = "WRAM"; break;
case LibGambatte.CDLog_AddrType.CartRAM: key = "CartRAM"; break;
default: throw new InvalidOperationException("Juniper lightbulb proxy");
}
CDL[key][addr] |= (byte)flags;
}
}
}

View File

@ -29,7 +29,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
CreateMemoryDomain(LibGambatte.MemoryAreas.wram, "WRAM");
CreateMemoryDomain(LibGambatte.MemoryAreas.rom, "ROM");
CreateMemoryDomain(LibGambatte.MemoryAreas.vram, "VRAM");
CreateMemoryDomain(LibGambatte.MemoryAreas.cartram, "Cart RAM");
CreateMemoryDomain(LibGambatte.MemoryAreas.cartram, "CartRAM");
CreateMemoryDomain(LibGambatte.MemoryAreas.oam, "OAM");
CreateMemoryDomain(LibGambatte.MemoryAreas.hram, "HRAM");

View File

@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
portedUrl: "http://gambatte.sourceforge.net/"
)]
[ServiceNotApplicable(typeof(IDriveLight), typeof(IDriveLight))]
public partial class Gameboy : IEmulator, IVideoProvider, ISyncSoundProvider, ISaveRam, IStatable, IInputPollable,
public partial class Gameboy : IEmulator, IVideoProvider, ISyncSoundProvider, ISaveRam, IStatable, IInputPollable, ICodeDataLogger,
IDebuggable, ISettable<Gameboy.GambatteSettings, Gameboy.GambatteSyncSettings>
{
/// <summary>
@ -173,6 +173,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
TimeCallback = new LibGambatte.RTCCallback(GetCurrentTime);
LibGambatte.gambatte_setrtccallback(GambatteState, TimeCallback);
CDCallback = new LibGambatte.CDCallback(CDCallbackProc);
NewSaveCoreSetBuff();
}
catch
@ -182,6 +184,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
}
}
public IEmulatorServiceProvider ServiceProvider { get; private set; }
#region ALL SAVESTATEABLE STATE GOES HERE

View File

@ -34,6 +34,19 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
MULTICART_COMPAT = 4
}
public enum CDLog_AddrType : int
{
ROM, HRAM, WRAM, CartRAM
}
[Flags]
public enum CDLog_Flags : int
{
ExecFirst = 1,
ExecOperand = 2,
Data = 4
}
/// <summary>
/// Load ROM image.
/// </summary>
@ -161,6 +174,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void MemoryCallback(uint address);
/// <summary>
/// type of the CDLogger callback
/// </summary>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void CDCallback(int addr, CDLog_AddrType addrtype, CDLog_Flags flags);
/// <summary>
/// set a callback to occur immediately BEFORE EVERY cpu read, except for opcode first byte fetches
/// </summary>
@ -185,6 +204,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
[DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void gambatte_setexeccallback(IntPtr core, MemoryCallback callback);
/// <summary>
/// set a callback whicih enables CD Logger feedback
/// </summary>
[DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void gambatte_setcdcallback(IntPtr core, CDCallback callback);
/// <summary>
/// type of the cpu trace callback
/// </summary>

View File

@ -28,13 +28,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
//speedups to deploy later:
//todo - convey rom data faster than pipe blob (use shared memory) (WARNING: right now our general purpose shared memory is only 1MB. maybe wait until ring buffer IPC)
//todo - collapse input messages to one IPC operation. right now theresl ike 30 of them
//todo - collapse input messages to one IPC operation. right now theres like 30 of them
//todo - collect all memory block names whenever a memory block is alloc/dealloced. that way we avoid the overhead when using them for gui stuff (gfx debugger, hex editor)
InstanceDll instanceDll;
string InstanceName;
Process process;
System.Threading.EventWaitHandle watchdogEvent;
NamedPipeServerStream pipe;
BinaryWriter bwPipe;
BinaryReader brPipe;
@ -49,46 +48,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
[DllImport("msvcrt.dll", EntryPoint = "memcpy", CallingConvention = CallingConvention.Cdecl, SetLastError = false)]
public static unsafe extern void* CopyMemory(void* dest, void* src, ulong count);
static bool DryRun(string exePath)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
delegate void DllInit(string ipcname);
public LibsnesApi(string dllPath)
{
ProcessStartInfo oInfo = new ProcessStartInfo(exePath, "Bongizong");
oInfo.WorkingDirectory = Path.GetDirectoryName(exePath);
oInfo.UseShellExecute = false;
oInfo.CreateNoWindow = true;
oInfo.RedirectStandardOutput = true;
oInfo.RedirectStandardError = true;
Process proc = System.Diagnostics.Process.Start(oInfo);
string result = proc.StandardError.ReadToEnd();
proc.WaitForExit();
//yongou chonganong nongo tong rongeadong
//pongigong chong hongi nonge songe
if (result == "Honga Wongkong" && proc.ExitCode == 0x16817)
return true;
return false;
}
static HashSet<string> okExes = new HashSet<string>();
public LibsnesApi(string exePath)
{
//make sure we've checked this exe for OKness.. the dry run should keep us from freezing up or crashing weirdly if the external process isnt correct
if (!okExes.Contains(exePath))
{
bool ok = DryRun(exePath);
if (!ok)
throw new InvalidOperationException(string.Format("Couldn't launch {0} to run SNES core. Not sure why this would have happened. Try redownloading BizHawk first.", Path.GetFileName(exePath)));
okExes.Add(exePath);
}
InstanceName = "libsneshawk_" + Guid.NewGuid().ToString();
#if DEBUG
//use this to get a debug console with libsnes output
InstanceName = "console-" + InstanceName;
#endif
var pipeName = InstanceName;
mmf = MemoryMappedFile.CreateNew(pipeName, 1024 * 1024);
@ -97,19 +63,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
pipe = new NamedPipeServerStream(pipeName, PipeDirection.InOut, 1, PipeTransmissionMode.Byte, PipeOptions.None, 1024 * 1024, 1024);
//slim chance this might be useful sometimes:
//http://stackoverflow.com/questions/2590334/creating-a-cross-process-eventwaithandle
//create an event for the child process to monitor with a watchdog, to make sure it terminates when the emuhawk process terminates.
//NOTE: this is alarming! for some reason .net releases this event when it gets finalized, instead of when i (dont) dispose it.
bool createdNew;
watchdogEvent = new System.Threading.EventWaitHandle(false, System.Threading.EventResetMode.AutoReset, InstanceName + "-event", out createdNew);
process = new Process();
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(exePath);
process.StartInfo.FileName = exePath;
process.StartInfo.Arguments = pipeName;
process.StartInfo.ErrorDialog = true;
process.Start();
instanceDll = new InstanceDll(dllPath);
var dllinit = (DllInit)Marshal.GetDelegateForFunctionPointer(instanceDll.GetProcAddress("DllInit"), typeof(DllInit));
dllinit(pipeName);
//TODO - start a thread to wait for process to exit and gracefully handle errors? how about the pipe?
@ -142,10 +98,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
public void Dispose()
{
watchdogEvent.Dispose();
process.Kill();
process.Dispose();
process = null;
WritePipeMessage(eMessage.eMessage_Shutdown);
WaitForCompletion();
instanceDll.Dispose();
pipe.Dispose();
mmva.Dispose();
mmf.Dispose();

View File

@ -14,6 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
eMessage_BeginBufferIO,
eMessage_EndBufferIO,
eMessage_ResumeAfterBRK,
eMessage_Shutdown,
eMessage_QUERY_library_id,
eMessage_QUERY_library_revision_major,

View File

@ -57,7 +57,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
this.SyncSettings = (SnesSyncSettings)SyncSettings ?? new SnesSyncSettings();
api = new LibsnesApi(GetExePath());
api.CMD_init();
api.ReadHook = ReadHook;
api.ExecHook = ExecHook;
api.WriteHook = WriteHook;
@ -384,7 +383,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
// if (Win32.Is64BitOperatingSystem)
// bits = "64";
var exename = "libsneshawk-" + bits + "-" + CurrentProfile.ToLower() + ".exe";
var exename = "libsneshawk-" + bits + "-" + CurrentProfile.ToLower() + ".dll";
string exePath = Path.Combine(CoreComm.CoreFileProvider.DllPath(), exename);
@ -679,7 +678,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
//video provider
int IVideoProvider.BackgroundColor { get { return 0; } }
int[] IVideoProvider.GetVideoBuffer() { return vidBuffer; }
int IVideoProvider.VirtualWidth { get { return vidWidth; } }
int IVideoProvider.VirtualWidth { get { return (int)(vidWidth * 1.146); } }
public int VirtualHeight { get { return vidHeight; } }
int IVideoProvider.BufferWidth { get { return vidWidth; } }
int IVideoProvider.BufferHeight { get { return vidHeight; } }

View File

@ -663,7 +663,16 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
{
int mapIndex = mty * dims.Width + mtx;
var te = map[mapIndex];
int tileNum = te.tilenum + tx + ty * 16 + baseTileNum;
//apply metatile flipping
int tnx = tx, tny = ty;
if (tilesize == 16)
{
if ((te.flags & TileEntryFlags.Horz) != 0) tnx = 1 - tnx;
if ((te.flags & TileEntryFlags.Vert) != 0) tny = 1 - tny;
}
int tileNum = te.tilenum + tnx + tny * 16 + baseTileNum;
int srcOfs = tileNum * 64;
for (int i = 0, y = 0; y < 8; y++)
{

Some files were not shown because too many files have changed in this diff Show More