Remove FPU precision (probably not needed according to natt)

This commit is contained in:
YoshiRulz 2019-10-25 21:21:56 +10:00
parent 4974807b21
commit 60cf4e6c02
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 51 additions and 88 deletions

View File

@ -29,8 +29,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
[CoreConstructor("NES")]
public QuickNES(CoreComm comm, byte[] file, object settings, object syncSettings)
{
using (FP.Save())
{
ServiceProvider = new BasicServiceProvider(this);
CoreComm = comm;
@ -72,44 +70,12 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
throw;
}
}
}
static readonly LibQuickNES QN;
static readonly DynamicLibraryImportResolver Resolver;
public IEmulatorServiceProvider ServiceProvider { get; private set; }
#region FPU precision
private class FPCtrl : IDisposable
{
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern uint _control87(uint @new, uint mask);
public static void PrintCurrentFP()
{
uint curr = _control87(0, 0);
Console.WriteLine("Current FP word: 0x{0:x8}", curr);
}
uint cw;
public IDisposable Save()
{
cw = _control87(0, 0);
_control87(0x00000, 0x30000);
return this;
}
public void Dispose()
{
_control87(cw, 0x30000);
}
}
FPCtrl FP = new FPCtrl();
#endregion
#region Controller
public ControllerDefinition ControllerDefinition { get; private set; }
@ -183,8 +149,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
public bool FrameAdvance(IController controller, bool render, bool rendersound = true)
{
CheckDisposed();
using (FP.Save())
{
if (controller.IsPressed("Power"))
QN.qn_reset(Context, true);
if (controller.IsPressed("Reset"))
@ -211,7 +175,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
if (CB1 != null) CB1();
if (CB2 != null) CB2();
}
return true;
}