From afbe01381179dac7535869912b1fccbb81190cb4 Mon Sep 17 00:00:00 2001 From: s2 Date: Fri, 3 Oct 2025 07:26:12 +0900 Subject: [PATCH] pcm: support 2024091200 version (#389) ## Link to GitHub Issue, if one exists none ## Description of change Supports PCM version 2024091200. ## Testing 1. After starting the PCM, touch card and auth. 2. Press the bill insert button. 3. Check account balance has increased. --- src/spice2x/games/pcm/pcm.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/spice2x/games/pcm/pcm.cpp b/src/spice2x/games/pcm/pcm.cpp index 7c0dd22..de84e82 100644 --- a/src/spice2x/games/pcm/pcm.cpp +++ b/src/spice2x/games/pcm/pcm.cpp @@ -14,6 +14,7 @@ namespace games::pcm { static double BILL_DELAY = 2.0; static int bill_kind = 0; + static int accept_bill_kind = 0; static int __cdecl BillVali_GetEscrowBillKind() { return bill_kind; @@ -74,6 +75,12 @@ namespace games::pcm { BILL_IN_TIME = get_performance_seconds(); } else if ((BILL_IN_TIME != 0) && ((BILL_IN_TIME + BILL_DELAY) <= get_performance_seconds())) { BILL_IN_TIME = 0; + + if (accept_bill_kind != 0 && accept_bill_kind != bill_kind) { + bill_kind = 0; + return 0; + } + switch (bill_kind) { case 1: return 1; @@ -98,7 +105,8 @@ namespace games::pcm { return true; } - static bool __cdecl BillVali_SetAcceptBill(int) { + static bool __cdecl BillVali_SetAcceptBill(int a1) { + accept_bill_kind = a1; return true; } @@ -148,5 +156,13 @@ namespace games::pcm { system, "?GetEscrowBillKind@GsBillVali@@SAHXZ")); detour::inline_hook(BillVali_SetAcceptBill, libutils::try_proc( system, "?SetAcceptBill@GsBillVali@@SA_NH@Z")); + + // NOTE: for 2024091200 or newer + detour::inline_hook(BillVali_ReceiveBill, libutils::try_proc( + system, "?ReceiveBill@GsBillVali@@SA_NXZ")); + detour::inline_hook(BillVali_GetEscrowBillKind, libutils::try_proc( + system, "?GetEscrowBillKind@GsBillVali@@SA?AW4E_BILLKIND@@XZ")); + detour::inline_hook(BillVali_SetAcceptBill, libutils::try_proc( + system, "?SetAcceptBill@GsBillVali@@SA_NW4E_BILLKIND@@@Z")); } }