Merge pull request #1057 from TASVideos/master

Sync GBHawk with master
This commit is contained in:
alyosha-tas 2017-11-19 09:47:14 -05:00 committed by GitHub
commit 821953348a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 123 additions and 7 deletions

View File

@ -268,6 +268,7 @@
<Compile Include="tools\Watch\SeparatorWatch.cs" />
<Compile Include="tools\Watch\Watch.cs" />
<Compile Include="tools\Watch\WatchList\WatchChangeCountComparer.cs" />
<Compile Include="tools\Watch\WatchList\WatchDisplayTypeComparer.cs" />
<Compile Include="tools\Watch\WatchList\WatchEqualityComparer.cs" />
<Compile Include="tools\Watch\WatchList\WatchDomainComparer.cs" />
<Compile Include="tools\Watch\WatchList\WatchAddressComparer.cs" />

View File

@ -0,0 +1,44 @@
using System.Collections.Generic;
namespace BizHawk.Client.Common
{
/// <summary>
/// This class hold a collection <see cref="Watch"/>
/// </summary>
public sealed partial class WatchList
{
/// <summary>
/// Nested private class that defines how to compare two <see cref="Watch"/>es based on their full display type
/// </summary>
private sealed class WatchFullDisplayTypeComparer
: WatchEqualityComparer, IComparer<Watch>
{
/// <summary>
/// Compares two <see cref="Watch"/>es and determines which has greater size.
/// If they are equal, comparison will done on the display type and then on endianness
/// </summary>
/// <param name="x">First <see cref="Watch"/></param>
/// <param name="y">Second <see cref="Watch"/></param>
/// <returns>0 for equality, 1 if x comes first; -1 if y comes first</returns>
public int Compare(Watch x, Watch y)
{
if (Equals(x, y))
{
return 0;
}
if (x.Size.Equals(y.Size))
{
if (x.Type.Equals(y.Type))
{
return x.BigEndian.CompareTo(y.BigEndian);
}
return x.Type.CompareTo(y.Type);
}
return x.Size.CompareTo(y.Size);
}
}
}
}

View File

@ -26,11 +26,13 @@ namespace BizHawk.Client.Common
public const string PREV = "PrevColumn";
public const string CHANGES = "ChangesColumn";
public const string DIFF = "DiffColumn";
public const string TYPE = "TypeColumn";
public const string DOMAIN = "DomainColumn";
public const string NOTES = "NotesColumn";
private static readonly WatchDomainComparer DomainComparer = new WatchDomainComparer();
private static readonly WatchAddressComparer AddressComparer = new WatchAddressComparer();
private static readonly WatchFullDisplayTypeComparer DisplayTypeComparer = new WatchFullDisplayTypeComparer();
private static readonly WatchValueComparer ValueComparer = new WatchValueComparer();
private static readonly WatchPreviousValueComparer PreviousValueComparer = new WatchPreviousValueComparer();
private static readonly WatchValueDifferenceComparer ValueDifferenceComparer = new WatchValueDifferenceComparer();
@ -297,6 +299,19 @@ namespace BizHawk.Client.Common
break;
case TYPE:
if (reverse)
{
_watchList.Sort(DisplayTypeComparer);
_watchList.Reverse();
}
else
{
_watchList.Sort(DisplayTypeComparer);
}
break;
case NOTES:
if (reverse)
{

View File

@ -165,11 +165,19 @@ namespace BizHawk.Client.EmuHawk
public IEnumerable<Tuple<string, float>> GetFloats()
{
var g = state.Gamepad;
const float f = 3.2768f;
//constant for adapting a +/- 32768 range to a +/-10000-based range
const float f = 32768 / 10000.0f;
//constant for adapting a 0-255 range to a 0-10000-based range
const float f255 = 255 / 10000.0f;
yield return new Tuple<string, float>("LeftThumbX", g.sThumbLX / f);
yield return new Tuple<string, float>("LeftThumbY", g.sThumbLY / f);
yield return new Tuple<string, float>("RightThumbX", g.sThumbRX / f);
yield return new Tuple<string, float>("RightThumbY", g.sThumbRY / f);
yield return new Tuple<string, float>("LeftTrigger", g.bLeftTrigger / f255);
yield return new Tuple<string, float>("RightTrigger", g.bRightTrigger / f255);
yield break;
}

View File

@ -114,6 +114,7 @@
this.PrevColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ChangesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.TypeColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.ListViewContextMenu.SuspendLayout();
@ -850,6 +851,7 @@
this.PrevColumn,
this.ChangesColumn,
this.DiffColumn,
this.TypeColumn,
this.DomainColumn,
this.NotesColumn});
this.WatchListView.ContextMenuStrip = this.ListViewContextMenu;
@ -907,6 +909,12 @@
this.DiffColumn.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.DiffColumn.Width = 59;
//
// TypeColumn
//
this.TypeColumn.Name = "TypeColumn";
this.TypeColumn.Text = "Type";
this.TypeColumn.Width = 55;
//
// DomainColumn
//
this.DomainColumn.Name = "DomainColumn";
@ -959,6 +967,7 @@
private System.Windows.Forms.ColumnHeader PrevColumn;
private System.Windows.Forms.ColumnHeader ChangesColumn;
private System.Windows.Forms.ColumnHeader DiffColumn;
private System.Windows.Forms.ColumnHeader TypeColumn;
private System.Windows.Forms.ColumnHeader DomainColumn;
private System.Windows.Forms.ColumnHeader NotesColumn;
private MenuStripEx RamWatchMenu;
@ -1040,4 +1049,4 @@
private System.Windows.Forms.ToolStripMenuItem WriteBreakpointContextMenuItem;
private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
}
}
}

View File

@ -73,8 +73,9 @@ namespace BizHawk.Client.EmuHawk
new Column { Name = WatchList.PREV, Visible = false, Index = 2, Width = 59 },
new Column { Name = WatchList.CHANGES, Visible = true, Index = 3, Width = 55 },
new Column { Name = WatchList.DIFF, Visible = false, Index = 4, Width = 59 },
new Column { Name = WatchList.DOMAIN, Visible = true, Index = 5, Width = 55 },
new Column { Name = WatchList.NOTES, Visible = true, Index = 6, Width = 128 },
new Column { Name = WatchList.TYPE, Visible = false, Index = 5, Width = 55 },
new Column { Name = WatchList.DOMAIN, Visible = true, Index = 6, Width = 55 },
new Column { Name = WatchList.NOTES, Visible = true, Index = 7, Width = 128 },
};
}
@ -428,6 +429,39 @@ namespace BizHawk.Client.EmuHawk
}
}
private string ComputeDisplayType(Watch w)
{
String s = w.Size == WatchSize.Byte ? "1" : (w.Size == WatchSize.Word ? "2" : "4");
switch (w.Type)
{
case Common.DisplayType.Binary:
s += "b";
break;
case Common.DisplayType.FixedPoint_12_4:
s += "F";
break;
case Common.DisplayType.FixedPoint_16_16:
s += "F6";
break;
case Common.DisplayType.FixedPoint_20_12:
s += "F2";
break;
case Common.DisplayType.Float:
s += "f";
break;
case Common.DisplayType.Hex:
s += "h";
break;
case Common.DisplayType.Signed:
s += "s";
break;
case Common.DisplayType.Unsigned:
s += "u";
break;
}
return s + (w.BigEndian ? "B" : "L");
}
private string GetColumnValue(string name, int index)
{
switch (name)
@ -444,6 +478,8 @@ namespace BizHawk.Client.EmuHawk
return _watches[index].ChangeCount.ToString();
case WatchList.DIFF:
return _watches[index].Diff;
case WatchList.TYPE:
return ComputeDisplayType(_watches[index]);
case WatchList.DOMAIN:
return _watches[index].Domain.Name;
case WatchList.NOTES:
@ -619,6 +655,9 @@ namespace BizHawk.Client.EmuHawk
case WatchList.DIFF:
text = _watches[index].Diff;
break;
case WatchList.TYPE:
text = ComputeDisplayType(_watches[index]);
break;
case WatchList.DOMAIN:
text = _watches[index].Domain.Name;
break;

View File

@ -3,7 +3,7 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Nintendo.GBA
{
[Core("mGBA", "endrift", true, true, "0.6.0 (24ab81f8db7745586cef246be8957ad272aded9b)", "https://mgba.io/", false)]
[Core("mGBA", "endrift", true, true, "0.6.1 (c3e9258bc3a1e8a0e68ff73d5ff9674b56257eb7)", "https://mgba.io/", false)]
[ServiceNotApplicable(typeof(IDriveLight), typeof(IRegionable))]
public partial class MGBAHawk : IEmulator, IVideoProvider, ISoundProvider, IGBAGPUViewable,
ISaveRam, IStatable, IInputPollable, ISettable<MGBAHawk.Settings, MGBAHawk.SyncSettings>,

@ -1 +1 @@
Subproject commit e94475387505141fc8d4b4107f6db09dae9e106f
Subproject commit 7ea2de6ddac62351de472e69a84fd90b59ec95ad

Binary file not shown.

Binary file not shown.

View File

@ -253,7 +253,7 @@ ECL_EXPORT void GetMemoryAreas(MemoryArea *m)
m[5].Data = Pico.rom;
m[5].Name = "MD CART";
m[5].Size = Pico.romsize;
m[5].Flags = MEMORYAREA_FLAGS_WORDSIZE2 | MEMORYAREA_FLAGS_SWAPPED;
m[5].Flags = MEMORYAREA_FLAGS_WORDSIZE2 | MEMORYAREA_FLAGS_SWAPPED | MEMORYAREA_FLAGS_YUGEENDIAN;
if (Pico32xMem)
{