fix #2805 for real this time (#2936)

* fix https://github.com/TASVideos/BizHawk/issues/2805

* fix https://github.com/TASVideos/BizHawk/issues/2805 for real this time

* misc

* advance penguin
This commit is contained in:
CasualPokePlayer 2021-09-21 05:46:57 -07:00 committed by GitHub
parent b5639f8834
commit d513c5b2a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -180,6 +180,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
[BizImport(cc, Compatibility = true)]
public abstract byte BizReadBus(IntPtr ctx, uint addr);
[UnmanagedFunctionPointer(cc)]
public delegate void InputCallback();
[BizImport(cc, Compatibility = true)]
public abstract void BizSetInputCallback(IntPtr ctx, InputCallback cb);
[UnmanagedFunctionPointer(cc)]
public delegate void TraceCallback(string msg);
[BizImport(cc, Compatibility = true)]

View File

@ -4,10 +4,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
{
public partial class MGBAHawk : IInputPollable
{
private readonly LibmGBA.InputCallback InputCallback;
public int LagCount { get; set; }
public bool IsLagFrame { get; set; }
[FeatureNotImplemented]
public IInputCallbackSystem InputCallbacks { get; private set; }
private void InputCb()
{
// most things are already handled in the core, this is just for event.oninputpoll
InputCallbacks.Call();
}
private InputCallbackSystem _inputCallbacks = new InputCallbackSystem();
public IInputCallbackSystem InputCallbacks => _inputCallbacks;
}
}

View File

@ -78,7 +78,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
throw;
}
InputCallbacks = new MemoryBasedInputCallbackSystem(this, "System Bus", new[] { 0x4000130u });
InputCallback = new LibmGBA.InputCallback(InputCb);
LibmGBA.BizSetInputCallback(Core, InputCallback);
}
public IEmulatorServiceProvider ServiceProvider { get; }

@ -1 +1 @@
Subproject commit 751a87dd3a7b4bdc2b2b00fa89ace69b685529ce
Subproject commit ade176cfbaca2903ab40d998287f9eb1e84624b5