Merge branch 'master' of https://github.com/Upthorn/Bizhawk
This commit is contained in:
commit
435d717f7b
|
@ -63,7 +63,7 @@ namespace SevenZip
|
||||||
/// 7z.dll (from the 7-zip distribution) supports every InArchiveFormat for encoding and decoding.
|
/// 7z.dll (from the 7-zip distribution) supports every InArchiveFormat for encoding and decoding.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
//private static string _libraryFileName = ConfigurationManager.AppSettings["7zLocation"] ?? Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "7z.dll");
|
//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
|
#endif
|
||||||
#if WINCE
|
#if WINCE
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace BizHawk.Client.Common
|
||||||
Markers = new TasMovieMarkerList(this);
|
Markers = new TasMovieMarkerList(this);
|
||||||
Markers.CollectionChanged += Markers_CollectionChanged;
|
Markers.CollectionChanged += Markers_CollectionChanged;
|
||||||
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
|
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
|
||||||
BindMarkersToInput = true;
|
BindMarkersToInput = false;
|
||||||
CurrentBranch = -1;
|
CurrentBranch = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ namespace BizHawk.Client.Common
|
||||||
Markers = new TasMovieMarkerList(this);
|
Markers = new TasMovieMarkerList(this);
|
||||||
Markers.CollectionChanged += Markers_CollectionChanged;
|
Markers.CollectionChanged += Markers_CollectionChanged;
|
||||||
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
|
Markers.Add(0, startsFromSavestate ? "Savestate" : "Power on");
|
||||||
BindMarkersToInput = true;
|
BindMarkersToInput = false;
|
||||||
CurrentBranch = -1;
|
CurrentBranch = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,17 +509,13 @@ namespace BizHawk.Client.Common
|
||||||
Log?.Dispose();
|
Log?.Dispose();
|
||||||
Log = branch.InputLog.Clone();
|
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)
|
if (divergentPoint.HasValue)
|
||||||
{
|
{
|
||||||
_stateManager.Invalidate(divergentPoint.Value);
|
InvalidateAfter(divergentPoint.Value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_stateManager.Invalidate(branch.InputLog.Count);
|
InvalidateAfter(branch.InputLog.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BindMarkersToInput) // pretty critical not to erase them
|
if (BindMarkersToInput) // pretty critical not to erase them
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>..\output\</OutputPath>
|
<OutputPath>..\output\</OutputPath>
|
||||||
<DefineConstants>WINDOWS;DEBUG</DefineConstants>
|
<DefineConstants>DEBUG;WINDOWS;EXE_PROJECT</DefineConstants>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||||
<OutputPath>..\output\</OutputPath>
|
<OutputPath>..\output\</OutputPath>
|
||||||
<DefineConstants>WINDOWS</DefineConstants>
|
<DefineConstants>WINDOWS;EXE_PROJECT</DefineConstants>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
|
@ -113,6 +113,9 @@
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="..\BizHawk.Common\PlatformLinkedLibSingleton.cs">
|
||||||
|
<Link>PlatformLinkedLibSingleton.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="..\Version\svnrev.cs">
|
<Compile Include="..\Version\svnrev.cs">
|
||||||
<Link>svnrev.cs</Link>
|
<Link>svnrev.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -3060,11 +3060,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (IsSeeking && Emulator.Frame == PauseOnFrame.Value)
|
if (IsSeeking && Emulator.Frame == PauseOnFrame.Value)
|
||||||
{
|
{
|
||||||
PauseEmulator();
|
PauseEmulator();
|
||||||
PauseOnFrame = null;
|
|
||||||
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
if (GlobalWin.Tools.IsLoaded<TAStudio>())
|
||||||
{
|
{
|
||||||
GlobalWin.Tools.TAStudio.StopSeeking();
|
GlobalWin.Tools.TAStudio.StopSeeking();
|
||||||
}
|
}
|
||||||
|
PauseOnFrame = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,14 +23,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
|
||||||
var libLoader = PlatformLinkedLibSingleton.LinkedLibManager;
|
var libLoader = EXE_PROJECT.PlatformLinkedLibSingleton.LinkedLibManager;
|
||||||
|
|
||||||
//http://www.codeproject.com/Articles/310675/AppDomain-AssemblyResolve-Event-Tips
|
//http://www.codeproject.com/Articles/310675/AppDomain-AssemblyResolve-Event-Tips
|
||||||
|
|
||||||
//try loading libraries we know we'll need
|
//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
|
//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
|
//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 d3dx9 = libLoader.LoadPlatformSpecific($"d3dx9_43{libExt}");
|
||||||
var vc2015 = libLoader.LoadPlatformSpecific($"vcruntime140{libExt}");
|
var vc2015 = libLoader.LoadPlatformSpecific($"vcruntime140{libExt}");
|
||||||
var vc2012 = libLoader.LoadPlatformSpecific($"msvcr120{libExt}"); //TODO - check version?
|
var vc2012 = libLoader.LoadPlatformSpecific($"msvcr120{libExt}"); //TODO - check version?
|
||||||
|
@ -65,7 +65,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
libLoader.FreePlatformSpecific(vc2010);
|
libLoader.FreePlatformSpecific(vc2010);
|
||||||
libLoader.FreePlatformSpecific(vc2010p);
|
libLoader.FreePlatformSpecific(vc2010p);
|
||||||
|
|
||||||
if (!PlatformLinkedLibSingleton.RunningOnUnix)
|
if (!EXE_PROJECT.PlatformLinkedLibSingleton.RunningOnUnix)
|
||||||
{
|
{
|
||||||
// this will look in subdirectory "dll" to load pinvoked stuff
|
// this will look in subdirectory "dll" to load pinvoked stuff
|
||||||
string dllDir = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "dll");
|
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 UnixMonoMainLoopCrashHandler()
|
||||||
: (PlatformSpecificMainLoopCrashHandler) new Win32MainLoopCrashHandler();
|
: (PlatformSpecificMainLoopCrashHandler) new Win32MainLoopCrashHandler();
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GlobalWin.GLManager = GLManager.Instance;
|
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
|
//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:
|
REDO_DISPMETHOD:
|
||||||
if (Global.Config.DispMethod == Config.EDispMethod.GdiPlus)
|
if (Global.Config.DispMethod == Config.EDispMethod.GdiPlus)
|
||||||
GlobalWin.GL = new Bizware.BizwareGL.Drivers.GdiPlus.IGL_GdiPlus();
|
GlobalWin.GL = new Bizware.BizwareGL.Drivers.GdiPlus.IGL_GdiPlus();
|
||||||
|
@ -313,7 +313,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
goto REDO_DISPMETHOD;
|
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.
|
//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".
|
//The relevant initialization happened just before in "create IGL context".
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
TasBranch branch = GetBranch(index);
|
TasBranch branch = GetBranch(index);
|
||||||
if (branch != null)
|
if (branch != null)
|
||||||
{
|
{
|
||||||
var record = Tastudio.CurrentTasMovie[branch.Frame];
|
var record = Movie[branch.Frame];
|
||||||
if (index == Movie.CurrentBranch)
|
if (index == Movie.CurrentBranch)
|
||||||
{
|
{
|
||||||
color = TAStudio.CurrentFrame_InputLog;
|
color = TAStudio.CurrentFrame_InputLog;
|
||||||
|
@ -146,7 +146,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private TasBranch GetBranch(int index)
|
private TasBranch GetBranch(int index)
|
||||||
{
|
{
|
||||||
return Tastudio.CurrentTasMovie.GetBranch(index);
|
return Movie.GetBranch(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Branch()
|
public void Branch()
|
||||||
|
@ -199,13 +199,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Tastudio.CurrentTasMovie.LoadBranch(branch);
|
Movie.LoadBranch(branch);
|
||||||
var stateInfo = new KeyValuePair<int, byte[]>(branch.Frame, branch.CoreData);
|
var stateInfo = new KeyValuePair<int, byte[]>(branch.Frame, branch.CoreData);
|
||||||
Tastudio.LoadState(stateInfo);
|
Tastudio.LoadState(stateInfo);
|
||||||
|
Movie.TasStateManager.Capture(true);
|
||||||
QuickBmpFile.Copy(new BitmapBufferVideoProvider(branch.OSDFrameBuffer), Tastudio.VideoProvider);
|
QuickBmpFile.Copy(new BitmapBufferVideoProvider(branch.OSDFrameBuffer), Tastudio.VideoProvider);
|
||||||
|
|
||||||
if (Tastudio.Settings.OldControlSchemeForBranches && Tastudio.TasPlaybackBox.RecordingMode)
|
if (Tastudio.Settings.OldControlSchemeForBranches && Tastudio.TasPlaybackBox.RecordingMode)
|
||||||
Tastudio.CurrentTasMovie.Truncate(branch.Frame);
|
Movie.Truncate(branch.Frame);
|
||||||
|
|
||||||
GlobalWin.MainForm.PauseOnFrame = null;
|
GlobalWin.MainForm.PauseOnFrame = null;
|
||||||
Tastudio.RefreshDialog();
|
Tastudio.RefreshDialog();
|
||||||
|
@ -242,7 +243,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
private void AddBranchToolStripMenuItem_Click(object sender, EventArgs e)
|
private void AddBranchToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Branch();
|
Branch();
|
||||||
CallSavedCallback(Tastudio.CurrentTasMovie.BranchCount - 1);
|
CallSavedCallback(Movie.BranchCount - 1);
|
||||||
GlobalWin.OSD.AddMessage("Added branch " + Movie.CurrentBranch.ToString());
|
GlobalWin.OSD.AddMessage("Added branch " + Movie.CurrentBranch.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,7 +251,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
Branch();
|
Branch();
|
||||||
EditBranchTextPopUp(Movie.CurrentBranch);
|
EditBranchTextPopUp(Movie.CurrentBranch);
|
||||||
CallSavedCallback(Tastudio.CurrentTasMovie.BranchCount - 1);
|
CallSavedCallback(Movie.BranchCount - 1);
|
||||||
GlobalWin.OSD.AddMessage("Added branch " + Movie.CurrentBranch.ToString());
|
GlobalWin.OSD.AddMessage("Added branch " + Movie.CurrentBranch.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,13 +367,13 @@ namespace BizHawk.Client.EmuHawk
|
||||||
if (_branchUndo == BranchUndo.Load)
|
if (_branchUndo == BranchUndo.Load)
|
||||||
{
|
{
|
||||||
LoadBranch(_backupBranch);
|
LoadBranch(_backupBranch);
|
||||||
CallLoadedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
|
CallLoadedCallback(Movie.Branches.IndexOf(_backupBranch));
|
||||||
GlobalWin.OSD.AddMessage("Branch Load canceled");
|
GlobalWin.OSD.AddMessage("Branch Load canceled");
|
||||||
}
|
}
|
||||||
else if (_branchUndo == BranchUndo.Update)
|
else if (_branchUndo == BranchUndo.Update)
|
||||||
{
|
{
|
||||||
Movie.UpdateBranch(Movie.GetBranch(_backupBranch.UniqueIdentifier), _backupBranch);
|
Movie.UpdateBranch(Movie.GetBranch(_backupBranch.UniqueIdentifier), _backupBranch);
|
||||||
CallSavedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
|
CallSavedCallback(Movie.Branches.IndexOf(_backupBranch));
|
||||||
GlobalWin.OSD.AddMessage("Branch Update canceled");
|
GlobalWin.OSD.AddMessage("Branch Update canceled");
|
||||||
}
|
}
|
||||||
else if (_branchUndo == BranchUndo.Text)
|
else if (_branchUndo == BranchUndo.Text)
|
||||||
|
@ -384,7 +385,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
Movie.AddBranch(_backupBranch);
|
Movie.AddBranch(_backupBranch);
|
||||||
BranchView.RowCount = Movie.BranchCount;
|
BranchView.RowCount = Movie.BranchCount;
|
||||||
CallSavedCallback(Tastudio.CurrentTasMovie.Branches.IndexOf(_backupBranch));
|
CallSavedCallback(Movie.Branches.IndexOf(_backupBranch));
|
||||||
GlobalWin.OSD.AddMessage("Branch Removal canceled");
|
GlobalWin.OSD.AddMessage("Branch Removal canceled");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -822,6 +822,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
SingleClickFloatEditMenuItem.Checked = Settings.SingleClickFloatEdit;
|
SingleClickFloatEditMenuItem.Checked = Settings.SingleClickFloatEdit;
|
||||||
OldControlSchemeForBranchesMenuItem.Checked = Settings.OldControlSchemeForBranches;
|
OldControlSchemeForBranchesMenuItem.Checked = Settings.OldControlSchemeForBranches;
|
||||||
LoadBranchOnDoubleclickMenuItem.Checked = Settings.LoadBranchOnDoubleClick;
|
LoadBranchOnDoubleclickMenuItem.Checked = Settings.LoadBranchOnDoubleClick;
|
||||||
|
BindMarkersToInputMenuItem.Checked = CurrentTasMovie.BindMarkersToInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e)
|
private void SetMaxUndoLevelsMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -191,7 +191,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
this.Invoke(() => SavingProgressBar.Visible = true);
|
this.Invoke(() => SavingProgressBar.Visible = true);
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if (_seekBackgroundWorker.CancellationPending || !this.IsHandleCreated)
|
if (_seekBackgroundWorker.CancellationPending || !IsHandleCreated || !Mainform.PauseOnFrame.HasValue)
|
||||||
{
|
{
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
using System;
|
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
|
namespace BizHawk.Common
|
||||||
{
|
#endif
|
||||||
public sealed class PlatformLinkedLibSingleton
|
{
|
||||||
|
|
||||||
|
public sealed class PlatformLinkedLibSingleton
|
||||||
{
|
{
|
||||||
public static readonly bool RunningOnUnix = Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX;
|
public static readonly bool RunningOnUnix = Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX;
|
||||||
|
|
||||||
|
@ -83,4 +90,4 @@ namespace BizHawk.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
case 0xFF54: ret = HDMA_dest_lo; break; // HDMA4
|
case 0xFF54: ret = HDMA_dest_lo; break; // HDMA4
|
||||||
case 0xFF55: ret = HDMA_ctrl; break; // HDMA5
|
case 0xFF55: ret = HDMA_ctrl; break; // HDMA5
|
||||||
case 0xFF68: ret = BG_pal_ret; break; // BGPI
|
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 0xFF6A: ret = OBJ_pal_ret; break; // OBPI
|
||||||
case 0xFF6B: ret = OBJ_bytes[OBJ_bytes_index]; break; // OBPD
|
case 0xFF6B: ret = OBJ_bytes[OBJ_bytes_index]; break; // OBPD
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,18 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
return ret;
|
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)
|
public override void WriteReg(int addr, byte value)
|
||||||
{
|
{
|
||||||
switch (addr)
|
switch (addr)
|
||||||
|
@ -240,8 +252,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
BG_bytes_inc = ((value & 0x80) == 0x80);
|
BG_bytes_inc = ((value & 0x80) == 0x80);
|
||||||
break;
|
break;
|
||||||
case 0xFF69: // BGPD
|
case 0xFF69: // BGPD
|
||||||
BG_transfer_byte = value;
|
if (VRAM_access_write)
|
||||||
BG_bytes[BG_bytes_index] = value;
|
{
|
||||||
|
BG_transfer_byte = value;
|
||||||
|
BG_bytes[BG_bytes_index] = value;
|
||||||
|
}
|
||||||
|
|
||||||
// change the appropriate palette color
|
// change the appropriate palette color
|
||||||
color_compute_BG();
|
color_compute_BG();
|
||||||
|
|
|
@ -49,7 +49,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
if ((value & 1) > 0)
|
if ((value & 1) > 0)
|
||||||
{
|
{
|
||||||
clk_internal = true;
|
clk_internal = true;
|
||||||
clk_rate = 512;
|
if (((value & 2) > 0) && Core.GBC_compat)
|
||||||
|
{
|
||||||
|
clk_rate = 256;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clk_rate = 512;
|
||||||
|
}
|
||||||
serial_clock = clk_rate;
|
serial_clock = clk_rate;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -64,7 +71,14 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
|
||||||
if ((value & 1) > 0)
|
if ((value & 1) > 0)
|
||||||
{
|
{
|
||||||
clk_internal = true;
|
clk_internal = true;
|
||||||
clk_rate = 512;
|
if (((value & 2) > 0) && Core.GBC_compat)
|
||||||
|
{
|
||||||
|
clk_rate = 256;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clk_rate = 512;
|
||||||
|
}
|
||||||
serial_clock = clk_rate;
|
serial_clock = clk_rate;
|
||||||
}
|
}
|
||||||
else
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
||||||
|
|
||||||
public ControllerDefinition ControllerDefinition => _controllerDeck.Definition;
|
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)
|
public void FrameAdvance(IController controller, bool render, bool rendersound)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("-----------------------FRAME-----------------------");
|
//Console.WriteLine("-----------------------FRAME-----------------------");
|
||||||
|
@ -105,7 +100,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
||||||
R.do_single_step();
|
R.do_single_step();
|
||||||
|
|
||||||
// the signal to shift out a bit is when serial_clock = 1
|
// 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)
|
if (LinkConnected)
|
||||||
{
|
{
|
||||||
|
@ -113,7 +108,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
||||||
|
|
||||||
if ((R.serialport.clk_rate == -1) && R.serialport.serial_start)
|
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.send_external_bit((byte)(R.serialport.serial_data & 0x80));
|
||||||
R.serialport.coming_in = L.serialport.going_out;
|
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;
|
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)
|
if (LinkConnected)
|
||||||
{
|
{
|
||||||
|
@ -129,7 +124,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
||||||
|
|
||||||
if ((L.serialport.clk_rate == -1) && L.serialport.serial_start)
|
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.send_external_bit((byte)(L.serialport.serial_data & 0x80));
|
||||||
L.serialport.coming_in = R.serialport.going_out;
|
L.serialport.coming_in = R.serialport.going_out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
||||||
ser.Sync("_cableconnected", ref _cableconnected);
|
ser.Sync("_cableconnected", ref _cableconnected);
|
||||||
ser.Sync("_cablediscosignal", ref _cablediscosignal);
|
ser.Sync("_cablediscosignal", ref _cablediscosignal);
|
||||||
_controllerDeck.SyncState(ser);
|
_controllerDeck.SyncState(ser);
|
||||||
|
|
||||||
|
LinkConnected = _cableconnected;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
||||||
{
|
{
|
||||||
static QuickNES()
|
static QuickNES()
|
||||||
{
|
{
|
||||||
QN = BizInvoker.GetInvoker<LibQuickNES>(new DynamicLibraryImportResolver(LibQuickNES.dllname), CallingConventionAdapters.Native);
|
Resolver = new DynamicLibraryImportResolver(LibQuickNES.dllname);
|
||||||
|
QN = BizInvoker.GetInvoker<LibQuickNES>(Resolver, CallingConventionAdapters.Native);
|
||||||
QN.qn_setup_mappers();
|
QN.qn_setup_mappers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,6 +74,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
||||||
}
|
}
|
||||||
|
|
||||||
static readonly LibQuickNES QN;
|
static readonly LibQuickNES QN;
|
||||||
|
static readonly DynamicLibraryImportResolver Resolver;
|
||||||
|
|
||||||
public IEmulatorServiceProvider ServiceProvider { get; private set; }
|
public IEmulatorServiceProvider ServiceProvider { get; private set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue