Merge from maser@TASVideos

This commit is contained in:
Hathor86 2015-11-15 11:27:00 +01:00
commit c7dcb42b94
58 changed files with 3005 additions and 1657 deletions

View File

@ -154,6 +154,7 @@
<Compile Include="movie\bk2\Bk2Movie.HeaderApi.cs">
<DependentUpon>Bk2Movie.cs</DependentUpon>
</Compile>
<Compile Include="movie\bk2\StringLogs.cs" />
<Compile Include="movie\import\PXMImport.cs" />
<Compile Include="movie\tasproj\StateManagerState.cs" />
<Compile Include="movie\tasproj\TasBranch.cs" />
@ -229,7 +230,6 @@
<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" />

View File

@ -32,6 +32,17 @@ namespace BizHawk.Client.Common
return PathManager.SaveRamPath(Global.Game);
}
public string GetRetroSaveRAMDirectory()
{
return PathManager.RetroSaveRAMDirectory(Global.Game);
}
public string GetRetroSystemPath()
{
return PathManager.RetroSystemPath(Global.Game);
}
public string GetGameBasePath()
{
return PathManager.GetGameBasePath(Global.Game);

View File

@ -292,6 +292,38 @@ namespace BizHawk.Client.Common
return Path.Combine(MakeAbsolutePath(pathEntry.Path, game.System), name) + ".SaveRAM";
}
public static string RetroSaveRAMDirectory(GameInfo game)
{
//hijinx here to get the core name out of the game name
var name = FilesystemSafeName(game);
name = Path.GetDirectoryName(name);
if (name == "") name = FilesystemSafeName(game);
if (Global.MovieSession.Movie.IsActive)
{
name = Path.Combine(name, "movie-" + Path.GetFileNameWithoutExtension(Global.MovieSession.Movie.Filename));
}
var pathEntry = Global.Config.PathEntries[game.System, "Save RAM"] ??
Global.Config.PathEntries[game.System, "Base"];
return Path.Combine(MakeAbsolutePath(pathEntry.Path, game.System), name);
}
public static string RetroSystemPath(GameInfo game)
{
//hijinx here to get the core name out of the game name
var name = FilesystemSafeName(game);
name = Path.GetDirectoryName(name);
if(name == "") name = FilesystemSafeName(game);
var pathEntry = Global.Config.PathEntries[game.System, "System"] ??
Global.Config.PathEntries[game.System, "Base"];
return Path.Combine(MakeAbsolutePath(pathEntry.Path, game.System), name);
}
public static string GetGameBasePath(GameInfo game)
{
var name = FilesystemSafeName(game);

View File

@ -255,39 +255,49 @@ namespace BizHawk.Client.Common
if (AsLibretro)
{
//we'll need to generate a game name for purposes of state/saveram pathing etc.
string gameName;
string codePathPart = Path.GetFileNameWithoutExtension(nextComm.LaunchLibretroCore);
var retro = new LibRetroEmulator(nextComm, nextComm.LaunchLibretroCore);
nextEmulator = retro;
//kind of dirty.. we need to stash this, and then we can unstash it in a moment, in case the core doesnt fail
var oldGame = Global.Game;
if (retro.Description.SupportsNoGame && string.IsNullOrEmpty(path))
{
//must be done before LoadNoGame (which triggers retro_init and the paths to be consumed by the core)
//game name == name of core
var gameName = codePathPart;
Global.Game = game = new GameInfo { Name = gameName, System = "Libretro" };
//if we are allowed to run NoGame and we dont have a game, boot up the core that way
bool ret = retro.LoadNoGame();
Global.Game = oldGame;
if (!ret)
{
DoLoadErrorCallback("LibretroNoGame failed to load. This is weird", "Libretro");
retro.Dispose();
return false;
}
//game name == name of core
gameName = codePathPart;
}
else
{
bool ret;
//must be done before LoadNoGame (which triggers retro_init and the paths to be consumed by the core)
//game name == name of core + extensionless_game_filename
var gameName = Path.Combine(codePathPart, Path.GetFileNameWithoutExtension(file.Name));
Global.Game = game = new GameInfo { Name = gameName, System = "Libretro" };
//if the core requires an archive file, then try passing the filename of the archive
//(but do we ever need to actually load the contents of the archive file into ram?)
if (retro.Description.NeedsArchives)
{
if (file.IsArchiveMember)
throw new InvalidOperationException("Should not have bound file member for libretro block_extract core");
retro.LoadPath(file.FullPathWithoutMember);
ret = retro.LoadPath(file.FullPathWithoutMember);
}
else
{
@ -303,21 +313,18 @@ namespace BizHawk.Client.Common
if (ret)
ret = retro.LoadData(file.ReadAllBytes());
}
if (!ret)
{
DoLoadErrorCallback("Libretro failed to load the given file. This is probably due to a core/content mismatch. Moreover, the process is now likely to be hosed. We suggest you restart the program.", "Libretro");
retro.Dispose();
return false;
}
}
//game name == name of core + extensionless_game_filename
gameName = Path.Combine(codePathPart, Path.GetFileNameWithoutExtension(file.Name));
Global.Game = oldGame;
if (!ret)
{
DoLoadErrorCallback("Libretro failed to load the given file. This is probably due to a core/content mismatch. Moreover, the process is now likely to be hosed. We suggest you restart the program.", "Libretro");
retro.Dispose();
return false;
}
}
game = new GameInfo { Name = gameName, System = "Libretro" };
}
else

View File

@ -74,8 +74,10 @@ namespace BizHawk.Client.Common
public bool AcceptBackgroundInput = false;
public bool SingleInstanceMode = false;
public bool AllowUD_LR = false;
public bool ForbidUD_LR = false;
public bool ShowContextMenu = true;
public bool EnableBackupMovies = true;
public bool MoviesOnDisk = false;
public bool HotkeyConfigAutoTab = true;
public bool InputConfigAutoTab = true;
public bool ShowLogWindow = false;

View File

@ -315,10 +315,11 @@ namespace BizHawk.Client.Common
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Base", Path = Path.Combine(".", "Libretro"), Ordinal = 0 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Cores", Path = Path.Combine(".", "Cores"), Ordinal = 1 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Savestates", Path = Path.Combine(".", "State"), Ordinal = 2 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 3 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 4 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 5 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "System", Path = Path.Combine(".", "System"), Ordinal = 2 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Savestates", Path = Path.Combine(".", "State"), Ordinal = 3 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Save RAM", Path = Path.Combine(".", "SaveRAM"), Ordinal = 4 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Screenshots", Path = Path.Combine(".", "Screenshots"), Ordinal = 5 },
new PathEntry { System = "Libretro", SystemDisplayName = "Libretro", Type = "Cheats", Path = Path.Combine(".", "Cheats"), Ordinal = 6 },
};
}

View File

@ -105,8 +105,13 @@ namespace BizHawk.Client.Common
return Source.GetFloat(name);
}
HashSet<string> Unpresses = new HashSet<string>();
public bool IsPressed(string button)
{
bool PriorityUD_LR = !Global.Config.AllowUD_LR && !Global.Config.ForbidUD_LR; //implied by neither of the others being set (left as non-enum for back-compatibility)
if (Global.Config.AllowUD_LR)
{
return Source.IsPressed(button);
@ -116,37 +121,63 @@ namespace BizHawk.Client.Common
//" C " is for N64 "P1 C Up" and the like, which should not be subject to mutexing
//regarding the unpressing and UDLR logic...... don't think about it. don't question it. don't look at it.
if (button.Contains("Down") && !button.Contains(" C "))
{
if (!Source.IsPressed(button)) Unpresses.Remove(button);
prefix = button.GetPrecedingString("Down");
if (Source.IsPressed(prefix + "Up"))
return false;
string other = prefix + "Up";
if (Source.IsPressed(other))
{
if (Unpresses.Contains(button)) return false;
if (Global.Config.ForbidUD_LR) return false;
Unpresses.Add(other);
}
else Unpresses.Remove(button);
}
if (button.Contains("Up") && !button.Contains(" C "))
{
if (!Source.IsPressed(button)) Unpresses.Remove(button);
prefix = button.GetPrecedingString("Up");
if (Source.IsPressed(prefix + "Down"))
return false;
string other = prefix + "Down";
if (Source.IsPressed(other))
{
if (Unpresses.Contains(button)) return false;
if (Global.Config.ForbidUD_LR) return false;
Unpresses.Add(other);
}
else Unpresses.Remove(button);
}
if (button.Contains("Right") && !button.Contains(" C "))
{
if (!Source.IsPressed(button)) Unpresses.Remove(button);
prefix = button.GetPrecedingString("Right");
if (Source.IsPressed(prefix + "Left"))
string other = prefix + "Left";
if (Source.IsPressed(other))
{
return false;
if (Unpresses.Contains(button)) return false;
if (Global.Config.ForbidUD_LR) return false;
Unpresses.Add(other);
}
else Unpresses.Remove(button);
}
if (button.Contains("Left") && !button.Contains(" C "))
{
if (!Source.IsPressed(button)) Unpresses.Remove(button);
prefix = button.GetPrecedingString("Left");
if (Source.IsPressed(prefix + "Right"))
string other = prefix + "Right";
if (Source.IsPressed(other))
{
return false;
if (Unpresses.Contains(button)) return false;
if (Global.Config.ForbidUD_LR) return false;
Unpresses.Add(other);
}
else Unpresses.Remove(button);
}
return Source.IsPressed(button);

View File

@ -8,7 +8,7 @@ namespace BizHawk.Client.Common
{
public partial class Bk2Movie
{
protected List<string> _log = new List<string>();
protected IStringLog _log;
protected string LogKey = string.Empty;
public string GetInputLog()
@ -58,7 +58,7 @@ namespace BizHawk.Client.Common
// We are in record mode so replace the movie log with the one from the savestate
if (!Global.MovieSession.MultiTrack.IsActive)
{
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Any())
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Count != 0)
{
SaveBackup();
MakeBackup = false;

View File

@ -27,6 +27,8 @@ namespace BizHawk.Client.Common
MakeBackup = true;
Header[HeaderKeys.MOVIEVERSION] = "BizHawk v2.0.0";
_log = StringLogUtil.MakeStringLog();
}
private string _filename;

View File

@ -0,0 +1,196 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using BizHawk.Common;
namespace BizHawk.Client.Common
{
public static class StringLogUtil
{
public static bool DefaultToDisk;
public static IStringLog MakeStringLog()
{
if (DefaultToDisk)
return new DiskStringLog();
else return new ListStringLog();
}
}
public interface IStringLog : IDisposable, IEnumerable<string>
{
void RemoveAt(int index);
int Count { get; }
void Clear();
void Add(string str);
string this[int index] { get; set; }
void Insert(int index, string val);
void InsertRange(int index, IEnumerable<string> collection);
void AddRange(IEnumerable<string> collection);
void RemoveRange(int index, int count);
IStringLog Clone();
void CopyTo(string[] array);
void CopyTo(int index, string[] array, int arrayIndex, int count);
}
class ListStringLog : List<string>, IStringLog
{
public IStringLog Clone()
{
ListStringLog ret = new ListStringLog();
ret.AddRange(this);
return ret;
}
public void Dispose() { }
}
/// <summary>
/// A dumb-ish IStringLog with storage on disk with no provision for recovering lost space, except upon Clear()
/// The purpose here is to avoid having too complicated buggy logic or a dependency on sqlite or such.
/// It should be faster than those alternatives, but wasteful of disk space.
/// It should also be easier to add new IList<string>-like methods than dealing with a database
/// </summary>
class DiskStringLog : IStringLog
{
List<long> Offsets = new List<long>();
long cursor = 0;
BinaryWriter bw;
BinaryReader br;
FileStream stream;
public DiskStringLog()
{
var path = TempFileCleaner.GetTempFilename("movieOnDisk");
stream = new FileStream(path, FileMode.Create, System.Security.AccessControl.FileSystemRights.FullControl, FileShare.None, 4 * 1024, FileOptions.DeleteOnClose);
bw = new BinaryWriter(stream);
br = new BinaryReader(stream);
}
public IStringLog Clone()
{
DiskStringLog ret = new DiskStringLog();
for (int i = 0; i < Count; i++)
ret.Add(this[i]);
return ret;
}
public void Dispose()
{
stream.Dispose();
}
public int Count { get { return Offsets.Count; } }
public void Clear()
{
stream.SetLength(0);
Offsets.Clear();
cursor = 0;
}
public void Add(string str)
{
Offsets.Add(stream.Position);
bw.Write(str);
bw.Flush();
}
public void RemoveAt(int index)
{
Offsets.RemoveAt(index);
//no garbage collection in the disk file... oh well.
}
public string this[int index]
{
get
{
stream.Position = Offsets[index];
return br.ReadString();
}
set
{
stream.Position = stream.Length;
Offsets[index] = stream.Position;
bw.Write(value);
bw.Flush();
}
}
public void Insert(int index, string val)
{
Offsets.Insert(index, stream.Position);
bw.Write(val);
bw.Flush();
}
public void InsertRange(int index, IEnumerable<string> collection)
{
foreach(var item in collection)
Insert(index++,item);
}
public void AddRange(IEnumerable<string> collection)
{
foreach (var item in collection)
Add(item);
}
class Enumerator : IEnumerator<string>
{
public DiskStringLog log;
int index;
public string Current { get { return log[index]; } }
object System.Collections.IEnumerator.Current { get { return log[index]; } }
bool System.Collections.IEnumerator.MoveNext()
{
index++;
if (index >= log.Count)
{
index = log.Count;
return false;
}
return true;
}
void System.Collections.IEnumerator.Reset() { index = 0; }
public void Dispose() { }
}
IEnumerator<string> IEnumerable<string>.GetEnumerator()
{
return new Enumerator() { log = this };
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return new Enumerator() { log = this };
}
public void RemoveRange(int index, int count)
{
int end = index + count - 1;
for (int i = 0; i < count; i++)
{
RemoveAt(end);
end--;
}
}
public void CopyTo(string[] array)
{
for (int i = 0; i < Count; i++)
array[i] = this[i];
}
public void CopyTo(int index, string[] array, int arrayIndex, int count)
{
for (int i = 0; i < count; i++)
array[i + arrayIndex] = this[index + i];
}
}
}

View File

@ -145,7 +145,7 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
tas.BinarySavestate = savestate;
tas.ClearLagLog();
List<string> entries = old.GetLogEntries();
var entries = old.GetLogEntries();
tas.CopyLog(entries.Skip(frame));
tas.CopyVerificationLog(old.VerificationLog);
@ -220,7 +220,7 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
tas.TasStateManager.Clear();
tas.ClearLagLog();
List<string> entries = old.GetLogEntries();
var entries = old.GetLogEntries();
tas.CopyVerificationLog(old.VerificationLog);
tas.CopyVerificationLog(entries);

View File

@ -12,7 +12,7 @@ namespace BizHawk.Client.Common
{
public int Frame { get; set; }
public byte[] CoreData { get; set; }
public List<string> InputLog { get; set; }
public IStringLog InputLog { get; set; }
public BitmapBuffer OSDFrameBuffer { get; set; }
public TasLagLog LagLog { get; set; }
public TasMovieChangeLog ChangeLog { get; set; }
@ -64,8 +64,9 @@ namespace BizHawk.Client.Common
bs.PutLump(ninput, delegate(TextWriter tw)
{
foreach (var line in b.InputLog)
tw.WriteLine(line);
int todo = b.InputLog.Count;
for (int i = 0; i < todo; i++)
tw.WriteLine(b.InputLog[i]);
});
bs.PutLump(nframebuffer, delegate(Stream s)
@ -146,7 +147,7 @@ namespace BizHawk.Client.Common
bl.GetLump(ninput, true, delegate(TextReader tr)
{
b.InputLog = new List<string>();
b.InputLog = StringLogUtil.MakeStringLog();
string line;
while ((line = tr.ReadLine()) != null)
b.InputLog.Add(line);

View File

@ -319,7 +319,7 @@ namespace BizHawk.Client.Common
ChangeLog.ClearLog();
}
private static string InputLogToString(List<string> log)
private static string InputLogToString(IStringLog log)
{
var sb = new StringBuilder();
foreach (var record in log)

View File

@ -21,7 +21,7 @@ namespace BizHawk.Client.Common
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 IStringLog VerificationLog = StringLogUtil.MakeStringLog(); // 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;
@ -81,7 +81,7 @@ namespace BizHawk.Client.Common
}
public TasLagLog TasLagLog { get { return LagLog; } }
public List<string> InputLog { get { return _log; } }
public IStringLog InputLog { get { return _log; } }
public TasMovieMarkerList Markers { get; set; }
public bool BindMarkersToInput { get; set; }
public bool UseInputCache { get; set; }
@ -331,7 +331,7 @@ namespace BizHawk.Client.Common
}
}
public List<string> GetLogEntries()
public IStringLog GetLogEntries()
{
return _log;
}
@ -350,7 +350,7 @@ namespace BizHawk.Client.Common
{
TimelineBranchFrame = null;
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Any())
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Count != 0)
{
SaveBackup();
MakeBackup = false;
@ -500,7 +500,8 @@ namespace BizHawk.Client.Common
{
int? divergentPoint = DivergentPoint(_log, branch.InputLog);
_log = branch.InputLog.ToList();
if (_log != null) _log.Dispose();
_log = branch.InputLog.Clone();
//_changes = true;
// if there are branch states, they will be loaded anyway
@ -523,7 +524,7 @@ namespace BizHawk.Client.Common
}
// TODO: use LogGenerators rather than string comparisons
private int? DivergentPoint(List<string> currentLog, List<string> newLog)
private int? DivergentPoint(IStringLog currentLog, IStringLog newLog)
{
int max = newLog.Count;
if (currentLog.Count < newLog.Count)

View File

@ -58,9 +58,22 @@ namespace BizHawk.Client.Common
get { return _rewindFrequency; }
}
bool IsRewindEnabledAtAll
{
get
{
if (!Global.Config.RewindEnabledLarge && !Global.Config.RewindEnabledMedium && !Global.Config.RewindEnabledSmall)
return false;
else return true;
}
}
// TOOD: this should not be parameterless?! It is only possible due to passing a static context in
public void CaptureRewindState()
{
if (!IsRewindEnabledAtAll)
return;
if (Global.Emulator.HasSavestates())
{
if (_rewindImpossible)
@ -83,6 +96,12 @@ namespace BizHawk.Client.Common
public void DoRewindSettings()
{
if (_rewindThread != null)
{
_rewindThread.Dispose();
_rewindThread = null;
}
if (Global.Emulator.HasSavestates())
{
// This is the first frame. Capture the state, and put it in LastState for future deltas to be compared against.
@ -132,11 +151,6 @@ namespace BizHawk.Client.Common
_rewindBuffer = new StreamBlobDatabase(Global.Config.Rewind_OnDisk, capacity, BufferManage);
if (_rewindThread != null)
{
_rewindThread.Dispose();
}
_rewindThread = new RewindThreader(this, Global.Config.Rewind_IsThreaded);
}
}
@ -144,7 +158,7 @@ namespace BizHawk.Client.Common
public void Rewind(int frames)
{
if (Global.Emulator.HasSavestates())
if (Global.Emulator.HasSavestates() && _rewindThread != null)
{
_rewindThread.Rewind(frames);
}

View File

@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.IO;
using BizHawk.Common;
namespace BizHawk.Client.Common
{
/// <summary>
@ -23,7 +25,7 @@ namespace BizHawk.Client.Common
_mCapacity = capacity;
if (onDisk)
{
var path = Path.Combine(Path.GetTempPath(), "bizhawk.rewindbuf-pid" + System.Diagnostics.Process.GetCurrentProcess().Id + "-" + Guid.NewGuid());
var path = TempFileCleaner.GetTempFilename("rewindbuf");
// I checked the DeleteOnClose operation to make sure it cleans up when the process is aborted, and it seems to.
// Otherwise we would have a more complex tempfile management problem here.

View File

@ -733,6 +733,12 @@
<Compile Include="tools\Debugger\RegisterBoxControl.Designer.cs">
<DependentUpon>RegisterBoxControl.cs</DependentUpon>
</Compile>
<Compile Include="tools\GameShark.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="tools\GameShark.Designer.cs">
<DependentUpon>GameShark.cs</DependentUpon>
</Compile>
<Compile Include="tools\GBA\GBAGPUView.cs">
<SubType>Form</SubType>
</Compile>
@ -1379,6 +1385,9 @@
<EmbeddedResource Include="tools\Debugger\RegisterBoxControl.resx">
<DependentUpon>RegisterBoxControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\GameShark.resx">
<DependentUpon>GameShark.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="tools\GBA\GBAGPUView.resx">
<DependentUpon>GBAGPUView.cs</DependentUpon>
</EmbeddedResource>

View File

@ -120,6 +120,7 @@ namespace BizHawk.Client.EmuHawk
/// <summary>
/// these variables will track the dimensions of the last frame's (or the next frame? this is confusing) emulator native output size
/// THIS IS OLD JUNK. I should get rid of it, I think. complex results from the last filter ingestion should be saved instead.
/// </summary>
int currEmuWidth, currEmuHeight;
@ -800,8 +801,16 @@ namespace BizHawk.Client.EmuHawk
int currNativeWidth = presentationPanel.NativeSize.Width;
int currNativeHeight = presentationPanel.NativeSize.Height;
currNativeWidth += ClientExtraPadding.Horizontal;
currNativeHeight += ClientExtraPadding.Vertical;
int width,height;
if(name == "emu") { width = currEmuWidth; height = currEmuHeight; }
if(name == "emu") {
width = currEmuWidth;
height = currEmuHeight;
width += GameExtraPadding.Horizontal;
height += GameExtraPadding.Vertical;
}
else if(name == "native") { width = currNativeWidth; height = currNativeHeight; }
else throw new InvalidOperationException("Unknown lua surface name: " +name);

View File

@ -157,10 +157,10 @@ namespace BizHawk.Client.EmuHawk.WinFormExtensions
/// <summary>
/// Handles EmuHawk specific issues before showing a modal dialog
/// </summary>
public static DialogResult ShowHawkDialog(this Form form)
public static DialogResult ShowHawkDialog(this Form form, IWin32Window owner = null)
{
GlobalWin.Sound.StopSound();
var result = form.ShowDialog();
var result = (owner == null ? form.ShowDialog() : form.ShowDialog(owner));
GlobalWin.Sound.StartSound();
return result;
}

View File

@ -408,6 +408,8 @@
this.ShowMenuContextMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.timerMouseIdle = new System.Windows.Forms.Timer(this.components);
this.OpenAdvancedMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gameSharkConverterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MainformMenu.SuspendLayout();
this.MainStatusBar.SuspendLayout();
this.MainFormContextMenu.SuspendLayout();
@ -1841,6 +1843,9 @@
this.customToolToolStripMenuItem,
this.toolStripSeparator29,
this.MultiDiskBundlerFileMenuItem,
this.toolStripSeparator29,
this.MultiDiskBundlerFileMenuItem,
this.gameSharkConverterToolStripMenuItem,
this.batchRunnerToolStripMenuItem});
this.ToolsSubMenu.Name = "ToolsSubMenu";
this.ToolsSubMenu.Size = new System.Drawing.Size(44, 17);
@ -3459,6 +3464,7 @@
this.toolStripMenuItem13.Name = "toolStripMenuItem13";
this.toolStripMenuItem13.Size = new System.Drawing.Size(157, 22);
this.toolStripMenuItem13.Text = "&Autofire...";
this.toolStripMenuItem13.Click += new System.EventHandler(this.AutofireMenuItem_Click);
//
// toolStripMenuItem14
//
@ -3502,16 +3508,19 @@
//
this.SavestateTypeDefaultContextMenuItem.Name = "SavestateTypeDefaultContextMenuItem";
this.SavestateTypeDefaultContextMenuItem.Size = new System.Drawing.Size(67, 22);
this.SavestateTypeDefaultContextMenuItem.Text = "&Default";
//
// SavestateBinaryContextMenuItem
//
this.SavestateBinaryContextMenuItem.Name = "SavestateBinaryContextMenuItem";
this.SavestateBinaryContextMenuItem.Size = new System.Drawing.Size(67, 22);
this.SavestateBinaryContextMenuItem.Text = "&Binary";
//
// SavestateTextContextMenuItem
//
this.SavestateTextContextMenuItem.Name = "SavestateTextContextMenuItem";
this.SavestateTextContextMenuItem.Size = new System.Drawing.Size(67, 22);
this.SavestateTextContextMenuItem.Text = "&Text";
//
// CoreSelectionContextSubMenu
//
@ -3606,6 +3615,14 @@
this.OpenAdvancedMenuItem.Text = "Open Ad&vanced";
this.OpenAdvancedMenuItem.Click += new System.EventHandler(this.OpenAdvancedMenuItem_Click);
//
// gameSharkConverterToolStripMenuItem
//
this.gameSharkConverterToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("gameSharkConverterToolStripMenuItem.Image")));
this.gameSharkConverterToolStripMenuItem.Name = "gameSharkConverterToolStripMenuItem";
this.gameSharkConverterToolStripMenuItem.Size = new System.Drawing.Size(189, 22);
this.gameSharkConverterToolStripMenuItem.Text = "GameShark Converter";
this.gameSharkConverterToolStripMenuItem.Click += new System.EventHandler(this.gameSharkConverterToolStripMenuItem_Click);
//
// MainForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -4025,6 +4042,6 @@
private System.Windows.Forms.ToolStripMenuItem CodeDataLoggerMenuItem;
private System.Windows.Forms.ToolStripMenuItem setLibretroCoreToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem OpenAdvancedMenuItem;
private System.Windows.Forms.ToolStripMenuItem gameSharkConverterToolStripMenuItem;
}
}

View File

@ -1246,9 +1246,10 @@ namespace BizHawk.Client.EmuHawk
AutoHawkMenuItem.Visible = VersionInfo.DeveloperBuild;
BasicBotMenuItem.Enabled = GlobalWin.Tools.IsAvailable<BasicBot>();
string toolPath = Path.Combine(Global.Config.PathEntries["Global", "GameTools"].Path, string.Format("{0}.dll", Global.Game.Name));
customToolToolStripMenuItem.Enabled = File.Exists(toolPath);
customToolToolStripMenuItem.Enabled = File.Exists(toolPath);
gameSharkConverterToolStripMenuItem.Enabled = GlobalWin.Tools.IsAvailable<GameShark>();
}
private void AutoHawkMenuItem_Click(object sender, EventArgs e)

View File

@ -321,7 +321,7 @@ namespace BizHawk.Client.EmuHawk
if (cmdRom != null)
{
// Commandline should always override auto-load
LoadRom(cmdRom);
LoadRom(cmdRom, new MainForm.LoadRomArgs() { OpenAdvanced = new OpenAdvanced_OpenRom() });
if (Global.Game == null)
{
MessageBox.Show("Failed to load " + cmdRom + " specified on commandline");
@ -3446,7 +3446,7 @@ namespace BizHawk.Client.EmuHawk
LoadRomArgs CurrentLoadRomArgs;
// Still needs a good bit of refactoring
public bool LoadRom(string path, LoadRomArgs args = null)
public bool LoadRom(string path, LoadRomArgs args)
{
//default args
if (args == null) args = new LoadRomArgs();
@ -3977,6 +3977,11 @@ namespace BizHawk.Client.EmuHawk
Global.Config.DisplayMessages ^= true;
}
private void gameSharkConverterToolStripMenuItem_Click(object sender, EventArgs e)
{
GlobalWin.Tools.Load<GameShark>();
}
private void HelpSubMenu_DropDownOpened(object sender, EventArgs e)
{
FeaturesMenuItem.Visible = VersionInfo.DeveloperBuild;
@ -3994,4 +3999,4 @@ namespace BizHawk.Client.EmuHawk
}
}
}
}

View File

@ -121,6 +121,39 @@
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="gameSharkConverterToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAY9SURBVEhLtZZpUJNXFIZRZ/SHf6BCEWrHpaAUbS0TkDAp
IEtAiMCAYisIsSASZJNNJJRYGECCEjZtyxI26RQIYcAAsoU97IsKOgQLLuA+Ou770jd+aQhpAP3hO3cy
X77cc557zzn33Ki8/8z6ZMC7d++eP3/+8OHDBw8e4PPRo0dPnz59/fq19Of/6RMAz549u3nz5j8fNDk5
eeXKlatXr05PT9+4cQPv7969iwnSqXL6KMDjx4/h8eLFi3V1ddHR0VZW1uvWrdPU0tb+evU3Ojpubm5C
oXB0dHRoaGhgYGBwcBDP2ChhuwDg1atXcD08PJyenm68xVj1qzX6zvStcdkOBUKfmnMc4WBFU1tLS0tT
U1N9fX1tbW1FRUVxcXFQUBB2RnhQAnj79i1i+ubNm/v37589ezYnJ2fTpk2rfiBTWZnu5f17KoYiagZL
2vpEXV2dHZ0CgQDLh2SAU6dO0el0qS8FwMuXLxHK69evT01NIb4TExO9vb1OO1xpRzL3loropd3+/O6S
tn6ot6enC4DOzqSkpNTUVHlAeHh4WVkZkk/4nAW4ffv20aNHEUECgOAgn+Pj4vbhEValiF3d1TM4TAS6
5z9AW5skRDIAn883s3O4PDV9/vx5wqdiiBCczMzMxsZGOcD42NjYhQsXYIOIKQXIcsBkMreH/FY/MNrQ
0EDkWRGAEJWWlq7X068SVMsDUEIjIyNzAcrLy6uqqqqrq8mWtowsfk5dp7BZiPKFw1kAnCCQ12/Q2xF6
hM46fqa+YS4AcgNAe3s7l8ttbm7e4+GJ5QcHB7scZDEyio+V1GJCd3c3fM4CoBzt7e2pu739krMYyVkR
ySeUAhBDR0enkpISpNfGzh5xN9/uXMHnG5pZwwojIZ8nEomQGPicASDDiYmJ+iSyb1wqRlDSib7hcwoA
2FhTqYYWtlHHTxpTTANDwnbuC9jt5h4Qm7zTdZd7GAuGB+LTOHnFNTU1YMCtFICEtLa26ulvpIfG7GMm
YtS3dSrkAEc0MjIygZMRfyLXh5mwwyfI0d3Lj8W2dXU/wGJbOrrGpv3JLfqLk5q6b78vDjzKZAZw69at
iIgICpW2N4SJkc4tUqgihRwIW1pZx9LpBw9jMj79mXHFpbza2jNJ7CSdDd/W1DX4+/vjwM4AkBBDoy0/
+QTQA8JDWQli8fj8AFSRSNTlGxrp5hu8P4x5WlCNMkVKdPX0fwkMn5iY9PPzIzxLAKj9vLy8kLCI3v4B
9BDZSZ4f4O3tbUTZutPT5+8yHnKDFoTidnLb+we3MDc3l8fjzQDu3bsnFovhGk7ReBcEwN22bdu+MzC0
c94VEc0iDhqF8qOVvZPzzx5jYrGDg8OLFy9mADii5ubmK1dqaWmvYjD85gJgGto1OuXq1WtIW0zMrWyt
bWmlZTwA4uPjN35vgDdZudzCwsKUlBTCOyQBwIxG225oRCYZkVM4aUoBcXFxmzdvVtf4UkdnPcnQmGpr
d5j562mBgDjJgYGBsN3t7nHp0iVLS8snT54Q3iEJAPXn7OICS4zs7GylgPJyflpaOoeTevLk75WVlcgB
surl5YWuBUBuLtfAgNTX189gMNAzCNeEpCHy8PBQU/sCA8d9wRygSRw6dGjFihXLly+n0WhISWNjU1kZ
r6CgAEjZXUZIArh27VpMTMzixYsXLVqkpqaGNjIXAN0tLCxMS0tLRUUF8wkTpBQdLD8/39TUFJcr4Vcm
CQD3DMpUW1sbZhAeUGeXP4gAICBsNhttatmyZcQcmdTV1YuKikJCQmJjY7Emwqm8JAAI20R5YDlSOxUV
DQ0NCwsLKpWqq6u7ZMkS6Vs5YbKJiQkaKroeiUTCpX3nzh3Cm7ykAFy/2KOLi4vUeiFpamqiM+IWioqK
MjMzI1q/UkkBEGqD+EOgqqoqdaNMa9euRcvr6+vD9Ysd4Fl2ppRqBoB5CDQqAac8NDSUQqEgmQj60qVL
ES4EwdPTE7vEjY8Jjo6O1tbW6BlS47k1A4DwLygjIwONEKcRhfGh/hrx2dHRgeaOLaLYyGQyShPviWa5
oGYBIFQxmhK2gvVijTY2NsgzQgG/KEdkErWrUOnzSxEgE7ygy6IwwEN14+sn+ZWJAMCSGPNK8vtHTJPX
+/f/AtNpu+2UY3h4AAAAAElFTkSuQmCC
</value>
</data>
<data name="DisplayConfigMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO

View File

@ -72,7 +72,10 @@ namespace BizHawk.Client.EmuHawk
//scan the current libretro core to see if it can be launched with NoGame,and other stuff
try
{
using (var retro = new LibRetroEmulator(new BizHawk.Emulation.Common.CoreComm(null, null), core))
//a stub corecomm. to reinforce that this won't touch the frontend at all!
//LibRetroEmulator should be able to survive having this stub corecomm
var coreComm = new BizHawk.Emulation.Common.CoreComm(null, null);
using (var retro = new LibRetroEmulator(coreComm, core))
{
btnLibretroLaunchGame.Enabled = true;
if (retro.Description.SupportsNoGame)

View File

@ -59,13 +59,16 @@ namespace BizHawk.Client.EmuHawk
}
}
BizHawk.Client.Common.TempFileCleaner.Start();
BizHawk.Common.TempFileCleaner.Start();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
HawkFile.ArchiveHandlerFactory = new SevenZipSharpArchiveHandler();
string iniPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.ini");
Global.Config = ConfigService.Load<Config>(iniPath);
Global.Config.ResolveDefaults();
HawkFile.ArchiveHandlerFactory = new SevenZipSharpArchiveHandler();
BizHawk.Client.Common.StringLogUtil.DefaultToDisk = Global.Config.MoviesOnDisk;
//super hacky! this needs to be done first. still not worth the trouble to make this system fully proper
for (int i = 0; i < args.Length; i++)
@ -307,7 +310,7 @@ namespace BizHawk.Client.EmuHawk
void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e)
{
if (e.CommandLine.Count >= 1)
(MainForm as MainForm).LoadRom(e.CommandLine[0]);
(MainForm as MainForm).LoadRom(e.CommandLine[0], new MainForm.LoadRomArgs() { OpenAdvanced = new OpenAdvanced_OpenRom() });
}
protected override void OnCreateMainForm()

View File

@ -1,16 +1,19 @@
using System;
using System.Drawing;
using System.Collections.Generic;
namespace BizHawk.Client.EmuHawk
{
[AttributeUsage(AttributeTargets.Class)]
public class ToolAttributes : Attribute
{
public ToolAttributes(bool released)
public ToolAttributes(bool released, string[] supportedSystems)
{
Released = released;
SupportedSystems = supportedSystems;
}
public bool Released { get; private set; }
public IEnumerable<string> SupportedSystems { get; private set; }
}
}

View File

@ -35,7 +35,6 @@
this.AutofireControlsTab = new System.Windows.Forms.TabPage();
this.AnalogControlsTab = new System.Windows.Forms.TabPage();
this.checkBoxAutoTab = new System.Windows.Forms.CheckBox();
this.checkBoxUDLR = new System.Windows.Forms.CheckBox();
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
@ -48,6 +47,10 @@
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label38 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.rbUDLRForbid = new System.Windows.Forms.RadioButton();
this.rbUDLRPriority = new System.Windows.Forms.RadioButton();
this.rbUDLRAllow = new System.Windows.Forms.RadioButton();
this.btnMisc = new BizHawk.Client.EmuHawk.MenuButton();
this.tabControl1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
@ -82,7 +85,7 @@
this.AutofireControlsTab.Location = new System.Drawing.Point(4, 22);
this.AutofireControlsTab.Name = "AutofireControlsTab";
this.AutofireControlsTab.Padding = new System.Windows.Forms.Padding(3);
this.AutofireControlsTab.Size = new System.Drawing.Size(554, 478);
this.AutofireControlsTab.Size = new System.Drawing.Size(554, 495);
this.AutofireControlsTab.TabIndex = 1;
this.AutofireControlsTab.Text = "Autofire Controls";
this.AutofireControlsTab.UseVisualStyleBackColor = true;
@ -91,7 +94,7 @@
//
this.AnalogControlsTab.Location = new System.Drawing.Point(4, 22);
this.AnalogControlsTab.Name = "AnalogControlsTab";
this.AnalogControlsTab.Size = new System.Drawing.Size(554, 478);
this.AnalogControlsTab.Size = new System.Drawing.Size(554, 495);
this.AnalogControlsTab.TabIndex = 2;
this.AnalogControlsTab.Text = "Analog Controls";
this.AnalogControlsTab.UseVisualStyleBackColor = true;
@ -100,7 +103,7 @@
//
this.checkBoxAutoTab.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxAutoTab.AutoSize = true;
this.checkBoxAutoTab.Location = new System.Drawing.Point(394, 548);
this.checkBoxAutoTab.Location = new System.Drawing.Point(371, 548);
this.checkBoxAutoTab.Name = "checkBoxAutoTab";
this.checkBoxAutoTab.Size = new System.Drawing.Size(70, 17);
this.checkBoxAutoTab.TabIndex = 3;
@ -108,17 +111,6 @@
this.checkBoxAutoTab.UseVisualStyleBackColor = true;
this.checkBoxAutoTab.CheckedChanged += new System.EventHandler(this.CheckBoxAutoTab_CheckedChanged);
//
// checkBoxUDLR
//
this.checkBoxUDLR.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.checkBoxUDLR.AutoSize = true;
this.checkBoxUDLR.Location = new System.Drawing.Point(470, 548);
this.checkBoxUDLR.Name = "checkBoxUDLR";
this.checkBoxUDLR.Size = new System.Drawing.Size(101, 17);
this.checkBoxUDLR.TabIndex = 4;
this.checkBoxUDLR.Text = "Allow U+D/L+R";
this.checkBoxUDLR.UseVisualStyleBackColor = true;
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@ -177,26 +169,26 @@
this.loadDefaultsToolStripMenuItem,
this.clearToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(147, 70);
this.contextMenuStrip1.Size = new System.Drawing.Size(142, 70);
//
// testToolStripMenuItem
//
this.testToolStripMenuItem.Name = "testToolStripMenuItem";
this.testToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.testToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
this.testToolStripMenuItem.Text = "Save Defaults";
this.testToolStripMenuItem.Click += new System.EventHandler(this.ButtonSaveDefaults_Click);
//
// loadDefaultsToolStripMenuItem
//
this.loadDefaultsToolStripMenuItem.Name = "loadDefaultsToolStripMenuItem";
this.loadDefaultsToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.loadDefaultsToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
this.loadDefaultsToolStripMenuItem.Text = "Load Defaults";
this.loadDefaultsToolStripMenuItem.Click += new System.EventHandler(this.ButtonLoadDefaults_Click);
//
// clearToolStripMenuItem
//
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
this.clearToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.clearToolStripMenuItem.Size = new System.Drawing.Size(141, 22);
this.clearToolStripMenuItem.Text = "Clear";
this.clearToolStripMenuItem.Click += new System.EventHandler(this.ClearBtn_Click);
//
@ -214,7 +206,7 @@
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(206, 550);
this.label2.Location = new System.Drawing.Point(197, 550);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(168, 13);
this.label2.TabIndex = 111;
@ -224,12 +216,54 @@
//
this.label38.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.label38.AutoSize = true;
this.label38.Location = new System.Drawing.Point(47, 550);
this.label38.Location = new System.Drawing.Point(41, 550);
this.label38.Name = "label38";
this.label38.Size = new System.Drawing.Size(153, 13);
this.label38.TabIndex = 110;
this.label38.Text = "* Escape clears a key mapping";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(442, 550);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(57, 13);
this.label1.TabIndex = 113;
this.label1.Text = "U+D/L+R:";
//
// rbUDLRForbid
//
this.rbUDLRForbid.AutoSize = true;
this.rbUDLRForbid.Location = new System.Drawing.Point(559, 548);
this.rbUDLRForbid.Name = "rbUDLRForbid";
this.rbUDLRForbid.Size = new System.Drawing.Size(54, 17);
this.rbUDLRForbid.TabIndex = 114;
this.rbUDLRForbid.TabStop = true;
this.rbUDLRForbid.Text = "Forbid";
this.rbUDLRForbid.UseVisualStyleBackColor = true;
//
// rbUDLRPriority
//
this.rbUDLRPriority.AutoSize = true;
this.rbUDLRPriority.Location = new System.Drawing.Point(622, 548);
this.rbUDLRPriority.Name = "rbUDLRPriority";
this.rbUDLRPriority.Size = new System.Drawing.Size(56, 17);
this.rbUDLRPriority.TabIndex = 115;
this.rbUDLRPriority.TabStop = true;
this.rbUDLRPriority.Text = "Priority";
this.rbUDLRPriority.UseVisualStyleBackColor = true;
//
// rbUDLRAllow
//
this.rbUDLRAllow.AutoSize = true;
this.rbUDLRAllow.Location = new System.Drawing.Point(503, 548);
this.rbUDLRAllow.Name = "rbUDLRAllow";
this.rbUDLRAllow.Size = new System.Drawing.Size(50, 17);
this.rbUDLRAllow.TabIndex = 116;
this.rbUDLRAllow.TabStop = true;
this.rbUDLRAllow.Text = "Allow";
this.rbUDLRAllow.UseVisualStyleBackColor = true;
//
// btnMisc
//
this.btnMisc.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@ -248,11 +282,14 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(932, 572);
this.Controls.Add(this.rbUDLRAllow);
this.Controls.Add(this.rbUDLRPriority);
this.Controls.Add(this.rbUDLRForbid);
this.Controls.Add(this.label1);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label38);
this.Controls.Add(this.btnMisc);
this.Controls.Add(this.checkBoxUDLR);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK);
@ -277,7 +314,6 @@
private System.Windows.Forms.TabPage NormalControlsTab;
private System.Windows.Forms.TabPage AutofireControlsTab;
private System.Windows.Forms.CheckBox checkBoxAutoTab;
private System.Windows.Forms.CheckBox checkBoxUDLR;
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
@ -292,5 +328,9 @@
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label38;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.RadioButton rbUDLRForbid;
private System.Windows.Forms.RadioButton rbUDLRPriority;
private System.Windows.Forms.RadioButton rbUDLRAllow;
}
}

View File

@ -5,6 +5,7 @@ using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using BizHawk.Common;
using BizHawk.Client.Common;
using BizHawk.Emulation.Common;
using BizHawk.Client.EmuHawk.WinFormExtensions;
@ -84,7 +85,7 @@ namespace BizHawk.Client.EmuHawk
return new AnalogBindPanel(settings, buttons) { Dock = DockStyle.Fill, AutoScroll = true };
}
private static void LoadToPanel<T>(Control dest, string controllerName, IList<string> controllerButtons, IDictionary<string, Dictionary<string, T>> settingsblock, T defaultvalue, PanelCreator<T> createpanel)
private static void LoadToPanel<T>(Control dest, string controllerName, IList<string> controllerButtons, Dictionary<string,string> categoryLabels, IDictionary<string, Dictionary<string, T>> settingsblock, T defaultvalue, PanelCreator<T> createpanel)
{
Dictionary<string, T> settings;
if (!settingsblock.TryGetValue(controllerName, out settings))
@ -109,6 +110,7 @@ namespace BizHawk.Client.EmuHawk
// split the list of all settings into buckets by player number
var buckets = new List<string>[MAXPLAYERS + 1];
var categoryBuckets = new WorkingDictionary<string, List<string>>();
for (var i = 0; i < buckets.Length; i++)
{
buckets[i] = new List<string>();
@ -133,7 +135,14 @@ namespace BizHawk.Client.EmuHawk
i = 0;
}
buckets[i].Add(button);
if (button == "Pointer Pressed")
{
int zzz = 9;
}
if (categoryLabels.ContainsKey(button))
categoryBuckets[categoryLabels[button]].Add(button);
else buckets[i].Add(button);
}
if (buckets[0].Count == controllerButtons.Count)
@ -158,6 +167,13 @@ namespace BizHawk.Client.EmuHawk
}
}
foreach (var cat in categoryBuckets)
{
string tabname = cat.Key;
tt.TabPages.Add(tabname);
tt.TabPages[pageidx].Controls.Add(createpanel(settings, cat.Value, tt.Size));
}
if (buckets[0].Count > 0)
{
string tabname = Global.Emulator.SystemId == "C64" ? "Keyboard" : "Console"; // hack
@ -174,7 +190,9 @@ namespace BizHawk.Client.EmuHawk
SuspendLayout();
LoadPanels(Global.Config);
checkBoxUDLR.Checked = Global.Config.AllowUD_LR;
rbUDLRAllow.Checked = Global.Config.AllowUD_LR;
rbUDLRForbid.Checked = Global.Config.ForbidUD_LR;
rbUDLRPriority.Checked = !Global.Config.AllowUD_LR && !Global.Config.ForbidUD_LR;
checkBoxAutoTab.Checked = Global.Config.InputConfigAutoTab;
SetControllerPicture(def.Name);
@ -189,9 +207,9 @@ namespace BizHawk.Client.EmuHawk
IDictionary<string, Dictionary<string, string>> autofire,
IDictionary<string, Dictionary<string, Config.AnalogBind>> analog)
{
LoadToPanel(NormalControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, normal, string.Empty, CreateNormalPanel);
LoadToPanel(AutofireControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, autofire, string.Empty, CreateNormalPanel);
LoadToPanel(AnalogControlsTab, _theDefinition.Name, _theDefinition.FloatControls, analog, new Config.AnalogBind(string.Empty, 1.0f, 0.1f), CreateAnalogPanel);
LoadToPanel(NormalControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, _theDefinition.CategoryLabels, normal, string.Empty, CreateNormalPanel);
LoadToPanel(AutofireControlsTab, _theDefinition.Name, _theDefinition.BoolButtons, _theDefinition.CategoryLabels, autofire, string.Empty, CreateNormalPanel);
LoadToPanel(AnalogControlsTab, _theDefinition.Name, _theDefinition.FloatControls, _theDefinition.CategoryLabels, analog, new Config.AnalogBind(string.Empty, 1.0f, 0.1f), CreateAnalogPanel);
if (AnalogControlsTab.Controls.Count == 0)
{
@ -298,7 +316,8 @@ namespace BizHawk.Client.EmuHawk
private void ButtonOk_Click(object sender, EventArgs e)
{
Global.Config.AllowUD_LR = checkBoxUDLR.Checked;
Global.Config.AllowUD_LR = rbUDLRAllow.Checked;
Global.Config.ForbidUD_LR = rbUDLRForbid.Checked;
Global.Config.InputConfigAutoTab = checkBoxAutoTab.Checked;
Save();

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -11,7 +11,7 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(released: false)]
[ToolAttributes(released: false, supportedSystems: null)]
public partial class AutoHawk : Form, IToolFormAutoConfig
{
public AutoHawk()

View File

@ -13,7 +13,6 @@ using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(released: true)]
public partial class GenericDebugger : Form, IToolFormAutoConfig, IControlMainform
{
public GenericDebugger()

View File

@ -0,0 +1,133 @@
namespace BizHawk.Client.EmuHawk
{
partial class GameShark
{
/// <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(GameShark));
this.mnuGameShark = new System.Windows.Forms.MenuStrip();
this.btnClear = new System.Windows.Forms.Button();
this.lblCheat = new System.Windows.Forms.Label();
this.txtCheat = new System.Windows.Forms.TextBox();
this.btnGo = new System.Windows.Forms.Button();
this.lblDescription = new System.Windows.Forms.Label();
this.txtDescription = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// mnuGameShark
//
this.mnuGameShark.Location = new System.Drawing.Point(0, 0);
this.mnuGameShark.Name = "mnuGameShark";
this.mnuGameShark.Size = new System.Drawing.Size(284, 24);
this.mnuGameShark.TabIndex = 0;
//
// btnClear
//
this.btnClear.Location = new System.Drawing.Point(141, 132);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(75, 23);
this.btnClear.TabIndex = 4;
this.btnClear.Text = "Clear";
this.btnClear.UseVisualStyleBackColor = true;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
//
// lblCheat
//
this.lblCheat.AutoSize = true;
this.lblCheat.Location = new System.Drawing.Point(147, 91);
this.lblCheat.Name = "lblCheat";
this.lblCheat.Size = new System.Drawing.Size(63, 13);
this.lblCheat.TabIndex = 11;
this.lblCheat.Text = "Cheat Code";
//
// txtCheat
//
this.txtCheat.Location = new System.Drawing.Point(128, 106);
this.txtCheat.Name = "txtCheat";
this.txtCheat.Size = new System.Drawing.Size(100, 20);
this.txtCheat.TabIndex = 2;
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(35, 131);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(75, 23);
this.btnGo.TabIndex = 3;
this.btnGo.Text = "Convert";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
//
// lblDescription
//
this.lblDescription.AutoSize = true;
this.lblDescription.Location = new System.Drawing.Point(42, 90);
this.lblDescription.Name = "lblDescription";
this.lblDescription.Size = new System.Drawing.Size(60, 13);
this.lblDescription.TabIndex = 17;
this.lblDescription.Text = "Description";
//
// txtDescription
//
this.txtDescription.Location = new System.Drawing.Point(22, 106);
this.txtDescription.Name = "txtDescription";
this.txtDescription.Size = new System.Drawing.Size(100, 20);
this.txtDescription.TabIndex = 1;
//
// GameShark
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.Controls.Add(this.txtDescription);
this.Controls.Add(this.lblDescription);
this.Controls.Add(this.btnClear);
this.Controls.Add(this.lblCheat);
this.Controls.Add(this.txtCheat);
this.Controls.Add(this.btnGo);
this.Controls.Add(this.mnuGameShark);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.mnuGameShark;
this.MaximizeBox = false;
this.Name = "GameShark";
this.Text = "GameShark Converter";
this.Load += new System.EventHandler(this.GameShark_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.MenuStrip mnuGameShark;
internal System.Windows.Forms.Button btnClear;
internal System.Windows.Forms.Label lblCheat;
internal System.Windows.Forms.TextBox txtCheat;
internal System.Windows.Forms.Button btnGo;
private System.Windows.Forms.Label lblDescription;
private System.Windows.Forms.TextBox txtDescription;
}
}

View File

@ -0,0 +1,103 @@
using System;
using System.Windows.Forms;
using BizHawk.Emulation.Common;
using BizHawk.Client.Common;
using System.Globalization;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(released: true, supportedSystems: new[] { "GB" })]
public partial class GameShark : Form, IToolForm, IToolFormAutoConfig
{
//We are using Memory Domains, so we NEED this.
[RequiredService]
private IMemoryDomains MemoryDomains { get; set; }
public GameShark()
{
InitializeComponent();
}
public bool UpdateBefore
{
get
{
return true;
}
}
public bool AskSaveChanges()
{
return true;
}
public void FastUpdate()
{
}
public void Restart()
{
}
public void UpdateValues()
{
}
private void btnGo_Click(object sender, EventArgs e)
{
//This line ONLY applies to GB/GBC codes.
if (txtCheat.Text.Length != 8)
{
MessageBox.Show("All GameShark and CodeBreaker cheats need to be Eight characters in Length", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
//Sample Input for GB/GBC:
//010FF6C1
//Becomes:
//Address C1F6
//Value 0F
string parseString = null;
string RAMAddress = null;
string RAMValue = null;
parseString = txtCheat.Text.Remove(0, 2);
//Now we need to break it down a little more.
RAMValue = parseString.Remove(2, 4);
parseString = parseString.Remove(0, 2);
//The issue is Endian... Time to get ultra clever. And Regret it.
//First Half
RAMAddress = parseString.Remove(0, 2);
RAMAddress = RAMAddress + parseString.Remove(2, 2);
//We now have our values.
//This part, is annoying...
try
{
//A Watch needs to be generated so we can make a cheat out of that. This is due to how the Cheat engine works.
//System Bus Domain, The Address to Watch, Byte size (Byte), Hex Display, Description. Not Big Endian.
var watch = Watch.GenerateWatch(MemoryDomains["System Bus"], long.Parse(RAMAddress, NumberStyles.HexNumber), Watch.WatchSize.Byte, Watch.DisplayType.Hex, txtDescription.Text, false);
//Take Watch, Add our Value we want, and it should be active when addded?
Global.CheatList.Add(new Cheat(watch, int.Parse(RAMValue, NumberStyles.HexNumber)));
//Clear old Inputs
txtCheat.Clear();
txtDescription.Clear();
}
catch (Exception ex)
{
MessageBox.Show("An Error occured:" + ex.GetType().ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnClear_Click(object sender, EventArgs e)
{
//Clear old Inputs
txtCheat.Clear();
txtDescription.Clear();
}
private void GameShark_Load(object sender, EventArgs e)
{
}
}
}

View File

@ -0,0 +1,183 @@
<?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="mnuGameShark.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>
AAABAAEAICAAAAEAGACoDAAAFgAAACgAAAAgAAAAQAAAAAEAGAAAAAAAAAAAAGAAAABgAAAAAAAAAAAA
AAD////+///+///+/////////////////////////////////////////////v/+///+////////////
////////////////////////////////////////////////////////////////////////////////
///+/v77+/vq6urk5OTz8/P+/v7+/v7/////////////////////////////////////////////////
///////////////////////////////////////+/v7k5OSJiYleXl5ERERGRkZFRUU5OTk4ODhNTU2R
kZHe3t7+/v7/////////////////////////////////////////////////////////////////////
///6+vqSkpJra2uhoaG6urq9vb27u7u9vb3Dw8PFxcWwsLB9fX04ODhLS0u7u7v9/f3/////////////
///////////////////////////////////////////////4+PiJiYmgoKCrq6tycnI7OzsZGRkHBwcG
BgYVFRUzMzNeXl6fn5/Ly8urq6tOTk5ERETMzMz/////////////////////////////////////////
//////////////+wsLCkpKRubm4QEBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhISF3d3fKysqu
rq45OTl3d3f4+Pj////////////////////////////////////////////u7u6fn59SUlIAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXFxeGhobV1dV5eXk+Pj7m5ub/////////////
//////////////////////////+9vb1ubm4BAQEAAAAAAAAAAAAVFRVBQUFFRUUlJSUDAwMAAAAAAAAA
AAAAAAAAAAAAAAABAQE5OTnCwsKoqKgzMzORkZHq6ur////////////////////////////5+fmenp4a
GhoAAAAAAAAaGhqcnJzf39/f39/c3Nza2trIyMiJiYlKSkoHBwcAAAAAAAAAAAAAAAAAAAAUFBSioqJx
cXGBgYHh4eH////////////////////////////i4uJ9fX0CAgIBAQERERHJycnj4+Ph4eHe3t7c3Nza
2trY2NjW1tbT09PExMRzc3MZGRkAAAACAgICAgIBAQFNTU26urqfn589PT3z8/P/////////////////
///////S0tJdXV0SERESERFvb2/l5eXj4+Ph4eHe3t7c3Nza2trY2NjW1tbT09PQ0NDOzs7GxsZ2dnYT
ExMLCwtLS0u9vb28u7urqqqgoKBiYmL+/v7////////////////////Nzc1SUlEmJCQmJCSamprl5eXj
4+Ph4eHe3t7c3Nza2trY2NitrKyRkJCPjo6WlZWwsLDIyMi5ubliYmK7u7u/v7+dnJwzMTHLyspoaGix
sbH///////////////////+4uLhMS0s4NTQ4NTOQjo3l5eXj4+Ph4eHe3t7c3Nza2trY2NiCgoIvLy8W
FRQmJCQ3NDNJR0V8enizs7LBwcG/v79tbW04NTNdW1nb29tCQkL09PT////////////////S0tI/Pz8Z
GBgcGhlpaGjl5eXj4+Ph4eHe3t7c3Nza2trY2NjW1tbS0tK4uLhubm4gHx85NjNHQz9LR0Srqqm/v7+E
hIQxLitHQz+dnJmhoaGNjY3////////////////t7e3Z2dnk5OTh4eHn5+fl5eXj4+Ph4eHe3t7c3Nza
2trY2NjW1tbT09PQ0NDOzs69vb1ISEg0MS1WUUl+e3W/v7+8vLw8OztPSkNdWFHZ2dhNTU34+Pj/////
///////7+/uenp51c3HMy8nk5OTl5eXj4+Ph4eHe3t7c3Nza2trY2NjW1tbT09PQ0NDOzs7MzMzIyMhj
Y2NAOzVlXlSrqqe9vb2kpKQqKCZgWk+hnZecnJyrq6v////////////////Hx8c2NTRsZVd0bF+FfnLa
2dnh4eHe3t7c3Nza2trY2NjW1tbT09PQ0NDOzs7MzMzIyMjGxcV3cmdvZ1p6c2a0s7K5ubmPj48qKCV0
bWHe3d1paWn////////////////o6Oh1dXVLRTt6cWB6cWCinZHh4eHe3t7c3Nza2trY2NjW1tbT09PQ
0NDOzs7MzMzAv72Ri354cF96cWB4cF+CemurqaS3traIiYgpJyS6uLVra2v9/f3////////////+/v7A
wMArKih9cl+GemSGemTEwbne3t7c3Nza2trY2NjW1tbNzc13d3eSjoWclISFemVuZVNiW06JfmlbVUeJ
fmpVTkKYkIGlop2Pj45nZmR7e3vh4eH////////////////p6emGhoY4MyqPgmePgmeUiG7Rz8rc3Nza
2trY2NjW1tbT09O9vb1FRURHQTSVjHk9OzdzcW1sZFRbWlmKgWxWVVR+c1uPgmeQhGqkno61tbXFxcX/
///////////////////Pz89KSkpjWUWZimmZimiUinXc3Nza2trY2NjW1tbT09PQ0NDOzs6Tk5NPTk6o
qKiPj49KSUatra1RTD+tra5EPjSZimiZimirn4XFxcW9vb3////////////////////39/e6urooJyZ/
clOMfl+6ubfc3Nza2trY2NjW1tbT09PQ0NDOzs7MzMzJycnGxsbCwsKdnZ2+vr5eXVy2trZvb29+cFKk
kmi2qIvJycnHx8f////////////////////////r6+upqakqKCa0s7He3t7c3Nza2trY2NjW1tbT09PQ
0NDOzs7MzMzIyMjGxsbExMTBwcG/v7+srKyxsbG0tLRHQjitmWjEuJu9vr3m5ub/////////////////
///////7+/uTk5O7u7vh4eHe3t7c3Nza2trY2NjV1dXS0tLQ0NDOzs7MzMzIyMjGxsbExMTBwcG/v7+8
vLy5ubm2trZ6enqAcUzUzLm6urr+/v7////////////////////p6emHh4fU1NTj4+Ph4eHe3t7c3NzZ
2trTz8LFsH7GtInPzcjOzs7MzMzIyMjGxsbExMTBwcG/v7+9vb25ubm2tratra1NST7k49/S0tL/////
///////////////////5+fnr6+vl5eXj4+Ph4eHd3d3JyclVU0+Tf0vFqWDHqV/HrWvLwajLy8vIyMnG
xsbExMSIiIiPj4+9vb25ubm2traurq50dHSqqqry8vL////////////////////////////////9/f37
+/v8/Pzu7u7Q0NCbm5ssLCw4MByTfkXLrFvOrlzNtXXKwajGxsXEw8Szs7O9vb29vb25ubm2traurq6j
o6NfX1/////////////////////////////////////////////////////6+vre3t7Pz8+RkZE3Njcg
GxBfUSqagkC9oE3RtWXNvY7BvK6/v7+8vLy5ubm2traurq6kpKRubm7k5OT/////////////////////
///////////////////////////////////z8/Pe3t7W1ta4uLh7e3tEQ0MiIiIaGRcfHRokJCNaWlq9
vb3U1NTOzs7MzMzNzc3U1NT+/v7/////////////////////////////////////////////////////
///////////29vbn5+fc3Nzc3Nze3t7g4ODh4eHk5OTm5ubn5+fr6+v29vb/////////////////////
///////////////////////////////////////////////////////////////////+/v739/fx8fHw
8PDx8fHy8vL19fX7+/v/////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAH/AAAH/8AABwfgAAwA+AAAACAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
</value>
</data>
</root>

View File

@ -240,7 +240,7 @@ namespace BizHawk.Client.EmuHawk
)]
public static void OpenRom(string path)
{
GlobalWin.MainForm.LoadRom(path);
GlobalWin.MainForm.LoadRom(path, new MainForm.LoadRomArgs() { OpenAdvanced = new OpenAdvanced_OpenRom() });
}
[LuaMethodAttributes(

View File

@ -190,10 +190,9 @@ namespace BizHawk.Client.EmuHawk
)]
public void DestroyAll()
{
foreach (var form in _luaForms)
for (var i = _luaForms.Count - 1; i >= 0; i--)
{
form.Close();
_luaForms.Remove(form);
_luaForms.ElementAt(i).Close();
}
}

View File

@ -136,6 +136,7 @@ namespace BizHawk.Client.EmuHawk
public void Close()
{
FormsLibrary.DestroyAll();
_lua = new Lua();
GuiLibrary.Dispose();
}

View File

@ -109,7 +109,7 @@ namespace BizHawk.Client.EmuHawk
DialogResult = DialogResult.OK;
Close();
GlobalWin.MainForm.LoadRom(fileInfo.FullName);
GlobalWin.MainForm.LoadRom(fileInfo.FullName, new MainForm.LoadRomArgs() { OpenAdvanced = new OpenAdvanced_OpenRom() });
}
}

View File

@ -230,7 +230,7 @@ namespace BizHawk.Client.EmuHawk
{
Frame = Global.Emulator.Frame,
CoreData = (byte[])((Global.Emulator as IStatable).SaveStateBinary().Clone()),
InputLog = Movie.InputLog.ToList(),
InputLog = Movie.InputLog.Clone(),
OSDFrameBuffer = GlobalWin.MainForm.CaptureOSD(),
LagLog = Movie.TasLagLog.Clone(),
ChangeLog = new TasMovieChangeLog(Movie),

View File

@ -43,10 +43,14 @@ namespace BizHawk.Client.EmuHawk
public IToolForm Load(Type toolType, bool focus = true)
{
if (!typeof(IToolForm).IsAssignableFrom(toolType))
throw new ArgumentException(String.Format("Type {0} does not implement IToolForm.", toolType.Name));
{
throw new ArgumentException(string.Format("Type {0} does not implement IToolForm.", toolType.Name));
}
if (!ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, toolType))
if (!IsAvailable(toolType))
{
return null;
}
var existingTool = _tools.FirstOrDefault(x => toolType.IsAssignableFrom(x.GetType()));
@ -63,6 +67,7 @@ namespace BizHawk.Client.EmuHawk
existingTool.Show();
existingTool.Focus();
}
return existingTool;
}
}
@ -624,7 +629,37 @@ namespace BizHawk.Client.EmuHawk
public bool IsAvailable(Type t)
{
return ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, t);
if (!ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, t))
{
return false;
}
var tool = Assembly
.GetAssembly(typeof(IToolForm))
.GetTypes()
.FirstOrDefault(type => type == t);
if (tool == null) // This isn't a tool, must not be available
{
return false;
}
var attr = tool.GetCustomAttributes(false)
.OfType<ToolAttributes>()
.FirstOrDefault();
if (attr == null) // If no attributes there is no supported systems documented so assume all
{
return true;
}
// If no supported systems mentioned assume all
if (attr.SupportedSystems != null && attr.SupportedSystems.Any())
{
return attr.SupportedSystems.Contains(Global.Emulator.SystemId);
}
return true;
}
// Eventually we want a single game genie tool, then this mess goes away

View File

@ -756,7 +756,7 @@ namespace BizHawk.Client.EmuHawk
MemoryDomains = _memoryDomains
};
we.SetWatch(_watches.Domain);
we.ShowHawkDialog();
we.ShowHawkDialog(this);
if (we.DialogResult == DialogResult.OK)
{
_watches.Add(we.Watches[0]);

View File

@ -76,6 +76,7 @@
<Compile Include="SimpleTime.cs" />
<Compile Include="Sprintf.cs" />
<Compile Include="SwitcherStream.cs" />
<Compile Include="TempFileManager.cs" />
<Compile Include="UndoHistory.cs" />
<Compile Include="UnmanagedResourceHeap.cs" />
<Compile Include="Util.cs" />

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Runtime.InteropServices;
@ -9,7 +9,7 @@ namespace BizHawk.Common
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);
var path = TempFileCleaner.GetTempFilename(string.Format("{0}", Path.GetFileNameWithoutExtension(dllPath)),".dll",false);
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);
@ -24,10 +24,8 @@ namespace BizHawk.Common
string envpath_new = Path.GetDirectoryName(path) + ";" + envpath;
Environment.SetEnvironmentVariable("PATH", envpath_new, EnvironmentVariableTarget.Process);
_hModule = LoadLibrary(path); //consider using LoadLibraryEx instead of shenanigans?
var newfname = Path.GetFileName(path);
newfname = "bizhawk.bizdelete-" + newfname;
var newpath = Path.Combine(Path.GetDirectoryName(path), newfname);
File.Move(path, newpath);
var newfname = TempFileCleaner.RenameTempFilenameForDelete(path);
File.Move(path, newfname);
}
finally
{
@ -71,4 +69,4 @@ namespace BizHawk.Common
IntPtr _hModule;
}
}
}

View File

@ -442,7 +442,9 @@ namespace BizHawk.Common
#region s - string
case 's': // string
string t = "{0" + ( fieldLength != int.MinValue ? "," + ( flagLeft2Right ? "-" : String.Empty ) + fieldLength.ToString() : String.Empty ) + ":s}";
w = Marshal.PtrToStringAnsi(n);
if (n == IntPtr.Zero)
w = "(null)";
else w = Marshal.PtrToStringAnsi(n);
if ( fieldPrecision >= 0 )
w = w.Substring( 0, fieldPrecision );

View File

@ -1,7 +1,7 @@
using System;
using System;
using System.IO;
namespace BizHawk.Client.Common
namespace BizHawk.Common
{
/// <summary>
/// Starts a thread which cleans any filenames in %temp% beginning with bizhawk.bizdelete.
@ -12,6 +12,23 @@ namespace BizHawk.Client.Common
{
//todo - manage paths other than %temp%, make not static, or allow adding multiple paths to static instance
public static string GetTempFilename(string friendlyname, string extension = null, bool delete = true)
{
string guidPart = Guid.NewGuid().ToString();
var fname = string.Format("biz-{0}-{1}-{2}{3}", System.Diagnostics.Process.GetCurrentProcess().Id, friendlyname, guidPart, extension ?? "");
if (delete) fname = RenameTempFilenameForDelete(fname);
return Path.Combine(Path.GetTempPath(), fname);
}
public static string RenameTempFilenameForDelete(string path)
{
string filename = Path.GetFileName(path);
string dir = Path.GetDirectoryName(path);
if (!filename.StartsWith("biz-")) throw new InvalidOperationException();
filename = "bizdelete-" + filename.Remove(0, 4);
return Path.Combine(dir, filename);
}
public static void Start()
{
lock (typeof(TempFileCleaner))
@ -31,7 +48,7 @@ namespace BizHawk.Client.Common
var di = new DirectoryInfo(Path.GetTempPath());
for (; ; )
{
var fis = di.GetFiles("bizhawk.bizdelete*");
var fis = di.GetFiles("bizdelete-*");
foreach (var fi in fis)
{
try

View File

@ -81,6 +81,7 @@ namespace BizHawk.Emulation.Common
public string Name { get; set; }
public Dictionary<string, string> CategoryLabels = new Dictionary<string, string>();
public List<string> BoolButtons { get; set; }
public List<string> FloatControls { get; private set; }
public List<FloatRange> FloatRanges { get; private set; }

View File

@ -18,9 +18,15 @@ namespace BizHawk.Emulation.Common
string DllPath();
/// <summary>
/// produces a path that contains saveram... because libretro cores need it? not sure yet
/// produces a path that contains saveram... because libretro cores need it
/// </summary>
string GetSaveRAMPath();
/// <returns></returns>
string GetRetroSaveRAMDirectory();
/// <summary>
/// produces a path for use as a libretro system path (different for each core)
/// </summary>
string GetRetroSystemPath();
string GetGameBasePath();

View File

@ -867,8 +867,6 @@
<Compile Include="CPUs\Z80\Tables.cs" />
<Compile Include="CPUs\Z80\Z80A.cs" />
<Compile Include="FileID.cs" />
<Compile Include="LibRetro.cs" />
<Compile Include="LibRetroEmulator.cs" />
<Compile Include="Consoles\PC Engine\MemoryMap.cs" />
<Compile Include="Consoles\PC Engine\MemoryMap.SF2.cs" />
<Compile Include="Consoles\PC Engine\MemoryMap.SuperGrafx.cs" />
@ -877,6 +875,9 @@
<Compile Include="Consoles\PC Engine\VDC.cs" />
<Compile Include="Consoles\PC Engine\VDC.Render.cs" />
<Compile Include="Consoles\PC Engine\VPC.cs" />
<Compile Include="Libretro\LibRetro.cs" />
<Compile Include="Libretro\LibRetroEmulator.cs" />
<Compile Include="Libretro\LibRetroEmulator.InputCallbacks.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Consoles\Sega\Genesis\Genesis.cs" />
<Compile Include="Consoles\Sega\Genesis\GenVDP.cs" />

View File

@ -0,0 +1,219 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using Newtonsoft.Json;
using BizHawk.Common;
using BizHawk.Emulation.Common;
using BizHawk.Common.BufferExtensions;
namespace BizHawk.Emulation.Cores
{
partial class LibRetroEmulator
{
//meanings (they are kind of hazy, but once we're done implementing this it will be completely defined by example)
//port = console physical port?
//device = logical device type
//index = sub device index? (multitap?)
//id = button id (or key id)
short retro_input_state(uint port, uint device, uint index, uint id)
{
//helpful debugging
//Console.WriteLine("{0} {1} {2} {3}", port, device, index, id);
switch ((LibRetro.RETRO_DEVICE)device)
{
case LibRetro.RETRO_DEVICE.POINTER:
{
switch ((LibRetro.RETRO_DEVICE_ID_POINTER)id)
{
case LibRetro.RETRO_DEVICE_ID_POINTER.X: return (short)Controller.GetFloat("Pointer X");
case LibRetro.RETRO_DEVICE_ID_POINTER.Y: return (short)Controller.GetFloat("Pointer Y");
case LibRetro.RETRO_DEVICE_ID_POINTER.PRESSED: return (short)(Controller["Pointer Pressed"] ? 1 : 0);
}
return 0;
}
case LibRetro.RETRO_DEVICE.KEYBOARD:
{
string button = "";
switch ((LibRetro.RETRO_KEY)id)
{
case LibRetro.RETRO_KEY.BACKSPACE: button = "Backspace"; break;
case LibRetro.RETRO_KEY.TAB: button = "Tab"; break;
case LibRetro.RETRO_KEY.CLEAR: button = "Clear"; break;
case LibRetro.RETRO_KEY.RETURN: button = "Return"; break;
case LibRetro.RETRO_KEY.PAUSE: button = "Pause"; break;
case LibRetro.RETRO_KEY.ESCAPE: button = "Escape"; break;
case LibRetro.RETRO_KEY.SPACE: button = "Space"; break;
case LibRetro.RETRO_KEY.EXCLAIM: button = "Exclaim"; break;
case LibRetro.RETRO_KEY.QUOTEDBL: button = "QuoteDbl"; break;
case LibRetro.RETRO_KEY.HASH: button = "Hash"; break;
case LibRetro.RETRO_KEY.DOLLAR: button = "Dollar"; break;
case LibRetro.RETRO_KEY.AMPERSAND: button = "Ampersand"; break;
case LibRetro.RETRO_KEY.QUOTE: button = "Quote"; break;
case LibRetro.RETRO_KEY.LEFTPAREN: button = "LeftParen"; break;
case LibRetro.RETRO_KEY.RIGHTPAREN: button = "RightParen"; break;
case LibRetro.RETRO_KEY.ASTERISK: button = "Asterisk"; break;
case LibRetro.RETRO_KEY.PLUS: button = "Plus"; break;
case LibRetro.RETRO_KEY.COMMA: button = "Comma"; break;
case LibRetro.RETRO_KEY.MINUS: button = "Minus"; break;
case LibRetro.RETRO_KEY.PERIOD: button = "Period"; break;
case LibRetro.RETRO_KEY.SLASH: button = "Slash"; break;
case LibRetro.RETRO_KEY._0: button = "0"; break;
case LibRetro.RETRO_KEY._1: button = "1"; break;
case LibRetro.RETRO_KEY._2: button = "2"; break;
case LibRetro.RETRO_KEY._3: button = "3"; break;
case LibRetro.RETRO_KEY._4: button = "4"; break;
case LibRetro.RETRO_KEY._5: button = "5"; break;
case LibRetro.RETRO_KEY._6: button = "6"; break;
case LibRetro.RETRO_KEY._7: button = "7"; break;
case LibRetro.RETRO_KEY._8: button = "8"; break;
case LibRetro.RETRO_KEY._9: button = "9"; break;
case LibRetro.RETRO_KEY.COLON: button = "Colon"; break;
case LibRetro.RETRO_KEY.SEMICOLON: button = "Semicolon"; break;
case LibRetro.RETRO_KEY.LESS: button = "Less"; break;
case LibRetro.RETRO_KEY.EQUALS: button = "Equals"; break;
case LibRetro.RETRO_KEY.GREATER: button = "Greater"; break;
case LibRetro.RETRO_KEY.QUESTION: button = "Question"; break;
case LibRetro.RETRO_KEY.AT: button = "At"; break;
case LibRetro.RETRO_KEY.LEFTBRACKET: button = "LeftBracket"; break;
case LibRetro.RETRO_KEY.BACKSLASH: button = "Backslash"; break;
case LibRetro.RETRO_KEY.RIGHTBRACKET: button = "RightBracket"; break;
case LibRetro.RETRO_KEY.CARET: button = "Caret"; break;
case LibRetro.RETRO_KEY.UNDERSCORE: button = "Underscore"; break;
case LibRetro.RETRO_KEY.BACKQUOTE: button = "Backquote"; break;
case LibRetro.RETRO_KEY.a: button = "A"; break;
case LibRetro.RETRO_KEY.b: button = "B"; break;
case LibRetro.RETRO_KEY.c: button = "C"; break;
case LibRetro.RETRO_KEY.d: button = "D"; break;
case LibRetro.RETRO_KEY.e: button = "E"; break;
case LibRetro.RETRO_KEY.f: button = "F"; break;
case LibRetro.RETRO_KEY.g: button = "G"; break;
case LibRetro.RETRO_KEY.h: button = "H"; break;
case LibRetro.RETRO_KEY.i: button = "I"; break;
case LibRetro.RETRO_KEY.j: button = "J"; break;
case LibRetro.RETRO_KEY.k: button = "K"; break;
case LibRetro.RETRO_KEY.l: button = "L"; break;
case LibRetro.RETRO_KEY.m: button = "M"; break;
case LibRetro.RETRO_KEY.n: button = "N"; break;
case LibRetro.RETRO_KEY.o: button = "O"; break;
case LibRetro.RETRO_KEY.p: button = "P"; break;
case LibRetro.RETRO_KEY.q: button = "Q"; break;
case LibRetro.RETRO_KEY.r: button = "R"; break;
case LibRetro.RETRO_KEY.s: button = "S"; break;
case LibRetro.RETRO_KEY.t: button = "T"; break;
case LibRetro.RETRO_KEY.u: button = "U"; break;
case LibRetro.RETRO_KEY.v: button = "V"; break;
case LibRetro.RETRO_KEY.w: button = "W"; break;
case LibRetro.RETRO_KEY.x: button = "X"; break;
case LibRetro.RETRO_KEY.y: button = "Y"; break;
case LibRetro.RETRO_KEY.z: button = "Z"; break;
case LibRetro.RETRO_KEY.DELETE: button = "Delete"; break;
case LibRetro.RETRO_KEY.KP0: button = "KP0"; break;
case LibRetro.RETRO_KEY.KP1: button = "KP1"; break;
case LibRetro.RETRO_KEY.KP2: button = "KP2"; break;
case LibRetro.RETRO_KEY.KP3: button = "KP3"; break;
case LibRetro.RETRO_KEY.KP4: button = "KP4"; break;
case LibRetro.RETRO_KEY.KP5: button = "KP5"; break;
case LibRetro.RETRO_KEY.KP6: button = "KP6"; break;
case LibRetro.RETRO_KEY.KP7: button = "KP7"; break;
case LibRetro.RETRO_KEY.KP8: button = "KP8"; break;
case LibRetro.RETRO_KEY.KP9: button = "KP9"; break;
case LibRetro.RETRO_KEY.KP_PERIOD: button = "KP_Period"; break;
case LibRetro.RETRO_KEY.KP_DIVIDE: button = "KP_Divide"; break;
case LibRetro.RETRO_KEY.KP_MULTIPLY: button = "KP_Multiply"; break;
case LibRetro.RETRO_KEY.KP_MINUS: button = "KP_Minus"; break;
case LibRetro.RETRO_KEY.KP_PLUS: button = "KP_Plus"; break;
case LibRetro.RETRO_KEY.KP_ENTER: button = "KP_Enter"; break;
case LibRetro.RETRO_KEY.KP_EQUALS: button = "KP_Equals"; break;
case LibRetro.RETRO_KEY.UP: button = "Up"; break;
case LibRetro.RETRO_KEY.DOWN: button = "Down"; break;
case LibRetro.RETRO_KEY.RIGHT: button = "Right"; break;
case LibRetro.RETRO_KEY.LEFT: button = "Left"; break;
case LibRetro.RETRO_KEY.INSERT: button = "Insert"; break;
case LibRetro.RETRO_KEY.HOME: button = "Home"; break;
case LibRetro.RETRO_KEY.END: button = "End"; break;
case LibRetro.RETRO_KEY.PAGEUP: button = "PageUp"; break;
case LibRetro.RETRO_KEY.PAGEDOWN: button = "PageDown"; break;
case LibRetro.RETRO_KEY.F1: button = "F1"; break;
case LibRetro.RETRO_KEY.F2: button = "F2"; break;
case LibRetro.RETRO_KEY.F3: button = "F3"; break;
case LibRetro.RETRO_KEY.F4: button = "F4"; break;
case LibRetro.RETRO_KEY.F5: button = "F5"; break;
case LibRetro.RETRO_KEY.F6: button = "F6"; break;
case LibRetro.RETRO_KEY.F7: button = "F7"; break;
case LibRetro.RETRO_KEY.F8: button = "F8"; break;
case LibRetro.RETRO_KEY.F9: button = "F9"; break;
case LibRetro.RETRO_KEY.F10: button = "F10"; break;
case LibRetro.RETRO_KEY.F11: button = "F11"; break;
case LibRetro.RETRO_KEY.F12: button = "F12"; break;
case LibRetro.RETRO_KEY.F13: button = "F13"; break;
case LibRetro.RETRO_KEY.F14: button = "F14"; break;
case LibRetro.RETRO_KEY.F15: button = "F15"; break;
case LibRetro.RETRO_KEY.NUMLOCK: button = "NumLock"; break;
case LibRetro.RETRO_KEY.CAPSLOCK: button = "CapsLock"; break;
case LibRetro.RETRO_KEY.SCROLLOCK: button = "ScrollLock"; break;
case LibRetro.RETRO_KEY.RSHIFT: button = "RShift"; break;
case LibRetro.RETRO_KEY.LSHIFT: button = "LShift"; break;
case LibRetro.RETRO_KEY.RCTRL: button = "RCtrl"; break;
case LibRetro.RETRO_KEY.LCTRL: button = "LCtrl"; break;
case LibRetro.RETRO_KEY.RALT: button = "RAlt"; break;
case LibRetro.RETRO_KEY.LALT: button = "LAlt"; break;
case LibRetro.RETRO_KEY.RMETA: button = "RMeta"; break;
case LibRetro.RETRO_KEY.LMETA: button = "LMeta"; break;
case LibRetro.RETRO_KEY.LSUPER: button = "LSuper"; break;
case LibRetro.RETRO_KEY.RSUPER: button = "RSuper"; break;
case LibRetro.RETRO_KEY.MODE: button = "Mode"; break;
case LibRetro.RETRO_KEY.COMPOSE: button = "Compose"; break;
case LibRetro.RETRO_KEY.HELP: button = "Help"; break;
case LibRetro.RETRO_KEY.PRINT: button = "Print"; break;
case LibRetro.RETRO_KEY.SYSREQ: button = "SysReq"; break;
case LibRetro.RETRO_KEY.BREAK: button = "Break"; break;
case LibRetro.RETRO_KEY.MENU: button = "Menu"; break;
case LibRetro.RETRO_KEY.POWER: button = "Power"; break;
case LibRetro.RETRO_KEY.EURO: button = "Euro"; break;
case LibRetro.RETRO_KEY.UNDO: button = "Undo"; break;
}
return (short)(Controller["Key " + button] ? 1 : 0);
}
case LibRetro.RETRO_DEVICE.JOYPAD:
{
//The JOYPAD is sometimes called RetroPad (and we'll call it that in user-facing stuff cos retroarch does)
//It is essentially a Super Nintendo controller, but with additional L2/R2/L3/R3 buttons, similar to a PS1 DualShock.
string button = "";
switch ((LibRetro.RETRO_DEVICE_ID_JOYPAD)id)
{
case LibRetro.RETRO_DEVICE_ID_JOYPAD.A: button = "A"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.B: button = "B"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.X: button = "X"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.Y: button = "Y"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.UP: button = "Up"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.DOWN: button = "Down"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.LEFT: button = "Left"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.RIGHT: button = "Right"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.L: button = "L"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.R: button = "R"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.SELECT: button = "Select"; break;
case LibRetro.RETRO_DEVICE_ID_JOYPAD.START: button = "Start"; break;
}
return (short)(GetButton(port+1, "RetroPad", button) ? 1 : 0);
}
default:
return 0;
}
}
}
}

View File

@ -3,8 +3,10 @@ next
=========================================
*EmuHawk
**Add libretro player, compatible with selected cores
**Support Code-Data Logger for GB/GBC, SMS/GG, SNES, and Genesis
**Add GameShark cheat converter
**Add custom exception display box, so exception info can be clipboarded out
**Support Code-Data Logger for GB/GBC, SMS/GG, and Genesis
**Cheat Dialog: Fix flakiness in value-editing
**Stop FP precision conflicts between lua scripts and D3D Display method
**DispMethod D3D: More leniency in compilation of optional shaders (so it's able to run on more low spec systems)
@ -12,8 +14,13 @@ next
**Validate user shaders at selection time
**Support user custom AR selection
**Add --load-state commandline
**Streamline editing RAM Watches
**Tidy main form context menu
**Add more options for U+D/L+R forbid/mutex
**Fix #525 - Memorywatch hex textbox now remembers values across memdomain switches
**Fix #526 - Hex editor repainting fails and garbage rendering
**Fix #535 - domain list does not update when changing cores
**Fix #537 - Annoyance with "always on top"
**Tastudio (TODO - editorialize this section)
***color stated frames on WasLag too.
@ -33,6 +40,8 @@ next
**Lua
**Fix gameExtraPadding coordinate translation
**Clarify script pause/stop state in UI and logic
**Fix forms.destroyall() and call it when lua console closes
**Fix error in sizing of lua draw buffers with SetGameExtraPadding (and probably ClientExtraPadding) use
*PSX
**Fix #530 "AV Resizing shows black screen with PSX"
@ -40,6 +49,7 @@ next
*SNES
**Fix crashes in GFX debugger (including fix #529)
**Recommend proper SNES PAR
**Build dlls without msvcrt14 dependencies (to run on more systems)
*Genesis
**Fix missing scrollbars in VDP viewer

View File

@ -81,12 +81,12 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Compatibility|Win32'">
<TargetName>libsneshawk-32-compatibility</TargetName>
<OutDir>..\..\output\dll</OutDir>
<OutDir>..\..\output\dll\</OutDir>
<IntDir>.obj\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Performance|Win32'">
<TargetName>libsneshawk-32-performance</TargetName>
<OutDir>..\..\output\dll</OutDir>
<OutDir>..\..\output\dll\</OutDir>
<IntDir>.obj\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Performance|Win32'">
@ -135,6 +135,7 @@
<OmitFramePointers>true</OmitFramePointers>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -146,7 +147,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Compatibility|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
@ -154,6 +155,10 @@
<AdditionalIncludeDirectories>$(ProjectDir)../bsnes</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HOOKS;BIZHAWK;PROFILE_COMPATIBILITY;GAMEBOY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>None</DebugInformationFormat>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -318,6 +323,7 @@
<ClCompile Include="..\bsnes\gameboy\scheduler\scheduler.cpp" />
<ClCompile Include="..\bsnes\gameboy\system\system.cpp" />
<ClCompile Include="..\bsnes\gameboy\video\video.cpp" />
<ClCompile Include="..\bsnes\libco\x86.c" />
<ClCompile Include="..\bsnes\snes\alt\cpu\cpu.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Compatibility|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Compatibility|Win32'">true</ExcludedFromBuild>
@ -709,7 +715,6 @@
<ClCompile Include="..\bsnes\snes\system\system.cpp" />
<ClCompile Include="..\bsnes\target-libsnes\libsnes.cpp" />
<ClCompile Include="..\bsnes\target-libsnes\libsnes_pwrap.cpp" />
<ClCompile Include="..\libco_msvc_win32\libco_msvc_win32.c" />
</ItemGroup>
<ItemGroup>
<None Include="..\bsnes\snes\alt\smp\core\cc.sh">

View File

@ -139,9 +139,6 @@
<Filter Include="target-libsnes">
<UniqueIdentifier>{1d1cf6c9-9e1b-402c-b1cc-7ed8866092e7}</UniqueIdentifier>
</Filter>
<Filter Include="libco_msvc_win32">
<UniqueIdentifier>{d2cbafd7-caaf-404c-9fdb-4adaaf5c1687}</UniqueIdentifier>
</Filter>
<Filter Include="snes\cpu\core">
<UniqueIdentifier>{be676f5c-dcb3-4a39-911c-4e102dfa25d8}</UniqueIdentifier>
</Filter>
@ -166,6 +163,9 @@
<Filter Include="snes\smp\timing">
<UniqueIdentifier>{a2db2d0e-68ec-4fa0-91fc-2bcc8ac33d32}</UniqueIdentifier>
</Filter>
<Filter Include="libco">
<UniqueIdentifier>{70659d45-e958-48ff-94a3-8a57aa76dd61}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\bsnes\base\base.hpp">
@ -392,9 +392,6 @@
<ClCompile Include="..\bsnes\target-libsnes\libsnes_pwrap.cpp">
<Filter>target-libsnes</Filter>
</ClCompile>
<ClCompile Include="..\libco_msvc_win32\libco_msvc_win32.c">
<Filter>libco_msvc_win32</Filter>
</ClCompile>
<ClCompile Include="..\bsnes\snes\cpu\core\core.cpp">
<Filter>snes\cpu\core</Filter>
</ClCompile>
@ -569,6 +566,9 @@
<ClCompile Include="..\bsnes\snes\dsp\counter.cpp">
<Filter>snes\dsp</Filter>
</ClCompile>
<ClCompile Include="..\bsnes\libco\x86.c">
<Filter>libco</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\bsnes\snes\alt\smp\core\op_misc.b">

View File

@ -26,6 +26,141 @@
"P2 RetroPad L": "",
"P2 RetroPad R": "",
"Pointer Pressed": "WMouse L",
"Key Backspace": "Backspace",
"Key Tab": "Tab",
"Key Clear": "",
"Key Return": "Return",
"Key Pause": "",
"Key Escape": "Escape",
"Key Space": "Space",
"Key Exclaim": "",
"Key QuoteDbl": "",
"Key Hash": "",
"Key Dollar": "",
"Key Ampersand": "",
"Key Quote": "",
"Key LeftParen": "",
"Key RightParen": "",
"Key Asterisk": "",
"Key Plus": "",
"Key Comma": "Comma",
"Key Minus": "Minus",
"Key Period": "Period",
"Key Slash": "Slash",
"Key 0": "D0",
"Key 1": "D1",
"Key 2": "D2",
"Key 3": "D3",
"Key 4": "D4",
"Key 5": "D5",
"Key 6": "D6",
"Key 7": "D7",
"Key 8": "D8",
"Key 9": "D9",
"Key Colon": "",
"Key Semicolon": "Semicolon",
"Key Less": "",
"Key Equals": "Equals",
"Key Greater": "",
"Key Question": "",
"Key At": "",
"Key LeftBracket": "LeftBracket",
"Key Backslash": "Backslash",
"Key RightBracket": "RightBracket",
"Key Caret": "",
"Key Underscore": "",
"Key Backquote": "Grave",
"Key A": "A",
"Key B": "B",
"Key C": "C",
"Key D": "D",
"Key E": "E",
"Key F": "F",
"Key G": "G",
"Key H": "H",
"Key I": "I",
"Key J": "J",
"Key K": "K",
"Key L": "L",
"Key M": "M",
"Key N": "N",
"Key O": "O",
"Key P": "P",
"Key Q": "Q",
"Key R": "R",
"Key S": "S",
"Key T": "T",
"Key U": "U",
"Key V": "V",
"Key W": "W",
"Key X": "X",
"Key Y": "Y",
"Key Z": "Z",
"Key Delete": "Delete",
"Key KP0": "NumberPad0",
"Key KP1": "NumberPad1",
"Key KP2": "NumberPad2",
"Key KP3": "NumberPad3",
"Key KP4": "NumberPad4",
"Key KP5": "NumberPad5",
"Key KP6": "NumberPad6",
"Key KP7": "NumberPad7",
"Key KP8": "NumberPad8",
"Key KP9": "NumberPad9",
"Key KP_Period": "NumberPadPeriod",
"Key KP_Divide": "NumberPadSlash",
"Key KP_Multiply": "NumberPadStar",
"Key KP_Minus": "NumberPadMinus",
"Key KP_Plus": "NumberPadPlus",
"Key KP_Enter": "NumberPadEnter",
"Key KP_Equals": "",
"Key Up": "UpArrow",
"Key Down": "DownArrow",
"Key Left": "LeftArrow",
"Key Insert": "LeftControl",
"Key Home": "Home",
"Key End": "End",
"Key PageUp": "PageUp",
"Key PageDown": "PageDown",
"Key F1": "F1",
"Key F2": "F2",
"Key F3": "F3",
"Key F4": "F4",
"Key F5": "F5",
"Key F6": "F6",
"Key F7": "F7",
"Key F8": "F8",
"Key F9": "F9",
"Key F10": "F10",
"Key F11": "F11",
"Key F12": "F12",
"Key F13": "",
"Key F14": "",
"Key F15": "",
"Key NumLock": "NumberLock",
"Key CapsLock": "CapsLock",
"Key ScrollLock": "ScrollLock",
"Key RShift": "RightShift",
"Key LShift": "LeftShift",
"Key RCtrl": "RightControl",
"Key LCtrl": "LeftControl",
"Key RAlt": "RightAlt",
"Key LAlt": "LeftAlt",
"Key RMeta": "",
"Key LMeta": "",
"Key LSuper": "",
"Key RSuper": "",
"Key Mode": "",
"Key Compose": "",
"Key Help": "",
"Key Print": "",
"Key SysReq": "",
"Key Break": "",
"Key Menu": "Applications",
"Key Power": "",
"Key Euro": "",
"Key Undo": "",
"Key Right": "RightArrow"
},
"NES Controller": {
"P1 Up": "UpArrow, J1 POV1U, X1 DpadUp, X1 LStickUp",