diff --git a/BizHawk.Client.Common/7z/LibraryManager.cs b/BizHawk.Client.Common/7z/LibraryManager.cs
index 8f0d8c4b68..ac0aedd2ee 100644
--- a/BizHawk.Client.Common/7z/LibraryManager.cs
+++ b/BizHawk.Client.Common/7z/LibraryManager.cs
@@ -63,7 +63,7 @@ namespace SevenZip
/// 7z.dll (from the 7-zip distribution) supports every InArchiveFormat for encoding and decoding.
///
//private static string _libraryFileName = ConfigurationManager.AppSettings["7zLocation"] ?? Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "7z.dll");
- private static string _libraryFileName = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "7z.dll");
+ private static string _libraryFileName = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "dll\\7z.dll");
#endif
#if WINCE
diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs
index e500a1e833..a226d2d17f 100644
--- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs
+++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs
@@ -65,7 +65,7 @@ namespace BizHawk.Client.Common
Markers = new TasMovieMarkerList(this);
Markers.CollectionChanged += Markers_CollectionChanged;
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
- BindMarkersToInput = true;
+ BindMarkersToInput = false;
CurrentBranch = -1;
}
@@ -84,7 +84,7 @@ namespace BizHawk.Client.Common
Markers = new TasMovieMarkerList(this);
Markers.CollectionChanged += Markers_CollectionChanged;
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
- BindMarkersToInput = true;
+ BindMarkersToInput = false;
CurrentBranch = -1;
}
@@ -509,17 +509,13 @@ namespace BizHawk.Client.Common
Log?.Dispose();
Log = branch.InputLog.Clone();
- _lagLog.FromLagLog(branch.LagLog);
-
- // if there are branch states, they will be loaded anyway
- // but if there's none, or only *after* divergent point, don't invalidate the entire movie anymore
if (divergentPoint.HasValue)
{
- _stateManager.Invalidate(divergentPoint.Value);
+ InvalidateAfter(divergentPoint.Value);
}
else
{
- _stateManager.Invalidate(branch.InputLog.Count);
+ InvalidateAfter(branch.InputLog.Count);
}
if (BindMarkersToInput) // pretty critical not to erase them
diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj
index fd0185f1b6..53c12c988e 100644
--- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj
+++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj
@@ -45,7 +45,7 @@
true
..\output\
- WINDOWS;DEBUG
+ DEBUG;WINDOWS;EXE_PROJECT
true
full
AnyCPU
@@ -56,7 +56,7 @@
..\output\
- WINDOWS
+ WINDOWS;EXE_PROJECT
true
true
pdbonly
@@ -113,6 +113,9 @@
+
+ PlatformLinkedLibSingleton.cs
+
svnrev.cs
diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs
index ccc8ef8ef0..9283463289 100644
--- a/BizHawk.Client.EmuHawk/MainForm.cs
+++ b/BizHawk.Client.EmuHawk/MainForm.cs
@@ -3060,11 +3060,11 @@ namespace BizHawk.Client.EmuHawk
if (IsSeeking && Emulator.Frame == PauseOnFrame.Value)
{
PauseEmulator();
- PauseOnFrame = null;
if (GlobalWin.Tools.IsLoaded())
{
GlobalWin.Tools.TAStudio.StopSeeking();
}
+ PauseOnFrame = null;
}
}
diff --git a/BizHawk.Client.EmuHawk/Program.cs b/BizHawk.Client.EmuHawk/Program.cs
index cc970daf55..0ed765e047 100644
--- a/BizHawk.Client.EmuHawk/Program.cs
+++ b/BizHawk.Client.EmuHawk/Program.cs
@@ -23,14 +23,14 @@ namespace BizHawk.Client.EmuHawk
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
- var libLoader = PlatformLinkedLibSingleton.LinkedLibManager;
+ var libLoader = EXE_PROJECT.PlatformLinkedLibSingleton.LinkedLibManager;
//http://www.codeproject.com/Articles/310675/AppDomain-AssemblyResolve-Event-Tips
//try loading libraries we know we'll need
//something in the winforms, etc. code below will cause .net to popup a missing msvcr100.dll in case that one's missing
//but oddly it lets us proceed and we'll then catch it here
- var libExt = PlatformLinkedLibSingleton.RunningOnUnix ? ".dll.so" : ".dll";
+ var libExt = EXE_PROJECT.PlatformLinkedLibSingleton.RunningOnUnix ? ".dll.so" : ".dll";
var d3dx9 = libLoader.LoadPlatformSpecific($"d3dx9_43{libExt}");
var vc2015 = libLoader.LoadPlatformSpecific($"vcruntime140{libExt}");
var vc2012 = libLoader.LoadPlatformSpecific($"msvcr120{libExt}"); //TODO - check version?
@@ -65,7 +65,7 @@ namespace BizHawk.Client.EmuHawk
libLoader.FreePlatformSpecific(vc2010);
libLoader.FreePlatformSpecific(vc2010p);
- if (!PlatformLinkedLibSingleton.RunningOnUnix)
+ if (!EXE_PROJECT.PlatformLinkedLibSingleton.RunningOnUnix)
{
// this will look in subdirectory "dll" to load pinvoked stuff
string dllDir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "dll");
@@ -200,7 +200,7 @@ namespace BizHawk.Client.EmuHawk
}
}
}
- private static PlatformSpecificMainLoopCrashHandler mainLoopCrashHandler = PlatformLinkedLibSingleton.RunningOnUnix
+ private static PlatformSpecificMainLoopCrashHandler mainLoopCrashHandler = EXE_PROJECT.PlatformLinkedLibSingleton.RunningOnUnix
? (PlatformSpecificMainLoopCrashHandler) new UnixMonoMainLoopCrashHandler()
: (PlatformSpecificMainLoopCrashHandler) new Win32MainLoopCrashHandler();
@@ -265,7 +265,7 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.GLManager = GLManager.Instance;
//now create the "GL" context for the display method. we can reuse the IGL_TK context if opengl display method is chosen
- if (PlatformLinkedLibSingleton.RunningOnUnix) Global.Config.DispMethod = Config.EDispMethod.GdiPlus;
+ if (EXE_PROJECT.PlatformLinkedLibSingleton.RunningOnUnix) Global.Config.DispMethod = Config.EDispMethod.GdiPlus;
REDO_DISPMETHOD:
if (Global.Config.DispMethod == Config.EDispMethod.GdiPlus)
GlobalWin.GL = new Bizware.BizwareGL.Drivers.GdiPlus.IGL_GdiPlus();
@@ -313,7 +313,7 @@ namespace BizHawk.Client.EmuHawk
goto REDO_DISPMETHOD;
}
- if (!PlatformLinkedLibSingleton.RunningOnUnix)
+ if (!EXE_PROJECT.PlatformLinkedLibSingleton.RunningOnUnix)
{
//WHY do we have to do this? some intel graphics drivers (ig7icd64.dll 10.18.10.3304 on an unknown chip on win8.1) are calling SetDllDirectory() for the process, which ruins stuff.
//The relevant initialization happened just before in "create IGL context".
diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs
index 8e7adcc47b..f64cace517 100644
--- a/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs
+++ b/BizHawk.Client.EmuHawk/tools/TAStudio/BookmarksBranchesBox.cs
@@ -117,7 +117,7 @@ namespace BizHawk.Client.EmuHawk
TasBranch branch = GetBranch(index);
if (branch != null)
{
- var record = Tastudio.CurrentTasMovie[branch.Frame];
+ var record = Movie[branch.Frame];
if (index == Movie.CurrentBranch)
{
color = TAStudio.CurrentFrame_InputLog;
@@ -146,7 +146,7 @@ namespace BizHawk.Client.EmuHawk
private TasBranch GetBranch(int index)
{
- return Tastudio.CurrentTasMovie.GetBranch(index);
+ return Movie.GetBranch(index);
}
public void Branch()
@@ -199,13 +199,14 @@ namespace BizHawk.Client.EmuHawk
return;
}
- Tastudio.CurrentTasMovie.LoadBranch(branch);
+ Movie.LoadBranch(branch);
var stateInfo = new KeyValuePair(branch.Frame, branch.CoreData);
Tastudio.LoadState(stateInfo);
+ Movie.TasStateManager.Capture(true);
QuickBmpFile.Copy(new BitmapBufferVideoProvider(branch.OSDFrameBuffer), Tastudio.VideoProvider);
if (Tastudio.Settings.OldControlSchemeForBranches && Tastudio.TasPlaybackBox.RecordingMode)
- Tastudio.CurrentTasMovie.Truncate(branch.Frame);
+ Movie.Truncate(branch.Frame);
GlobalWin.MainForm.PauseOnFrame = null;
Tastudio.RefreshDialog();
@@ -242,7 +243,7 @@ namespace BizHawk.Client.EmuHawk
private void AddBranchToolStripMenuItem_Click(object sender, EventArgs e)
{
Branch();
- CallSavedCallback(Tastudio.CurrentTasMovie.BranchCount - 1);
+ CallSavedCallback(Movie.BranchCount - 1);
GlobalWin.OSD.AddMessage("Added branch " + Movie.CurrentBranch.ToString());
}
@@ -250,7 +251,7 @@ namespace BizHawk.Client.EmuHawk
{
Branch();
EditBranchTextPopUp(Movie.CurrentBranch);
- CallSavedCallback(Tastudio.CurrentTasMovie.BranchCount - 1);
+ CallSavedCallback(Movie.BranchCount - 1);
GlobalWin.OSD.AddMessage("Added branch " + Movie.CurrentBranch.ToString());
}
@@ -366,13 +367,13 @@ namespace BizHawk.Client.EmuHawk
if (_branchUndo == BranchUndo.Load)
{
LoadBranch(_backupBranch);
- CallLoadedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
+ CallLoadedCallback(Movie.Branches.IndexOf(_backupBranch));
GlobalWin.OSD.AddMessage("Branch Load canceled");
}
else if (_branchUndo == BranchUndo.Update)
{
Movie.UpdateBranch(Movie.GetBranch(_backupBranch.UniqueIdentifier), _backupBranch);
- CallSavedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
+ CallSavedCallback(Movie.Branches.IndexOf(_backupBranch));
GlobalWin.OSD.AddMessage("Branch Update canceled");
}
else if (_branchUndo == BranchUndo.Text)
@@ -384,7 +385,7 @@ namespace BizHawk.Client.EmuHawk
{
Movie.AddBranch(_backupBranch);
BranchView.RowCount = Movie.BranchCount;
- CallSavedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
+ CallSavedCallback(Movie.Branches.IndexOf(_backupBranch));
GlobalWin.OSD.AddMessage("Branch Removal canceled");
}
diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs
index 013f04ea77..f2eb9db437 100644
--- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs
+++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs
@@ -822,6 +822,7 @@ namespace BizHawk.Client.EmuHawk
SingleClickFloatEditMenuItem.Checked = Settings.SingleClickFloatEdit;
OldControlSchemeForBranchesMenuItem.Checked = Settings.OldControlSchemeForBranches;
LoadBranchOnDoubleclickMenuItem.Checked = Settings.LoadBranchOnDoubleClick;
+ BindMarkersToInputMenuItem.Checked = CurrentTasMovie.BindMarkersToInput;
}
private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e)
diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs
index 0019b8e3eb..8b0647d1f6 100644
--- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs
+++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs
@@ -191,7 +191,7 @@ namespace BizHawk.Client.EmuHawk
this.Invoke(() => SavingProgressBar.Visible = true);
for (;;)
{
- if (_seekBackgroundWorker.CancellationPending || !this.IsHandleCreated)
+ if (_seekBackgroundWorker.CancellationPending || !IsHandleCreated || !Mainform.PauseOnFrame.HasValue)
{
e.Cancel = true;
break;
diff --git a/BizHawk.Common/PlatformLinkedLibSingleton.cs b/BizHawk.Common/PlatformLinkedLibSingleton.cs
index 9a9ed2baab..14ed9c29e6 100644
--- a/BizHawk.Common/PlatformLinkedLibSingleton.cs
+++ b/BizHawk.Common/PlatformLinkedLibSingleton.cs
@@ -1,9 +1,16 @@
using System;
-using System.Runtime.InteropServices;
-
+using System.Runtime.InteropServices;
+
+//put in a different namespace for EXE so we can have an instance of this type (by linking to this file rather than copying it) built-in to the exe
+//so the exe doesnt implicitly depend on the dll
+#if EXE_PROJECT
+namespace EXE_PROJECT
+#else
namespace BizHawk.Common
-{
- public sealed class PlatformLinkedLibSingleton
+#endif
+{
+
+public sealed class PlatformLinkedLibSingleton
{
public static readonly bool RunningOnUnix = Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX;
@@ -83,4 +90,4 @@ namespace BizHawk.Common
}
}
}
-}
\ No newline at end of file
+}
diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs
index b02084f64b..27775f026b 100644
--- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs
+++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/GBC_PPU.cs
@@ -82,7 +82,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
case 0xFF54: ret = HDMA_dest_lo; break; // HDMA4
case 0xFF55: ret = HDMA_ctrl; break; // HDMA5
case 0xFF68: ret = BG_pal_ret; break; // BGPI
- case 0xFF69: ret = BG_bytes[BG_bytes_index]; break; // BGPD
+ case 0xFF69: ret = BG_PAL_read(); break; // BGPD
case 0xFF6A: ret = OBJ_pal_ret; break; // OBPI
case 0xFF6B: ret = OBJ_bytes[OBJ_bytes_index]; break; // OBPD
}
@@ -90,6 +90,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
return ret;
}
+ public byte BG_PAL_read()
+ {
+ if (VRAM_access_read)
+ {
+ return BG_bytes[BG_bytes_index];
+ }
+ else
+ {
+ return 0xFF;
+ }
+ }
+
public override void WriteReg(int addr, byte value)
{
switch (addr)
@@ -240,8 +252,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
BG_bytes_inc = ((value & 0x80) == 0x80);
break;
case 0xFF69: // BGPD
- BG_transfer_byte = value;
- BG_bytes[BG_bytes_index] = value;
+ if (VRAM_access_write)
+ {
+ BG_transfer_byte = value;
+ BG_bytes[BG_bytes_index] = value;
+ }
// change the appropriate palette color
color_compute_BG();
diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/SerialPort.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/SerialPort.cs
index 4aa700268c..f5e0150c61 100644
--- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/SerialPort.cs
+++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawk/SerialPort.cs
@@ -49,7 +49,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
if ((value & 1) > 0)
{
clk_internal = true;
- clk_rate = 512;
+ if (((value & 2) > 0) && Core.GBC_compat)
+ {
+ clk_rate = 256;
+ }
+ else
+ {
+ clk_rate = 512;
+ }
serial_clock = clk_rate;
}
else
@@ -64,7 +71,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
if ((value & 1) > 0)
{
clk_internal = true;
- clk_rate = 512;
+ if (((value & 2) > 0) && Core.GBC_compat)
+ {
+ clk_rate = 256;
+ }
+ else
+ {
+ clk_rate = 512;
+ }
serial_clock = clk_rate;
}
else
@@ -75,7 +89,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
}
}
- serial_control = (byte)(0x7E | (value & 0x81)); // middle six bits always 1
+ if (Core.GBC_compat)
+ {
+ serial_control = (byte)(0x7C | (value & 0x83)); // extra CGB bit
+ }
+ else
+ {
+ serial_control = (byte)(0x7E | (value & 0x81)); // middle six bits always 1
+ }
+
break;
}
}
diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs
index 0a95188026..1cebe9f5b4 100644
--- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs
+++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IEmulator.cs
@@ -14,11 +14,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
public ControllerDefinition ControllerDefinition => _controllerDeck.Definition;
- public byte controller_state;
- public bool in_vblank_old;
- public bool in_vblank;
- public bool vblank_rise;
-
public void FrameAdvance(IController controller, bool render, bool rendersound)
{
//Console.WriteLine("-----------------------FRAME-----------------------");
@@ -105,7 +100,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
R.do_single_step();
// the signal to shift out a bit is when serial_clock = 1
- if (L.serialport.serial_clock == 1)
+ if ((L.serialport.serial_clock == 1) || (L.serialport.serial_clock == 2))
{
if (LinkConnected)
{
@@ -113,7 +108,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
if ((R.serialport.clk_rate == -1) && R.serialport.serial_start)
{
- R.serialport.serial_clock = 1;
+ R.serialport.serial_clock = L.serialport.serial_clock;
R.serialport.send_external_bit((byte)(R.serialport.serial_data & 0x80));
R.serialport.coming_in = L.serialport.going_out;
}
@@ -121,7 +116,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
L.serialport.coming_in = R.serialport.going_out;
}
}
- else if (R.serialport.serial_clock == 1)
+ else if ((R.serialport.serial_clock == 1) || (R.serialport.serial_clock == 2))
{
if (LinkConnected)
{
@@ -129,7 +124,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
if ((L.serialport.clk_rate == -1) && L.serialport.serial_start)
{
- L.serialport.serial_clock = 1;
+ L.serialport.serial_clock = R.serialport.serial_clock;
L.serialport.send_external_bit((byte)(L.serialport.serial_data & 0x80));
L.serialport.coming_in = R.serialport.going_out;
}
diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IStatable.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IStatable.cs
index ffd05ea99f..5429566225 100644
--- a/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IStatable.cs
+++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/GBHawkLink/GBHawkLink.IStatable.cs
@@ -60,6 +60,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
ser.Sync("_cableconnected", ref _cableconnected);
ser.Sync("_cablediscosignal", ref _cablediscosignal);
_controllerDeck.SyncState(ser);
+
+ LinkConnected = _cableconnected;
}
}
}
diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs
index fc632d8fa9..899ae0254f 100644
--- a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs
+++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs
@@ -21,7 +21,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
{
static QuickNES()
{
- QN = BizInvoker.GetInvoker(new DynamicLibraryImportResolver(LibQuickNES.dllname), CallingConventionAdapters.Native);
+ Resolver = new DynamicLibraryImportResolver(LibQuickNES.dllname);
+ QN = BizInvoker.GetInvoker(Resolver, CallingConventionAdapters.Native);
QN.qn_setup_mappers();
}
@@ -73,6 +74,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
}
static readonly LibQuickNES QN;
+ static readonly DynamicLibraryImportResolver Resolver;
public IEmulatorServiceProvider ServiceProvider { get; private set; }