diff --git a/Assets/dll/libgambatte.dll b/Assets/dll/libgambatte.dll index 18f0d80d9d..b3ab3c3433 100644 Binary files a/Assets/dll/libgambatte.dll and b/Assets/dll/libgambatte.dll differ diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs index c1e8b08932..24479aba0f 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.ISettable.cs @@ -118,6 +118,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy [DefaultValue(false)] public bool MulticartCompat { get; set; } + [DisplayName("Cart Bus Pull-Up Time")] + [Description("Time it takes for the cart bus to pull-up to 0xFF in CPU cycles. Used to account for differences in pull-up times between carts/consoles.")] + [DefaultValue(8)] + public uint CartBusPullUpTime { get; set; } + [DisplayName("Realtime RTC")] [Description("If true, the real time clock in MBC3 and HuC3 games will reflect real time, instead of emulated time. Ignored (treated as false) when a movie is recording.")] [DefaultValue(false)] diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs index dcd8df1ba5..ff121d645b 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.cs @@ -180,6 +180,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy LibGambatte.gambatte_setrtcdivisoroffset(GambatteState, _syncSettings.RTCDivisorOffset); + LibGambatte.gambatte_setcartbuspulluptime(GambatteState, _syncSettings.CartBusPullUpTime); + _cdCallback = new LibGambatte.CDCallback(CDCallbackProc); NewSaveCoreSetBuff(); diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs index 2cc5b0c2b5..74c7245136 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/LibGambatte.cs @@ -279,6 +279,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy [DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)] public static extern void gambatte_setrtcdivisoroffset(IntPtr core, int rtcDivisorOffset); + /// + /// Sets how long until the cart bus pulls up in CPU cycles. + /// This is used to account for differences in pull-up times between carts/consoles. + /// + /// opaque state pointer + /// Pull-Up Time + [DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)] + public static extern void gambatte_setcartbuspulluptime(IntPtr core, uint cartBusPullUpTime); + /// /// Returns true if the currently loaded ROM image is treated as having CGB support. /// diff --git a/submodules/gambatte b/submodules/gambatte index 7054db2650..97c6008635 160000 --- a/submodules/gambatte +++ b/submodules/gambatte @@ -1 +1 @@ -Subproject commit 7054db26504566649882688244be59cd75c29a19 +Subproject commit 97c6008635508bda05e198af393805af49a38563