From 50b38b856fc8e56fba068658507617d97a1fe1d4 Mon Sep 17 00:00:00 2001 From: James Liu <17558260+JamesLewisLiu@users.noreply.github.com> Date: Fri, 28 Aug 2026 00:05:36 +0800 Subject: [PATCH] gitadora: fix 32bit gfdm coin button not working (#893) ## Link to GitHub Issue or related Pull Request, if one exists #0 ## Description of change Fix Add Coin/COIN button not actuated after pressing ## Testing *XG2* XG2 *XG3* XG3 --- src/spice2x/misc/device.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/spice2x/misc/device.cpp b/src/spice2x/misc/device.cpp index 54ae9b7..fecf390 100644 --- a/src/spice2x/misc/device.cpp +++ b/src/spice2x/misc/device.cpp @@ -285,8 +285,10 @@ static int __cdecl device_read_secplug(int a1, int a2, int a3) { return 1; } -static int __cdecl device_set_coinblocker_open(char number, char open) { - return 0; +static void __cdecl device_set_coinblocker_open(char slot1_open, char slot2_open) { + // libdevice exposes one open flag per coin slot. Since spice has a shared + // software coin stock, consider it blocked only when both slots are closed. + eamuse_coin_set_block(!slot1_open && !slot2_open); } static void __cdecl device_set_coincounter_merge() { @@ -617,7 +619,9 @@ void spicedevice_attach() { detour::inline_hook((void *) device_finalize, libutils::try_proc_list( DEVICE_INSTANCE, {"device_finalize", "?device_finalize@@YAXXZ"})); detour::inline_hook((void *) device_get_coinstock, libutils::try_proc_list( - DEVICE_INSTANCE, {"device_get_coinstock", "?device_get_coinstock@@YAXPEAG0@Z"})); + DEVICE_INSTANCE, {"device_get_coinstock", + "?device_get_coinstock@@YAXPEAG0@Z", + "?device_get_coinstock@@YAXPAG0@Z"})); detour::inline_hook((void *) device_get_coinstock_all, libutils::try_proc_list( DEVICE_INSTANCE, {"device_get_coinstock_all", "?device_get_coinstock_all@@YAXPEAG0@Z",